Water Level Sensor interfacing with Arduino

Water Level Sensor interfacing with Arduino: In 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

Specifications

  • 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

Code for water level sensor interfacing with Arduino

void setup(){

  Serial.begin(9600);

}

void loop() {

  int waterValue = analogRead(A0); // read input value of water level

  Serial.print("Level Value   ");

  Serial.println(waterValue);

  delay(2000);

}
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
Result:
More and more you dip the board in water the value on serial monitor keeps on increasing.


0 Comentários