Build a Smart Water Tank Monitor with Arduino!
Learn how to build a cool gadget that watches your water tank and beeps loudly when the water gets too low. Perfect for young engineers! 💧⚡
What are we making?
Imagine you have a big water tank at your home or school. Sometimes the water runs out and nobody notices until it's too late — no water for drinking, cooking, or washing! That's a real problem. 😟
In this project, we'll build a Smart Water Tank Monitor using an Arduino — a tiny computer you can program yourself! Our gadget will:
Watch the water level
Sensors measure water depth continuously
Show the level
LEDs glow green, yellow, or red
Buzz an alert
Buzzer beeps when water is low
Keep watching
Updates every second automatically
Parts you'll need
Collect all these parts before you start. Most can be found in an Arduino starter kit or bought very cheaply online!
Circuit diagram
Here's how everything connects. Don't worry if it looks complicated — we'll explain each wire in the table below!
Pin connection table
This table tells you exactly which wire goes where. Think of it as your treasure map! 🗺️
| Component | Component Pin | Arduino Pin | Wire Colour |
|---|---|---|---|
| 🌊 Water Sensor | VCC | 5V | RED |
| 🌊 Water Sensor | GND | GND | BLACK |
| 🌊 Water Sensor | SIG / OUT | A0 | GREEN |
| 🔔 Buzzer | + (positive) | D8 | ORANGE |
| 🔔 Buzzer | – (negative) | GND | BLACK |
| 🟢 Green LED (+) | Anode (+) | D9 → 220Ω → LED | GREEN |
| 🟢 Green LED (–) | Cathode (–) | GND | BLACK |
| 🟡 Yellow LED (+) | Anode (+) | D10 → 220Ω → LED | YELLOW |
| 🟡 Yellow LED (–) | Cathode (–) | GND | BLACK |
| 🔴 Red LED (+) | Anode (+) | D11 → 220Ω → LED | RED |
| 🔴 Red LED (–) | Cathode (–) | GND | BLACK |
Step-by-step build guide
Set up your breadboard
Place your breadboard on a flat surface. Push the Arduino Uno next to it. The breadboard has two long rails on each side — one for power (🔴 red) and one for ground (🔵 blue). Connect a wire from Arduino 5V to the red rail, and GND to the blue rail.
Connect the water level sensor
Place the water level sensor module on one side. Connect:
- Sensor VCC → breadboard red rail (5V) 🔴
- Sensor GND → breadboard blue rail (GND) ⚫
- Sensor SIG → Arduino pin A0 🟢
Add the three LEDs
Push the Green, Yellow, and Red LEDs into the breadboard (long leg first). For each LED:
- Connect a 220Ω resistor from the Arduino pin to the LED's long leg (+)
- Connect the short leg (–) to the GND rail
- Green LED → pin D9 · Yellow LED → pin D10 · Red LED → pin D11
Connect the buzzer
Place the active buzzer on the breadboard. The + leg connects to Arduino D8. The – leg connects to the GND rail. (An active buzzer makes sound on its own — no music code needed!)
Double-check everything!
Before turning on, look at every wire and make sure nothing is loose. Check that resistors are in place before each LED. Ask a grown-up to look it over too. When happy — plug in the USB cable! 🎉
The Arduino code
Copy this code into the Arduino IDE, select your board and port, then click the Upload button (the right-arrow ➡️). Watch the magic happen!
// ============================================ // Smart Water Tank Monitor // For MakeMindz Kids Robotics Blog // ============================================ // --- Pin Numbers --- const int SENSOR_PIN = A0; // Water level sensor signal const int BUZZER_PIN = 8; // Buzzer const int GREEN_LED = 9; // Full water - GREEN light const int YELLOW_LED = 10; // Medium water - YELLOW light const int RED_LED = 11; // Low water - RED light + buzzer! // --- Water Level Limits --- const int HIGH_LEVEL = 700; // Sensor reads this when tank is full const int LOW_LEVEL = 300; // Sensor reads this when water is low // ============================================ // setup() runs ONCE when Arduino turns on // ============================================ void setup() { pinMode(BUZZER_PIN, OUTPUT); pinMode(GREEN_LED, OUTPUT); pinMode(YELLOW_LED, OUTPUT); pinMode(RED_LED, OUTPUT); Serial.begin(9600); // Start talking to computer Serial.println("💧 Smart Water Monitor started!"); } // ============================================ // loop() runs FOREVER (like a heartbeat) // ============================================ void loop() { // 1. Read the sensor (0 = no water, 1023 = full) int waterLevel = analogRead(SENSOR_PIN); // 2. Print it so we can see on the computer Serial.print("Water level: "); Serial.println(waterLevel); // 3. Turn off all lights first digitalWrite(GREEN_LED, LOW); digitalWrite(YELLOW_LED, LOW); digitalWrite(RED_LED, LOW); digitalWrite(BUZZER_PIN, LOW); // 4. Decide which light to turn on if (waterLevel >= HIGH_LEVEL) { // 🟢 Tank is FULL – all good! digitalWrite(GREEN_LED, HIGH); Serial.println("✅ Status: FULL – Tank is nice and full!"); } else if (waterLevel >= LOW_LEVEL) { // 🟡 Tank is MEDIUM – getting lower digitalWrite(YELLOW_LED, HIGH); Serial.println("⚠️ Status: MEDIUM – Keep an eye on it"); } else { // 🔴 Tank is LOW – ALERT! ALERT! digitalWrite(RED_LED, HIGH); digitalWrite(BUZZER_PIN, HIGH); // BEEEEP! Serial.println("🚨 ALERT: LOW WATER – Please refill now!"); } // 5. Wait 1 second before reading again delay(1000); }
The low-water alert in action
LOW WATER ALERT!
When the water level drops below 300, the RED LED lights up AND the buzzer goes BEEEEP! — so nobody can ignore it. This is exactly how real water monitoring systems work!
How does it actually work?
Let's understand the science behind our project! It's simpler than you think 😄
The water sensor uses electricity!
The sensor has tiny metal tracks on it. When water covers them, electricity can flow between the tracks. More water = more electricity flowing = higher number on the Arduino. It's like a tiny bridge that water completes!
Arduino reads the signal
The analogRead(A0) command asks the sensor "how much water is there?" and gets a number between 0 (no water) and 1023 (maximum water). The Arduino's brain decides what to do with that number.
LEDs and buzzer are outputs
When the code says digitalWrite(GREEN_LED, HIGH), it sends 5 volts to the LED pin — and the LED lights up! The buzzer works the same way. Arduino is like a traffic controller deciding which lights to turn on.
Extra challenges for super engineers!
Finished the project? Try these upgrades to make it even cooler! 🚀
Common questions
My sensor gives weird numbers when not in water – is that normal?
Can I use a passive buzzer instead of an active one?
tone(BUZZER_PIN, 1000) command to make sound. An active buzzer is easier — it makes sound when you just give it power, which is why we chose it for this beginner project.
Comments
Post a Comment