

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 a system, users can monitor soil conditions and optimize irrigation schedules, ensuring efficient water usage and healthier plants.








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 (proportional to soil moisture) |
| Current Consumption | ~20mA |
| Dimensions | 60mm x 20mm |
| Interface Type | Analog |
| Operating Temperature | 0°C to 50°C |
The SparkFun Soil Moisture Sensor has three pins, as described in the table below:
| Pin | Name | Description |
|---|---|---|
| 1 | VCC | Power supply pin. Connect to 3.3V or 5V from the microcontroller or power source. |
| 2 | GND | Ground pin. Connect to the ground of the circuit. |
| 3 | SIG | Analog signal output. Provides a voltage proportional to the soil moisture level. |
Wiring the Sensor:
VCC pin of the sensor to the 3.3V or 5V pin of your microcontroller.GND pin of the sensor to the ground (GND) of your circuit.SIG pin to an analog input pin on your microcontroller (e.g., A0 on an Arduino UNO).Placement:
Reading the 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; // Analog pin connected to the sensor's SIG pin
int sensorValue = 0; // Variable to store the sensor reading
void setup() {
Serial.begin(9600); // Initialize serial communication at 9600 baud
pinMode(sensorPin, INPUT); // Set the sensor pin as an input
}
void loop() {
// Read the analog value from the sensor
sensorValue = analogRead(sensorPin);
// Print the sensor value to the Serial Monitor
Serial.print("Soil Moisture Level: ");
Serial.println(sensorValue);
// Add a delay to avoid flooding the Serial Monitor
delay(1000); // Wait for 1 second
}
analogRead() function returns a value between 0 and 1023, corresponding to the sensor's output voltage.No Output or Incorrect Readings:
VCC, GND, and SIG pins are properly connected.Fluctuating Readings:
Corrosion of Prongs:
Sensor Not Responding:
Q1: Can the sensor be used in hydroponic systems?
A1: The sensor is designed for soil use. While it can measure moisture in some hydroponic setups, prolonged exposure to water may accelerate corrosion.
Q2: How do I calibrate the sensor?
A2: Measure the sensor's output voltage in completely dry soil and fully saturated soil. Use these values to create a mapping function for your application.
Q3: Can I use the sensor with a Raspberry Pi?
A3: Yes, but since the Raspberry Pi lacks analog input pins, you will need an external ADC (Analog-to-Digital Converter) to read the sensor's output.
Q4: What is the lifespan of the sensor?
A4: The lifespan depends on usage and environmental conditions. Proper care, such as avoiding prolonged exposure to water and using protective coatings, can extend its life.
By following this documentation, you can effectively integrate the SparkFun Soil Moisture Sensor into your projects and ensure reliable performance.