This article is part of the DIY LabVIEW Crew Online Group. Join Today!
When I moved in, I was fortunate enough to already have an existing sprinkler system installed at my house. Unfortunately, the system had not been used in years and nearly everything was either broken or severely outdated. The property has nine zones that were run from manual on/off valves. The valves were old and rusted and most of the sprinkler heads needed cleaning, repair, or replacement. Discovering where the pipes lead was a matter of turning on the valve and listening for the gurgling in the yard. At that point, I began replacing sprinkler heads where necessary, fixing all the leaks, making sure I had good water coverage, and generally fixing the plumbing so that it would work well as a manual system.
Figure 1 - Many sprinkler heads needed cleaning or replacing in most cases
After the plumbing is good to go, the automation process begins with obtaining electronic valves to replace the manual ones. These electronic valves are fairly inexpensive from any home improvement store (~$12/valve). You need one valve per controlled zone
Figure 2 - The anatomy of the electronic anti-siphon valve
You want to always buy anti-siphon valves, which prevent backflow, basically, so that the water from the ground or in the pipes in the yard can not get back up into the water supply. Valves also include a flow control knob as well as a 24VAC-activated solenoid valve.
Figure 3 - Manifold of multiple zones from one source pipe
The main idea of wiring the system is to get one control line and a common ground from each electronic solenoid routed to a good location in the house for a controller. The central location for me was the garage. For wiring, it pays to buy the nice multi-conductor sprinkler wire. This type of wire is larger gauge and solid core. It is typically rated to run in outdoor environments and can be buried if needed. I ran mine along eves of the house and other out-of-sight places using screw-in wire hangers.
Figure 4 - Wiring using multi conductor wire and plastic screw-in hangers
I certainly could have gone at this point and picked up a nice sprinkler controller for around 50 dollars. However, working at National Instruments does have its perks. I was able to get a traditional Fieldpoint controller that was literally thrown away, because it was heavily used and the compact flash was corrupted. After getting some new flash from an internet store, I had it up and running, saving it from being tossed in a landfill somewhere. Although I did not replace the flash with industrial-grade solid state memory (like it originally came with) everything is working great (this is of course not recommended by NI in any way, so please do not call in and say that the flash you bought from Ebay is not workig right. And then quote this blog as proof that you can use consumer grade flash... anyway.....). In addition to the NI controller, I got two 8-channel relay modules to fully control my 9-zone system, a wireless access point so that it would be on my home network, a 24V AC Rainbird plug-in power supply for solenoid activation, and a "Powered by LabVIEW" sign to fly the flag of coolness.
Figure 5 - Complete controller setup
The basic system uses the relay modules to energize the control line of each solenoid with the 24VAC signal. This opens the corresponding water valve and turns on the appropriate sprinkler zone.
Figure 6 - Closeup view controller system
The basic software design of this system is a state machine created in LabVIEW with a while loop and a case structure. Unfortunately, when I created the control system, the NI Statechart Module had not yet been released, but I have since mocked up the system as a LabVIEW Statechart, even though statechart is not actually running on the controller (this is a possible future improvement).
Figure 7 - Statechart of the Sprinkler control system
The main mode of the system is the time check state where it is polling the current time/date and comparing it to the start time configured for the system. When the start time is reached the program enters the "Sprinkler Sequence" state where it flips the relay for each zone and keeps it on for the specified number of minutes. One it has finished with the sequence the program returns to polling the time. I also have a web-enabled user interface using remote front panels. With this feature I can log onto the system from a laptop from anywhere in my home network and potentially anywhere with an internet connection. On the UI, clicking the configure tab gives me the choice of setting start times and duratoins for each zone on each day of the week. In this tab, the user can also set the time and date, reinitialize, and disable the sprinklers. Disabling the sprinklers is easy way to shut it down temporarily when it rains.
Figure 8 - Main user interface to the system running on the LV Web Server
Using a hyperlink in a browser I see this interface which has LEDs for each sprinkler zone and a chart of the zones and rough coverage areas overlaid onto a satellite picture of the property. This way I can get a quick picture of what zones exist, where they are covering, and when controlling manually which sprinkler I am turning on and off.
Figure 9 - Configuration tab of the User Interface
Moving to the tab configuration you can see the user interface for setting the times a durations for each zone on each day along with buttons for setting time/date of the system, reinitialize, and system disable. The configuration tab still show the sprinkler map for reference.
The first day that I set the sprinkler to turn on in the morning by themselves, I got up, made coffee, and woke up my wife to come to the window and watch as our clock hit 6AM. Right on cue, the Zone 1 sprinkler popped up and spread water beautifully across the lawn. My wife went directly back to sleep while I went outside and watched the whole show.
.
Figure 10 - Zone 1 on and working
As of now the system functions very well and has been running non-stop without downtime for nearly a year. I have been extremely impressed with the reliability of my Fieldpoint dumpster diving. It also makes a great "demo" when friends come to visit. It is safe to say that most people have not seen anyone turn on their home sprinklers wirelessly from a laptop web browser. For my NI friends, they completely understand the system but are just impressed/embarrassed-for-me that I spent my own time creating such a system. Many people ask, "Can't you get a sprinkler controller at Home Depot for 30 bucks that will do the same thing?" to which I respond, "Can those controllers do this?" - as I pop open my laptop and step out on the back porch.
Another thing about my system has that you do not get from pre-done solution is the complete configurability and openness you get with LabVIEW. Some future improvements that I plan to implement include:
Feedback to the system from a rain gauge.
Feedback to the system from other sensors like soil moisture, humidity, temperature, etc.
Feedback to the system from online forecasts (ex. weather.com)
Use an online time server to automatically set the time and date correctly (this feature keeps it perfectly up-to-date but more importantly resets it in case of a power outage).
Ability to control my sprinklers from any internet connection anywhere in the world (requires some security).
Ability to control my sprinklers from my phone.
UI improvements.
Datalogging and better error reporting.
Piece this system in as just one part of my bigger home automation system.
This is awesome! You put the 'field' in 'Fieldpoint' with this application. I wonder if around Christmas, you will be adding lights to each sprinkler head and have it play in unison with some music (http://www.youtube.com/watch?v=szLmAPW39uE).
RE: "You put the 'field' in 'Fieldpoint' with this application"
Hilarious....I am going to use that one
This is really informative and easy to understand! It is really cool! You should put the stuff about the touch-screen on there so people can see how you can turn on the sprinklers from the wall.
Wow Rick! This is cool. I never thought watering the lawn could actually be entertaining. Way to Geek-Out!
I am a student learning labview and I want to know if I could duplicate this. I would really want to know what it takes to do this. What do you have to buy as far as laview hardware? Can you leed me in the right direction?
There are student copies of LabVIEW that are very affordable. You can find info about that here: http://www.ni.com/labviewse/
As far as the hardware, keep in mind that I was able to refurbish a non-functional unit, and this is a perk of working for NI. The hardware I used was traditional fieldpoint RT system with a relay module.
Here are the two main components from NI:
Fieldpoint Controller - http://sine.ni.com/nips/cds/view/p/lang/en/nid/12202
FP Relay Module - http://sine.ni.com/nips/cds/view/p/lang/en/nid/10659
Other components I used:
Orbit Sprinkler Valves - http://www.orbitonline.com/products/Valves/02/16/07/1826/
Wireless Router/Access point - http://www.encore-usa.com/product_item.php?region=us&bid=2&pgid=4&pid=103
Thanks for your post
Hey, I was thinking, if you are a student it might be cool to setup a similar system using LabVIEW FPGA and the academic Spartan Board from Xilinx. You can get one $150 and it is a full-blown LabVIEW FPGA target. Here is more information: http://digital.ni.com/express.nsf/bycode/spartan3e?opendocument&lang=en&node=seminar_US
Nice Job!
I would like to note that reason for anti-siphon valves is not to prevent leaks from the water source out the sprinker (the non-energized valve does that). The anti-siphon feature is a sanitation safety feature. It keeps untreated ground water from migrating backward from the sprinkler into the house plumbing in the event that the main water pressure is lost. If for example the main shutoff valve for the home has been closed and the sprinkler system opens a valve, the anti-siphon blocks the ground water from back-feeding into the house pipes. This is a code requirement in many locations.
Thanks I will update the writeup.
A very cool presentation...kudos to Rick for taking time to flesh this out. I wish NI would sponsor more of these DIY projects.
Getting used, obsolete but functional equipment into the hands of LV developers free or cheap would spur additional creativity and innovation in garages and basements across the country. It would be a win/win for NI, the developers, and our faltering economy.
I'd like to see a reply from NI management on this....
Thanks!
Ted Anderson
(please pardon the John Dvorak text style 😃
Geek !
What sorts of things were you thinking of for the rest of your home automation?
The thermostat would be another simple, weather- and vacation- related task.
How about non-contact thermometers on the oven hood (pointing down on the burners) to have a PID control for your stovetop?
I am looking at lighting first, and I also have some ideas about a thermostat. I would like to replace my programmable one with some I/O from the sprinkler system System.
One thing I was able to do recently is put the garage door through one of the relays on the Fieldpoint so that it can be raised and lowered automatically or manually over the network. I will keep this group updated on work that I do that can benefit the community.
Have you thought about auto filling the bath to a required temp and depth (maybe from your phone)? - just b4 u drive home, text for the bath to be ready when you get home.
I keep wondering about doing it, but the cost of the NI control H/W is prohibitive for the average joe like me.
I'm currently an aspiring systems engineer (senior in college) and this article is super cool.
It would be really awesome if it could check with weather.com, to determine if it should turn on the sprinklers that day. I know you mentioned it but that was my first thought when reading this.