A jumble of electronics on a wood board

In Praise of the Dirty Protype

I’m working on my irrigation system. This requires a controller to turn it on and off. Cheap controllers are just timers. More expensive controllers factor in the current weather and avoid watering the garden during a rainstorm. Very expensive controllers (weather-based irrigation controllers) look at weather forecasts to avoid irrigating the garden when a rainstorm is going to happen in the next few days.

I’m satisfied with simple timers, but I forget to bring them in before freezing weather. They freeze, they break. Time to buy a new timer.

I’d like to be more sophisticated about my watering schedule. And I have all these Raspberry Pi and electronics parts laying around the house. It’s time to put together a Raspberry Pi Powered irrigation system with look-ahead scheduling based on the actual water needs of my plants. That’s a lot of technology to put together and get to work reliably.

I’ve learned to do this type of thing in small steps and am a firm believer in “the better is the enemy of the good.

Dit que le mieux est l’ennemi du bien.

M. de Voltaire

The picture at the top of this post is the current irrigation prototype. It’s nailed to a board and uses wire nuts where possible. Let’s take a look at the pieces:

Power

Here’s the power supply. Starting from the left, a 110 volt to 24 volt transformer. This is the voltage required by the irrigation valves. To the right is a standard junction box. Wall power comes in, supplies the two generic outlets and transformer with power. This is all governed by the wall switch on the right of the junction box. Plugged into one of the standard outlets is a USB 5vdc power plug. This supplies power to the Raspberry Pi.

A jumble of electronics on a wood board

Raspberry Pi Zero

Below the power supply sits a Raspberry Pi Zero. This is the smallest of the Raspberry Pi family (short of the RP2040 micro-controller). Since the irrigation system, at most, turns on once per day for a granularity of five minutes, I didn’t need a lot of processing power. I chose the Raspberry Pi over the Pico because I needed internet connectivity to download weather reports, and I wanted to program in the R programming language rather than micropython.

A jumble of electronics on a wood board

Relays

Just below the Raspberry Pi sit two relays from Adafruit. I’m controlling 24 VAC, but a Raspberry Pi can only generate 5VDC. These are designed to be plugged right into the Raspberry Pi GPIO and so far, work like a charm.

Ugly, But It Works

The board is ugly. The screws are mismatched. There’s wires everywhere. But by golly if it doesn’t work. I didn’t spend any time worrying about how it looks, only how it works. Dit que le mieux est l’ennemi du bien!

Mmmm...Rπ!

Stay current on MNR and his Raspberry Pi adventures.

We promise we’ll never spam! Take a look at our Privacy Policy for more info.