Water Level Sensor interfacing with Arduino

Water Level Sensor interfacing with ArduinoIn this tutorial you will learn how to interface water level sensor with Arduino. Water level sensor is used to measure water level in water tank or in any other equipment. In our daily life we need to detect the level of water like in water tank at the top of roof which is not directly accessible and in laboratories where specific level of any liquid is required to be monitored. In such applications water level sensor is very useful. In today’s tutorial we will see how to interface water level sensor with Arduino and how to monitor specific water level using this assembly. Water level sensor gives output int the form of voltage.So before using water level sensor, you should know, how to meausre analog voltage using Arduino  and if you are new to arduino programming I recommend you to check this arduino programming in c tutorial first. water level sensor interfacing with arduino

Hardware Required 

  • Arduino UNO
  • Water level sensor
  • Connecting wires

Pin Configuration 

Water level sensor is provided with three output terminals.

  • + stands for        +5V
  • – stands for        GND
  • S stands for        signal


  • Operating Voltage: DC5V
  • Working current: less than 20mA
  • Sensor Type: Analog
  • Detection area :40mm x16mm

Circuit Diagram of water level detector

Connect the circuit as follows:

Sensor S pin                 with                 Arduino Analog pin A0

Sensor + pin                with                 Arduino 5V

Sensor – pin                with                 Arduino GND

 Video lecture

Code for water level sensor interfacing with Arduino

void setup()




void loop()


  int val = analogRead(A0); // read input value

  Serial.print("Pin Value   ");




Testing the Circuit:

  1. After hardware connection, insert the sample sketch into the Arduino IDE.
  2. Using a USB cable, connect the ports from the Arduino to the computer.
  3. Upload the program.
  4. See the results in the serial monitor


More and more you dip the board in water the value on serial monitor keeps on increasing.


2 thoughts on “Water Level Sensor interfacing with Arduino”

    • you can check the output file where you code is stored to know either Arduino IDE generate ASM file or not.
      Every compiler first generate assembly file and then convert it into hex or binary file

Leave a Comment