The controller can be any device capable of running python with network connectivity. In this case, I'm using a BeagleBone Black running Debian, as it's already running other services for the network. The best irrigation time is in the middle of the night due to decreased water evaporation as a result of the cooler temperatures. As such the controller should be on at that time and due to the low power consumption the beagle bone is ideal for the task.

Wunderground API Key

We will need to get forecasted weather information to decide whether or not the valves should operate.

Go to Wunderground and register for a free account. Go to the developer's menu. Generate a free API key. Get a link for your local weather forecast with you API key. The API documentation provides an example, that can be further customized by replacing the City name with the zip code. API Documentation http://api.wunderground.com/api/ {key} /forecast/q/ {state} / {city} .json

http://api.wunderground.com/api/ {key} /forecast/q/ {state} / {zip} .json

ex - http://api.wunderground.com/api/{key}/forecast/q/CA/San_Francisco.json Populate the python script with the key, state, and zip(or city)

key = "API key" state = "state" zip = "zip or city"

Rain Sensor

Connect a wired rain sensor to the node and provide the nodes URL to the python script.

sensorURL = 'http://irrigation.local/'

Evapotranspiration Rates

The evapotranspiration rates are the bread and butter of water conservation and beautiful landscapes. With this information, we can determine the precise amount of water that is required to maintain the plants and conserve water. For further details see the Details step.

What we require is the evapotranspiration rates specific to our area. There are two sites that have the information readily available. Once the data is obtained, enter it by month as seen below and note that the different sources use different units, but the data will be normalized and the units will not matter.

Enter the information into the "data" file.

{"Jan": ".07", "Feb": ".09", "Mar": ".11", "Apr": ".15", "May": ".17", "Jun": ".19", "Jul": ".21", "Aug": ".19", "Sep": ".18", "Oct": ".14", "Nov": ".08", "Dec": ".06"}

Watering Times

Visit any of the following sites to calculate watering schedules for your plants and area. Just keep in mind that we are after the watering minutes per week, while some of these calculators split the times by days and further by scheduling a cycle multiple times a day. Simply multiply the minutes by cycle by the number of cycles per week and by the number of days per week to get the minutes per week. Also when scheduling, make sure to check with your local water utility for possible watering restrictions.

To enter the data, we will split the minutes/week into the number of days desired and further by the number of times per day. Based on my area, I need to water turf for 41 minutes/week, thus I will have the following entry in the data file. Use different URL's for different nodes, the entries below are on two different nodes but controlled by the same script.

Valve 1; 780 sec; Tue,Thu,Sat; <a href="http://irrigation.local/" rel="nofollow"> http://irrigation.local/ </a> Valve 1; 13 min; Tue,Thu,Sat; <a href="http://irrigation2.local/" rel="nofollow"> http://irrigation.local/ </a>

The format is as:

{Label} ; {Minutes or seconds per cycle} ; {Days of the week - comma separated} ; {Node URL}

Watering for too long a time will cause water run-off. To solve this issue we can reduce the watering time by half and schedule the script to run twice per day. Another way to solve this issue is to limit the watering duration per cycle and any excess time will be scheduled after a given delay. We set these values in the script.

#5min * 60sec/min = 300 sec maxDur = 300 #20 min * 60min/sec = 1200 sec delayTime = 1200

With these settings, a valve that is set to run for 13 minutes will:

run for 5 minutes

delay for 20 minutes (other valves can run in the meantime)

run for 5 minutes

delay for 20 minutes (other valves can run in the meantime)

run for 3 minutes

Zero-Conf Networking:

Zero-Conf Networking allows devices to use names instead of IP addresses without the use of a local DNS server. Apple includes it with their OS, Windows PC's might have it with the latest version of Windows 10 or by downloading Bonjour which comes with Itunes, on Linux you can download Avahi-daemon.

Here are some more details and instructions on how to set it up. Adafruit ZeroConf