OpenSprinkler Pi (OSPi) is an open-source sprinkler / irrigation extension board for the Raspberry Pi. It is an easy and low-cost solution to transform a Raspberry Pi into a sprinkler controller. The standard unit comes with 8 zones for lawn and garden watering. The number of zones can be expanded with a Zone Expander.
The original OpenSprinkler documentation didn't need supplemental instructions. This guide was to simply document my progress. When I first did the project, there was a preconfigured OpenSprinkler image, which made it very simple. Now, the OpenSprinkler firmware is installed on top of Raspberry Pi OS.
This is the perfect home automation project. If you are looking for a first project, do this one.
The goals of this project are to:
Don’t lose any functionality from my currently installed Rainbird (or Orbit) irrigation system
Control the irrigation system from the web
Add functionality to the irrigation system
Integrate with weather reports (built in to OpenSprinkler)
Add rain sensor
Add soil sensors (I haven't done this yet – not supported by Open Sprinkler as of publish date)
Use WiFi instead of a wired connection
Use a Raspberry Pi
Document how to upgrade either the OS or the Raspberry Pi
I first installed OpenSprinkler in May 2015, and wrote and published an instructable in December 2015. My instructable was selected as Featured and it has 23K+ views. This is an update of that instructable in 2021. A lot has changed since the original was installed in 2015.
My OpenSprinker has been in continuous use since it was installed.
Over the years, I had a local irrigation specialist add a zone, and split one zone into two. These changes allowed better control over my watering. I am not a fan of the rotary sprinklers, which shoot water over a long span (image on left),
I prefer the spray sprinkler shown on the left.
Also, I learned that limiting sprinkling in each zone to 14 minutes allows the shallow central Texas soil to absorb the water without running off. To get more water, If required, I will run a 14 minute program multiple times. Depending on the time of year, a program run from 0-3 times.
Central Texas regularly experiences droughts and cities impose watering restrictions. If I water on the wrong day, during the wrong hours (after 10pm and before 7am), or if water runs into the street, then I get a $50 fine. In general, I try to water as little as possible, but because it runs in the middle of the night I forget about it.
My house came with a Rainbird ESP-M controller, which is not WiFi enabled and cannot be accessed from the web. At a minimum, I would need to upgrade the Rainbird controller.
Notes:
I use a MacBook to communicate with the Raspberry Pi, but any computer can be used.
Please see standards for conventions used for all projects in the footer of any page
References are included in the text or at the end
$ indicates a command entered in a terminal window on a MacBook and executed on a Raspberry Pi
Once the Raspberry Pi and OSPI are connected, the micro SD slot is not accessible.
Twice a year, I inspect my sprinklers for broken heads. Using my smartphone to connect to OpenSprinkler makes it very easy to turn on a zone for a few minutes to check if any of the heads are broken
Multiple times a year I change the number of times a program is run
The OpenSprinkler Raspberry Pi (OSPi) user interface is very intuitive. OSPi integrates with a weather system and rain sensor, which means no watering when it isn’t required. Hopefully, the savings on water bills justifies the project.
Parts:
In another Raspberry Pi project, I measured, tested and experimented with various kits and components. The parts below seem to work best for me. A case and power supply for the Raspberry are not needed.
OpenSprinkler OS3.0 AC-powered (including 24VAC power adapter, US) $166.00
Raspberry Pi 3 B+ Element14 $37.96
SanDisk Ultra 16GB Ultra Micro SDHC UHS-I/Class 10 Card with Adapter (SDSQUNC-016G-GN6MA) from Amazon $6.60
Orbit Water Conservation Sprinkler System Rain/Freeze Sensor, Amazon $30.11
I had these:
Micro USB to USB cable 3ft from Amazon $5.49
USB 5v 2.1A wall adapter Amazon $7.57
Rainbird irrigation system with 7 zones and 24V AC sprinkler valves (OSPi can handle more zones with additional parts)
Tapered machine screws to attach back to front of OpenSprinkler housing (screw head must fit into OSPi slot)
8x 8 inch solid wire (same gauge as Rainbird wire)
Mounting kit: 4 screws and pop toggles
MacBook with SD Card slot
Drill with 5/8 inch drillbit
8x Wire nuts
Small flathead screwdriver, Phillips head screwdriver, and needle nose electronics plier
The OSPi v3.0 kit includes the enclosure (with a clear acrylic window), assembled and tested OSPi circuit board and terminal blocks. The kit includes an AC adapter .
Step 1. Gather Rainbird (or Orbit) Documentation for currently installed system
If the project fails or I want to reinstall the Rainbird controller, I need the Rainbird documentation for my model, which included:
Rainbird ESP-M Watering Cycle (aka, programming sheet)
Rainbird Product Sheet ESP-M
Rainbird ESP-M Modular Controller Manual
Page 42 of the Rainbird ESP-M Modular Controller Manual shows how the zones are wired.
Step 2. Take photographs of everything
Take pictures of everything when converting from an installed irrigation system to OpenSprinkler.
The white wire in the center of the image is COM.
And the seven wires below the white wire are the zone wires
Step 3. Setup Raspberry Pi running latest version of Raspberry Pi OS
In Step 3's link:
Setup the Raspberry Pi to be headless (SSH and Wi-Fi)
Change the password from raspberry to something you choose
Open a terminal window and login using the password: raspberry
$ ssh pi@raspberrypi.local
In System Settings, change hostname to opensprinkler or something else you prefer
$ sudo raspi-config
Finish and reboot
Once the hostname has been changed, login using ♣your-password♣
ssh pi@opensprinkler.local
Disable the uncomplicated firewall
$ sudo ufw disable
Step 4. Add OpenSprinkler (OSPi) Firmware to the Raspberry Pi
Run the following commands to build the OpenSprinkler firmware:
$ cd ~/.
$ sudo apt-get install build-essential
$ git clone https://github.com/OpenSprinkler/OpenSprinkler-Firmware.git
$ cd OpenSprinkler-Firmware
$ sudo ./build.sh ospi
Answer Y to start up script
The web interface is accessible from a browser using: http://localhost:8080. The default password to log into the web interface is opendoor.
Change the password. Go to the home page of OpenSprinkler and click on the hamburger menu. Thenm click on change password.
Run the command to shutdown the Raspberry Pi
$ sudo shutdown -h 0
Step 5: Setup OSPi Power Supply
The OSPi power supply has two wires: one is marked 300V the other is not. It does not matter which wire goes into which slot on the 24V AC clip.
The OpenSprinkler clips are removable.
Remove the clip for 24V AC input.
On the orange clip, loosen screws.
Insert one wire from the power supply into each slot in the 24V AC clip as shown in the image.
Tighten the screws
Step 6: Test Power Supply
Read carefully before doing these steps:
Insert the transformer clip in to the matching terminal on OSPi.
Plug in the transformer.
The transformer will power both the OpenSprinkler board and the Raspberry Pi.
The Raspberry Pi power supply should not be used. Put it away.
The green LED should light up, indicating power is on. See image in previous step.
If the LED doesn’t light up, unplug the power immediately
If you can’t figure out the problem, send an email to support@opensprinkler.com
Remove the power supply clip from the OSPi board
Step 7: Attach Raspberry Pi (RPi) to OpenSprinkler (OSPi)
OSPi has two support pillars that match the screw holes on Raspberry Pi.
With the micro SD card inserted into Raspberry Pi:
Remove the two top screws from the support pillars
Plug Raspberry Pi into OSPi through the 2x20 pin headers
Double check orientation and ensure all pins are aligned. The two screw holes must align with the support pillars.
Gently, insert Raspberry Pi all the way to the end. The USB and Ethernet connector should go through the cutouts on the PCB.
Insert screws for posts and gently tighten the two screws.
The left image shows the connectors, and Raspberry Pi mapped out pins. The right image shows the locations of the USB WiFi dongle and SD card.
Step 8: OSPI Web Interface
The OSPi firmware contains a built in website.
Next, open a browser, and type in http://♣ospi-ip-address♣:8080, which is the Raspberry Pi's IP address (such as http://♣ospi-ip-address♣:8080, or http://♣hostname.local♣:8080.
A welcome page with further OSPI instructions appears. If this page appears, congratulations! The image is successfully burned on the micro SD card and WiFi is working.
The actual OSPi User Interface is accessible via http://♣ospi-ip-address♣:8080
default password = opendoor
In Step 4, the default OPSi password should have changed to ♣your-password♣
If all is okay, then shutdown the raspberry:
$ sudo shutdown
Step 9: Install OSPi
My home's Rainbird system had seven zones. A local company split one of the backyard zones into 2. So, I could get more even watering. The Rainbird system and is installed on the garage wall. So, move OpenSprinkler to the garage and mount OSPi on the wall.
Disconnect electricity from both Rainbird and Open Sprinkler.
If necessary, I want to be able to setup my Rainbird system again. So, I am leaving the Rainbird controller in place, as well as, its wiring. I run wires from the OSPi through a hole in the Rainbird controller case
The Rainbird control panel swings out. Grab the notch on the upper left and swing out the control panel
Drill 3/5in hole in the lower left side of Rainbird case
Connect the front and back of the OSPi enclosure using tapered screws. Do not over tighten.
Find a suitable location for the OSPi and mount to the wall on left side of Rainbird controller.
I used toggle mounts for the OSPi
Step 10: Wiring Sprinkler Zones
To connect sprinkler zones:
Remove COM (common) wire from Rainbird Controller and insert it into OSPi's COM terminal
On my system the COM wire is white (shown in image as yellow)
The COM terminal has two ports – they are internally connected so you can connect to either port
Cut 8 pieces of wire to the same length (measure and leave some extra - each wire must be long enough to run from Rainbird controller to OSPI
Run wires 8 wires from OSPi into Rainbird case
For each wire in Rainbird case do the following (do one at a time):
Loosen Phillips’ head screw on zone wire in Rainbird case
Remove the loose wire from the connector
Use wire nut to connect loosened wire to one of the cut wires
The cut wire runs from the Rainbird controller, through the hole, and to the OSPi controller
Loosen flathead screw on OSPi connector that corresponds to Rainbird (both are numbered right to left)
Insert wire into OSPi connector
Step 11: Setup Zones and Programs
The OSPi can be expanded to handle additional zones. I only need 7 zones. If you need more refer to the OSPi Manual.
OSPi’s GUI is easy to use.
Setup Zones and Edit Programs.
Test to make sure everything works.
You are done!
Appendix
References:
OpenThings: Installing and Updating the Unified Firmware on OSPi
OpenSprinkler 1.4 User's Manual
SmartHomePursuits: OpenSprinkler - I found this and it seems very similar to mine. I thought it might be a good alternate source if someone gets stuck
Trouble Shooting:
Change WiFi SSID and Password
In the Upgrade Raspberry Pi section below, get access to the microSD card
In the Setup Raspberry Pi Headless, go to the step dealing with editing wpa_supplicant.conf and change your SSID and password
Put it all back together
Upgrade Raspberry Pi
To upgrade the Raspberry Pi from a 2 to a or 4, remove the 4 screws attaching the back plate to the wall (above left).
Remove the 2 screws holding the front case to the backplate (above middle).
Undo the screws holding the Raspberry Pi to the OpenSprinkler (above right, screws are circled in yellow).
Gently remove the Raspberry Pi from the OpenSprinkler.
Setup new Raspberry Pi with heat sinks. Check that heat sinks do not interfere with OpenSprinkler board or case