Skip to content
SensorsSoil

Capacitive Soil Moisture Sensor v1.2

Capacitive soil moisture sensor that won't corrode — ideal for long-term plant watering projects.

Wiring & code for

Soil Capacitive practical reference

Unlike resistive probes, this capacitive sensor doesn't corrode over time, making it the preferred choice for long-running automated plant watering builds. The sensor works by measuring the change in capacitance between two exposed copper plates embedded in the probe as soil moisture content changes, entirely without running any current directly through the soil (unlike older resistive probes) — since there's no direct electrical contact current flowing through the wet medium, the sensor doesn't suffer the electrolytic corrosion that eventually kills resistive soil probes.

Key specifications

  • Sensor type: Capacitive soil moisture probe (v1.2), corrosion-resistant compared to resistive-type probes
  • Operating voltage: 3.3V–5.5V DC
  • Operating current: ~5 mA typical
  • Output: Analog voltage, inversely related to moisture — drier soil gives a higher voltage, wetter soil gives a lower voltage (or vice versa, check your specific board's convention)
  • Interface: Single analog output pin, read with analogRead()
  • Durability: No exposed metal contacts in direct current-carrying contact with soil, significantly longer usable lifespan than resistive probes
  • Calibration: Requires per-sensor calibration (a 'dry air' and 'water' reading) since raw analog values vary between individual sensors and soil types

Pinout and connection notes

Take a reading in dry air and a reading fully submerged in water to establish the sensor's practical analog range, then map subsequent readings between those two calibration points to get a 0-100% moisture-ish scale — raw analog values are not standardized across different soil types or even between individual sensor units, so skipping this calibration step will give inconsistent results in different soil.

  • VCC: Power, 3.3–5.5V DC
  • GND: Ground
  • AOUT: Analog output — read with analogRead(), inversely proportional to soil moisture

Integration checklist

  1. Confirm the exact part number and breakout-board revision.
  2. Verify supply voltage, current demand, logic levels, and signal direction against the datasheet.
  3. Check controller pin assignments and bus address or interface mode against the example code.
  4. Power up with external loads disconnected, then test signals before full integration.
  5. If readings or communication fail, check power and ground first, then pin mapping, interface settings, and library initialization.

Troubleshooting and reproducibility

Record the board used, wiring, library/version, supply arrangement, and measured behavior. Use the selected board-specific wiring example as the source of truth. Never assume visually similar modules share identical voltage tolerance or pin order.

Board Integration

Library

None — built-in analogRead by —

No library needed; uses core Arduino functions only.

Wiring

Component pinArduino Uno pinNote
VCC5V3.3-5.5V accepted.
GNDGND
AOUTA0Lower value = wetter soil (opposite of resistive probes).

Swipe sideways to see every column →

C++
  • Capacitive sensors corrode much slower than the cheaper resistive probes, since there is no exposed metal in contact with the soil — worth the small price difference for anything left in the ground.
  • AIR_VALUE and WATER_VALUE vary between individual sensors; run the sensor in dry air and in a glass of water once to get real numbers before trusting the percentage.
View full Arduino Uno guide