Skip to content
AkerminMeasure. Monitor. Improve. Compare Products
Learning Center

Capacitive Soil Moisture Sensor Not Working: Causes and Fixes

You wired up a capacitive soil moisture sensor and the value never changes, sits at the maximum, or wanders for no reason. A multimeter, a glass of water and a few minutes will show whether the board, the wiring or the code is at fault.

When a capacitive soil moisture sensor gives a flat, stuck or nonsensical reading, check the analog output with a multimeter before you touch the code: in dry air it should sit noticeably higher than when the probe is dipped in water, because the output voltage falls as moisture rises. If it does not change, the board is faulty or underpowered; on some clone boards the timer chip does not run reliably at 3.3 V, and some boards have a manufacturing defect in which a resistor is not connected to ground. If the voltage changes but your code does not, the problem is the analog pin, the reference voltage or missing dry and wet calibration values.

How these sensors measure moisture

A capacitive soil moisture sensor is a printed circuit board with a copper pattern buried under the solder mask. It does not pass current through the soil the way a cheap two-prong resistive probe does. Instead, the pattern acts as one plate of a capacitor, and the soil around it acts as part of the dielectric. Water has a much higher dielectric constant than dry soil or air, so wet soil raises the capacitance.

On the common blue or black modules, a small timer chip generates a square wave that drives the sensing pattern through a resistor. The board then rectifies and smooths the result into a DC voltage on its analog output pin. More capacitance means more of the signal is absorbed, so the output voltage falls as moisture rises. Dry air gives the highest voltage and water gives the lowest. That inverse relationship catches many people out: the sensor is working, but their code treats a high number as wet.

Because the copper is insulated, these sensors do not corrode the way resistive probes do, as long as the coating and the board edges stay sealed.

The usual culprits

Cause How to spot it Fix
Supply voltage too low for the timer chip Works at 5 V, flat or erratic at 3.3 V Power at 5 V and scale the output, or use a board with a low-voltage timer chip
Board defect, resistor not tied to ground Output responds very slowly or stays high after drying Inspect the board; rework the connection or replace the module
Wrong pin on the microcontroller Multimeter shows changes, code does not Move to a true analog input; on ESP32 avoid ADC2 pins when Wi-Fi is on
Wiring order mixed up Reading stuck at zero or maximum Check the board label for VCC, GND and AOUT
No calibration Readings vary but the percentage is meaningless Record dry and wet values and map between them
Probe not inserted to the line Readings change with how far it is pushed in Insert to the marked depth, firm soil around it
Water in the electronics Readings drift after watering, especially on exposed boards Seal the top components and edges with conformal coating or heat shrink
Long or shared cable Noisy readings, values jump Shorten the cable, add a small capacitor and average many samples

Bench test with a multimeter

This isolates the sensor from your code and your soil. You need a digital multimeter, the power supply you intend to use and a glass of tap water.

  1. Power the sensor on its own: VCC and GND only, nothing on the output yet. Use the voltage you plan to use in the project.
  2. Set the multimeter to DC volts and measure from AOUT to GND with the sensor held in dry air. Write the number down.
  3. Dip the sensor into the water up to the line marked on the board, keeping the electronics at the top dry. Watch the reading settle and write it down.
  4. Lift it out, wipe it dry, and check the voltage climbs back to the dry value within a few seconds.
  5. Repeat at the other supply voltage if you can, 3.3 V and 5 V, to see if behaviour changes.
What you see Diagnosis
Clear drop in water, recovery in air Sensor is healthy; problem is in wiring, pin choice or code
Good at 5 V, little or no change at 3.3 V Timer chip not suited to 3.3 V; power at 5 V or swap the board
Drops in water but recovers very slowly Likely the floating-resistor defect
No change at all Dead board, damaged chip, or a broken trace
Output equal to supply voltage Output shorted to VCC or regulator problem

Exact voltages vary between boards and supply voltages, so focus on the direction and size of the change rather than a specific number.

Calibrating so the numbers mean something

Once the sensor responds, turn raw readings into a usable scale. Read the ADC value with the probe in dry air and call that 0 percent. Read it with the probe in water and call that 100 percent. Then map each new reading linearly between those two. For example, if dry reads 2,900 counts and water reads 1,300 counts, a reading of 2,100 counts is halfway: (2,900 minus 2,100) divided by (2,900 minus 1,300) equals 0.5, or 50 on your scale.

That percentage is relative, not volumetric water content. Soil type changes the response: sandy soil, clay and potting mix with lots of organic matter give different readings at the same actual moisture. For better results, calibrate in your own soil, first dried out and then thoroughly watered and drained. The same idea applies to building moisture meters, where readings vary by material for the same physical reason.

Average several readings, ten or more spaced a few milliseconds apart, and if you run on batteries, power the sensor only when sampling, through a transistor or a spare GPIO pin within its current rating.

Installation habits that keep it working

  • Push the probe in vertically to the marked line so the sensing area is fully surrounded by soil. Air gaps against the board read as dry.
  • Firm the soil gently around it after inserting. A loose fit after watering shifts the reading.
  • Keep the electronics and the cut edges dry. Many boards have bare edges where moisture can creep into the fibreglass and change readings over time. Sealing the edges and the component area extends life considerably.
  • Do not let the probe sit directly beside a drip emitter, or it will see a wetter spot than the root zone.
  • Use the same supply voltage for calibration and use, because the output scale depends on it.

For checking wood, drywall or plaster rather than soil, a dedicated meter is a better tool; the comparison of pin and pinless moisture meters explains how those work in building materials.

When to replace the board

Replace the module if the bench test shows no response in water at any supply voltage, if the output stays pinned at the supply voltage, if the coating is cracked or peeling, or if readings keep drifting after the board edges have absorbed water. These boards are simple and inexpensive, and a clone with a defective resistor or an unsuitable timer chip is not worth hours of debugging. When you buy a replacement, check product photos or the listing for the timer chip type and confirm it is meant for the voltage your microcontroller uses.

Start with the glass of water

Disconnect the sensor from your project, power it at the voltage you plan to use, and measure the analog output in dry air and then in water with a multimeter. If the voltage drops clearly, fix the pin, wiring and calibration in your code; if it barely moves, try 5 V or replace the module rather than debugging software that is working correctly.

Frequently Asked Questions

Why does my reading go down when the soil gets wetter?

These sensors output a lower voltage when capacitance rises, and wet soil raises capacitance. Map dry air to 0 and water to 100 in your code to get a scale that increases with moisture.

Can I run a capacitive soil sensor at 3.3 V?

Some boards work at 3.3 V and some do not, depending on the timer chip and regulator fitted. Test the output in air and water at 3.3 V before committing to it.

Why does my ESP32 always read zero from the sensor?

ADC2 pins on the ESP32 cannot be read reliably while Wi-Fi is active. Move the sensor output to an ADC1 pin.

How accurate are these sensors?

They are good at showing whether soil is drying or wetting and at triggering watering. Without calibration in your own soil, the percentage they give is relative rather than an exact water content.

Should I leave the sensor powered all the time?

Powering it only when you take a reading saves battery and can reduce long-term effects on the board. Allow a short settling time after switching it on before sampling.