Introduction

For this project I'm going to use a raspberry Pi to create a home irrigation system using node red to provide the user interface.

 

The build for the control box is covered in my homebrew controller project here:

Raspberry Pi Homebrew controller with Node Red UI

 

So I'm going to use the same controller and use web service to count the number of days without rain in the town that I live.  I'm using the https://openweathermap.org/  site which has a python API that allows your python code to get a weather summary.  With this service you get a free account then you can enter a key into the python API and use it int the pyowm python library.

 

The code to do this is surprisingly straightforwards:

So we basically just get a weather summary string and look for the substring 'rain' within it every hour, count up the number of hours and turn on an irrigation solenoid if it's past a threshold.

 

The API returns the above forecast in string format.

 

Equipment

I use the control box from my previous project and a cheap micro irrigation kit off ebay.

 

Solenoid

I'm using a micro 24V water solenoid that I can control direct from my PiIO PCB.  I've made a small junction box so it can go outside and then put it inline of my micro irrigation hose.  It's important that this isn't kinked.  The solenoid has an in and out feed, I've tie wrapped it here to ensure the hose doesn't kink.

 

 

Which can be wall mounted near my water butt, the rubber attachment then goes on the water butt as the water source.

Next it's just a case of attaching the drain lines and moving them to my most important plants (strawberries and blueberries).

Node red

Like the previous example I do all the main processing in a python program and interface to node red using MQTT.  This gives me a user interface with auto and manual irrigation control as well as some basic stats on irrigation usage.

 

 

Source code can be viewed here.

https://github.com/lawsonkeith/PiIO/blob/master/examples/hydro_ADIO.py