Introduction
Parts
- Arduino Mega 2560
- Water Level Sensor
- HookUp Wires
- Buzzer
- LED
Water level Sensor:

Connection:
- Connected the Input pin of the sensor to the digital pin 13 of Arduino Mega 2560.
- Connected the Vcc of sensor to the 5v of the Arduino Mega 2560.
- Connected the Gnd of sensor to the Gnd of the Arduino Mega 2560.
Step 2: Connection from LED to ArduinoMega2560,
Negative pin = Gnd.
Step 3: Connection from Buzzer to Arduino Mega 2560.
Negative pin = Gnd
Programming:
- #define Grove_Water_Sensor 13 //Attach Water sensor to Arduino Digital Pin 13
- #define Grove_Piezo_Buzzer 10 //Attach Piezo Buzzer to Arduino Digital Pin 10
- #define LED 12 //Attach an LED to Digital Pin 12 (or use onboard LED)
- void setup(){
- pinMode(Grove_Water_Sensor, INPUT); //The Water Sensor is an Input
- pinMode(Grove_Piezo_Buzzer, OUTPUT); //The Piezo Buzzer is an Output
- pinMode(LED, OUTPUT); //The LED is an Output
- }
- void loop()
- {
- if(digitalRead(Grove_Water_Sensor) == LOW){
- digitalWrite(LED,HIGH);
- digitalWrite(Grove_Piezo_Buzzer, HIGH);
- delay(2);
- digitalWrite(Grove_Piezo_Buzzer, LOW);
- delay(40);
- }
- else
- {
- digitalWrite(Grove_Piezo_Buzzer, LOW);
- digitalWrite(LED,LOW);
- }
- }
When the water leak it will automatically produce sound and LED also turns ON. When the water is not leaking it will not produce any sound and LED remains the same i.e OFF. It can be used in to detect a leak, spill, flood, rain, etc.

Read more articles on Arduino:

Sr KarthigaPosted Feb 29, 2016, 7:48 PM
thank you asfend sir
Asfend YarPosted Feb 29, 2016, 2:21 PM
good and nice share
Sr KarthigaPosted Feb 19, 2016, 7:52 PM
Thank you mohammed sir
Sr KarthigaPosted Feb 19, 2016, 7:51 PM
Thank you hemant sir
Mohammed IbrahimPosted Feb 19, 2016, 2:50 PM
nice
Hemant SrivastavaPosted Feb 19, 2016, 2:40 PM
Good to know
Sr KarthigaPosted Feb 18, 2016, 7:42 PM
thank you gowtham sir
Sr KarthigaPosted Feb 18, 2016, 7:42 PM
thank you shubham sir
Sr KarthigaPosted Feb 18, 2016, 7:41 PM
thank you sibeesh sir
Sr KarthigaPosted Feb 18, 2016, 7:41 PM
Thank you SANTHAKUMAR SIR
Gowtham KPosted Feb 18, 2016, 11:41 AM
Good one
Shubham KumarPosted Feb 18, 2016, 12:09 AM
Interesting +1 keep share
Sibeesh VenuPosted Feb 18, 2016, 12:09 AM
Nice Share
Santhakumar MunuswamyPosted Feb 17, 2016, 10:15 PM
Thanks for nice work
Sr KarthigaPosted Feb 17, 2016, 8:03 PM
Thank you kumaresh sir
Kumaresh RajalingamPosted Feb 17, 2016, 7:39 PM
Good Explanation