Sprinkler Controller

by kwinana in Circuits > Gadgets

37 Views, 0 Favorites, 0 Comments

Sprinkler Controller

ChatGPT Image Feb 20, 2026, 06_39_32 PM.png
backyard sprinkler layout.png

My nice wireless sprinkler controller died. I thought it had been about 5 years, but it had made it 8. Still, they don't build them like they used to. I wasn't very happy, even though they really aren't that expensive. And I had an ESP32 laying around with nothing to do. My nephew had an 8-relay board. And I happen to have 8 zones. So putting 2 and 2 together, I thought I'd try building my own.


Note: AI generated images in use.

Supplies

ESP32

Breadboard

Jumper Wires

8-relay board

24V AC power supply

Options and More Options

6a97b1d3-b46f-41f6-8b3c-9f6d49b1557e.png

At first I was going to use my Arduino. But I wanted to replicate the wireless capabilities of my old controller. So I needed to be able to connect to it wirelessly. And the Arduino Uno and Duemilanove I had did not have wireless. I considered connecting it to the ESP8266 I had, but then once again, why complicate things? I already had an ESP32, and it is a very powerful microcontroller on its own.

The other thing I had to figure out was the relay board. A relay uses a small 3.3V or 5V signal to turn something on/off. I needed to be able to turn the 24V AC switches that sprinkler valves use. I bought a relay kit, but it turned out to be a daunting task to solder the thing. I outsourced that to a co-worker, and he soldered it upside down. Believe me, it was an easy mistake to make. He tried unsoldering it, even though I told him to not worry about it. That ruined the board. My nephew is a nerd like me, and we were discussing really important things like electronics. He mentioned that he had an 8-relay board he would be happy to give me. And it worked great.

Wire It Up!

attachment (11).jpg
Screenshot 2026-02-20 184130.png

A picture is worth a thousand words. And there are hundreds of guides on relays. I watched a couple of Youtube videos, and now I'm an expert. Basically, the ESP32 uses an i/o pin to send 3.3V to one of the relays on the board. Internally, that connects the 24V AC signal to the output, which is connected to the sprinkler valve.

Programming: a Dilemna

1697e33a-7f40-48c2-98f5-735a902cd351.png
Screenshot 2026-02-20 182857.png

I learned C in college - not C++, just C. I can look at a C program and understand what it is doing. But I haven't done much programming. I played around with an Arduino about 10 years ago with one of my sons. But it's just been too long. I was not at all sure how I was going to develop the software for this. Then the thought came to my noggin: why don't you try vibe coding? So I sat down one lazy afternoon, and discovered this amazing tool. I took it step by step. I used Gemini. I asked it to make the light on the board blink. It wanted to know which board I had, and then I had a blinking light. Amazing.

Next, I asked for a webpage that where I could press a button on the page to turn on a relay. I explained that this would be the core of my sprinkler controller. It walked me through to make sure the wiring was correct. It reviewed the picture I took of the board and confirmed that it was good. And it made the requested page. And it worked. I clicked the button on the webpage, and the light on the relay turned on.

I spent a couple of hours adding features. This is amazing! It would have taken me weeks to months to code this myself. Instead, it was literally hours. It made a couple of mistakes along the way. I tweaked a few things in the code as well. In the end, I was so impressed. I manage a few developers. I have been an evangelist ever since. If you are not using AI, you need to figure it out. If you don't, this new technology will leave you behind. Is it perfect? No. Does a human need to be in control? Yes! But the ability for the average person to create code is just remarkable. I heard it this way: it used to be that the average person owned a few sets of clothing. They probably made that clothing themselves. Sewing machines and looms were amazing technology of the day that made material inexpensive. Today, clothing is made for every little thing you can do. This is what AI is doing for code. So get out there and build something!