If you just want to prevent your garden from slowly turning into a desert, have a look at the available off-the-shelf home automation solutions, pick one, lean back and let moisture monitoring and automated irrigation take over. If you want to get into electronics, learn PCB design and experience the personal victory that comes with all that, do what [Patrick] did, and build your own ESP8266 based irrigation controller . It’s also a lot of fun!
[Patrick] already had a strong software background and maintains his own open source home automation system , so building his own physical hardware to extend its functionality was a logical step. In particular, [Patrick] wanted to add four wirelessly controlled valves to the system.
He started by designing the circuit that would do the job using EAGLE. An interface circuit from transistors and relays would help the ESP8266 to drive the electromechanical valves. Because these require 24 V AC to open, a clean and simple switched mode power supply circuit based on the LM2596T was employed to convert the already present 24 V AC supply voltage down to 3.3 V DC for the ESP8266. A few status LEDs were added to check the system status at a glance. One could’ve wasted a few optocouplers on the relay part – but in case of the ESP8266, why bother to spend more on protection circuitry than on the µC, right?
[Patrick] was crafty enough to avoid a few of the common pitfalls when starting with building hardware projects. He knew the EPS8266 boots with the GPIOs set high, so he used PNP transistors in the relay circuit to avoid sprinkling his lawn every time the device starts up. Also, he added footprints for some optional components to the board, just in case something wouldn’t work as expected, which turned out to be very helpful in the end.
The board layout was then sent to a manufacturer. After assembling the retrieved PCBs, [Patrick] noticed the RX/TX pins on the programming header were reversed, so a pin-re-reversing adapter would be required. Also, the chip antenna on the ESP-03 turned out to be rather weak. Luckily, an optional U.FL connector footprint was present, so an external antenna could be added easily.
On the firmware side, [Patrick] uses his own “DWN” protocol, which allows new devices to notify the home automation server about their presence and type. The firmware also prevents overwatering by limiting the maximum ON-time for a valve to 30 minutes. Eventually, the controller board went into a rugged enclosure and not only the finished build but also the schematics, layout and firmware have been released into the wild. We’re sure you’ll find this well-documented project a great resource for your next home automation project!