Capacitive soil moisture sensor
v1.2, analog output
You push it into a flower pot and it tells you how wet the soil is. The capacitive version has no exposed metal, so it does not corrode like cheap two-prong sensors.
Open the course →How it works
The board is a capacitor: water has a much higher dielectric constant than dry soil, so the wetter it is, the higher the capacitance. A small circuit (555 timer) turns that into a voltage on AOUT: dry soil = high voltage, wet = low. The ESP32 reads it with analogRead(), and you record the "dry" and "in water" values for calibration.
Pins and wiring
| Pin | What it is | Where it connects / why |
|---|---|---|
| GND | Ground | → GND. |
| VCC | Supply 3.3–5.5 V | → 3V3 (then the output stays below 3 V, safe for the ADC). |
| AOUT | Analog output | → ADC1 pin (e.g. GPIO 32). |
Specifications
Supply3.3 – 5.5 V
Output~1.2 V (in water) to ~2.5 V (in air)
Principlecapacitive, no corrosion
Current~5 mA
Tips and typical mistakes
- Push it in only up to the white line — the electronics at the top must not get wet.
- Every sensor is slightly different: measure "dry" and "in a glass of water" and put them in the code.
- Use an ADC1 pin (32–39) if you want WiFi later.