Soil Humidity Sensor

Overview

Soil moisture sensors measures the amount of water in the soil to maintain consistent and ideal soil conditions for plants. They can be used to detect the moisture of soil or judge if there is water around the sensor. They can be very easy to use, just insert it into the soil and then read it.

Documentation for this sensor is available here.

Connecting to Arduino

There are only three pins that you need to worry about on the soil humidity sensor:

Soil Sensor Pins Arduino Pins
VCC 5V
GND GND
A0 A0

Code example

/********************
 * Soil humidity sensor tester
 * Read soil humidity by measuring its resistance.
 ********************/

int sensorPin = A0;
int soilHumidity = -1;

void setup() {
  Serial.begin(38400);  
}

void loop() {
  soilHumidity = analogRead(sensorPin);
  Serial.println(soilHumidity);
  delay(100);
}

The raw source of the sketch example is visible here.

Enjoy!