
Micro Hydro ELC with Dump Load on Raspberry Pi 5 - Proteus Simulation

Hello friends, I hope you all are doing great. Today, I am going to share the Micro Hydro ELC with Dump Load on Raspberry Pi 5 - Proteus Simulation, the eighty-second project of our IoT Projects series. If you have searched for an electronic load controller for micro hydro, how a dump load keeps a turbine's voltage steady, load shedding, or a Raspberry Pi with an ADS1115 in a Proteus simulation, here is a complete one. A small hydro plant in a village or on a farm has no governor to open and close the water gate. When the lamps go off, the turbine loses its load, speeds up and its voltage climbs high enough to burn whatever is still connected; when too much is switched on, it slows down and the lights go dim.
The answer used on thousands of small plants is the electronic load controller (ELC). It keeps the turbine's total load constant: whatever power the consumers are not using goes into a dump load, usually a water or air heater. This Raspberry Pi 5 is the ELC of an F50 micro hydro generator on a 12 V bus. It measures the bus with an ADS1115, switches a bank of five dump resistors in binary steps of 0.5 W to hold the bus at 12 V, switches two 12 V lamps, and sheds the less important lamp when there is not enough water for both. In this tutorial, we will go through the circuit, how a turbine behaves under load, the ELC idea, binary-weighted dump loads, measuring with an ADS1115 and a shunt, a control loop that stays stable, feed-forward and load shedding. Then we change the water pressure and the lamps in the simulation. At the end, you can download the project with the program and every library file.
NOTICE: Our team has put a lot of effort into this project: the circuit, the code and every part in the simulation are our own work, and you get them all free. Your feedback is the fuel that keeps us going, so please tell us what you think in the comments below. And if our free projects help you, you can buy us a coffee. So, let's get started with the micro hydro ELC with dump load on Raspberry Pi 5 in Proteus simulation:
What Does This Load Controller Do?
- Measures the bus: its voltage through a divider and the load current through a 0.1 ohm shunt, with a 16-bit ADS1115.
- Holds 12 V: a dump load of five power resistors in binary steps (0 to 15.5 W in 0.5 W steps) takes what the lamps do not use.
- Switches the consumers: two 12 V 5 W lamps on MOSFETs, asked for from the dashboard.
- Reacts at once: when a lamp comes on, the dump gives up the lamp's 5 W at the same moment (feed-forward).
- Sheds load: when the water cannot carry both lamps, the yard lamp goes first, then the house lamp; each comes back when there is spare power again.
- Reports everything: an I2C LCD on the board and a dashboard on a laptop or a phone.
It is a great project for learning closed-loop control, power electronics switching and a bit of renewable energy in one go. In the simulation, the generator's pop-up shows the tap, the turbine, its curve and the working point, and its chips change the water pressure, so we can play wet season and dry season in seconds.
Components Used in the Proteus Simulation
All the parts come from our Proteus libraries, each with its own tutorial. The project zip at the end includes every LIB and DLL file and the TEP Pi runtime.
| Part | Proteus device | Library post | Connection |
|---|---|---|---|
| Raspberry Pi 5 | RASPBERRY PI 5 | Raspberry Pi 5 Library for Proteus | PI1, hydro_elc.py, Ethernet 192.168.1.51 |
| F50 micro hydro generator | HYDROF50TEP | Micro Hydro Generator Library for Proteus | G1, TYPE 80V, + on the bus |
| ADS1115 16-bit ADC | ADS1115TEP | ADS1115 ADC Library for Proteus | U1 on I2C1 at 0x48 |
| IRLZ44N MOSFET (x 7) | IRLZ44NTEP | N-MOSFET Library for Proteus | Q1 - Q5 the dump, Q6 / Q7 the lamps |
| Power resistors (x 6) | RESISTORPOWER5WTEP, RESISTORPOWER10WTEP | Power Resistor Library for Proteus | the dump (288R - 18R) and the 0R1 shunt |
| W5W bulb (x 2) | BULBW5WTEP | Filament Bulb Library for Proteus | L1 the house, L2 the yard |
| I2C LCD 16x2 | I2C LCD 16x2 | I2C LCD 16x2 Library for Proteus | LCD1 at 0x27 |
| Resistors 220k / 10k | RESISTOR4BANDTEP | Resistor Library for Proteus | the bus divider (/ 23) |
| Laptop WiFi Monitor | LAPTOP WIFI MONITOR | Laptop WiFi Monitor | PC1 |
| Mobile WiFi Monitor | MOBILE WIFI MONITOR | Mobile WiFi Monitor | MOB1 |
Proteus Simulation of the Micro Hydro ELC: the Circuit
| Signal | Raspberry Pi 5 | Goes to |
|---|---|---|
| SDA / SCL | GPIO2 (pin 3) / GPIO3 (pin 5) | the ADS1115 (0x48) and the LCD (0x27) |
| 3.3 V / 5 V | pin 1 / pin 2 | the ADS1115's VDD / the LCD's VCC |
| D0 - D4 | GPIO5, 6, 13, 19, 26 (pins 29, 31, 33, 35, 37) | the gates of the dump MOSFETs: 0.5, 1, 2, 4, 8 W |
| LA1 / LA2 | GPIO20 (pin 38) / GPIO21 (pin 40) | the gates of the lamp MOSFETs |
| VSENSE | - | ADS1115 A0: the bus through 220k / 10k |
| LRET | - | ADS1115 A1: the top of the 0.1 ohm shunt |
Every load, the five dump resistors and the two lamps, hangs from the bus and returns through its own IRLZ44N to the net LRET, which goes to ground through the 0.1 ohm shunt. The IRLZ44N is a logic-level MOSFET: its gate turns it fully on from the Pi's 3.3 V. The divider brings the bus down 23 times, so even the 80 V of an unloaded turbine at full pressure stays under the ADS1115's 4.096 V range.
How the Micro Hydro ELC Works
A Turbine Without a Governor
The F50 is a small turbine with a permanent-magnet generator and a rectifier. With no load it spins freely and its voltage follows the water pressure: 38 V at 0.3 MPa, 54 V at 0.5 MPa, 70 V at 0.8 MPa. A load's current brakes the runner, so the voltage falls. Near the working point it behaves like a voltage source with a large internal resistance. Worked example from the model's numbers: at 0.5 MPa the open-circuit voltage is 54 V, the runner's torque gives an apparent resistance of 54 x 0.08 / 0.0644 = 67 ohm, plus the 10.5 ohm winding, minus the rectifier's 1.2 V: V = 52.8 - 77.6 x I. For 12 V, I = (52.8 - 12) / 77.6 = 0.53 A, so the turbine gives about 6.3 W at 12 V. At 0.3 MPa the same sum gives 3.1 W, at 0.8 MPa 10.9 W.
The ELC Idea: Keep the Total Load Constant
If the turbine always carries the same total load, it always turns at the same speed and gives the same voltage. The ELC watches the voltage: above the target it adds dump load, below it removes some. The consumers can switch lamps on and off as they like; the dump load simply takes the difference. On a real plant the dump is a heater element in a water tank, so the spare energy still does something useful. Real ELCs on AC plants watch the frequency and use phase-angle control or many steps; this DC version watches the bus voltage and uses binary steps.
A Binary-Weighted Dump Load
Five resistors of 288, 144, 72, 36 and 18 ohm take 0.5, 1, 2, 4 and 8 W at 12 V. Each one is twice the power of the one before, like the bits of a binary number. A 5-bit code from 0 to 31 switches any combination: code 13 = 8 + 4 + 1 = the 4 W, 2 W and 0.5 W resistors = 6.5 W. So five MOSFETs give 32 steps of 0.5 W, from 0 to 15.5 W.
Measuring the Bus with an ADS1115
The Pi has no analog inputs, so a 16-bit ADS1115 does the measuring over I2C. For each reading the Pi writes the configuration register: start a single conversion, the input, the range (plus or minus 4.096 V for the voltage, plus or minus 0.256 V for the shunt) and 128 samples a second. Then it waits for the conversion and reads the two-byte result. Worked example: a reading of 4,208 counts on the 4.096 V range is 4208 x 4.096 / 32768 = 0.526 V, times 23 = 12.1 V on the bus. The current comes from the 0.1 ohm shunt: 53 mV means 0.53 A.
A Control Loop That Stays Stable
The first idea is to move the dump by a step for every quarter volt of error. That fails here: from the turbine's equation, one 0.5 W step moves this bus by 0.4 V at 0.8 MPa, 0.65 V at 0.5 MPa and 1.1 V at 0.3 MPa. A loop that corrects 1 V of error with four steps overshoots by four times and oscillates. So the program has a dead band of plus or minus 0.6 V, wider than one step's effect, and outside it moves one step per 1.5 V of error, at least one. Then each correction is smaller than the error, the loop gain stays under 1 at every pressure, and the bus settles within about half a volt of 12 V. A big error, such as the start-up with the turbine at 50 V, still gets many steps at once.
Feed-Forward and Load Shedding
When a lamp comes on, the loop would only see the voltage dip afterwards. But the program knows the lamp takes about 5 W, so it removes 10 dump steps at the same moment, and the bus hardly moves: that is feed-forward. When a lamp is switched off from the dashboard, the dump takes its 5 W back at once. If the dump is already at zero and the bus still sags under 11 V for 1.5 seconds (or under 9 V for 0.4 seconds), there is simply not enough water for every lamp: the program sheds the lowest-priority one, the yard lamp first. A shed or newly wanted lamp comes on when the dump has been taking at least 5.5 W, the lamp's 5 W plus a little spare, for 4 seconds.
The Python Code Explained
The program is hydro_elc.py, written for Raspberry Pi OS with lgpio for the GPIO and the I2C bus. The dump steps:
DUMP_OHMS = (288.0, 144.0, 72.0, 36.0, 18.0)
One ADS1115 conversion: the configuration word, the wait, and the signed result:
cfg = 0x8000 | (0b100 + ch) << 12 | self.PGA[fsr] << 9 | 0x0100 | 0b100 << 5 | 0x0003 # OS, AINx vs GND, PGA, single, 128 SPS
raw -= 65536 if raw & 0x8000 else 0 # (two's complement)
The bus and the current:
v = ads.volts(0) * DIVIDER
The control step, with its dead band:
n = max(1, int(round(abs(e) / STEP_V)))
Setting the five MOSFETs from the code:
lgpio.gpio_write(chip, p, code >> k & 1)
Feed-forward when a lamp comes back:
code = max(0, code - FF_STEPS) # feed-forward: the dump gives up the lamp's 5 W at the same moment
Load shedding: no dump left and the bus still sagging, then the lowest priority first:
if code == 0 and v < SHED_V and any(on):
k = 1 if on[1] else 0
The power the dump takes now:
return sum(v * v / r for k, r in enumerate(DUMP_OHMS) if code >> k & 1)
A second thread writes the LCD twice a second (only the line that changed), and the web server answers / with the dashboard and /data with JSON; /lamp1 and /lamp2 ask for a lamp or switch it off.
How to Run the Proteus Simulation
- Download the project zip below and install the library files (the steps are under the download button).
- Open Pi-5-Hydro-ELC.pdsprj from the Proteus Simulation folder. Keep hydro_elc.py and the DLL files next to it.
- Press Play. The turbine starts at 0.5 MPa and the Pi pulls the bus down to 12 V with the dump load.
- Open the Laptop WiFi Monitor (press Go) and click LAMP 1 and LAMP 2.
- Click G1 for the turbine's pop-up and change the water pressure with its chips: 0.3, 0.5, 0.8 MPa.
Simulation Results: the ELC in Proteus
We ran the plant through a wet and a dry season in 72 simulated seconds: the lamps asked for from the dashboard, the water pressure changed from the generator's pop-up. The times below are the program's.
The Start: the Dump Holds 12 V
At 0.5 MPa with nothing switched on, the unloaded turbine sat near 50 V. Within two seconds the controller had pulled the bus down with the dump, and it settled at 11.75 V with dump code 13: the 8 W, 4 W and 0.5 W resistors, 6.24 W at that voltage. The shunt measured 0.528 A, and the turbine's own pop-up agreed: 11.76 V at 528 mA, 6.22 W, the runner at 2,210 RPM. That is the 6.3 W the turbine's equation predicted.
LAMP 1: Feed-Forward at Work
At 12.7 s we asked for LAMP 1. It came on at 17.0 s, once the dump had held 5.5 W spare for 4 seconds, and in the same step the dump dropped from code 13 to code 3. The bus barely moved: 11.63 V with the dump at 1.41 W and the lamp taking the rest. At 22.0 s we asked for LAMP 2 too, but with only 1.4 W spare the dashboard said waiting for water.
The Wet Season: 0.8 MPa
Then we raised the pressure to 0.8 MPa. The turbine sped up and the bus jumped to 14.6 V, until the controller added dump steps: code 11, 5.96 W, at 12.49 V. Now there was water for the yard lamp, and at 32.7 s LAMP 2 came on, with the dump dropping to 0.98 W. Both lamps lit, the bus at 11.87 V, and the turbine giving 10.78 W at 908 mA and 2,699 RPM: the 10.9 W the equation said.
The Dry Season: 0.3 MPa
Then the pressure fell to 0.3 MPa, where the turbine can give only about 3 W at 12 V, and the lamps wanted 10 W. The dump went to zero at once but the bus collapsed to 2.1 V. Under 9 V, the fast rule applied: at 41.8 s the yard lamp was SHED; the house lamp alone still pulled the bus down to 6.71 V, so at 42.5 s it was shed too. With the lamps off, the bus came back to 12.31 V and the dump took the turbine's whole 3.15 W.
Back to 0.5 MPa
At 0.5 MPa again the dump climbed to 6.51 W at 12.50 V, and at 61.4 s the house lamp came BACK ON with the same feed-forward step: 11.63 V, the dump 1.41 W. The yard lamp stayed shed, waiting for more water than 0.5 MPa can give.
Through every change the bus came back within about half a volt of 12 V, and every number agreed with the turbine's equation worked out before the run.
Download the Project Files
Click the button below to download Micro-Hydro-ELC-Dump-Load-Raspberry-Pi-5-Proteus-Simulation-v1.0.zip (about 15.1 MB, without the source code of the models):
Micro Hydro ELC with Dump Load on Raspberry Pi 5 - Proteus Simulation V1.0- Proteus Simulation: Pi-5-Hydro-ELC.pdsprj, hydro_elc.py and copies of the models.
- Python Code: hydro_elc.py, the program.
- Proteus Library Files: the LIB files of every part.
- Proteus Model Files: the DLL models and the TEPPi folder (the Python runtime of the simulated Pi).
- README.txt: the installation steps, the properties, the test results and the links to every library post.
No Proteus yet? Read How to Download and Install Proteus 7 and 8. New to libraries? Follow How to Install a New Library in Proteus.
How to Install the Project Files
- Close Proteus and extract the whole zip file, for example to your Desktop.
- Copy the files from Proteus Library Files into the LIBRARY folder of Proteus.
- Copy everything from Proteus Model Files, the DLL files and the TEPPi folder, into the MODELS folder.
- Start Proteus and open the project from the Proteus Simulation folder.
Changing the Code
hydro_elc.py is plain Python: edit it next to the project and press Play again. The setpoint, the dead band, the step size, the shedding thresholds and the lamps' priority are near the top. On a real Raspberry Pi the same file runs with python3-lgpio installed and I2C enabled in raspi-config.
Ideas to Extend the Project
- Use the dump energy: a 12 V water heater element instead of resistors, with a thermostat that tells the ELC when the tank is hot.
- Add more steps (6 or 7 bits) or PWM one small resistor between steps for a smoother bus.
- Log the turbine's power all day and estimate the water flow from it.
- Add a battery through a charge controller as one more consumer with its own priority.
- Run an AC plant: watch the frequency instead of the voltage and switch the dump with a TRIAC.
- Protect the plant: a relay that opens the bus if the voltage stays too high, for example if a MOSFET fails open.
From Simulation to Real Hardware
- Size the dump for the turbine: the dump must take the full output when every consumer is off, with resistors rated for it and cooled.
- Add a hardware limit: a crowbar or a Zener-triggered dump so that a crashed program cannot let the voltage run away.
- Mind the switching: each MOSFET needs a heatsink at higher powers, a gate resistor and a pull-down so the dump comes on if the Pi stops.
- Filter the measurement: a real generator's bus has ripple; average several ADS1115 readings.
- Keep grounds clean: the shunt's ground and the ADS1115's ground meet at one point.
Troubleshooting
- The bus reads 0 V: the ADS1115 at 0x48 (ADDR to GND), VDD on 3.3 V, A0 on the middle of the divider.
- The bus swings up and down: the step is too big for the dead band; widen BAND or raise STEP_V.
- A lamp never comes on: there is not enough water; the dump must show 5.5 W spare first.
- Every lamp is shed: the pressure is too low even for one lamp; at 0.3 MPa the turbine gives only about 3 W at 12 V.
- The LCD stays blank: SDA and SCL on pins 3 and 5, VCC on 5 V.
Limitations of the Simulation
- The turbine is our library's model: a smooth runner and generator law fitted to the maker's curve, without water hammer, the pipe's inertia or a real runner's losses at every speed.
- The lamps' power on the dashboard is estimated from the bus voltage (a filament draws about V to the power 1.55); the current through the shunt is measured.
- The network to the laptop and the phone is simulated inside Proteus.
- Raspberry Pi is a trademark of Raspberry Pi Ltd, the ADS1115 a product of Texas Instruments and the IRLZ44N of Infineon; this project is not made or endorsed by them or by Labcenter.
So, that was all about the Micro Hydro ELC with Dump Load on Raspberry Pi 5 - Proteus Simulation. I hope it helps you understand why a small turbine needs a load controller, how a binary dump load and a carefully tuned loop keep its voltage steady, and how load shedding shares out water that is running short, all tested in a simulation before you build a single dump resistor. More projects with the Raspberry Pi 5 and the ESP32 are coming. If you have any questions, ask in the comments and I will help you out. Till the next tutorial, take care and have fun!






















Comments
0