Ray Wang | Samer Albahra |
The Story of OpenSprinkler
by Ray Wang
This is the story of how learning Arduino inspired me to invent the OpenSprinkler — an open-source, web-based sprinkler controller. I’ve had a passion for making electronic circuits since I was a kid, spending hours looking at schematics and building simple circuits like a single-transistor radio, an electronic cricket, a sound-controlled switch. Most of the electronic parts I worked with back then were scavenged from waste circuit boards. Taking apart used circuits, learning to solder, and etching PCBs — these were some of the happiest moments of my childhood.
First Encounter with Arduino
I first got to know Arduino when I read Phillip Torrone’s open source hardware gift guide in 2007. Open-source hardware, physical computing, Arduino, these were all brand-new concepts to me, and they looked completely fascinating. Getting to know Arduino was like re-discovering my childhood passion for electronics — I came to realize how much it would’ve enabled me to do had it existed when I was a kid. I soon started learning about Arduino.
As a Computer Science professor at UMass Amherst, I saw it as an inspiring and enabling tool for research and teaching. Together with my students, we built a camera remote for taking time-lapse photos, and a controller for a pan-tilt camera that tracks objects in real-time. I started giving lectures on Arduino and physical computing in the Computer Graphics and Java programming classes that I teach. Recently I’ve offered several wearable electronics workshops at UMass and nearby colleges, using an Arduino-based controller board that I designed called SquareWear.
Mint-tin Water Valve Controller
I’d always hoped to use Arduino in a home automation project. An opportunity came when I installed a new lawn in my backyard in spring of 2010. I had to shop for a sprinkler timer to water the lawn regularly. I went to retail stores and wasn’t very happy with what I found there. The sprinkler timers sold in retail stores looked like they were designed in the 80’s — very limited functionality and no web connectivity at all.
What if I need more flexible watering schedules? What if I am traveling and need to turn off sprinklers remotely? Wouldn’t it be cool if I could build my own sprinkler controller, set schedules any way I want, and even better, program it wirelessly? My experience in Arduino got me seriously thinking about the idea. I started doing research on it, and a few weeks later, I completed the first functioning prototype built with an Arduino Pro Mini, a wireless transceiver, and a homemade PCB. I published the project along with a demo video as my first ever blog post: “A Mint-tin Water Valve Controller.” A few days later it got posted on the Make: blog.
Arduino-based OpenSprinkler
The mint-tin valve controller was a rewarding project and a lot of fun to make. But at that moment I didn’t realize automated sprinklers would become an important part of my life for the next few years. That is until Chris Anderson (former editor-in-chief of Wired magazine and now the CEO of 3DRobotics) contacted me after seeing my blog post. He was in the middle of writing his upcoming book Makers — the New Industrial Revolution, and he saw my project as not only a nice story for his book, but a potential business opportunity: an open-source, web-based smart sprinkler controller could have a big market. Since we’re both passionate about making, open-source hardware, and automated sprinklers, we started collaborating. We came up with the name ‘OpenSprinkler’ — meaning it’s an open-source sprinkler controller.
Keeping it as an open-source project is important to me: as an educator, I’ve always wanted people to not only use a product, but to have the opportunity to learn the underpinnings — how the product works internally. There is a strong educational purpose of it. Also, anyone who wants to design a new sprinkler controller can base their work on mine, without having to reinvent the wheel. This is a great way to promote technology innovations.
Chris and I set an initial plan for OpenSprinkler. First, the controller should be compatible with standard 24V AC sprinkler valves in lawn watering and irrigation systems. Second, it should be Arduino-based, because Arduino’s widely available libraries and community support make it easy to extend OpenSprinkler’s functionality. Lastly and most importantly, it should have an Ethernet controller and a web-based interface, so that one can set and modify sprinkler programs online in a web browser or through a mobile app. This would be much more intuitive and convenient than a traditional sprinkler controller, where everything has to be set on the controller body using buttons, knobs, and a tiny LCD (which nobody likes!). Additionally, a web-based controller enables remote access, and makes it possible to pull weather data online to help adjust watering schedules when necessary.
OpenSprinkler 1.0 was released on Oct 9, 2011 as a DIY kit. It included the PCB, all through-hole components, and a beautiful, clear-cover plastic enclosure. Following the soldering and assembly instructions, you could build your own web-based sprinkler controller from scratch, in a couple of hours.
Since version 1.0, OpenSprinkler has gone through several rounds of revisions till the most recent version 2.1. Each revision improves the circuit design by considering the feedback and suggestions received from the previous round. It has been a truly rewarding learning experience for me. In May 2012 I went to Maker Faire Bay Area to demonstrate OpenSprinkler for the first time, and it was very well received. The interest and demand have increased significantly since then. From version 1.4 we started offering fully assembled OpenSprinklers made with primarily surface mount components. The DIY kits are still available for those who enjoy soldering and building circuits. From version 2.0, we’ve upgraded the microcontroller from ATmega328 to ATmega644, and this is also the first version that uses the OpenSprinkler injection molded enclosure designed by SeeedStudio.
The current OpenSprinkler v2.1 has the following built-in hardware features:
- ATmega644 flashed with OpenSprinkler firmware and USB bootloader
- 16×2 LCD, DS1307 RTC with back-up battery, microSD slot, mini relay
- Ethernet jack, rain sensor terminal, and zone expansion connector for linking OpenSprinkler zone expansion board
- Spare digital and analog pins for connecting to sensors, wireless transceivers, or other components.
The OpenSprinkler firmware (written in Arduino) provides a rich set of features, including web-based user interface, interval programming, graphical preview, custom station names, support for master station, rain delay, concurrent station runs, etc. You can change program data and settings in a web browser or using the OpenSprinkler mobile app. The hardware design and software code are available for download at the OpenSprinkler Github repository.
OpenSprinkler Pi and Beagle
In late 2012, I noticed that some users were using OpenSprinkler in conjunction with Raspberry Pi (RPi), to provide advanced features such as logging and weather-based adjustment. An idea came to my mind: why not design a sprinkler extension board for the RPi, so that one can use RPi’s GPIO pins to directly control sprinkler valves? I immediately bought an RPi, and was pleasantly surprised that it fits into the existing OpenSprinkler enclosure perfectly. After two rounds of prototyping, OpenSprinkler Pi (OSPi) 1.0 was born and released on Feb 18, 2013.
Different from the Arduino-based OpenSprinkler, the software for OSPi is actually developed not by myself, but by a group of enthusiastic users. Dan Kimberling first ported the Arduino code to Python, and has since then introduced many new software features. Rich Zimmerman developed a sprinklers_pi program that has a built-in mobile frontend and advanced logging. More recently, Samer Albahra and Jonathan Marsh have joined the team to revamp the code and provide a modern, streamlined user interface. I am grateful to this group of people who share the same passion with me and are willing to help and contribute to the project — this is a great evidence of the spirit of open-source development.
With the success of OSPi, I then designed a similar sprinkler extension board for the BeagleBone Black, and released it as OpenSprinkler Beagle (OSBo) on Nov 15, 2013.
For both OSPi and OSBo, I’ve released a pre-configured SD card image with OpenSprinkler software pre-installed. Download the image, burn it to an SD card, pop it in, and you can immediately transform your RPi or BeagleBone into a capable sprinkler controller.
OpenSprinkler Mobile App by Samer Albahra
Until mid-2013, OpenSprinkler had one big missing feature — a mobile app. The built-in web frontend works fine in a desktop browser, but it’s not particularly stylish, nor is it mobile friendly. On June 07, 2013, Samer Albahra released the first version of OpenSprinkler Mobile App. The app received overwhelming responses. Since then, Samer has continued to improve the app by integrating users’ feedback and suggestions. Today the app is available in the iOS, Android, and Windows app stores (just search for ‘opensprinkler’), and it provides many neat features including language localization and support for multiple devices etc.
OpenSprinkler Bee and Sip
As in the past two years, I will be going to Maker Faire Bay Area again this year to demonstrate OpenSprinkler. In addition to the Arduino-based OpenSprinkler, OpenSprinkler Pi, and Beagle, I will bring a couple of new exciting projects that I am hoping to release soon. OpenSprinkler Bee is an OpenSprinkler variant designed specially for battery-operated sprinkler valves. It’s powered by AA batteries and has a built-in 2.4G RF transceiver to allow for wireless programming. OpenSprinkler Sip is another battery-powered controller, designed for indoor plant watering. It comes with a mini water pump and soil moisture sensor to automatically water your plants and flowers. Both OpenSprinkler Bee and Sip will be open-source and Arduino-based.
The past few years have been an incredible journey for me, from learning to write the first Arduino program to developing a full-featured OpenSprinkler. The most amazing part of the journey is the connections I’ve made with people who share the same passion. It’s been a fun and rewarding journey, one that I look forward to continuing.