{"id":156,"date":"2011-03-27T19:10:25","date_gmt":"2011-03-28T03:10:25","guid":{"rendered":"http:\/\/dan.minear.name\/wordpress\/?p=156"},"modified":"2011-03-27T19:11:01","modified_gmt":"2011-03-28T03:11:01","slug":"automating-my-sprinklers","status":"publish","type":"post","link":"http:\/\/dan.minear.name\/wordpress\/?p=156","title":{"rendered":"Automating my sprinklers"},"content":{"rendered":"<p>I have been spending a few hours creating a sprinkler controller.\u00a0 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.\u00a0 So far, I have the <a href=\"http:\/\/mbed.org\/users\/dminear\/notebook\/making-a-sprinkler-controller-with-a-mbed\/\" target=\"_blank\">embedded controller <\/a>ready to interface to a <a href=\"http:\/\/www.facebook.com\/album.php?aid=281358&amp;id=842551251&amp;l=5439ef13fa\" target=\"_blank\">hacked sprinkler controller <\/a> .\u00a0 The controller just takes a simple command to water a zone for so many seconds.\u00a0 There is no higher level sequencing that is in place yet.\u00a0 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\u00a0 to put that logic in the Perl program, so that&#8217;s where I am now.<\/p>\n<p>I have been working on the <a href=\"http:\/\/www.scrappintwins.com\/sprinkler\/weather.html\" target=\"_blank\">Perl program<\/a> to figure out my watering algorithm.\u00a0 So far, I just make a request to a NOAA weather site for an airport\u00a0 about 2 miles from me. The document is slurped as XML data that XML::Simple throws into a hash.\u00a0 From there, I take the relative humidity and integrate the &#8220;dryness&#8221;,\u00a0 or 100 minus the humidity, for the given time span.\u00a0 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.\u00a0 In the future, this will spawn off a sequence of webservice requests to water the lawn.<\/p>\n<p>So far, we have been having some interesting weather.\u00a0 There have been off-and-on rain storms coming through, and this week is setting up for a rapid change into hotter weather.\u00a0 A weather description that matches &#8220;Rain&#8221; will cause a reset of the integration so the lawn is not watered.\u00a0 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.<\/p>\n<p>A side product of this project is to tie it to my <a href=\"http:\/\/www.scrappintwins.com\/dumpcam\/\" target=\"_blank\">Doggie Dumpcam<\/a>, which captures realtime image changes on my front lawn.\u00a0 The tree is growing bigger lately, which is creeping outside of the mask area and triggering a lot of image captures.\u00a0 Some <a href=\"http:\/\/www.scrappintwins.com\/camera\/\" target=\"_blank\">interesting things<\/a> have been captured, including dogs, birds, and hornets.\u00a0 This Perl program will have the capability to trigger a particular sprinkler zone between, say, the 6am and 8am hours for a small timespan.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I have been spending a few hours creating a sprinkler controller.\u00a0 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.\u00a0 So far, I have the embedded controller ready to interface to a hacked sprinkler &hellip; <\/p>\n<p class=\"link-more\"><a href=\"http:\/\/dan.minear.name\/wordpress\/?p=156\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Automating my sprinklers&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[12,13,21,3],"tags":[],"_links":{"self":[{"href":"http:\/\/dan.minear.name\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/156"}],"collection":[{"href":"http:\/\/dan.minear.name\/wordpress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/dan.minear.name\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/dan.minear.name\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/dan.minear.name\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=156"}],"version-history":[{"count":3,"href":"http:\/\/dan.minear.name\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/156\/revisions"}],"predecessor-version":[{"id":159,"href":"http:\/\/dan.minear.name\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/156\/revisions\/159"}],"wp:attachment":[{"href":"http:\/\/dan.minear.name\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=156"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/dan.minear.name\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=156"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/dan.minear.name\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=156"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}