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, 2:48 PM EST
thank you asfend sir
Asfend YarPosted Feb 29, 2016, 9:21 AM EST
good and nice share
Sr KarthigaPosted Feb 19, 2016, 2:52 PM EST
Thank you mohammed sir
Sr KarthigaPosted Feb 19, 2016, 2:51 PM EST
Thank you hemant sir
Mohammed IbrahimPosted Feb 19, 2016, 9:50 AM EST
nice
Hemant SrivastavaPosted Feb 19, 2016, 9:40 AM EST
Good to know
Sr KarthigaPosted Feb 18, 2016, 2:42 PM EST
thank you gowtham sir
Sr KarthigaPosted Feb 18, 2016, 2:42 PM EST
thank you shubham sir
Sr KarthigaPosted Feb 18, 2016, 2:41 PM EST
thank you sibeesh sir
Sr KarthigaPosted Feb 18, 2016, 2:41 PM EST
Thank you SANTHAKUMAR SIR
Gowtham KTOP 100Posted Feb 18, 2016, 6:41 AM EST
Good one
Shubham KumarPosted Feb 17, 2016, 7:09 PM EST
Interesting +1 keep share
Sibeesh VenuTOP 100Posted Feb 17, 2016, 7:09 PM EST
Nice Share
Santhakumar MunuswamyPosted Feb 17, 2016, 5:15 PM EST
Thanks for nice work
Sr KarthigaPosted Feb 17, 2016, 3:03 PM EST
Thank you kumaresh sir
Kumaresh RajalingamPosted Feb 17, 2016, 2:39 PM EST
Good Explanation