Same-day dispatch before 2 PM · Free delivery over ₹999 · GST invoices Get the appPrices incl. GST
Geekobot
Snap & SendNEWGeeko AIWhere's myOrder
Log in
Products
  • Projects
    • Component guidesHow parts work, with code you can run
    • Learning pathsFrom your first LED to your first robot
    • Workshops & eventsOnline sessions for makers and classes
    • ElectrolarkFree guided builds, simulator and certificates
    • Students & teachersStudent discount and classroom help
    • CommunityShare builds and ask other makers
    • CalculatorsOhm's law, LED resistor, 555 and 100+ more
    • Circuit builderWire parts and run the circuit, powered by Electrolark
    • Geeko AIAsk what to buy or how to wire it
    • Snap & SendPhotograph a part or list, we find it
    • Part finderAnswer a few questions, get the right part
    • Compatibility checkWill these two parts work together?
    • Compare partsSpecs side by side
    • Business & bulk ordersGST invoices, credit and volume prices
    • Request a quotationSend your list, get a quote
    • Classroom kitsPer-student kits and lab bundles
    • Gift cardsFor students, teams and events
  • Atal Tinkering Lab
BOM to cart
Geekobot

Components, kits and know-how for makers, students, engineers, labs and businesses across India.

Ask Geeko AIOrders, parts and projects, any timeEmail supportReply within 1 working dayGet the Geekobot appAdd it to your home screen, free

Follow us

Shop

  • Boards & SBCs
  • Sensors & Modules
  • IoT & Wireless
  • Drone & FPV
  • 3D Printing
  • Filaments & Resins
  • Motors & Drivers
  • Power & Batteries
  • Semiconductors
  • Passive
  • Displays & LEDs
  • Switches & Relays
  • Wires & Cables
  • Prototyping
  • Tools & Test
  • Robotics
  • STEM Kits
  • Atal Tinkering Lab
  • Mechanical Parts
  • Audio

Orders

  • Track your order
  • Help & support
  • Shipping and delivery
  • Refunds and cancellation
  • Contact us

Learn

  • Projects
  • Geeko AI project assistant
  • Learning paths
  • Guides
  • Calculators
  • Electrolark: free guided builds

Part tools

  • Part finder
  • Compare parts
  • Will it work with my board?

Institutions

  • Classroom kits
  • Atal Tinkering Lab
  • Students & teachers
  • Workshops & Events

Business

  • Business & education
  • Request a quotation
  • BOM bulk upload
  • Quick order by SKU

Company

  • About Geekobot
  • Community
  • Gift cards
  • Terms & conditions
  • Privacy policy
  • Product directory
  • Sitemap

© 2026 Geekobot, a trade name of OLatus Systems Private Limited. All rights reserved.

20, 1st Floor, Neeladri Complex, 10th Cross, Sampige Rd, 2nd Main, Malleshwaram, Bengaluru, Karnataka 560003 · GSTIN 29AACCO0462F1ZM

+91 91810 15607 · connect@geekobot.in · Monday to Saturday, 10 AM to 2 PM IST

UPI · CARDS · NETBANKING · GST INVOICES

ShopProjectsGeeko AIGuides
Compare 0 parts →
Log in

Shop by category

Shop all components
  • Boards & SBCs1,910 products
    • Alternative Single Board Computers
    • Arduino Ecosystem
    • FPGA & Logic Boards
    • Microcontroller & Wireless Boards
    View all
  • Sensors & Modules4,701 products
    • Biomedical & Heart Rate
    • Current, Voltage & Power
    • Force, Weight & Pressure
    • Gas, Weather & Environmental
    View all
  • IoT & Wireless2,314 products
    • RF Modules
    • RFID & NFC
    • Antennas & RF Accessories
    • Cameras & Smart Vision
    View all
  • Drone & FPV3,558 products
    • Flight Control & Navigation
    • FPV Video & Optics
    • Frames & Structural Parts
    • Motors & Propulsion
    View all
  • 3D Printing2,204 products
    • 3D Printers
    • 3D Scanners & Digitizers
    • Laser Engravers & Cutters
    • Material Management & Upgrades
    View all
  • Filaments & Resins1,472 products
    • Filaments
    • Photopolymer Resins
    View all
  • Motors & Drivers463 products
    • BLDC Motor Drivers
    • DC & Geared Motors
    • DC Motor Drivers
    • Linear Actuators & Solenoids
    View all
  • Power & Batteries557 products
    • Battery Holders & Connectors
    • Breadboard Power
    • Chargers & BMS
    • DC-DC Converters
    View all
  • Semiconductors295 products
    • Diodes & Rectifiers
    • Interface & RF Encoder ICs
    • Logic ICs (74xx)
    • Logic ICs (CD4000)
    View all
  • Passive67 products
    • Capacitors
    • Circuit Protection
    • Crystals & Oscillators
    • Inductors
    View all
  • Displays & LEDs572 products
    • 7-Segment & Dot Matrix
    • Addressable LEDs
    • Character LCDs
    • Graphic LCDs
    View all
  • Switches & Relays184 products
    • Keypads & Touch
    • Push Buttons & Tactile
    • Relay Modules
    • Relays
    View all
  • Wires & Cables233 products
    • Board-to-Wire Connectors
    • Crimp & Splice
    • Headers & Dupont
    • Heat Shrink & Sleeving
    View all
  • Prototyping101 products
    • Breadboards
    • Interface Modules
    • PCBs & Perfboards
    View all
  • Tools & Test717 products
    • Bench Power Supplies
    • Hand Tools
    • Measuring Tools
    • Meters & Testers
    View all
  • Robotics180 products
    • Humanoid & Legged Robots
    • Robot Chassis & Platforms
    • Robotic Arms & Grippers
    • Wheels & Casters
    View all
  • STEM Kits268 products
    • Arduino Learning Kits
    • Coding & IoT Kits
    • Early Coding (Ages 3-8)
    • Invention Kits
    View all
  • Atal Tinkering Lab196 products
    • Package 1: Electronics, Robotics, IoT and Sensors
    • Package 2: Rapid Prototyping Tools
    • Package 3: Mechanical, Electrical and Measurement Tools
    • Package 4: Power Supply, Accessories and Safety Equipment
    View all
  • Mechanical Parts212 products
    • Bearings
    • Brackets & Mounts
    • Couplers
    • Fasteners & Standoffs
    View all
  • Audio109 products
    • Amplifier Modules
    • Buzzers & Sirens
    • Speakers
    View all
  1. Home
  2. ›Guides
  3. ›Sensors
  4. ›Capacitive Soil Moisture Sensor v1.2

Component guide · Beginner · 3 min read

Capacitive Soil Moisture Sensor v1.2

Wiring, Calibration and Code

By Geekobot Learning Team · Updated 29 Oct 2026

I'm using
Wiring, code and the Run it panels follow your board.
On this page
Short answerWhat the Capacitive soil moisture sensor isCapacitive soil moisture sensor pinoutWiring the Capacitive soil moisture sensorExample codeSetup and tuningWhat you needAlternatives and when to choose themCommon mistakesFAQsParts and next steps
Short answer

A capacitive soil moisture sensor measures how water changes the capacitance around its probe, without exposing metal to the soil, so it does not corrode like the forked resistive sensors. It gives an analog voltage that falls as the soil gets wetter. Calibrate it by reading the value in air (dry) and in water (wet), then map readings between the two to a percentage.

Key specs at a glance

Principle
Capacitive, coated PCB probe
Supply
3.3 to 5.5 V
Output
Analog, about 1.2 V (wet) to 2.8 V (dry) at 5 V
Current
About 5 mA
Connector
3-pin PH2.0 or Gravity/Grove
Life
Years in soil if the top edge electronics stay dry

Models in this guide

These are alternatives. Pick the one that fits your project; you only need one.

  • Option 1Capacitive Soil Moisture Sensor – 3.3V/5V Analog Output, PH2.54-3P Interface₹54
  • Option 2DFRobot Gravity Analog Capacitive Soil Moisture Sensor – Corrosion Resistant₹725
  • Option 3Cytron Technologies Maker Soil Moisture Sensor (Capacitive) – Analog Output, Grove Port₹599
  • Option 4Elecrow Crowtail-Capacitive Moisture Sensor – PH2.0-4Pin Interface₹184
  • Option 5Seeed Studio Grove Capacitive Moisture Sensor (Corrosion Resistant) – Analog Output₹719
01

What the Capacitive soil moisture sensor is

Readings depend on soil type, compaction and how deep the probe sits, so treat the percentage as relative and set your watering threshold by watching a real plant. Insert the probe to the line marked on the board and keep the electronics above the soil.

Some cheap v1.2 boards have a missing or wrong regulator and resistor; if the reading barely changes between air and water, the board is faulty.

02

Capacitive soil moisture sensor pinout

The pins on the Capacitive soil moisture sensor and what each one does.

PinFunction
VCC3.3 to 5 V
GNDGround
AOUTAnalog output
PinFunction
VCC
3.3 to 5 V
GND
Ground
AOUT
Analog output
03

Wiring the Capacitive soil moisture sensor

Use an ADC1 pin (GPIO 32 to 39) on the ESP32 so readings still work with Wi-Fi on. Seal the cut edges of the board with nail polish or epoxy for long outdoor use.

Capacitive soil moisture sensor pinArduino UnoESP32
VCC5V3V3
GNDGNDGND
AOUTA0GPIO 34
VCC
Arduino Uno:
5V
ESP32:
3V3
GND
Arduino Uno:
GND
ESP32:
GND
AOUT
Arduino Uno:
A0
ESP32:
GPIO 34
04

Example code

Replace DRY and WET with your own readings. On an ESP32 the raw numbers are 0 to 4095, so recalibrate.

Moisture percentage with two-point calibration (Uno) · Arduino C++Verify & upload in Electrolark
const int DRY = 590;   // reading in air
const int WET = 280;   // reading in a glass of water

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

void loop() {
  int raw = analogRead(A0);
  int pct = map(raw, DRY, WET, 0, 100);
  pct = constrain(pct, 0, 100);
  Serial.print(raw); Serial.print("  "); Serial.print(pct); Serial.println(" %");
  delay(1000);
}
05

Setup and tuning

Calibrate

note the reading in air and in water for each sensor; boards differ.

Watering

switch a pump through a relay below a threshold and stop a few percent above it.

Power saving

power the sensor from a GPIO and read only every few minutes.

Depth

keep the same insertion depth every time.

06

What you need

Shop this list10 of 11 found in our store · ₹3,302

  • Capacitive Soil Moisture Sensor – 3.3V/5V Analog Output, PH2.54-3P Interface: the part this guide coversCapacitive Soil Moisture Sensor – 3.3V/5V Analog Output, PH2.54-3P Interface₹54
  • DFRobot Gravity Analog Capacitive Soil Moisture Sensor – Corrosion Resistant: another version this guide coversDFRobot Gravity Analog Capacitive Soil Moisture Sensor – Corrosion Resistant₹725
  • Cytron Technologies Maker Soil Moisture Sensor (Capacitive) – Analog Output, Grove Port: another version this guide coversCytron Technologies Maker Soil Moisture Sensor (Capacitive) – Analog Output, Grove Port₹599
  • Elecrow Crowtail-Capacitive Moisture Sensor – PH2.0-4Pin Interface: another version this guide coversElecrow Crowtail-Capacitive Moisture Sensor – PH2.0-4Pin Interface₹184
  • Seeed Studio Studio Grove Capacitive Moisture Sensor (Corrosion Resistant) – Analog Output: another version this guide coversSeeed Studio Grove Capacitive Moisture Sensor (Corrosion Resistant) – Analog Output₹719Closest match, check the specs
  • 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
  • 0.96 inch OLED display 128x64: to show readings without a computer0.96" OLED Display 128x64₹139Closest match, check the specs
  • ADS1115 16-bit 4-channel ADC module: better analog readings, especially on ESP32ADS1115 16-Bit 4-Channel ADC Module₹199
07

Alternatives and when to choose them

  • ✓Resistive soil moisture sensor: cheaper but corrodes.
  • ✓RS485 soil sensors: calibrated probes with temperature, EC and NPK.
  • ✓Soil moisture sensors overview: resistive vs capacitive.
08

Common mistakes to avoid

  • !Burying the electronics.
  • !Using one calibration for every sensor.
  • !Reading on ESP32 ADC2 pins with Wi-Fi on.
  • !Expecting an absolute soil water content.
09

Frequently asked questions

Why is a wet reading lower?

The output voltage drops as moisture rises.

Does it corrode?

No exposed metal touches the soil, so it lasts far longer than resistive types.

Can it run on 3.3 V?

Yes, recalibrate at 3.3 V.

How deep should it go?

Up to the marked line, about 5 cm for pots.

Why does the reading drift?

Soil compaction and temperature; recalibrate each season.

Parts for this guide

  • Capacitive Soil Moisture Sensor – 3.3V/5V Analog Output, PH2.54-3P Interface
    ₹54View
  • DFRobot Gravity Analog Capacitive Soil Moisture Sensor – Corrosion Resistant
    ₹725View
  • Cytron Technologies Maker Soil Moisture Sensor (Capacitive) – Analog Output, Grove Port
    ₹599View
  • Elecrow Crowtail-Capacitive Moisture Sensor – PH2.0-4Pin Interface
    ₹184View
  • Seeed Studio Grove Capacitive Moisture Sensor (Corrosion Resistant) – Analog Output
    ₹719View
  • Uno R3 Development Board (No Cable)
    ₹359View
  • ESP32-WROOM-32 38-Pin Development Board
    ₹389View
  • 5V Relay Module with Optocoupler
    ₹74View
  • R385 / R365 Diaphragm Water Pump 12V
    ₹220View
  • 0.96" OLED Display 128x64
    ₹139View
  • ADS1115 16-Bit 4-Channel ADC Module
    ₹199View
Shop Soil Moisture, pH & Agriculture Sensors

Keep learning

ComparisonBeginnerSoil Moisture SensorsResistive (YL-69) vs capacitive v1.2/v2.0 soil moisture sensors: why resistive probes corrode, Arduino and ESP32 wiring, dry and wet calibration, auto watering.3 min read · SensorsComponent guideBeginnerResistive Soil Moisture Sensor (FC-28 Style)A resistive soil moisture sensor passes a small current between two metal prongs: wet soil conducts better, so the reading changes.4 min read · SensorsHow-toBeginnerMini Water Pumps for Arduino ProjectsA mini submersible pump is a small DC motor that pushes water when it sits underwater.3 min read · Motors & MotionComponent guideIntermediateADS1115 16-Bit ADC ModuleThe ADS1115 adds four precise 16-bit analog inputs to any board over I2C.3 min read · Sensors

Sources

  • DFRobot capacitive soil moisture sensor wiki
  • Seeed Grove capacitive moisture sensor wiki

Written by the Geekobot team from manufacturer datasheets. Always check the datasheet for the exact part and variant you buy.

On this page
Short answerWhat the Capacitive soil moisture sensor isCapacitive soil moisture sensor pinoutWiring the Capacitive soil moisture sensorExample codeSetup and tuningWhat you needAlternatives and when to choose themCommon mistakesFAQsParts and next steps
Need a hand?Ask Geeko AI which part fits your project, or talk to the Geekobot team.Ask Geeko AIHelp & support

Parts for this guide (Arduino Uno)8 items · ₹2,259

Capacitive Soil Moisture Sensor – 3.3V/5V Analog Output, PH2.54-3P Interface · DFRobot Gravity Analog Capacitive Soil Moisture Sensor – Corrosion Resistant · Cytron Technologies Maker Soil Moisture Sensor (Capacitive) – Analog Output, Grove Port · Elecrow Crowtail-Capacitive Moisture Sensor – PH2.0-4Pin Interface · 5V Relay Module with Optocoupler · R385 / R365 Diaphragm Water Pump 12V · ADS1115 16-Bit 4-Channel ADC Module · Uno R3 CH340G ATmega328p Compatible Development Board

Run itChange the inputs and watch the output

Calibrated with 590 in dry air and 280 in a glass of water. Wetter soil lowers the reading.

Moisture51 %
Serial monitor9600 baud
430  51 %

A simulation of the sketch above, so you know what to expect. Real readings vary with your parts and wiring.

Ask the Community

Ask a question