Automated Soil Moisture Monitoring and Irrigation System
Prototype plant watering and soil moisture monitoring system with local sensing and automatic watering control.
Intermediate Project
— This is more than a simple sensor demo because it combines analog moisture sensing, environmental sensing, pump switching, power integrity, and possibly WiFi telemetry, all of which need careful integration and calibration.
Assumptions:
- The prototype will monitor one or a few potted plants, not a large irrigation zone.
- The user wants a simple first build using the existing ESP32 or Arduino Uno rather than a custom PCB.
- Automatic watering is implied by the project name, so an actuator block is included for a pump or valve.
- Soil moisture sensing will use capacitive probes rather than resistive probes for better corrosion resistance.
- The system may optionally report readings over WiFi if the ESP32 is used.
Bill of Materials
Compatibility Notes
- The ESP32 family is 3.3 V logic, so the SEN0193, SEN-13322, and HDC1080DMBR should be powered and read with 3.3 V-compatible wiring or through appropriate scaling if a module outputs higher voltage.
- If you use the Arduino Uno instead of the ESP32, the analog soil sensor is still easy to read, but the HDC1080DMBR I2C lines need 5 V-safe interfacing or pullups to 3.3 V depending on the breakout.
- The recommended actuator MOSFET choice assumes a DC pump or solenoid with a separate supply and a flyback diode; do not drive the load directly from the MCU pin.
- The ESP32-DEVKITC-32E is appropriate for a higher-voltage input source, but the ESP32 and sensors still need a clean 3.3 V rail or a board with onboard regulation.
- If WiFi telemetry is used, keep the pump power wiring physically separated from the sensor wiring to reduce ADC noise and false moisture readings.
You'll Also Need
- A water pump or solenoid valve is not included in the database list and must be selected separately if you want automatic watering.
- You will need a flyback diode, gate resistor, pull-down resistor, and possibly a transistor or MOSFET driver depending on the actuator current.
- You will need tubing, a water reservoir, connectors, and a waterproof enclosure or at least splash protection.
- Calibration materials and firmware constants are needed because capacitive soil sensors vary significantly by soil type and pot geometry.
- If you want battery operation, you may also need a battery charger and protection circuit, which are not covered here.
Estimated BOM Cost: $20-40 for a basic prototype, excluding the pump/v (based on live distributor pricing)
Design Considerations
Moisture Sensor Calibration
Capacitive soil sensors are much better than resistive probes for long-term use, but they still need calibration per soil type and pot size. Record dry, field-capacity, and fully watered readings for each plant and map them to a percentage or threshold. Expect drift over time from mineral buildup and changing soil composition, so re-check calibration after a few weeks.
Pump Control and Protection
If you switch a DC pump with a MOSFET, add a flyback diode across the pump terminals and keep the high-current loop short. A relay is simpler conceptually, but it is noisier, slower, and wears out mechanically. For a prototype, a logic-level MOSFET plus diode is usually the most reliable and compact approach.
Power Budget
The ESP32 can draw large current bursts during WiFi activity, so size the regulator for peak load, not just average load. If the pump is powered from the same supply, separate the motor rail from the logic rail or add bulk capacitance to prevent brownouts. For battery operation, deep sleep can reduce the ESP32 average current dramatically, but the sensor and regulator quiescent currents must also be low.
Environmental Robustness
Plant environments are humid, splash-prone, and often electrically noisy because of pumps and long wires. Use conformal coating or at least careful enclosure design for the electronics, and route sensor cables away from pump wiring. If the humidity sensor is placed too close to the soil or water source, it will read local microclimate rather than room conditions.
Firmware Architecture
Use a simple state machine: sample sensor, filter readings, decide whether watering is needed, actuate for a bounded time, then verify recovery. Add a watchdog and a maximum pump-on timeout so a stuck sensor or firmware bug cannot flood the plant. If WiFi is enabled, send periodic heartbeats so you can distinguish a dead device from a dry plant.
Validation and Failure Modes
Test the system first with a cup of water and a dummy load before connecting a real pump and plant. The most common failures are sensor cable corrosion, pump supply sag, and false dry readings caused by poor grounding or ADC noise. Log raw sensor values over time so you can see whether the threshold is stable before trusting automatic watering.
Want to customize this project or build something different?
Try the Project Advisor


