Build Your Own Hydroelectric Dam!
Water falls, a turbine spins, and real electricity is born — while a smart servo-controlled gate watches the reservoir and manages the water supply all on its own.
📋 What's inside this project
🧰 What You'll Need
Most parts are common hobby-electronics components, plus a few household items for the dam structure.
Arduino Uno (1x)
Reads the sensors and controls the gate.
Small DC motor (1x)
Spun by falling water, it works in reverse as a generator.
Mini turbine wheel
A small pinwheel or paddle wheel attached to the motor shaft.
SG90 servo motor (1x)
Controls the dam's sluice gate to manage water flow.
Ultrasonic distance sensor (HC-SR04)
Measures how much water is left in the reservoir.
16x2 I2C LCD display
Your live dashboard for water level and voltage generated.
Small LED
Lights up directly from the generator — real electricity in action!
Resistors & a diode
Build a voltage divider and protect the Arduino's input pin.
Plastic bottle reservoir & waterproof tray
Holds the water supply and catches run-off safely.
⚙️ How Does It Work?
The same basic idea behind giant power-station dams, shrunk down to tabletop size.
1. Water falls
Water drops from the reservoir through the open gate.
2. Turbine spins
Falling water turns the mini turbine and generator.
3. Power is shown
The dashboard displays the electricity being generated.
A DC motor normally uses electricity to spin. Run it backwards — by spinning its shaft instead — and it does the opposite: it generates a small electrical voltage. That's exactly what happens when falling water spins the turbine wheel attached to the motor.
An ultrasonic sensor constantly measures the distance down to the water's surface in the reservoir, so the Arduino always knows the current water level. Using that reading, it adjusts the servo-controlled gate — opening it wider when there's plenty of water, and closing it to conserve water when supplies run low.
Meanwhile, the LCD dashboard shows the water level, the voltage being generated, and the gate's current position, all updating live.
🔌 The Circuit Diagram
The generator's own power lights an LED directly, while the Arduino separately monitors its voltage through a divider.
| Arduino Pin | Connects To | Notes |
|---|---|---|
| Pin 9 / Pin 8 | Ultrasonic sensor Trig / Echo | Measures water level |
| Pin 10 | Gate servo — signal | Opens and closes the sluice gate |
| A0 | Voltage divider (from generator) | Safely scales down the generator's voltage |
| A4 / A5 | LCD SDA / SCL | Live water level & voltage dashboard |
| Generator (+) / (–) | Demo LED (+ resistor) | Separate circuit — lit directly by generated power |
| Diode (in series) | Between generator and divider | Protects the Arduino's analog input |
🛠️ Let's Build It — Step by Step
Build the reservoir
Cut a spout near the bottom of a plastic bottle and mount it up high on a stand, above the rest of the model.
Attach the sluice gate
Fit a small flap or valve over the spout, connected to the servo so it can swing open and closed.
Build the turbine
Attach a small pinwheel or paddle wheel to the DC motor's shaft, positioned where falling water will spin it.
Mount the generator
Fix the motor securely below the gate so the turbine sits directly in the path of the falling water, above a waterproof catch tray.
Wire the voltage divider
Connect the generator's output through the resistor divider and diode into the Arduino's analog pin, and wire a separate demo LED straight to the generator.
Add the sensor and display
Mount the ultrasonic sensor above the reservoir facing down at the water, and wire up the LCD dashboard.
Upload the code
Flash the sketch from the next section using the Arduino IDE, after installing the required libraries.
Fill, test, and watch it work
Fill the reservoir, power on the system, and watch the gate open, the turbine spin, and the LED light up as the dashboard updates live.
💻 Time to Code!
This sketch measures the water level, reads the generator's voltage, manages the gate, and updates the dashboard.
Install the LiquidCrystal I2C and Servo libraries from the Library Manager, then upload this sketch to your Arduino Uno.
// DIY Hydroelectric Dam // Measures water level, reads generated voltage, and manages the gate #include <Wire.h> #include <LiquidCrystal_I2C.h> #include <Servo.h> #define TRIG_PIN 9 #define ECHO_PIN 8 #define GATE_SERVO_PIN 10 #define VOLTAGE_PIN A0 LiquidCrystal_I2C lcd(0x27, 16, 2); Servo gateServo; const float reservoirHeight = 20.0; // cm from sensor down to the empty bottom const float dividerRatio = 2.0; // (R1+R2)/R2 — match your resistor values void setup() { pinMode(TRIG_PIN, OUTPUT); pinMode(ECHO_PIN, INPUT); gateServo.attach(GATE_SERVO_PIN); gateServo.write(0); // gate starts closed lcd.init(); lcd.backlight(); } float readDistance() { digitalWrite(TRIG_PIN, LOW); delayMicroseconds(2); digitalWrite(TRIG_PIN, HIGH); delayMicroseconds(10); digitalWrite(TRIG_PIN, LOW); long duration = pulseIn(ECHO_PIN, HIGH, 30000); float distance = duration * 0.0343 / 2.0; // speed of sound in cm/microsecond return distance; } void loop() { float distance = readDistance(); float waterLevel = reservoirHeight - distance; if (waterLevel < 0) waterLevel = 0; int rawReading = analogRead(VOLTAGE_PIN); float measuredVoltage = (rawReading / 1023.0) * 5.0; float generatorVoltage = measuredVoltage * dividerRatio; int gateAngle; if (waterLevel > 15) gateAngle = 90; // plenty of water — open wide else if (waterLevel > 5) gateAngle = 45; // medium level — open halfway else gateAngle = 0; // running low — close to save water gateServo.write(gateAngle); lcd.clear(); lcd.setCursor(0, 0); lcd.print("Lvl:"); lcd.print(waterLevel, 1); lcd.print("cm "); lcd.print("V:"); lcd.print(generatorVoltage, 2); lcd.setCursor(0, 1); if (waterLevel < 2) { lcd.print("Refill reservoir!"); } else { lcd.print("Gate: "); lcd.print(gateAngle); lcd.print(" deg"); } delay(500); }
dividerRatio for an accurate voltage reading.reservoirHeight value.🛡️ Safety First
This project mixes water and electronics, so take extra care with waterproofing.
- Keep the Arduino, sensor, and servo body completely dry — only the turbine and generator section should ever get wet.
- Build over a waterproof catch tray to collect every drop of run-off water.
- Use only safe, low-voltage DC power — never connect this project to household mains electricity.
- Ask an adult to help with wiring the voltage divider and diode correctly.
- Unplug the power and empty the reservoir before changing any wiring.
✨ Fun Hydropower Facts
A little energy science to share while your dam generates its first watts.
Hydropower is one of the oldest renewable energy sources, dating back to ancient water wheels.
Hydroelectric dams generate electricity the same basic way your model does — just at a massive scale.
Hydropower produces a large share of the world's renewable electricity today.
Modern dams often include fish ladders, so wildlife can still travel past them safely.
❓ Frequently Asked Questions
How does a mini hydroelectric dam generate electricity?
Water falling from the reservoir spins a small turbine attached to a DC motor. Spinning the motor's shaft generates a small voltage — the same basic principle real hydroelectric stations use.
What does the servo-controlled gate do?
An ultrasonic sensor measures the reservoir's water level, and the Arduino opens the gate wider when there's plenty of water, or closes it to conserve water when supplies run low.
Is it safe to mix water and electronics in this project?
Yes, as long as the Arduino, sensor, and servo housing stay completely dry, water is contained to the turbine section over a waterproof tray, and everything runs on safe, low-voltage DC power.
What parts do I need to build a DIY hydroelectric dam?
An Arduino Uno, a small DC motor as a generator, a mini turbine wheel, a servo for the gate, an ultrasonic sensor, an LCD display, a raised reservoir, and a waterproof catch tray.

Comments
Post a Comment