Success story · FEDA · ESP32 PLC
FEDA counts every litre. ESP32 PLCs send every litre to the SCADA.
Pulse water meters, Modbus TCP and alarms in the SCADA.
A missed pulse is a missed litre.
The PLC keeps the total, even when the link fails.
FEDA, in Andorra, wanted as much information as possible on its fresh water consumption. Water quantity and quality in Andorra do not seem a concern, but natural resources are short everywhere. The aim of the project: control the cold water in FEDA buildings and add it to the energy efficiency plan of the company. SIRA, an Andorran technology company in robotics and artificial intelligence, is the technology partner named in the case. Industrial Shields ESP32 PLCs read the water meters and send the data with Modbus TCP to a Circutor PowerStudio SCADA.
From the case
FEDA and its SCADA screen.
Real material from the original success story: a FEDA building and the PowerStudio screen of the project, with one panel per meter.
The challenge
See the water use of every building, in real time.
FEDA wanted to see the cold water consumption of its buildings in real time and compare it with the consumption averages. The goal: find leaks and unnecessary losses early, and put water into the energy efficiency plan of the company. For that, every litre has to reach the SCADA, whatever happens to the network or the power supply.
Every litre, per building
Each building has water meters sized for its pipe cross-section. Each meter has a pulse emitter set up by NFC: one pulse of 300 ms for each litre. The PLC must not miss a pulse.
A link that can fail
The data travels from the buildings over Ethernet. A collision or a lost link must not cost a single litre in the records.
A power cut
The total that the PLC has recorded must still be there when the power comes back.
Into the SCADA, with alarms
The SCADA is Circutor PowerStudio, which works with Modbus TCP over Ethernet. It has to show each meter and warn the system managers when consumption is outside the pre-set parameters.
How it works
Two loops: count and keep every litre, then supervise.
Move the slider and press the buttons. The panels show the general pattern: what the PLC counts, what it keeps and what the SCADA shows. They are illustrative simulations. They do not show the program, the limits or the data of the installation.
One pulse is one litre. The PLC keeps the total.
Each water meter has a Bmeters pulse emitter. It gives one pulse of 300 ms for each litre. An Industrial Shields ESP32 PLC reads the pulses on a digital input and adds them to a total for each meter. It sends the total value in litres, not single pulses. If a frame is lost because of a collision or a link failure, the next frame still carries every litre. The PLC also stores its variables on a µSD card, so a power cut does not erase the total.
- 1 pulse = 1 litre, 300 ms per pulse
- Pulse emitter output N-MOS (NPN), up to 30 Vdc and 100 mA
- One total per meter, sent as one value
- µSD card keeps the total through a power cut
Illustrative simulation. Scaled time and example flow. "Increments" is a comparison: a sender of single increments loses the litres of every lost frame. The case sends the total. The program, the frame rate and how often the PLC writes to the µSD card are not published.
Related examples
The SCADA shows each meter and warns when something is wrong.
The PLCs send the frames over Ethernet with Modbus TCP, and Circutor PowerStudio captures them. Its screen shows the meter of each water inlet pipe, the averages in m³/h and the monthly consumption. A table exports the values per day and hour of any meter to Excel, and a graph compares all meters over time. Alarms and warnings tell the system managers when consumption is outside the pre-set parameters.
- Meter, averages in m³/h and monthly consumption
- Excel export per day and hour, any meter
- A graph to compare all meters over time
- Alarms and warnings outside the pre-set parameters
SCADA events (example)
Illustrative simulation. Example buildings, values and limits. The real limits of the installation are not published.
Related examples
System architecture
How do ESP32 PLCs bring the water meters of many buildings into one SCADA?
Each meter sends pulses to a digital input of an ESP32 PLC. A 12 to 24 Vdc power supply feeds the circuit. The PLC sends the litre total over Ethernet with Modbus TCP to Circutor PowerStudio. The case says the PLC keeps its variables on a µSD card. Based on the original diagram of the case: power supply, pulse emitter, PLC input and Ethernet Modbus TCP. The text of the case names ESP32 PLCs.
| Signal | Between | Type | Purpose |
|---|---|---|---|
| Water meter pulse | BetweenBmeters IWM-PL3 → ESP32 PLC | TypeDigital, N-MOS (NPN), max. 30 Vdc / 100 mA | Purpose1 pulse = 1 litre, 300 ms |
| Power supply | Between12 to 24 Vdc supply → PLC and pulse circuit | Type12 to 24 Vdc | PurposeFeeds the circuit of the case diagram |
| Litre total per meter | BetweenESP32 PLC → µSD card | TypeLocal storage | PurposeKeeps the total through a power cut |
| Litre totals | BetweenESP32 PLC → Circutor PowerStudio | TypeEthernet · Modbus TCP | PurposeTotal value per meter, so a lost frame loses no pulse |
| Alarms and warnings | BetweenPowerStudio → system managers | TypeSCADA alarm | PurposeConsumption outside the pre-set parameters |
| Reports | BetweenPowerStudio → Excel | TypeTable export | PurposeValues per day and hour of any meter |
Why Industrial Shields
Open hardware, room to grow, people who answer.
Open, no licence fees
The PLCs are programmed in C++. There are no licence fees, and the program belongs to the project. You can change any part of it.
Modular
The project can grow with the needs. A new building adds its own PLC on the Ethernet network, and each ESP32 PLC can add I/O with expansion modules over I2C.
Support before, during and after
Our support team works with you before, during and after the sale and the installation. The equipment is designed and manufactured for industrial use.
Hardware used
An ESP32 PLC on the DIN rail of each site.
ESP32 PLC 38R
An industrial controller of the ESP32 PLC family. In this project the PLCs read the meter pulses and send the totals over Ethernet with Modbus TCP. The case says the PLC stores its variables on a µSD card type memory. You program it in C++ with the Arduino IDE.
- Inputs
- 12: 8 analog/digital (0-10 V) and 4 digital optoisolated, 5 to 24 Vdc, 4 with interrupt
- Outputs
- 22: 16 relays (230 Vac 4 A / 24 Vdc 2 A, resistive) and 6 analog/digital/PWM (0-10 V)
- Network
- Ethernet 10/100 (RJ45), Wi-Fi 2.4 GHz, Bluetooth LE
- Serial
- RS-485, RS-232, TTL
- Power supply
- 12 to 24 Vdc
- Mounting
- DIN rail TS35, IP20
The case does not publish the exact ESP32 PLC model. It says the PLCs have up to 12 analog and digital I/Os and several communication protocols. The image shows the ESP32 PLC 38R as a current example of the family: Ethernet, and 16 relay outputs if a site also has to switch loads such as valves or pumps. Count your meters first, then choose the model, and check the input ratings for your pulse emitter in the family datasheet. Check µSD storage for your model with our team.
Questions about this project
How does a PLC count water meter pulses?
The water meter has a pulse emitter. Here it is a Bmeters IWM-PL3 on a Salvador Escoda meter, set up by NFC. It gives one pulse of 300 ms for each litre, on an N-MOS (NPN) output of up to 30 Vdc and 100 mA. The ESP32 PLC reads the pulse on a digital input and adds one litre to the total of that meter. For short or fast pulses, an input with interrupt is the safe choice.
What happens to the data if the network fails?
The PLC keeps counting. It sends the total value in litres for each meter, not single pulses. When the link comes back, the next frame carries the full total, so no pulse is lost. The project chose this to avoid losses from collisions or from a lost link with the buildings.
What happens if the power fails?
The case says the PLC stores its variables on a µSD card type memory. After a power cut, the total number of pulses it recorded is still there. The case does not publish how often the program writes to the card.
How does Circutor PowerStudio get the data?
Over Ethernet with Modbus TCP, a standard industrial protocol that PowerStudio also uses. The case does not publish the register map. A typical way to do it: the PLC works as a Modbus TCP server and keeps each litre total in two holding registers (32 bits).
Can the SCADA detect a leak?
The SCADA warns when consumption is outside the pre-set parameters, and the project compares consumption with the averages. That is how the system managers find a possible fault, such as a leak, and act fast. The limits of the installation are not published.
Do I need to program Arduino or ESP32 to do this?
Not necessarily. Start from the problem: how many meters, how many litres per pulse and which SCADA or database must get the data. The ESP32 PLC is programmed in C++ with the Arduino IDE, and the code is yours to change. If your team does not program, an integrator or our engineers can help.
Download the success story
4-page PDF with the challenge, the logic, the architecture and the hardware. No form required.
Similar project?
Tell us your meters and your SCADA. An engineer will answer.
Tell us how many meters you read, the litres per pulse, where the buildings are and which SCADA or database gets the data. We will tell you which controller fits and how to connect your pulse emitters.
- An answer from our technical team
- I/O count and sizing for your meters
- Arduino, ESP32 or Raspberry Pi based PLCs