Component guide · Beginner · 3 min read
Capacitive Soil Moisture Sensor v1.2

Wiring, Calibration and Code
By Geekobot Learning Team · Updated 29 Oct 2026
On this page
A capacitive soil moisture sensor measures how water changes the capacitance around its probe, without exposing metal to the soil, so it does not corrode like the forked resistive sensors. It gives an analog voltage that falls as the soil gets wetter. Calibrate it by reading the value in air (dry) and in water (wet), then map readings between the two to a percentage.
Key specs at a glance
- Principle
- Capacitive, coated PCB probe
- Supply
- 3.3 to 5.5 V
- Output
- Analog, about 1.2 V (wet) to 2.8 V (dry) at 5 V
- Current
- About 5 mA
- Connector
- 3-pin PH2.0 or Gravity/Grove
- Life
- Years in soil if the top edge electronics stay dry
Models in this guide
These are alternatives. Pick the one that fits your project; you only need one.
Option 1Capacitive Soil Moisture Sensor – 3.3V/5V Analog Output, PH2.54-3P Interface₹54
Option 2DFRobot Gravity Analog Capacitive Soil Moisture Sensor – Corrosion Resistant₹725
Option 3Cytron Technologies Maker Soil Moisture Sensor (Capacitive) – Analog Output, Grove Port₹599
Option 4Elecrow Crowtail-Capacitive Moisture Sensor – PH2.0-4Pin Interface₹184
Option 5Seeed Studio Grove Capacitive Moisture Sensor (Corrosion Resistant) – Analog Output₹719
What the Capacitive soil moisture sensor is
Readings depend on soil type, compaction and how deep the probe sits, so treat the percentage as relative and set your watering threshold by watching a real plant. Insert the probe to the line marked on the board and keep the electronics above the soil.
Some cheap v1.2 boards have a missing or wrong regulator and resistor; if the reading barely changes between air and water, the board is faulty.
Capacitive soil moisture sensor pinout
The pins on the Capacitive soil moisture sensor and what each one does.
| Pin | Function |
|---|---|
| VCC | 3.3 to 5 V |
| GND | Ground |
| AOUT | Analog output |
- VCC
- 3.3 to 5 V
- GND
- Ground
- AOUT
- Analog output
Wiring the Capacitive soil moisture sensor
Use an ADC1 pin (GPIO 32 to 39) on the ESP32 so readings still work with Wi-Fi on. Seal the cut edges of the board with nail polish or epoxy for long outdoor use.
| Capacitive soil moisture sensor pin | Arduino Uno | ESP32 |
|---|---|---|
| VCC | 5V | 3V3 |
| GND | GND | GND |
| AOUT | A0 | GPIO 34 |
- VCC
- Arduino Uno:
- 5V
- ESP32:
- 3V3
- GND
- Arduino Uno:
- GND
- ESP32:
- GND
- AOUT
- Arduino Uno:
- A0
- ESP32:
- GPIO 34
Example code
Replace DRY and WET with your own readings. On an ESP32 the raw numbers are 0 to 4095, so recalibrate.
const int DRY = 590; // reading in air
const int WET = 280; // reading in a glass of water
void setup() { Serial.begin(9600); }
void loop() {
int raw = analogRead(A0);
int pct = map(raw, DRY, WET, 0, 100);
pct = constrain(pct, 0, 100);
Serial.print(raw); Serial.print(" "); Serial.print(pct); Serial.println(" %");
delay(1000);
}Setup and tuning
note the reading in air and in water for each sensor; boards differ.
switch a pump through a relay below a threshold and stop a few percent above it.
power the sensor from a GPIO and read only every few minutes.
keep the same insertion depth every time.
What you need
Shop this list10 of 11 found in our store · ₹3,302
Capacitive Soil Moisture Sensor – 3.3V/5V Analog Output, PH2.54-3P Interface: the part this guide coversCapacitive Soil Moisture Sensor – 3.3V/5V Analog Output, PH2.54-3P Interface₹54
DFRobot Gravity Analog Capacitive Soil Moisture Sensor – Corrosion Resistant: another version this guide coversDFRobot Gravity Analog Capacitive Soil Moisture Sensor – Corrosion Resistant₹725
Cytron Technologies Maker Soil Moisture Sensor (Capacitive) – Analog Output, Grove Port: another version this guide coversCytron Technologies Maker Soil Moisture Sensor (Capacitive) – Analog Output, Grove Port₹599
Elecrow Crowtail-Capacitive Moisture Sensor – PH2.0-4Pin Interface: another version this guide coversElecrow Crowtail-Capacitive Moisture Sensor – PH2.0-4Pin Interface₹184
Seeed Studio Studio Grove Capacitive Moisture Sensor (Corrosion Resistant) – Analog Output: another version this guide coversSeeed Studio Grove Capacitive Moisture Sensor (Corrosion Resistant) – Analog Output₹719Closest match, check the specs- Uno R3 development board: the controller used in the wiring tableFind this part
ESP32-WROOM-32 38-pin development board: for Wi-Fi logging and dashboardsESP32-WROOM-32 38-Pin Development Board₹389
5V relay module with optocoupler: to switch a pump or valve5V Relay Module with Optocoupler₹74
R385 diaphragm water pump 12V: a pump to controlR385 / R365 Diaphragm Water Pump 12V₹220
0.96 inch OLED display 128x64: to show readings without a computer0.96" OLED Display 128x64₹139Closest match, check the specs
ADS1115 16-bit 4-channel ADC module: better analog readings, especially on ESP32ADS1115 16-Bit 4-Channel ADC Module₹199
Alternatives and when to choose them
- Resistive soil moisture sensor: cheaper but corrodes.
- RS485 soil sensors: calibrated probes with temperature, EC and NPK.
- Soil moisture sensors overview: resistive vs capacitive.
Common mistakes to avoid
- Burying the electronics.
- Using one calibration for every sensor.
- Reading on ESP32 ADC2 pins with Wi-Fi on.
- Expecting an absolute soil water content.
Frequently asked questions
Why is a wet reading lower?
The output voltage drops as moisture rises.
Does it corrode?
No exposed metal touches the soil, so it lasts far longer than resistive types.
Can it run on 3.3 V?
Yes, recalibrate at 3.3 V.
How deep should it go?
Up to the marked line, about 5 cm for pots.
Why does the reading drift?
Soil compaction and temperature; recalibrate each season.
Parts for this guide
Keep learning
Sources
Written by the Geekobot team from manufacturer datasheets. Always check the datasheet for the exact part and variant you buy.

