

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 systems, plant health monitoring, and agricultural automation. Its compact design and ease of integration make it a popular choice for both hobbyists and professionals in the field of smart gardening and precision agriculture.








The Soil Moisture V2 sensor is designed to operate efficiently in a variety of environments. Below are its key technical details:
| Parameter | Specification |
|---|---|
| Operating Voltage | 3.3V to 5V |
| Operating Current | < 20mA |
| Output Signal | Analog voltage (0-3.3V) |
| 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 PCB |
The Soil Moisture V2 sensor has three pins for easy interfacing:
| 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 |
To use the Soil Moisture V2 sensor in a circuit:
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
const int sensorPin = A0;
void setup() {
Serial.begin(9600); // Initialize serial communication at 9600 baud
}
void loop() {
int sensorValue = analogRead(sensorPin); // Read the analog value from the sensor
float voltage = sensorValue * (5.0 / 1023.0); // Convert to voltage (5V reference)
// Map the voltage to a percentage (0% to 100% soil moisture)
int moisturePercent = map(sensorValue, 0, 1023, 0, 100);
// Print the results to the Serial Monitor
Serial.print("Soil Moisture: ");
Serial.print(moisturePercent);
Serial.println("%");
delay(1000); // Wait for 1 second before the next reading
}
No Output or Incorrect Readings
Fluctuating or Unstable Readings
Sensor Corrosion
Q: Can the Soil Moisture V2 sensor be used 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.
Q: How do I calibrate the sensor?
A: Measure the sensor's output in dry soil (0% moisture) and fully saturated soil (100% moisture). Use these values to map the sensor's readings to a percentage scale.
Q: Is the sensor waterproof?
A: The sensor is water-resistant but not fully waterproof. Avoid submerging it in water for extended periods.
By following this documentation, you can effectively integrate the Soil Moisture V2 sensor into your projects and ensure accurate soil moisture monitoring.