

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 precision agriculture, gardening automation, and environmental monitoring. By integrating this sensor into your projects, you can monitor soil conditions and optimize irrigation systems to conserve water and improve plant health.








The SparkFun Soil Moisture Sensor is a simple yet effective tool for measuring soil moisture. Below are its key technical details:
| Parameter | Specification |
|---|---|
| Operating Voltage | 3.3V - 5V |
| Output Signal | Analog voltage (0V - Vcc) |
| Current Consumption | < 20 mA |
| Dimensions | 60mm x 20mm |
| Interface Type | Analog |
| Operating Temperature | -40°C to 85°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 output pin that provides soil moisture data |
To use the SparkFun Soil Moisture Sensor in a circuit:
Below is an example of how to use the SparkFun Soil Moisture Sensor with an Arduino UNO to read and display soil moisture levels:
// Define the analog pin connected to the sensor's SIG pin
const int sensorPin = A0;
// Variable to store the sensor reading
int sensorValue;
void setup() {
// Initialize serial communication for debugging
Serial.begin(9600);
}
void loop() {
// Read the analog value from the sensor
sensorValue = analogRead(sensorPin);
// Map the sensor value to a percentage (0% - 100%)
int moisturePercent = map(sensorValue, 0, 1023, 0, 100);
// Print the raw sensor value and moisture percentage to the Serial Monitor
Serial.print("Raw Sensor Value: ");
Serial.print(sensorValue);
Serial.print(" | Soil Moisture: ");
Serial.print(moisturePercent);
Serial.println("%");
// Wait for 1 second before the next reading
delay(1000);
}
No Output or Incorrect Readings
Fluctuating Readings
Corroded Probes
Q: Can this sensor be used in hydroponic systems?
A: No, this sensor is designed for soil use and may corrode quickly in water. For hydroponics, consider using a different type of moisture sensor.
Q: How do I calibrate the sensor?
A: Measure the sensor's output in completely dry soil and fully saturated soil. Use these values to map the sensor's output to a percentage or other meaningful range.
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) module to read the sensor's output.
By following this documentation, you can effectively integrate the SparkFun Soil Moisture Sensor into your projects and ensure reliable performance.