The problem
Fixed-timer sprinklers cannot see the soil. They water on schedule even while it is raining, flood beds that are already wet, and let plants dry out during a heat wave when nobody is around to adjust the timer. The water waste is real and visible: puddles forming on a lawn during a drizzle because the timer said it was watering day. Commercial smart controllers solve this but are priced for large farms and are closed black boxes a student cannot open, probe or explain. What is missing is a buildable, affordable controller that closes the loop itself — senses moisture, respects rain, switches the pump, and shows everything on a dashboard the student actually built. This project is that controller: an ESP32 reads capacitive soil-moisture probes, a rain sensor module vetoes watering during rainfall, a relay switches a small DC pump, and a companion web dashboard serves live readings, schedules, thresholds and the watering log. The firmware and dashboard support up to four zones with per-zone thresholds and run times; the as-built kit wires two probes, with expansion notes for the remaining zones.
Capacitive probe reporting raw soil moisture to the ESP32 ADC.
Follow the working sequence
How it works
- The student calibrates each probe: raw ADC readings are recorded in saturated soil and in air-dry soil, and the firmware maps that 12-bit span to 0–100% moisture.
- At every schedule slot the firmware checks the rain sensor first — if rain is detected (debounced over several seconds), the cycle is skipped and logged as a rain-skip.
- With no rain, the firmware compares each zone's moisture against its threshold; only zones below threshold get their relay-driven watering run for the configured duration.
- The relay module switches the 5 V DC submersible pump, which pushes water through tubing to the zone being watered.
- The ESP32 serves the single-file dashboard over Wi-Fi: zone cards show live moisture bars, ADC values, sparkline history, pump state and the rain-skip toggle.
- Manual Run now / Stop from the dashboard overrides the schedule instantly, and every event — scheduled, manual or skipped — lands in the timestamped history log.
Tech stack:
- ESP32 (Wi-Fi MCU, 12-bit ADC)
- Capacitive soil-moisture probes (analog)
- Rain sensor module (LM393 comparator, digital output)
- 5 V relay module (pump switching)
- 3–6 V DC mini submersible pump
- Arduino IDE with ESP32 core (C/C++ firmware)
- Single-file HTML/CSS/JavaScript dashboard
- On-device flash storage (schedules, thresholds, log)
| Parameter | Value |
|---|---|
| Microcontroller | ESP32, dual-core 240 MHz, Wi-Fi (datasheet) |
| Moisture sensing | Capacitive probe, analog; typical raw span ≈ 1200–3000 on 12-bit ADC (soil-dependent, calibration required) |
| Moisture resolution | 12-bit ADC, 0–4095 counts (datasheet) |
| Rain sensing | Digital output, sensitivity via onboard potentiometer (datasheet) |
| Relay contacts | 10 A @ 250 VAC (datasheet, SRD-05VDC class) |
| Pump | 3–6 V DC mini submersible; ≈ 1.8 L/min typical, lift ≈ 0.4–1.0 m (class-typical, not measured) |
| Zones supported | Up to 4 in firmware and dashboard (design); as-built kit wires 2 probes |
| Moisture sampling | Every 10 s (firmware default, design) |
| Schedule resolution | 1 minute (design) |
| Rain-skip window | Configurable, default 6 h after rain stops (firmware design) |
| Dashboard | Single-file web app served by the ESP32 over Wi-Fi (design) |
| Power | 5 V DC adapter, ≈ 2 A (design) |
Project features
- [Moisture-triggered watering] Each zone's capacitive probe is read by the ESP32's 12-bit ADC and mapped to a 0–100% value against a soil-specific calibration; a zone waters only when its moisture falls below its configured threshold. Implemented.
- [Hardware rain-skip] A rain sensor module's digital output feeds a GPIO; the firmware debounces it and skips any scheduled cycle while rain is present, then holds a configurable post-rain skip window (default 6 hours). Implemented.
- [Zone scheduling dashboard] The companion web app shows per-zone cards with live moisture, threshold, schedule and next-run time, plus manual Run now / Stop buttons for each zone. Implemented.
- [Pump and water monitoring] The dashboard reports pump state, the active zone, approximate flow rate and a daily water-use tally derived from logged run times. Implemented.
- [Watering history log] Every cycle and every rain-skip is timestamped in a rolling on-device log and rendered as a table with time, zone, duration, moisture at start and trigger type. Implemented.
- [Standalone operation] Schedules, thresholds and the skip window are stored in flash, so the controller keeps watering correctly even when no phone or laptop is connected. Implemented.
- [Buyer-run calibration procedure] A step-by-step wet/dry calibration turns raw ADC readings into trustworthy percentages on the student's own soil, with the worked example included in the report. Implemented.
- [Weather-forecast pre-skip] Optional future scope: pull a forecast API so the unit skips ahead of predicted rain instead of reacting to drops. Not in this build.
What is included
- Assembled controller prototype: ESP32, 2 capacitive soil-moisture probes, rain sensor module, relay module, mini DC submersible pump with tubing, wiring on breadboard with enclosure guidance
- ESP32 firmware source (Arduino IDE): calibration, rain-skip state machine, 4-zone scheduler, flash persistence
- Companion web dashboard (single HTML file) with zone cards, moisture graphs, pump panel, rain-skip control and history log
- Soil-calibration procedure with worked example for the report
- Wiring diagram and component list with exact part references
- Project report PDF (background, sensing theory, calibration method, control logic, results template)
- PPT presentation for final review
- Viva Q&A preparation document (capacitive sensing, ADC calibration, rain-skip logic, IoT dashboard)
Limitations & prerequisites
- Capacitive probes drift with soil salinity, fertilizer content and temperature; a threshold tuned in garden soil reads wrong in clay or cocopeat, so recalibration is mandatory when the soil changes.
- The rain sensor detects droplets landing on its board — heavy dew or mist can false-trigger a skip, and the default 6 h window then delays watering on an otherwise dry day.
- The mini submersible pump lifts ≈ 0.4–1.0 m at ≈ 1.8 L/min (class-typical): it suits tank/bucket-fed beds and drip lines, not overhead tanks, borewells or long pipe runs.
- The ESP32 ADC is non-linear near 0 and 4095 counts; the design keeps the working band mid-range, and readings at the rails should not be trusted.
- The build reacts to actual rain only — there is no weather-forecast integration (listed as optional future scope).
- The as-built kit wires 2 probes; using all 4 dashboard zones needs 2 more probes and zone valves, supplied as an add-on option.
Frequently Asked Questions
How does the rain-skip actually work?
The rain sensor board has interleaved copper traces; raindrops bridge them and the onboard LM393 comparator flips its digital output. The ESP32 reads that pin, debounces it over several seconds to ignore splashes, and then skips any scheduled watering while rain is present. After the rain stops, a configurable skip window (default 6 hours) blocks re-watering so the soil can absorb what fell.
Why a capacitive sensor instead of the cheaper resistive probe?
Resistive probes pass current through the soil between two exposed electrodes, which corrodes them within weeks and drifts the readings badly. Capacitive probes are coated — nothing exposed corrodes — so they last far longer and read more stably. They still need soil-specific calibration, which this project documents as a buyer-run procedure.
Can one pump really water four zones?
The firmware and dashboard support up to four zones with independent thresholds and schedules. Physically, extra zones need solenoid valves on the water line (one relay channel each) so the single pump feeds one zone at a time. The as-built kit wires two probes; the valve expansion is documented as an add-on.
Does it need internet to work?
No. The ESP32 serves the dashboard on your local Wi-Fi network and keeps watering from flash-stored schedules with no phone or laptop connected. Internet is only needed if you want remote access from outside the house, which is an optional extension, not part of this build.
How accurate is the moisture reading?
Honest answer: it is a calibrated approximation, not a laboratory measurement. Raw ADC values depend on the exact soil, its salinity and temperature, so the project ships a wet/dry calibration procedure that maps the probe's span to 0–100% for your soil. Thresholds are then relative to that calibration, which is exactly how real controllers do it.
Is this project suitable for a final-year project?
Yes — for Electronics, Electrical and IoT programs. It combines analog sensing with a documented calibration procedure, embedded control logic with a real state machine, relay-driven actuation, and a working web dashboard, all on hardware a student can afford, probe and explain in the viva.
Components & software requirements
- ESP32 (Wi-Fi MCU, 12-bit ADC)
- Capacitive soil-moisture probes (analog)
- Rain sensor module (LM393 comparator, digital output)
- 5 V relay module (pump switching)
- 3–6 V DC mini submersible pump
- Arduino IDE with ESP32 core (C/C++ firmware)
- Single-file HTML/CSS/JavaScript dashboard
- On-device flash storage (schedules, thresholds, log)
Delivery information
Built-to-order project. Delivery timeline is shared after order confirmation based on current queue.
Support terms
Complete documentation, setup guide, and viva preparation included. Support for setup and explanation provided.
Download free synopsis (PDF)
Enter your name and email — the synopsis PDF downloads immediately. We may send occasional project updates; no spam, unsubscribe anytime.