Overview

The Capacitive Soil Moisture Sensor (v1.2 / v2.0) is an analog soil moisture probe designed to overcome the rapid electrode oxidation and electrolysis corrosion that plague traditional resistive soil sensors (like the YL-69 / FC-28).

Instead of passing direct electric current through the soil, the module forms a coplanar capacitive element using insulated copper traces embedded within the fiberglass PCB probe. An onboard 555 timer IC (typically the low-power CMOS TL555I or NE555) generates a high-frequency square wave (~1.5 MHz). As soil moisture increases, the dielectric constant (ϵr\epsilon_r) of the surrounding soil rises significantly (water 80\approx 80 vs dry soil 35\approx 3-5), changing the capacitance and producing an analog output voltage that decreases inversely with moisture levels.

Quick reference

Operating voltage (VCC)3.3 V to 5.5 V DC
Output signalAnalog DC voltage (1.2 V1.2\text{ V} wet to 3.0 V3.0\text{ V} dry at 3.3V supply)
Operating current~5 mA
Sensing principleHigh-frequency capacitive dielectric measurement
Probe dimensions98 mm × 23 mm (insertion depth ~70 mm)
Connector3-pin PH2.0 or 0.1" (2.54 mm) header

Terminals

PinNameTypeDescription
1GNDPowerGround (0 V)
2VCCPowerSupply voltage (+3.3 V to +5.5 V DC)
3AOUTAnalog OutputAnalog voltage proportional to inverse moisture content

Electrical specifications

ParameterSymbolMinTypMaxUnitConditions
Supply VoltageVCCV_{CC}3.35.05.5VDC supply
Operating CurrentICCI_{CC}3.05.08.0mAVCC=5.0 VV_{CC} = 5.0\text{ V}
Output Voltage (Air / Dry Soil)VdryV_{dry}2.83.04.2VAir reference (VCC=5.0VV_{CC}=5.0\text{V})
Output Voltage (Saturated Water)VwetV_{wet}1.01.21.5VFully submerged in water
Oscillator Frequencyfoscf_{osc}1.01.52.0MHzOnboard 555 timer circuit
Operating TemperatureToprT_{opr}-1050°CNon-condensing

Operating principle & calibration

  1. Inverse Voltage Relationship: Unlike resistive sensors, higher moisture results in LOWER output voltage. In air (0% moisture), the output is highest (3.0 V\approx 3.0\text{ V} at 3.3V supply); in pure water (100% saturation), the output is lowest (1.2 V\approx 1.2\text{ V}).
  2. Two-Point Calibration: Calibration requires recording two ADC values for each individual sensor:
    • ADCairADC_{air}: Sensor held in free air (0% moisture baseline).
    • ADCwaterADC_{water}: Sensor submerged up to the white line in a cup of water (100% moisture baseline).

Moisture %=ADCairADCrawADCairADCwater×100%\text{Moisture \%} = \frac{ADC_{air} - ADC_{raw}}{ADC_{air} - ADC_{water}} \times 100\%

Wiring

Sensor PinArduino (5V Logic)ESP32 (3.3V ADC)Notes
VCC5V (or 3.3V)3.3VMatch supply to MCU ADC reference voltage
GNDGNDGNDSystem ground
AOUTAnalog Pin A0VP / GPIO36 (ADC1)Analog input pin
Warning

Waterproofing notice:

  • Only insert the sensor into soil up to the white warning line marked on the PCB probe.
  • The top electronics portion (containing the 555 timer IC, resistors, and header connector) is not waterproof. Exposing top components to rain or irrigation water will short the circuit. Apply heat-shrink tubing or conformal coating / hot glue over the top PCB edge for outdoor deployment.

Example

cpp
const int sensorPin = A0;

// Replace these values with your 2-point calibration readings
const int AirValue = 620;   // ADC reading in dry air (3.3V reference)
const int WaterValue = 310; // ADC reading in water cup

void setup() {
  Serial.begin(9600);
}

void loop() {
  int rawADC = analogRead(sensorPin);
  
  // Constrain ADC reading within calibrated bounds
  int constrainedADC = constrain(rawADC, WaterValue, AirValue);
  
  // Map inverse voltage to 0-100% moisture percentage
  int moisturePercent = map(constrainedADC, AirValue, WaterValue, 0, 100);

  Serial.print("Raw ADC: ");
  Serial.print(rawADC);
  Serial.print(" | Moisture: ");
  Serial.print(moisturePercent);
  Serial.println("%");

  delay(2000);
}

Common mistakes

  • Assuming 0 V is dry and 5 V is wet: Reversing the polarity interpretation leads to inverted readings (reporting 100% moisture in dry soil).
  • Powering from 5 V when reading with a 3.3 V ADC (ESP32 / STM32): Supplying 5 V to VCCV_{CC} causes the VdryV_{dry} output to reach up to ~4.2 V, exceeding the 3.3 V maximum input limit of ESP32 GPIO pins. Always power from 3.3 V when using 3.3 V microcontrollers.
  • Submerging the top electronics: Water contacting the 555 timer IC and surface-mount components alters the oscillator frequency or causes corrosion.
  • Clone resistor errors: Some cheap v1.2 clones ship with an incorrect voltage regulator or missing zero-ohm resistor on the output buffer line. If output voltage stays constant regardless of moisture, inspect the R4/R5 surface-mount components near the connector.

Notes

  • v1.2 vs v2.0: Version 2.0 adds a reverse polarity diode protection and a 3.3V voltage regulator (such as XC6206) to ensure consistent readings even when supply voltage fluctuates between 3.3 V and 5 V.

Assets & downloads