

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, automated gardening systems, and environmental monitoring. By integrating this sensor into your project, you can monitor soil conditions and optimize irrigation schedules, ensuring healthier plants and efficient water usage.








The SparkFun Soil Moisture Sensor is a simple yet effective tool for measuring soil moisture. Below are its key technical details and pin configuration:
| Parameter | Value |
|---|---|
| Operating Voltage | 3.3V to 5V |
| Output Type | Analog |
| Output Voltage Range | 0V (dry soil) to ~3.3V (wet soil) |
| Current Consumption | ~5mA |
| Dimensions | 60mm x 20mm |
| Connector Type | 3-pin header |
| Pin Name | Description |
|---|---|
| VCC | Power supply pin (3.3V to 5V) |
| GND | Ground pin |
| SIG | Analog signal output pin (provides moisture data) |
The SparkFun Soil Moisture Sensor is easy to integrate into your circuit. Follow the steps below to use it effectively:
VCC pin to a 3.3V or 5V power source and the GND pin to the ground of your circuit.SIG pin to an analog input pin on your microcontroller (e.g., Arduino UNO).Below is an example of how to connect the SparkFun Soil Moisture Sensor to an Arduino UNO:
VCC → Arduino 5VGND → Arduino GNDSIG → Arduino A0The following code reads the sensor's analog output and prints the soil moisture level to the Serial Monitor:
// Define the analog pin connected to the sensor's SIG pin
const int sensorPin = A0;
void setup() {
// Initialize the Serial Monitor for debugging
Serial.begin(9600);
}
void loop() {
// Read the analog value from the sensor
int sensorValue = analogRead(sensorPin);
// Map the sensor value to a percentage (0% = dry, 100% = wet)
int moisturePercent = map(sensorValue, 0, 1023, 0, 100);
// Print the moisture level to the Serial Monitor
Serial.print("Soil Moisture: ");
Serial.print(moisturePercent);
Serial.println("%");
// Wait for 1 second before the next reading
delay(1000);
}
No Output or Incorrect Readings
VCC, GND, and SIG pins are properly connected.Fluctuating Readings
VCC and GND to stabilize the power supply.Sensor Corrosion
Inconsistent Results in Different Soils
Q: Can this sensor be used with a 3.3V microcontroller?
A: Yes, the sensor operates at both 3.3V and 5V, making it compatible with most microcontrollers.
Q: How do I interpret the sensor's analog output?
A: The output voltage increases with soil moisture. Dry soil produces a low voltage (0V), while wet soil produces a higher voltage (3.3V).
Q: Is the sensor waterproof?
A: The probes are designed for soil insertion, but the PCB is not waterproof. Avoid exposing the PCB to water.
Q: How often should I take readings?
A: To minimize sensor wear, take readings at intervals (e.g., every few hours) rather than continuously.
By following this documentation, you can effectively integrate the SparkFun Soil Moisture Sensor into your projects and ensure reliable performance.