Soil Capacitive practical reference
Unlike resistive probes, this capacitive sensor doesn't corrode over time, making it the preferred choice for long-running automated plant watering builds. The sensor works by measuring the change in capacitance between two exposed copper plates embedded in the probe as soil moisture content changes, entirely without running any current directly through the soil (unlike older resistive probes) — since there's no direct electrical contact current flowing through the wet medium, the sensor doesn't suffer the electrolytic corrosion that eventually kills resistive soil probes.
Key specifications
- Sensor type: Capacitive soil moisture probe (v1.2), corrosion-resistant compared to resistive-type probes
- Operating voltage: 3.3V–5.5V DC
- Operating current: ~5 mA typical
- Output: Analog voltage, inversely related to moisture — drier soil gives a higher voltage, wetter soil gives a lower voltage (or vice versa, check your specific board's convention)
- Interface: Single analog output pin, read with analogRead()
- Durability: No exposed metal contacts in direct current-carrying contact with soil, significantly longer usable lifespan than resistive probes
- Calibration: Requires per-sensor calibration (a 'dry air' and 'water' reading) since raw analog values vary between individual sensors and soil types
Pinout and connection notes
Take a reading in dry air and a reading fully submerged in water to establish the sensor's practical analog range, then map subsequent readings between those two calibration points to get a 0-100% moisture-ish scale — raw analog values are not standardized across different soil types or even between individual sensor units, so skipping this calibration step will give inconsistent results in different soil.
- VCC: Power, 3.3–5.5V DC
- GND: Ground
- AOUT: Analog output — read with analogRead(), inversely proportional to soil moisture
Integration checklist
- Confirm the exact part number and breakout-board revision.
- Verify supply voltage, current demand, logic levels, and signal direction against the datasheet.
- Check controller pin assignments and bus address or interface mode against the example code.
- Power up with external loads disconnected, then test signals before full integration.
- If readings or communication fail, check power and ground first, then pin mapping, interface settings, and library initialization.
Troubleshooting and reproducibility
Record the board used, wiring, library/version, supply arrangement, and measured behavior. Use the selected board-specific wiring example as the source of truth. Never assume visually similar modules share identical voltage tolerance or pin order.
Water automatically: switch a 12 V pump with a 5V relay module when the soil reading crosses your dry threshold.
Specifications
- Sensor type
- Capacitive soil-moisture probe; commonly sold as v1.2, with many clone layouts
- Output
- Analog voltage from onboard oscillator/sensing circuit; direction and range must be calibrated on the actual probe
- Supply
- Common boards are used at 3.3 V or 5 V, but output voltage must remain within the controller ADC rating
- Measurement
- Relative moisture indication, not a universal volumetric water-content measurement
- Calibration
- Calibrate in the actual soil and substrate using repeatable dry and wet reference conditions
- Installation
- Insert only the sensing area; keep the component end and connector dry
- Limitations
- Soil type, salinity, fertilizer, compaction, temperature, probe coating and supply voltage affect readings
Pinout
| Pin | Name | Description |
|---|---|---|
| VCC | Supply | Power input for the probe; use a voltage supported by the exact board. |
| GND | Ground | Common ground with the microcontroller. |
| AOUT / AO | Analog output | Connect to an ADC input. Measure the maximum output first, especially when using a 3.3 V ESP32 ADC. |
Wiring & code
Setting up Soil Capacitive with Arduino Uno
Library
None — built-in analogRead by —
No library needed; uses core Arduino functions only.
Wiring
| Component pin | Arduino Uno pin | Note |
|---|---|---|
| VCC | 5V | 3.3-5.5V accepted. |
| GND | GND | |
| AOUT | A0 | Lower value = wetter soil (opposite of resistive probes). |
#include <Arduino.h>
#define SOIL_PIN A0
// Calibrate these two for your specific sensor/soil
const int AIR_VALUE = 800; // reading in dry air
const int WATER_VALUE = 350; // reading fully submerged in water
void setup() {
Serial.begin(9600);
}
void loop() {
int raw = analogRead(SOIL_PIN);
int moisturePercent = map(raw, AIR_VALUE, WATER_VALUE, 0, 100);
moisturePercent = constrain(moisturePercent, 0, 100);
Serial.print(F("Raw: ")); Serial.print(raw);
Serial.print(F(" Moisture: ")); Serial.print(moisturePercent);
Serial.println(F("%"));
delay(1000);
}- Capacitive sensors corrode much slower than the cheaper resistive probes, since there is no exposed metal in contact with the soil — worth the small price difference for anything left in the ground.
- AIR_VALUE and WATER_VALUE vary between individual sensors; run the sensor in dry air and in a glass of water once to get real numbers before trusting the percentage.








