Component guide · Beginner · 4 min read
Resistive Soil Moisture Sensor (FC-28 Style)

Analog, Digital and Relay Versions
By Geekobot Learning Team · Updated 29 Oct 2026
On this page
A resistive soil moisture sensor passes a small current between two metal prongs: wet soil conducts better, so the reading changes. Most come with an LM393 comparator board that gives an analog output plus a digital output whose threshold you set with a trimmer. They are cheap and easy for school projects, but the prongs corrode if powered all the time.
Key specs at a glance
- Principle
- Resistance between two exposed electrodes
- Supply
- 3.3 to 5 V
- Outputs
- AO (analog) and DO (digital, adjustable threshold)
- Comparator
- LM393 with sensitivity trimmer
- Relay versions
- 12 V controller boards with a relay output for pumps
- Life
- Weeks to months if powered continuously; longer if switched
Models in this guide
These are alternatives. Pick the one that fits your project; you only need one.
Option 1Soil Moisture Sensor Hygrometer Module – Analog/Digital Output₹33
Option 2Soil Moisture Sensor Module with 1.3M Cable – Analog/Digital Output₹299
Option 3Soil Moisture Sensor Module – Corrosion-Resistant Probe, Analog/Digital Output₹449
Option 4DFRobot Gravity Analog Soil Moisture Sensor – 3.3V/5V Compatible₹329
Option 5Elecrow Crowtail Moisture Sensor 2.0 – Analog Soil Moisture Sensor Module₹104
Option 6Seeed Studio Grove Moisture Sensor v1.4 – Soil Resistivity Measurement Module₹419
What the Resistive soil moisture sensor module is
Resistive soil moisture sensors (such as the YL-69 and FC-28) measure soil wetness by passing current between two probes, giving an analog value and a digital threshold output.
DC current through the prongs causes electrolysis, which eats the plating and changes readings. Power the probe from a GPIO and switch it on only for a reading every few minutes; that alone extends its life a lot.
The 12 V hygrometer with relay and the XH-M214 controller work without a microcontroller: set the threshold and they switch a pump directly.
Resistive soil moisture sensor module pinout
The pins on the Resistive soil moisture sensor module and what each one does.
| Pin | Function |
|---|---|
| VCC | 3.3 to 5 V |
| GND | Ground |
| AO | Analog output (higher = drier on most boards) |
| DO | Digital output, low when wet past the threshold |
- VCC
- 3.3 to 5 V
- GND
- Ground
- AO
- Analog output (higher = drier on most boards)
- DO
- Digital output, low when wet past the threshold
Wiring the Resistive soil moisture sensor module
Powering the sensor from a digital pin lets you switch it off between readings. A GPIO can supply the few milliamps the board needs.
| Resistive soil moisture sensor module pin | Arduino Uno | ESP32 |
|---|---|---|
| VCC | D7 (switched power) | GPIO 25 (switched power) |
| GND | GND | GND |
| AO | A0 | GPIO 34 |
| DO | D2 (optional) | GPIO 27 (optional) |
- VCC
- Arduino Uno:
- D7 (switched power)
- ESP32:
- GPIO 25 (switched power)
- GND
- Arduino Uno:
- GND
- ESP32:
- GND
- AO
- Arduino Uno:
- A0
- ESP32:
- GPIO 34
- DO
- Arduino Uno:
- D2 (optional)
- ESP32:
- GPIO 27 (optional)
Example code
Calibrate dry and wet values for your soil as with any moisture sensor. Use DO with the trimmer for simple on/off control.
const int PWR = 7;
void setup() { Serial.begin(9600); pinMode(PWR, OUTPUT); }
void loop() {
digitalWrite(PWR, HIGH);
delay(100); // let the reading settle
int raw = analogRead(A0);
digitalWrite(PWR, LOW);
Serial.println(raw); // higher = drier
delay(60000); // once a minute
}Setup and tuning
VCC, GND, AO to an analog pin and DO to a digital pin.
power the sensor from a GPIO only when reading to slow probe corrosion.
record dry and wet readings and map between them.
set DO with the trimmer for a simple watering alarm.
capacitive sensors last much longer in soil.
What you need
Shop this list15 of 16 found in our store · ₹5,683
Generic Soil Moisture Sensor Hygrometer Module – Analog/Digital Output: the part this guide coversSoil Moisture Sensor Hygrometer Module – Analog/Digital Output₹33
Generic Soil Moisture Sensor Module with 1.3M Cable – Analog/Digital Output: another version this guide coversSoil Moisture Sensor Module with 1.3M Cable – Analog/Digital Output₹299
Generic Soil Moisture Sensor Module – Corrosion-Resistant Probe, Analog/Digital Output: another version this guide coversSoil Moisture Sensor Module – Corrosion-Resistant Probe, Analog/Digital Output₹449
DFRobot Gravity Analog Soil Moisture Sensor – 3.3V/5V Compatible: another version this guide coversDFRobot Gravity Analog Soil Moisture Sensor – 3.3V/5V Compatible₹329
Elecrow Crowtail Moisture Sensor 2.0 – Analog Soil Moisture Sensor Module: another version this guide coversElecrow Crowtail Moisture Sensor 2.0 – Analog Soil Moisture Sensor Module₹104
Seeed Studio Studio Grove Moisture Sensor v1.4 – Soil Resistivity Measurement Module: another version this guide coversSeeed Studio Grove Moisture Sensor v1.4 – Soil Resistivity Measurement Module₹419Closest match, check the specs
Waveshare Moisture Sensor – Analog Output Module: another version this guide coversWaveshare Moisture Sensor – Analog Output Module₹349
M5 Stack Earth Moisture Sensor Unit with Analog and Digital Output – Grove Interface: another version this guide coversM5 Stack Earth Moisture Sensor Unit with Analog and Digital Output – Grove Interface₹489
SparkFun Qwiic Soil Moisture Sensor – Resistivity-Based Probe: another version this guide coversSparkFun Qwiic Soil Moisture Sensor – Resistivity-Based Probe₹1,799
Generic 12V Soil Hygrometer Humidity Detection Module with Relay – Automatic Watering Device: another version this guide covers12V Soil Hygrometer Humidity Detection Module with Relay – Automatic Watering Device₹135
XH-M214 Humidity Controller Soil Sensor Module 20-99%RH Precise Automatic Control Irrigation System Red Digital Display: another version this guide coversXH-M214 Humidity Controller Soil Sensor Module 20-99%RH Precise Automatic Control Irrigation System Red Digital Display₹416- 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
16x2 LCD with I2C: to show readings on a character display16×2 LCD with I2C (RG1602A)₹179Closest match, check the specs
Alternatives and when to choose them
- Capacitive soil moisture sensor: no corrosion, better for long term.
- Soil moisture sensors overview: which type to use.
- RS485 soil sensors: professional probes.
Common mistakes to avoid
- Powering the probe all the time.
- Skipping calibration.
- Using 5 V into a 3.3 V ADC.
- Expecting long life outdoors.
Frequently asked questions
Why does my soil sensor stop working after weeks?
The probes corrode from electrolysis; power it only during reads or use a capacitive sensor.
How do I calibrate it?
Record values in dry and wet soil, then map them to 0 to 100 %.
Why are readings higher with fertiliser?
Fertiliser salts raise soil conductivity, so the sensor reads wetter than it is.
Can I use it with ESP32?
Yes. Power it from 3.3 V so the analog output stays safe for the ESP32.
Is capacitive better?
Yes. Capacitive sensors do not pass current through soil, so they do not corrode.
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.

