

The SparkFun Soil Moisture Sensor is a device designed to measure the volumetric water content in soil. It provides an analog output that corresponds to the moisture level, making it an essential tool for applications such as agriculture, gardening, and automated irrigation systems. By integrating this sensor into your projects, you can monitor soil conditions and optimize water usage effectively.








The SparkFun Soil Moisture Sensor is a simple yet effective tool for detecting soil moisture levels. Below are its key technical details:
| Parameter | Value |
|---|---|
| Operating Voltage | 3.3V - 5V |
| Output Signal | Analog voltage (0V - VCC) |
| Current Consumption | < 20 mA |
| Dimensions | 60mm x 20mm x 5mm |
| Interface Type | Analog |
| Operating Temperature | 10°C to 55°C |
The sensor has three pins, as described in the table below:
| Pin | Name | Description |
|---|---|---|
| 1 | VCC | Power supply pin (3.3V - 5V) |
| 2 | GND | Ground connection |
| 3 | SIG | Analog signal output pin, provides voltage proportional |
| to soil moisture level |
Connect the Sensor:
VCC pin to a 3.3V or 5V power source.GND pin to the ground of your circuit.SIG pin to an analog input pin on your microcontroller (e.g., Arduino).Insert the Sensor into Soil:
Read the Analog Output:
Below is an example of how to use the SparkFun Soil Moisture Sensor with an Arduino UNO:
// SparkFun Soil Moisture Sensor Example Code
// This code reads the analog output from the sensor and prints the moisture level
// to the Serial Monitor.
const int sensorPin = A0; // Connect SIG pin to analog pin A0
int sensorValue = 0; // Variable to store sensor reading
void setup() {
Serial.begin(9600); // Initialize serial communication at 9600 baud
}
void loop() {
sensorValue = analogRead(sensorPin); // Read the analog value from the sensor
Serial.print("Soil Moisture Level: ");
Serial.println(sensorValue); // Print the sensor value to the Serial Monitor
delay(1000); // Wait for 1 second before taking the next reading
}
analogRead() function returns a value between 0 and 1023.No Output or Incorrect Readings:
VCC pin is connected to a 3.3V or 5V power source and that the GND pin is properly grounded.Fluctuating Readings:
Sensor Corrosion:
Low Sensitivity:
Q: Can this sensor be used in hydroponic systems?
A: No, this sensor is designed for soil-based applications. For hydroponics, consider using a water-level or EC (electrical conductivity) sensor.
Q: How do I extend the lifespan of the sensor?
A: Minimize exposure to water and consider using a corrosion-resistant version. Alternatively, remove the sensor from the soil when not in use.
Q: Can I use this sensor with a Raspberry Pi?
A: Yes, but since the Raspberry Pi lacks analog input pins, you will need an ADC (analog-to-digital converter) to read the sensor's output.
Q: What is the maximum soil depth this sensor can measure?
A: The sensor measures moisture only at the depth of its probes, which is approximately 5-6 cm.
By following this documentation, you can effectively integrate the SparkFun Soil Moisture Sensor into your projects and ensure accurate soil moisture monitoring.