top of page

Interfacing Water/Rain Sensor with Arduino

Updated: Feb 9

Let's talk about what a water sensor is! A water #sensor is typically a device that senses or detects the water levels. A water sensor is essentially used for the measurement of water level, detection of any leakage, monitor tanks, and water pump any many such similar activities. Through this article one can learn how to interface a water sensor with an #Arduino board in a very manageable way.


Apparatus Required:


These are the list of components used for the #interfacing purpose.


Components required
Components required

Water sensor:- A water sensor has three pins particularly VCC, ground, and analog output pins. The #hardware of a water sensor has 10 copper traces, 5 of them are for power traces, and the rest 5 of them are sense traces. The power and sense traces are placed alternately.


Water Sensor
Water Sensor

Arduino Board:- Arduino Board can read inputs such as light on a sensor, a finger on a button, or a Twitter message and convert it to an output such as activating a motor, turning on an LED, publishing something online. All of this can be done by sending a set of instructions to the microcontroller on the board by the use of the Arduino programming language.


Arduino Board
Arduino Board

Jumper wires:- Jumper wires are used for the connection purpose.

Jumper wires
Jumper wires

Circuit Diagram:- The circuit connections are as follows. VCC(positive terminal) is connected to the 8th pin of the Arduino board using a jumper wire. The ground pin of Arduino is connected to the ground of the water sensor, and lastly, the analog pin(output pin) of the sensor is connected to A(0) of the Arduino board.


Note:- The positive terminal of the sensor can also be connected to pin 5 of the Arduino board, but here it is connected to pin 8 so that whenever output values are desired only then then-current should be supplied to the sensor hardware. For the rest of the time, the current movement is stopped because as soon as the current flows through the sensor it gets electrified and starts to corrode. Basically to make the sensor more durable and prevention form corrosion.

Circuit Arrangement
Circuit Arrangement

Code:



Working


The image of the circuit when the switch is off.

OFF switch
OFF switch

When the switch is ON that is code is successfully uploaded to the sensor. The sensor in the case is coded in such a way that when it is immersed in water it shows the water level. In the serial #monitor initially, the sensor shows minimum values when it is not immersed in water. Once the sensor is made to sink in the water the serial monitor readings start to increase and reach a maximum level when the sensor is completely submerged in the water. In the same way, reading starts to decrease when the sensor is taken out of the water.


Note:- The sensor reading won't come to zero as it was in the starting position because the water droplet is still present on the sensor. To make the #reading zero one has to remove all the water droplets from the surface of the sensor.


ON Switch
ON Switch

Video description: -

Learn Electronics. (Sept 8, 2020). "Interfacing Water/Rain Sensor with Arduino". https://www.youtube.com/watch?v=KcGZjaFDvOw


In this article, the water sensor is used for water level #measurement. Besides this water sensor can be used in the rainy season to detect rainfall, can be planted in a water tank as a water level alarm, to detect any leakage. It is also used as a precautionary measure for #submersible electronics.


 

See Also:


410 views2 comments

Related Posts

See All
bottom of page