

The Soil Moisture V2 sensor, manufactured by ESP32, is a reliable and efficient device designed to measure the volumetric water content in soil. This sensor provides accurate data that can be used for irrigation management, plant health monitoring, and various agricultural or gardening applications. Its compact design and ease of integration make it suitable for both hobbyist projects and professional systems.








The Soil Moisture V2 sensor is designed to operate efficiently in a variety of environments. Below are its key technical details:
| Parameter | Value |
|---|---|
| Operating Voltage | 3.3V to 5V |
| Operating Current | < 20mA |
| Output Signal | Analog voltage (0-3.3V typical) |
| Measurement Range | 0% to 100% soil moisture |
| Interface Type | Analog |
| Dimensions | 60mm x 20mm x 5mm |
| Operating Temperature | -10°C to 60°C |
| Material | Corrosion-resistant electrodes |
The Soil Moisture V2 sensor has three pins for easy integration into circuits. Below is the pinout description:
| Pin | Name | Description |
|---|---|---|
| 1 | VCC | Power supply pin (3.3V to 5V) |
| 2 | GND | Ground connection |
| 3 | AOUT | Analog output pin that provides soil moisture data |
VCC pin to a 3.3V or 5V power source and the GND pin to the ground of your circuit.AOUT pin to an analog input pin of your microcontroller (e.g., ESP32 or Arduino UNO).AOUT pin and ground to reduce noise in the analog signal.Below is an example of how to use the Soil Moisture V2 sensor with an Arduino UNO:
// Define the analog pin connected to the sensor's AOUT pin
const int soilMoisturePin = A0;
// Variable to store the sensor reading
int soilMoistureValue = 0;
void setup() {
// Initialize serial communication for debugging
Serial.begin(9600);
}
void loop() {
// Read the analog value from the sensor
soilMoistureValue = analogRead(soilMoisturePin);
// Map the sensor value to a percentage (0% to 100%)
int moisturePercent = map(soilMoistureValue, 0, 1023, 0, 100);
// Print the moisture percentage to the Serial Monitor
Serial.print("Soil Moisture: ");
Serial.print(moisturePercent);
Serial.println("%");
// Wait for 1 second before the next reading
delay(1000);
}
If using the ESP32, connect the AOUT pin to one of the ESP32's ADC pins (e.g., GPIO34). Adjust the analogRead() function to match the ESP32's ADC resolution (typically 12 bits).
No Output Signal
Inconsistent Readings
AOUT pin and ground to filter noise. Ensure the sensor is properly inserted into the soil.Corrosion on Electrodes
Q: Can the Soil Moisture V2 sensor be used outdoors?
A: Yes, but it is recommended to protect the sensor from extreme weather conditions and ensure proper drainage to prevent corrosion.
Q: How do I interpret the analog output?
A: The analog output corresponds to the soil moisture level. Calibrate the sensor by measuring the output in dry and saturated soil, then map the values to a percentage scale.
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 external ADC (Analog-to-Digital Converter) module to read the sensor's output.
Q: What is the lifespan of the sensor?
A: The lifespan depends on usage conditions. Proper care, such as avoiding prolonged exposure to water and cleaning the electrodes, can extend its life.