Grove Resistive Plant Moisture Sensor
The Grove - Moisture Sensor can be used to detect the moisture of soil. It can be used to decide if the plants in a garden need watering. It can be used in gardens to automate watering plants. It can be used very easily by just inserting the sensor into the soil and reading the output using ADC.
This uses a Grove Analog port.
NOTE: This sensor is not hardened against contamination or exposure of the control circuitry to water and may be prone to electrolytic corrosion across the probes. It is designed for experimenting and prototyping only. It isn’t well suited to being used outdoors.
Features
- Grove compatible interface
- Easy to use
Interpreting the Output
Software for Arduino
The Arduino has a 10 bit ADC (Analog to digital converter). See specifications above.
// Test code for Grove - Moisture Sensor int sensorPin = A0; // select the input pin for the moisture sensor int sensorValue = 0; // variable to store the value coming from the sensor7= void setup() { Serial.begin(9600); } void loop() { // read the value from the sensor: sensorValue = analogRead(sensorPin); Serial.print("sensor = " ); Serial.println(sensorValue); delay(1000); }
Software for the Raspberry Pi
(using the 4 Channel 16 bit ADC for the Raspberry Pi)
This Python code snippet is taken from SmartPlantPi. This uses a 16 bit ADC.
if (config.ADS1115_Present): Moisture_Raw = ads1115.readADCSingleEnded(config.moistureADPin, gain, sps)/7 # AIN0 wired to AirQuality Sensor state.Moisture_Humidity = Moisture_Raw/7 if (DEBUG): print "Pre Limit Moisture_Humidity=", state.Moisture_Humidity if (state.Moisture_Humidity >100): state.Moisture_Humidity = 100; if (state.Moisture_Humidity <0): state.Moisture_Humidity = 0;
Specification
- Operating voltage: 3.3~5V
- Operating current: 35mA
- Sensor Output Value in dry soil: 0~ 300 (10 bit ADC - 0 - 1024)
- Sensor Output Value in humid soil: 300~700 (10 bit ADC - 0 - 1024)
- Sensor Output Value in water: 700 ~ 950 (10 bit ADC - 0 - 1024)
- PCB size: 2.0cm X 6.0cm
# Here are suggested sensor values:
# Min Typ Max Condition # 0 0 0 sensor in open air
# 0 20 300 sensor in dry soil
# 300 580 700 sensor in humid soil
# 700 940 950 sensor in water