part · Level 8 · Environment · input
How a soil moisture sensor works
Soil moisture sensor — Tells you when a plant is thirsty.
What it is
A soil moisture sensor is a probe you push into a plant pot; it reports how wet the soil is as a voltage your microcontroller can read. Water conducts electricity better than dry soil, and it also changes how the soil stores charge — the two common probe types each use one of those facts.
Resistive probes are two bare metal prongs. Current flows between them through the soil; wetter soil means less resistance, so the small board on top turns that into a voltage. They are cheap and they corrode within weeks because the current eats the metal.
Capacitive probes are a flat sealed board with no exposed metal. The soil around the probe changes the capacitance of a track on the board; an oscillator on the probe turns that into a voltage. They last for years and are the ones worth buying.
How it works
Either type outputs an analog voltage between 0 and the supply. A typical capacitive probe on 5 V reads about 3.0 V bone dry in air, 2.5 V in dry soil and 1.3 V in water — note that wetter is lower for these. On an Arduino, analogRead gives 0–1023 for 0–5 V, so those are roughly 615, 510 and 270.
The absolute numbers vary between probes and soils, so calibrate: read it in air and read it in a glass of water, then map the range. A "water me" threshold halfway between dry soil and wet soil is a fine start; the plant's opinion is the real calibration.
A resistive probe is a voltage divider you already know: the soil is one resistor (kilohms wet, megohms dry) and a 10 kΩ on the board is the other. Powering it only during the reading — a few milliseconds every hour, from a digital pin — slows the corrosion enormously.
The numbers
| Output | analog, 0 V to supply — capacitive: lower = wetter |
|---|---|
| Supply | 3.3–5.5 V — ≈ 5 mA for capacitive probes |
| Typical readings (5 V, capacitive) | air ≈ 3.0 V · dry soil ≈ 2.5 V · water ≈ 1.3 V — calibrate your own |
| Resistive probe life | weeks if powered continuously — months if powered only while reading |
| Depth | insert to the line on the board — the electronics must stay dry |
Mistakes everyone makes
- Electronics got wet. The top of the probe is not sealed. Fix: bury only up to the marked line; keep the top above the soil.
- Readings drift week to week. Resistive prongs corroding. Fix: capacitive probe, or power the resistive one only for readings.
- Reads the same in air and water. Wrong supply voltage (some capacitive probes need 5 V for their oscillator), or a dead probe. Fix: check VCC.
- Trusting one threshold for every plant. Soil type changes everything. Fix: calibrate per pot.
Questions people ask
- Capacitive or resistive soil moisture sensor — which should I buy?
- Capacitive. It has no exposed metal, so it does not corrode, and it reads more consistently. Resistive probes are cheaper but rust away within weeks if left powered.
- Why does my soil moisture sensor read lower when the soil is wetter?
- That is normal for capacitive probes: the oscillator output falls as capacitance rises. Map the range in code so that higher means wetter if you prefer.
- How do I calibrate a soil moisture sensor?
- Read it in dry air and in a glass of water to find your two extremes, then map the values between them to 0–100 %. Set the "water me" point by watching the plant for a week.
Projects that use this part
No project uses it yet — it arrives at Level 8, and the projects for that level are still being written and verified.
verified against: SparkFun — Soil Moisture Sensor Hookup Guide · Adafruit — capacitive soil sensor overview