Summary of WATER LEVEL MEASUREMENT USING ARDUINO UNO R3 AND WATER SENSORS
This article describes building an Arduino Uno water level detector and controller using multiple water sensors, LEDs, an LCD, buzzer, motor driven via a transistor/relay, and code to read 8 sensors and act on detected levels (turn motor on/off, sound buzzer on overflow). It explains sensor operation (conductive probes go HIGH when submerged) and provides the Arduino sketch and wiring overview.
Parts used in the Water Level Detector and Controller:
- Water sensors (8)
- Light Emitting Diodes (LEDs) (4)
- Arduino Uno (or similar)
- Buzzer
- Jumper wires
- Liquid Crystal Display (LCD) (20x4)
- Motor
- Relay with power source
- TIP122 NPN transistor
- Power source
Greetings, welcome back. Today, we will demonstrate the process of creating a water level detector utilizing an Arduino Uno and water sensors. There are numerous water level sensor tutorials available online, but this method stands out. To begin with, let’s talk about the components required for creating a water level indicator and controller.
Component required to make water level indicator .
water sensors that can give output 3-5 volt when water is present -8
Light Emitting Diodes (LEDs) -4
arduino uno or similar
buzzer
jumper wires
Liquid Crystal Display (LCD)
motor
relay with power source
tip-122 NPN transistor
power source
To begin with, let’s talk about the water sensor. With the abundance of water sensors in the market, we have the option of using any sensor that outputs 1 when submerged in water. Due to the conductivity of water, supplying 5 volts to the bottom of the water will cause the respective conductive pins to go high when water reaches higher levels, thus detecting the presence of water.
You may also opt to utilize water sensors as depicted in the figure below, which will generate 4.3 volts when fully immersed in water, indicating a digital electronic 1.

If you are not familier about other components please check arduino tutorials for beginners and you will learn something new before exploring other tutorial .
Okay now connect everythings as shown in circuit diagram and upload the code as shown in below and after that we will describe the code brifly .You can download the complete code , simulation file , from this link water level indication electronify.
WATER LEVEL MEASUREMENT USING ARDUINO UNO R3 AND WATER SENSORS (Code)
#include
LiquidCrystal lcd(13, 12, 11, 10, 9, 8);
byte sensorPin[] = {0,1,2,3,4,5,6,7};
byte ledPin[] = {17,16,15,14}; // number of leds = numbers of sensors
const byte sensors = 8;
const byte leds=4;
int motor = A4;
int buzzer = A5;
void setup()
{
for(int i = 0; i< sensors; i++) //initialize all sensor pins to input pin
{
pinMode(sensorPin[i], INPUT);
}
for(int i = 0; i< leds; i++) //initialize all led pins to output pins
{
pinMode(ledPin[i], OUTPUT);
}
pinMode(motor, OUTPUT); //initialize motor pin to output pin
lcd.begin(20, 4); //initializing 20x4 LCD
lcd.clear(); //clear LCD first
lcd.print("ELECTRONIFY.ORG"); // display string electronify.org
}
void loop()
{
int level = 0;
for(int i = 0; i < sensors; i++)
{
if(digitalRead(sensorPin[i]) == HIGH)
{
digitalWrite(ledPin[i/2], HIGH);
level = i+1;
} else
{
digitalWrite(ledPin[i/2], LOW);
}
}
lcd.setCursor(0,1);
lcd.print("WATER LEVEL MEASURE");
lcd.setCursor(0,2);
switch(level) {
case 1:
lcd.print("LEVEL 1");
digitalWrite(motor, HIGH);
break;
case 2:
lcd.print("LEVEL 2");
digitalWrite(motor, HIGH);
break;
case 3:
lcd.print("LEVEL 3 ");
digitalWrite(motor, HIGH);
break;
case 4:
lcd.print("LEVEL 4 ");
digitalWrite(motor, LOW);
break;
case 5:
lcd.print("LEVEL 5 ");
digitalWrite(motor, LOW);
break;
case 6:
lcd.print("LEVEL 6 ");
digitalWrite(motor, LOW);
break;
case 7:
lcd.print("LEVEL 7 ");
digitalWrite(motor, LOW);
break;
case 8:
lcd.print("LEVEL 8 ");
digitalWrite(motor, LOW);
lcd.setCursor(0,3);
lcd.print("WARNING : OVERFLOW");
for(int j = 0; j< 255; j++)
{
analogWrite(buzzer, j);
delay(10);
}
break;
default:
lcd.print("NO WATER");
digitalWrite(motor, HIGH);
break;
}
delay(50);
}
WATER LEVEL MEASUREMENT USING ARDUINO UNO R3 AND WATER SENSORS (Schematic Diagram)
Short Description
To begin with, let’s talk about the water sensor. With the abundance of water sensors in the market, we have the option of using any sensor that outputs 1 when submerged in water. Due to the conductivity of water, supplying 5 volts to the bottom of the water will cause the respective conductive pins to go high when water reaches higher levels, thus detecting the presence of water.
You may also opt to utilize water sensors as depicted in the figure below, which will generate 4.3 volts when fully immersed in water, indicating a digital electronic 1.
- What sensors are used to detect water levels?
The article uses water sensors that output a HIGH (about 3–5 V or 4.3 V when fully immersed) when submerged. - How does the water sensor detect water presence?
By supplying 5 volts to the bottom probe; when water conducts between probes the respective pin goes high indicating water presence. - How many sensors does the project use?
The provided code and description use eight water sensors. - What microcontroller is used in the project?
The project uses an Arduino Uno or a similar Arduino board. - What output devices indicate water level?
LEDs and a 20x4 LCD display indicate level; a buzzer sounds on overflow and a motor is controlled based on level. - How does the system respond to overflow?
When the highest sensor (level 8) is detected, the LCD shows WARNING : OVERFLOW and the buzzer is driven with increasing PWM until handled. - How is the motor controlled in the circuit?
The motor is driven via an output pin (A4) and controlled on/off based on detected level; a relay and TIP122 transistor are listed as components for switching and power handling. - Can analog water sensors be used as digital sensors?
Yes, the article notes analog strip sensors can act as digital: when fully drowned they produce a logic HIGH.

