Open-Source ESP32 Watering Controller Adds Pump Safety Checks

The open-source ESP32 project uses timed watering pulses, sensor validation and fault detection to prevent uncontrolled pumping when a plant-watering system fails.
An open-source plant-watering controller developed by Barcelona-based freelance developer Artur Puig uses an ESP32 to automate irrigation while protecting the pump against sensor errors and water supply failures. The project, called ESP32 Failsafe Watering, controls a low-voltage pump or solenoid valve using soil moisture readings. Its firmware includes several safeguards designed to stop watering when the sensor behaves unexpectedly, the reservoir runs dry or the pump exceeds its operating budget.
The controller uses a capacitive soil moisture sensor connected to an ESP32-C3 or ESP32-C6 development board. Instead of running the pump continuously until the soil reaches the target moisture level, it delivers five-second pulses and waits ten minutes between them to allow water to spread through the soil. Watering begins at 35 per cent moisture and stops at 45 per cent, with up to four pulses per cycle. The firmware also takes 16 sensor samples per reading, uses their median and rejects measurements outside a defined range or with excessive variation. Additional fault checks detect a lack of moisture increase after watering and limit total pump operation to 120 seconds by default.
Pump protection is handled through multiple software and hardware measures. A one-shot timer is armed before each pump pulse, while the task watchdog resets the controller if its control task stalls. A pull-down resistor keeps the MOSFET switched off before the firmware starts, and faults and accumulated pump time are saved in non-volatile storage to prevent ordinary reboots from clearing the safety limits. The hardware uses an N-channel MOSFET, a flyback diode and a separate power supply for the pump. The developer recommends testing the assembly with the pump outlet in a bucket before connecting it to a plant.
The project is published on GitHub under the MIT licence, with ESP-IDF firmware, configuration and testing resources available for developers to inspect and modify. Its test suite covers 12 failure scenarios, including sensor disconnection, an empty reservoir and fault persistence after reboot, alongside 300 simulated three-day runs. For more information, click here.
This summary is from Open Source For U, published Dec 3, 2026. NewsFusion links to the original reporting and groups related coverage.



