I have been spending a few hours creating a sprinkler controller. The basic structure is to have a Perl program do the hard core logic, and then issue a webservice request to trigger the sprinkler controller on for a watering cycle. So far, I have the embedded controller ready to interface to a hacked sprinkler controller . The controller just takes a simple command to water a zone for so many seconds. There is no higher level sequencing that is in place yet. In reality, I probably need to send a sequence to the embedded controller so the power supply only powers one water solenoid at a time. The alternative is to put that logic in the Perl program, so that’s where I am now.
I have been working on the Perl program to figure out my watering algorithm. So far, I just make a request to a NOAA weather site for an airport about 2 miles from me. The document is slurped as XML data that XML::Simple throws into a hash. From there, I take the relative humidity and integrate the “dryness”, or 100 minus the humidity, for the given time span. I have decided to water my grass every 3 days as a ballpark until I see how things are working. The program just prints out a trigger message for now. In the future, this will spawn off a sequence of webservice requests to water the lawn.
So far, we have been having some interesting weather. There have been off-and-on rain storms coming through, and this week is setting up for a rapid change into hotter weather. A weather description that matches “Rain” will cause a reset of the integration so the lawn is not watered. The script logs some pertenant data to the end of the script so I can rerun a scenario in the future with real world data.
A side product of this project is to tie it to my Doggie Dumpcam, which captures realtime image changes on my front lawn. The tree is growing bigger lately, which is creeping outside of the mask area and triggering a lot of image captures. Some interesting things have been captured, including dogs, birds, and hornets. This Perl program will have the capability to trigger a particular sprinkler zone between, say, the 6am and 8am hours for a small timespan.