Arduino Water Level Sensor, Controller + Indicator
Arduino Water Level Sensor, Controller + Indicator
1 of 8
http://www.electroschematics.com/9964/arduino-water-level-indicator-co...
Labs
free energy
Q&A
quizzes
Comments
Submit article
Contact
Register
Login
Arduino
555
Alarms
Audio
Basic
DIY
Hobby
Lights
Measure
Power supply
Radio
Solar
Tested
Theory
Various
Tools
261
Tweet
Here is a tested Arduino project that uses 3 sensor probes as water level indicator with 3 leds and one LCD display + a
simple controller that turns on a motor when the water has reached the desired level (the highest in our case). You can use
only the leds if you want, the lcd is optional.
9/8/2014 12:31 PM
2 of 8
http://www.electroschematics.com/9964/arduino-water-level-indicator-co...
The Arduino sketch code is pretty simple even though I spent almost 1 hour to test it. You can download it using the link
below and then extract the files.
arduino water level skecth
Water Level Sensor Code
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
//source: http://www.electroschematics.com/9964/arduino-water-level-sensor/
#include <LiquidCrystal.h>
LiquidCrystal lcd(7, 6, 5, 4, 3, 2);
byte sensorPin[] = {8, 9, 10};
byte ledPin[] = {11, 12, 13}; // number of leds = numbers of sensors
const byte sensors = 3;
int level = 0;
int motor = A4;
void setup() {
for(int i = 0; i < sensors; i++) {
pinMode(sensorPin[i], INPUT);
pinMode(ledPin[i], OUTPUT);
9/8/2014 12:31 PM
3 of 8
http://www.electroschematics.com/9964/arduino-water-level-indicator-co...
14.
}
15.
pinMode(motor, OUTPUT);
16.
lcd.begin(16, 2);
17. }
18.
19. void loop() {
20.
level = 0;
21.
for(int i = 0; i < sensors; i++) {
22.
if(digitalRead(sensorPin[i]) == LOW) {
23.
digitalWrite(ledPin[i], HIGH);
24.
level = sensors - i;
25.
} else {
26.
digitalWrite(ledPin[i], LOW);
27.
}
28.
}
29.
lcd.clear();
30.
lcd.print("Water level");
31.
lcd.setCursor(0,1);
32.
switch(level) {
33.
case 1:
34.
lcd.print("HIGH");
35.
digitalWrite(motor, HIGH);
36.
break;
37.
case 2:
38.
lcd.print("AVERAGE");
39.
digitalWrite(motor, LOW);
40.
break;
41.
case 3:
42.
lcd.print("LOW");
43.
digitalWrite(motor, LOW);
44.
break;
45.
default:
46.
lcd.print("NO WATER");
47.
digitalWrite(motor, LOW);
48.
break;
49.
}
50.
delay(50);
51. }
On line 2 we have included the LiquidCrystal.h header and then on line 3 the pins where to connect the LCD display. On line
4 we use sensorPin array to set the sensor pins, on line 5 ledPin is where we connect the 3 leds. We connected the motor on
pin A4 so we use this in our motor variable.
Inside the setup() function we set the sensor pins as INPUT and led pins and motor as OUTPUT. In the loop() we check to
see if the water level has reached any sensor and if so then turn an the corresponding led. We also use the LCD to display
HIGH if the water has reached the highest poing, AVERAGE for half-filled water tank, LOW when there is little water and
NO WATER when the container is empty or the water has not reached the LOW point yet.
We also used a motor (or you can use an electric water valve) that is turning ON when the water level is HIGH. This can be
useful when you want to empty the tank once it is full or to stop the water flow to the water tank.
9/8/2014 12:31 PM
4 of 8
Share
261
Water Level
Indicator Circuit
Tweet
Simple Water
Level Indicator
http://www.electroschematics.com/9964/arduino-water-level-indicator-co...
Water Level
Indicator/Sensor
Numeric Water
Level Indicator
1.
reply
Whi, this ckt is very usefull n easy to construct, can u tell me how can I get monetered byvsms on my mobilesthroughh
at command.
Thanks
2.
reply
3.
reply
9/8/2014 12:31 PM
5 of 8
http://www.electroschematics.com/9964/arduino-water-level-indicator-co...
i want the circuit of water level indicator using these componentstransistor bc 548-4pcs
resistor 220 ohm- 6pcs
led colored bulb- 4pcs
buzzer
9volt battery.
can you pls help me out by sending the circuit and explaining how to construct it??
Samaj says: on March 20, 2014 at 7:27 am
4.
reply
5.
reply
You have not published the entire thing. Let me something more because i am searching MCU based projects. I have
done the same project using NE555. Let me know about MCU programming
Thanks
valli says: on March 21, 2014 at 4:10 pm
6.
reply
7.
reply
i have run the above code using LCD on ISIS but LCD is not displaying anything,also the motor is continously running
irrespective of high.low or avg
Frank says: on March 23, 2014 at 8:40 pm
8.
reply
This is perfect for my purpose. I want to use it in a storage tank and for watering my garden at intervals that still have
to be determined.
Kay says: on April 30, 2014 at 7:25 am
9.
reply
Hye Mr P. Marian
9/8/2014 12:31 PM
6 of 8
http://www.electroschematics.com/9964/arduino-water-level-indicator-co...
just want to ask do you have your project flow chart? I want to make a references to my project as very similar to your
project here.
Really appreciate if u can share me your project flow chart.
Thank You
Val says: on May 12, 2014 at 6:55 pm
10.
reply
I think its smart project..but Im having problems trying to implement this project with BC 547c transistors..
No response from the probes and comes off and on irregularly
Maleeha Iesar says: on May 20, 2014 at 6:15 pm
11.
reply
12.
reply
what about if I use this with bluetooth ? and without the motor? how will the code be?
please reply
Gelu says: on July 6, 2014 at 3:43 pm
13.
reply
acest circuit poate fi flosit pentru a masura nivelul de benzina din rezervor?
14.
reply
Sir I need to construct the Water level controller without using the Micro controllers and arduino boards Pls guid me a
circuit
ramesh says: on July 25, 2014 at 7:22 pm
15.
reply
Hi dear rui,
Can u tell me the connection of lcd with arduino or parallel with led, pl repl
9/8/2014 12:31 PM
7 of 8
http://www.electroschematics.com/9964/arduino-water-level-indicator-co...
No file selected.
Check this checkbox to get notifications of followup comments via e-mail. You can also subscribe without
commenting.
electroschematics partners
Login
Username
Password
Remember Me
9/8/2014 12:31 PM
8 of 8
http://www.electroschematics.com/9964/arduino-water-level-indicator-co...
Recent Questions
How to check whether a Lightening Detector Circuit is working?
Need help to disable the PIR in a combined light/movement sensor
gsm signal repeater amplifier circuit diagram?
recently added electronic circuits
SCR Based SSS Solar Charge Control
AVR Bootloader Tutorial #18
Fluorescent Lamp Driver with Starter
4049 Datasheet
GSM Home Security Alarm System with Arduino
9/8/2014 12:31 PM