
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:
- After hardware connection, insert the sample sketch into the Arduino IDE.
- Using a USB cable, connect the ports from the Arduino to the computer.
- Upload the program.
- 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