

The Capacitive Soil Moisture Sensor (Manufacturer Part ID: SEN0193/SEN0308) by DFRobot is a reliable and non-invasive sensor designed to measure the volumetric water content in soil. Unlike resistive soil moisture sensors, this capacitive sensor detects changes in soil capacitance, making it less prone to corrosion and ensuring a longer lifespan. It is ideal for applications requiring accurate and durable soil moisture monitoring.








Below are the key technical details for the Capacitive Soil Moisture Sensor:
| Parameter | Value |
|---|---|
| Operating Voltage | 3.3V - 5.5V |
| Output Signal | Analog voltage (0-3.0V typical) |
| Current Consumption | < 20mA |
| Measurement Range | 0% - 100% soil moisture |
| Interface Type | Analog |
| Dimensions | 98mm x 23mm x 3mm |
| Cable Length | 200mm |
| Operating Temperature | -40°C to 85°C |
The sensor has a 3-pin interface for easy connection. The pinout is as follows:
| Pin | Name | Description |
|---|---|---|
| 1 | VCC | Power supply input (3.3V - 5.5V) |
| 2 | GND | Ground connection |
| 3 | AOUT | Analog output signal proportional to soil moisture |
Below is an example of how to connect the sensor to an Arduino UNO:
The following code reads the analog output from the sensor and converts it into a soil moisture percentage:
// Define the analog pin connected to the sensor
const int sensorPin = A0;
// Variable to store the sensor reading
int sensorValue = 0;
void setup() {
// Initialize serial communication for debugging
Serial.begin(9600);
}
void loop() {
// Read the analog value from the sensor
sensorValue = analogRead(sensorPin);
// Map the sensor value to a percentage (0% to 100%)
// Adjust the range (e.g., 0-1023) based on your sensor's calibration
int moisturePercent = map(sensorValue, 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);
}
Inconsistent Readings:
No Output Signal:
Output Always at Maximum or Minimum:
Q: Can this sensor be used outdoors?
A: Yes, the sensor is designed for outdoor use, but ensure the connections are protected from water and weather.
Q: How do I calibrate the sensor?
A: Measure the sensor's output in completely dry soil (0% moisture) and fully saturated soil (100% moisture). Use these values to map the sensor's output range in your code.
Q: Can I use this sensor with a 3.3V microcontroller?
A: Yes, the sensor operates within a voltage range of 3.3V to 5.5V, making it compatible with 3.3V systems like ESP32 or Raspberry Pi.
Q: Is the sensor affected by soil type?
A: Yes, different soil types may affect the sensor's readings. Calibration is recommended for accurate results.