edit

Grove - Water Sensor

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.

Version

Product Version Changes Released Date
Grove-Water Sensor V1.1 Initial July 2014

Features

  • Grove compatible interface
  • Low power consumption
  • 2.0cm x 2.0cm Grove module
  • High sensitivity

Applications Ideas

  • Rainfall detecting
  • Liquid leakage
  • Tank overflow detector

Specifications

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  %

Tip

More details about Grove modules please refer to Grove System

Platforms Supported

Arduino Raspberry Pi BeagleBone Wio LinkIt ONE

Caution

The platforms mentioned above as supported is/are an indication of the module's hardware or theoritical compatibility. We only provide software library or code examples for Arduino platform in most cases. It is not possible to provide software library / demo code for all possible MCU platforms. Hence, users have to write their own software library.

Getting Started

Note

If this is the first time you work with Arduino, we firmly recommend you to see Getting Started with Arduino before the start.

Play With Arduino

Hardware

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.

  • Step 1. Prepare the below stuffs:
Seeeduino V4.2 Base Shield Grove - Water Sensor
enter image description here enter image description here enter image description here
Get One Now Get One Now Get One Now
  • Step 2. Connect Water Sensor to port D2 of Grove-Base Shield.
  • Step 3. Plug Grove - Base Shield into Seeeduino.
  • Step 4. Connect Seeeduino to PC via a USB cable.

Note

If we don't have Grove Base Shield, We also can directly connect Grove_Water_Sensor to Seeeduino as below.

Seeeduino Grove - Water Sensor
5V Red
GND Black
Not Conencted White
D2 Yellow

Software

  • Step 1. Copy the code into Arduino IDE and upload. If you do not know how to upload the code, please check how to upload code.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
#define WATER_SENSOR 2

void setup()
{
  Serial.begin (9600);
  pinMode(WATER_SENSOR, INPUT);
}
void loop()
{
  Serial.println(digitalRead(WATER_SENSOR));
  delay(500);
}
- Step 2. We will see the output display on terminal as below.

1
2
3
4
5
6
1
1
0
0
1
1

Play With Raspberry Pi

Hardware

  • Step 1. Prepare the below stuffs:
Raspberry pi GrovePi_Plus Grove - Water Sensor
enter image description here enter image description here enter image description here
Get One Now Get One Now Get One Now
  • Step 2. Plug the GrovePi_Plus into Raspberry.
  • Step 3. Connect Grove-Water Sensor to D2 port of GrovePi_Plus.
  • Step 4. Connect the Raspberry to PC through USB cable.

Software

  • Step 1. Follow Setting Software to configure the development environment.
  • Step 2. Navigate to the demos' directory:
1
cd yourpath/GrovePi/Software/Python/
  • Step 3. To see the code
1
nano grove_water_sensor.py
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
import time
import grovepi

# Connect the Grove Water Sensor to digital port D2
# SIG,NC,VCC,GND
water_sensor = 2

grovepi.pinMode(water_sensor,"INPUT")

while True:
    try:
        print grovepi.digitalRead(water_sensor)
        time.sleep(.5)

    except IOError:
        print "Error"
  • Step 4. Run the demo.
1
sudo python grove_water_sensor.py
  • Step 5. We will see the output display on terminal as below.
1
2
3
4
5
1
1
0
0
1

Resources

Project

Smart Crops: Implementing IoT in Conventional Agriculture!:Our mission with nature is to preserve it, designing and implementing technologies and monitoring methods with the help of IoT via Helium.

Tech Support

Please submit any technical issue into our forum.