Smart Home & Building Mechatronics · Intermediate · Scheduling
ESP8266 Irrigation Zone Timer
A pump on a schedule, overridden by a page, and stopped by a reservoir float.
Firmware status: Generated from this project's own pin map and compiled with arduino-cli for esp8266:esp8266:nodemcuv2 before publication; bench validation on your hardware is still required.
Board: ESP8266 (NodeMCU v3 / Wemos D1 mini) · ESP8266EX @ 80 MHz · 3.3 V logic · build for esp8266:esp8266:nodemcuv2.
What you will build
An ESP8266 running a timed irrigation cycle with a web override and a hard stop when the reservoir float opens.
Components
- ESP8266 board
- 5 V relay module for the pump
- Float switch for the reservoir
- Soil moisture sensor on A0
- 5 V supply sized for the relay and pump control
Pin map for this build
| Sketch constant | Pin | What it is |
|---|---|---|
PIN_OUT_1 | 5 | Switched output — relay / MOSFET channel, 5 V coil |
PIN_OUT_2 | 15 | Switched output — relay / MOSFET channel, 5 V coil |
PIN_IN_1 | A0 | Analog input — 3.3 V maximum at the pin |
PIN_IN_2 | 12 | Analog input — 3.3 V maximum at the pin |
Tools
- USB programming cable
- Multimeter
- Current-limited bench supply (for anything that switches a load)
- Small screwdriver and wire cutters
Build sequence
- Test the float switch with a multimeter: it should read closed when the reservoir is full.
- Wire the float into a GPIO with the internal pull-up and confirm the stop works before the pump is connected.
- Flash and run one manual cycle from the page, timing it against a watch.
- Set the schedule and confirm a full day produces the cycles you asked for.
Test and expected result
Manual cycles run for the configured time, the float stops the pump regardless of schedule, and the moisture reading tracks the soil.
Acceptance checks
timed cycles, override works, float stops regardless, moisture tracks
Safety and limits
A pump that runs dry destroys itself. The float stop must work with the network down, and it must be tested before the first wet run.
Hardware scope
Scheduled output with web override, float interlock, analog moisture input.
Connection diagram
Download the connection diagram (SVG)
Download the Arduino sketch (E26_esp8266_irrigation_zone_timer.ino)
Guide source: the sketch on this page was generated from the pin map above and compiled for esp8266:esp8266:nodemcuv2 before publication.
Related projects
- ESP8266 Deep-Sleep Mailbox Notifier — A battery node that reports only when a switch closes, and sleeps the rest of the time.