Comparison · Beginner · 3 min read
Soil Moisture Sensors
Resistive vs Capacitive, Wiring and Calibration
By Geekobot Learning Team · Updated 24 Oct 2026
On this page
Buy a capacitive soil moisture sensor. Resistive sensors (YL-69, FC-28) pass current through two metal probes that corrode within weeks; capacitive sensors (v1.2 or v2.0) sense moisture through a coated PCB and last for years. Both give an analog voltage: read it with an ADC pin, record the dry and wet values once, and map between them.
Key specs at a glance
- Capacitive v1.2 / v2.0
- 3.3 to 5.5 V, analog out about 1.5 V (wet) to 3 V (dry), about 5 mA
- Resistive YL-69 / FC-28
- 3.3 to 5 V, analog + digital out, probes corrode
- Output
- Analog voltage; read with analogRead()
- Depth
- Insert to the line on the PCB, keep the electronics dry
- Lifetime
- Capacitive: years; resistive: weeks to months
- Calibration
- Record raw values in air and in water, then map
Resistive vs capacitive
| Resistive (YL-69, FC-28) | Capacitive (v1.2, v2.0) | |
|---|---|---|
| How it works | Resistance between two probes | Capacitance of a coated electrode changes with water |
| Corrosion | Fast: electrolysis eats the probes | None, nothing is exposed |
| Accuracy | Drifts as probes corrode | Stable, but affected by soil type |
| Price | Lowest | Slightly more |
| Verdict | Classroom demos only | Any real plant project |
- How it works
- Resistive (YL-69, FC-28):
- Resistance between two probes
- Capacitive (v1.2, v2.0):
- Capacitance of a coated electrode changes with water
- Corrosion
- Resistive (YL-69, FC-28):
- Fast: electrolysis eats the probes
- Capacitive (v1.2, v2.0):
- None, nothing is exposed
- Accuracy
- Resistive (YL-69, FC-28):
- Drifts as probes corrode
- Capacitive (v1.2, v2.0):
- Stable, but affected by soil type
- Price
- Resistive (YL-69, FC-28):
- Lowest
- Capacitive (v1.2, v2.0):
- Slightly more
- Verdict
- Resistive (YL-69, FC-28):
- Classroom demos only
- Capacitive (v1.2, v2.0):
- Any real plant project
Wiring and reading a capacitive sensor
Three wires: VCC (3.3 or 5 V), GND, AOUT to an analog pin. On an ESP32 use an ADC1 pin (GPIO 32 to 39) so readings work while Wi-Fi is on. On a Raspberry Pi you need an external ADC such as the ADS1115.
const int PIN = A0; // ESP32: 34
int dryValue = 620; // measure your own: sensor in air
int wetValue = 260; // sensor in a glass of water
void setup() { Serial.begin(9600); }
void loop() {
int raw = analogRead(PIN);
int pct = map(raw, dryValue, wetValue, 0, 100);
pct = constrain(pct, 0, 100);
Serial.print(raw); Serial.print(" "); Serial.print(pct); Serial.println(" %");
delay(1000);
}Calibrating for your soil
- 1Power the sensor and note the raw value in dry air: that is 0%.
- 2Dip it to the line in a glass of water: that is 100%.
- 3Put those two numbers in the code. Readings in real soil fall between them.
- 4For watering decisions, pick a threshold by checking the plant: many houseplants want watering around 30 to 40% on this scale. Different soils read differently, so calibrate per pot if accuracy matters.
Building an automatic plant waterer
Pair the sensor with a 3 to 6 V mini submersible pump driven by a MOSFET or relay module, and water in short bursts (a few seconds) followed by a wait of several minutes so the moisture has time to spread before the next reading. Read the sensor only when needed and power it from a GPIO pin to extend battery life and sensor lifetime.
Common problems
v1.2 boards use a 555 timer that needs at least 3.3 V on some batches and 5 V on others; try 5 V. Some v1.2 clones have a missing 1 MΩ resistor; v2.0 boards fix this.
mains noise or a long cable; average 10 readings.
water reached the electronics. Seal the top with heat-shrink or nail varnish and never bury past the line.
Try it: ADC resolution calculator
Change the values and the diagram and results update as you type.
Common mistakes to avoid
- Buying resistive probes for a long-term planter.
- Burying the sensor above the line and soaking the electronics.
- Using one calibration for every soil type and pot.
- Powering a pump from the microcontroller's 5 V pin.
- Watering continuously while the reading is low, flooding the plant before the sensor catches up.
Frequently asked questions
Which soil moisture sensor is best for Arduino?
A capacitive sensor (v1.2 or v2.0). It does not corrode and gives a stable analog signal that any Arduino, ESP32 or Pico can read.
Why does my soil moisture sensor always read dry?
Check that it is inserted to the line, powered at 5 V on v1.2 boards, and wired to an analog pin. Record your own dry and wet values instead of using numbers from the internet.
Can I use a soil moisture sensor with a Raspberry Pi?
Only with an external ADC, such as the ADS1115 (I2C) or MCP3008 (SPI), because the Pi has no analog inputs.
How long does a capacitive soil sensor last?
Years if the electronics stay dry. Resistive sensors corrode within weeks of continuous use.
Can I leave the sensor in the soil all the time?
Yes, for capacitive sensors. To extend battery life in a wireless node, power it only when taking a reading.
Parts for this guide
Calculators
Terms in this guide
Projects that use it
Put this into practice: 41 step-by-step builds in our project library use parts from this guide.
Keep learning
Sources
- Capacitive Soil Moisture Sensor v1.2 / v2.0 schematic (DFRobot and community)
- TLC555 datasheet (Texas Instruments)
Written by the Geekobot team from manufacturer datasheets. Always check the datasheet for the exact part and variant you buy.


