Soil Moisture Sensor

Capacitive soil moisture sensor module illustration

What is a Soil Moisture Sensor?

A soil moisture sensor estimates how much water is available around plant roots by measuring the electrical behavior of soil. It is one of the most useful sensors for smart irrigation, plant monitoring, greenhouse dashboards, and ESP32 IoT projects.

Resistive probes are cheap but corrode over time because current flows through exposed metal. Capacitive probes are usually better for long-term projects because they sense dielectric changes through a protected PCB surface.

Key Features

๐ŸŒฑ

Plant Health Feedback

Tracks dry, moist, and saturated soil states so watering can respond to actual conditions.

๐Ÿ“ˆ

Analog Output

Provides a variable voltage that can be mapped to a calibrated moisture percentage.

๐Ÿ’ง

Smart Irrigation

Pairs naturally with relays, pumps, valves, and IoT dashboards for automated watering.

๐Ÿงช

Calibration Friendly

Dry-air and wet-soil readings can be captured and mapped for your exact soil type.

๐Ÿ”‹

Low Duty Cycle Ready

Power the probe only during measurements to reduce corrosion and save battery.

๐Ÿชด

Beginner Useful

Great first analog sensor because changes are easy to observe in real projects.

Pin Configuration

VCC

Power input. Use 3.3V for ESP32 ADC compatibility or 5V for Arduino Uno modules that expect it.

GND

Ground reference connected to the microcontroller ground.

AO

Analog moisture signal. Connect to an ADC pin and calibrate dry and wet readings in code.

DO

Optional digital threshold output on comparator modules. Adjust trigger level with the onboard potentiometer.

How It Works

๐Ÿงช

The Science Behind It

Resistive soil sensors measure how easily current flows between two exposed electrodes. Wet soil conducts better than dry soil, so the output changes with water content and dissolved minerals.

Capacitive soil sensors form part of an oscillator or RC circuit. Water changes the soil dielectric constant around the probe, which shifts the circuit output without requiring exposed metal electrodes.

Basic Calibration:

Dry reading = ADC value in air or dry soil
Wet reading = ADC value in saturated soil
Moisture % = map(reading, dry, wet, 0, 100)

Always calibrate for your soil and probe. Potting mix, garden soil, fertilizer, and salt content can shift readings.

Wiring Tips & Best Practices

๐Ÿ›ก๏ธ

Prefer Capacitive Probes

Use capacitive sensors for permanent plant projects because exposed resistive probes corrode faster.

โšก

Switch Sensor Power

Power the probe from a GPIO or transistor only while measuring to reduce corrosion and drift.

๐Ÿ“Š

Average Readings

Take 10-20 ADC samples and average them to smooth noise from long wires and soil contact changes.

๐Ÿง‚

Watch Soil Chemistry

Fertilizer and salts affect conductivity, so do not treat raw ADC values as universal moisture values.

๐Ÿ“

Place Near Roots

Insert the probe at root depth and avoid touching the pot wall for more meaningful readings.

๐ŸŒง๏ธ

Waterproof the Electronics

Only the probe area belongs in soil. Keep connectors and comparator boards dry.

Related Resources

Soil Moisture Project

Build an Arduino plant monitor.

Humidity Sensor

Measure air humidity alongside soil moisture.

IoT Roadmap

Turn sensor data into connected dashboards.