Datasheet

10
With Raspberry Pi
1. You should have got a raspberry pi and a grovepi or grovepi+.
2. You should have completed configuring the development environment, otherwise
follow here.
3. Connection
Plug the sensor to grovepi socket A0 by using a grove cable.
4.Navigate to the demos' directory:
cd yourpath/GrovePi/Software/Python/
To see the code
nano grove_moisture_sensor.py # "Ctrl+x" to exit #
import time
import grovepi
# Connect the Grove Moisture Sensor to analog port A0
# SIG,NC,VCC,GND
sensor = 0
while True:
try:
print grovepi.analogRead(sensor)
time.sleep(.5)
except KeyboardInterrupt:
break
except IOError:
print "Error"
5.Run the demo.
sudo python grove_moisture_sensor.py