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 constantPinWhat it is
PIN_OUT_15Switched output — relay / MOSFET channel, 5 V coil
PIN_OUT_215Switched output — relay / MOSFET channel, 5 V coil
PIN_IN_1A0Analog input — 3.3 V maximum at the pin
PIN_IN_212Analog 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

  1. Test the float switch with a multimeter: it should read closed when the reservoir is full.
  2. Wire the float into a GPIO with the internal pull-up and confirm the stop works before the pump is connected.
  3. Flash and run one manual cycle from the page, timing it against a watch.
  4. 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

Connection diagram for ESP8266 Irrigation Zone Timer

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

Back to all project guides · Study the course