Grove Water Sensor
Last updated
Last updated
The Water Sensor module is part of the Grove system. It indicates whether the sensor is dry, damp or completely immersed in water by measuring conductivity. The sensor traces have a weak pull-up resistor of 1 MΩ. The resistor will pull the sensor trace value high until a drop of water shorts the sensor trace to the grounded trace. Believe it or not this circuit will work with the digital I/O pins of your Arduino or you can use it with the analog pins to detect the amount of water induced contact between the grounded and sensor traces.
Grove compatible interface
Low power consumption
2.0cm x 2.0cm Grove module
High sensitivity
!!!Tip More details about Grove modules please refer to Grove System
Rainfall detecting
Liquid leakage
Tank overflow detector
Caution This device is for educational and hobby applications only. It is not intended to be used in applications where its malfunction could result in damage to property or human safety.
Item
Min
Typical
Max
Unit
Working Voltage
4.75
5.0
5.25
V
Current
<20
mA
Working Temperature
10
-
30
℃
Working Humidity (without condensation)
10
-
90
%
Connect the module to the Basic board using any of the digital pin. You can gain the value of the signal pin. When there is water on the bare conducting wires, the value is LOW. Otherwise, it will be HIGH.
The following sketch demonstrates a simple application of using the Water sensor to control the buzzer. As the picture on the below indicates, the Water sensor is connected to digital port 8 of the Grove - Base Shield and the Buzzer is connected to digital port 12. When there is water on the bare conducting wires, the SIG pin output a LOW voltage. Then the Buzzer sounds. The hardware installation is as follows:
Then connect Arduino to PC by using a USB cable.
Copy and paste code below to a new Arduino sketch.
Upload the code.
The buzzer sounds when the sensor is damp or completely immersed in water. Have a try!
1.You should have a raspberry pi and a grovepi or grovepi+.
2.You should have completed configuring the development enviroment, otherwise follow here.
3.Connection
Plug the sensor to grovepi socket D2 by using a grove cable.
4.Navigate to the demos' directory:
To see the code
```
import time
import grovepi
water_sensor = 2
grovepi.pinMode(water_sensor,"INPUT")
while True: try: print grovepi.digitalRead(water_sensor) time.sleep(.5)
sudo python grove_water_sensor.py
```