Introduction
A Smart Water Leakage Detector is an electronic system designed to detect water leakage automatically and alert users. By integrating sensors, microcontrollers, and IoT, it helps prevent water wastage, property damage, and potential hazards.
This project demonstrates smart home automation and safety technology.
Objective of the Project
- To detect water leakage automatically
- To alert users through buzzer, LED, or mobile notification
- To prevent property damage and water wastage
- To integrate IoT for remote monitoring and alerts
Working Principle
- Water sensors or probes are placed at potential leakage points (like near tanks, pipelines, or washrooms)
- When water touches the sensor, it completes the circuit and sends a signal to the microcontroller
- Microcontroller triggers buzzer, LED, and optionally IoT notifications
- Optional: System can trigger automatic water shutoff valves for advanced applications
Components Required
- Arduino Uno / ESP32
- Water Level / Water Leakage Sensor
- Buzzer (for local alert)
- LEDs (Red for leakage, Green for safe)
- Relay Module (optional, for automatic valve control)
- Jumper wires and power supply
- Optional Wi-Fi module (ESP8266 / ESP32 built-in) for IoT
Block Diagram
Water Sensor / Probe
↓
Microcontroller (Arduino/ESP32)
↓
Buzzer & LED Alert
↓
Optional: Relay → Automatic Valve
↓
Optional: IoT Cloud / Mobile Notifications
Circuit Connections (Arduino + Water Sensor Example)
Water Sensor
VCC → 5V
GND → GND
DO → D2 (Arduino Digital Pin)
Buzzer
+ → D8
- → GND
LEDs
Red LED → D3 (with 220Ω resistor) // Leakage detected
Green LED → D4 (with 220Ω resistor) // No leakage
Optional Relay (for automatic valve)
IN → D7
VCC → 5V
GND → GND
COM → Live wire to solenoid valve
NO → Valve input
Arduino Code (Smart Water Leakage Detector)
#define WATER_SENSOR 2
#define BUZZER 8
#define RED_LED 3
#define GREEN_LED 4
#define RELAY 7 // Optional
void setup() {
pinMode(WATER_SENSOR, INPUT);
pinMode(BUZZER, OUTPUT);
pinMode(RED_LED, OUTPUT);
pinMode(GREEN_LED, OUTPUT);
pinMode(RELAY, OUTPUT);
digitalWrite(RED_LED, LOW);
digitalWrite(GREEN_LED, HIGH);
digitalWrite(RELAY, LOW);
Serial.begin(9600);
Serial.println("Smart Water Leakage Detector Ready");
}
void loop() {
int sensorState = digitalRead(WATER_SENSOR);
if(sensorState == HIGH){ // Water detected
Serial.println("Water Leakage Detected!");
digitalWrite(RED_LED, HIGH);
digitalWrite(GREEN_LED, LOW);
digitalWrite(BUZZER, HIGH);
digitalWrite(RELAY, HIGH); // Optional: Shutoff valve
} else { // No water leakage
digitalWrite(RED_LED, LOW);
digitalWrite(GREEN_LED, HIGH);
digitalWrite(BUZZER, LOW);
digitalWrite(RELAY, LOW);
}
delay(500);
}
Code Explanation
- Water sensor detects leakage and sends HIGH signal to Arduino
- Arduino activates buzzer, red LED, and optional relay
- Green LED indicates no leakage
- Optional IoT integration allows real-time alerts to mobile app or cloud server
Advantages
- Detects water leakage instantly
- Prevents property damage and wastage
- Integrates with IoT for remote monitoring
- Low-cost and easy to implement
Applications
- Homes and apartments (bathrooms, kitchens)
- Offices and industrial pipelines
- Smart city water management systems
- Educational projects in IoT and automation
Future Enhancements
- Add multiple sensors for full-house coverage
- IoT notifications via SMS, email, or app alerts
- Automatic water shutoff valve for complete safety
- Integration with smart home systems like Alexa or Google Home
Conclusion
The Smart Water Leakage Detector is a mini + innovation project that demonstrates safety, automation, and IoT technology. It ensures early detection of leaks, prevents damage, and promotes water conservation, making it ideal for smart homes and industrial applications.
