Optimizing Chemical Usage in Water Plants Through Machine Learning at the Edge.

By implementing real-time optimized Machine Learning algorithms at each of its desalination plants, ACCIONA a global infrastructure operator, managed to minimize the use of reactive chemicals, eliminate associated regulatory penalties, and leverage an edge infrastructure to implement new predictive applications for water quality control. In this article, we explore the intricacies of the project.

Smart Water

Machine Learning in Distributed Water Treatment Plants

Water management infrastructures generate vast and growing volumes of data every day. To manage this complexity and scale effectively, operators are increasingly adopting Edge Computing platforms like Barbara. These platforms enable real-time data processing at the source, without compromising the integrity or security of the Operational Technology (OT) network.

Enhancing Reagent Dosing Control with Machine Learning


Precise control of reagent dosing is critical for targeting fluctuating chemical compounds in water. Traditional methods rely on manual sampling and lab analysis, which often lead to delayed or outdated results.

ACCIONA, a global infrastructure operator, previously invested significant time and resources into laboratory testing to determine optimal chemical concentrations. However, the delays in obtaining results meant dosing decisions were often based on outdated information, leading to excess chemical usage, increased costs, and potential regulatory penalties.

By implementing Machine Learning algorithms at the edge, ACCIONA can now automatically and continuously adjust chemical dosages in real time, tailored to the environmental variables of each plant. This innovation not only improves efficiency but also ensures regulatory compliance and cost savings.

What Was ACCIONA Aiming to Achieve?

  1. Virtual Chemical Forecasting
    ACCIONA sought to implement advanced algorithms capable of virtually predicting chemical compositions in water—an insight traditionally derived through laboratory testing. By continuously monitoring related parameters, the goal was to gain tighter control over critical water quality variables.
  2. Cost Optimization
    A key objective was to reduce operational costs by optimizing reagent dosing loops—minimizing excessive chemical use while significantly lowering expenses tied to regulatory penalties.
  3. Scalability Across Global Operations
    With 89 plants worldwide, ACCIONA aimed to scale the solution globally, ensuring consistent performance, efficiency, and operational excellence across all facilities.
  4. Robust Data Ingestion and Management
    Efficient and secure data capture from diverse sources—including sensors, machines, and industrial devices—was essential, along with reliable storage and management of the collected data.
  5. AI Model Deployment and Adaptation
    The strategy included seamless deployment of AI models at the edge, with the ability to automatically fine-tune them based on each plant’s unique environmental conditions. ensuring continuous adaptability and precision.
  6. Centralized Remote Monitoring and Maintenance
    To streamline operations and maintain high performance, ACCIONA required centralized tools for remote monitoring, control, and lifecycle management of all deployed applications and connected devices.

Barbara’s Edge AI Platform: Enabling Real-Time Intelligence at Scale

With the explosion of connected devices and the growing demand for real-time data processing, sending all operational data to a centralized data center is no longer viable. To meet ACCIONA’s objectives, a robust Edge Infrastructure was essential. This approach addressed several critical requirements:

  1. Cost Efficiency – Significantly reduced costs associated with continuous data capture and transmission to the cloud.
  2. Data Privacy & Security – Ensured compliance with strict security and data protection regulations.
  3. Real-Time Processing – Enabled immediate data analysis and response directly at the source.

Barbara’s solution was designed to meet these needs through a comprehensive Edge AI Platform, consisting of:

  • Barbara OS: A lightweight, secure operating system for deploying, orchestrating, and maintaining AI models directly at the edge at water treatment plants, close to the data source.
  • Barbara Panel: A centralized management and orchestration tool that provides full remote control over edge nodes, including configuration, updates, and monitoring, ensuring complete lifecycle governance.

More specifically, the solution delivered:

  • Seamless connectivity and edge data processing, with real-time alerts in case of anomalies or incidents.
  • Remote, secure management of containerized (Docker-based) applications, including updates and configuration changes.
  • Full lifecycle management of edge nodes and gateways—covering updates, reconfigurations, and performance monitoring.
  • An intuitive graphical interface to visualize real-time measurements and system status.

This edge-native architecture empowered ACCIONA to operate with greater agility, reliability, and intelligence—while laying the foundation for scalable AI deployments across its global network of plants.

Main Challenges of the Project

One of the most significant challenges was fine-tuning distributed AI models to adapt to the diverse environmental variables present across ACCIONA’s network of water treatment plants. Achieving optimal performance from a single model required accounting for site-specific conditions such as temperature, operational state, and equipment configuration.

Another major challenge involved establishing robust and secure connectivity, particularly when working with the OPC-UA protocol, known for its complex authentication mechanisms. Ensuring seamless communication without compromising data integrity or system security was critical.

Barbara’s technological solution addressed these challenges by enabling the secure integration of Barbara Panel—its centralized platform for remote management of edge nodes and applications with ACCIONA’s local plant servers. This ensured encrypted data storage and transmission, maintaining the highest standards of data privacy and device security.

Impact of Edge AI – By the Numbers

  • $250,000 USD saved per plant in the first year alone.
  • 800% increase in the speed of deploying new applications across facilities.
  • Rapid rollout of predictive models, including those for water turbidity monitoring, driving smarter, data-informed operations.

Want to learn more? Download Acciona´s story here