

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 other agricultural or gardening applications. Its compact design and ease of integration make it a popular choice for both hobbyists and professionals.








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) |
| 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 coating |
The Soil Moisture V2 sensor has three pins for easy integration into circuits:
| 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).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 moisturePercentage = map(sensorValue, 0, 1023, 0, 100);
// Map the sensor value to a percentage (0% to 100%)
Serial.print("Soil Moisture: ");
Serial.print(moisturePercentage);
Serial.println("%"); // Print the moisture percentage to the Serial Monitor
delay(1000); // Wait for 1 second before taking the next reading
}
map() function is used to convert the raw analog reading (0-1023) to a percentage (0-100%). Adjust the map() parameters based on your sensor's calibration values.Serial Monitor in the Arduino IDE to view the soil moisture readings in real time.No Output or Incorrect Readings:
VCC, GND, and AOUT pins are properly connected.Fluctuating Readings:
VCC and GND to stabilize the power supply.Sensor Degradation:
Inaccurate Calibration:
Q1: Can the Soil Moisture V2 sensor be used with a Raspberry Pi?
A1: 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.
Q2: How deep should the sensor be inserted into the soil?
A2: Insert the sensor fully into the soil, ensuring the entire sensing area is in contact with the soil for accurate readings.
Q3: Can this sensor measure soil salinity?
A3: No, the Soil Moisture V2 sensor is designed specifically for measuring soil moisture, not salinity or other soil properties.
Q4: Is the sensor waterproof?
A4: The sensor is water-resistant due to its PCB coating, but it is not fully waterproof. Avoid submerging it in water for extended periods.
By following this documentation, you can effectively integrate and use the Soil Moisture V2 sensor in your projects.