Feed on

At times you may want a simple web-based interface to directly control each sprinkler valve, without having to set up a complex schedule. I’ve written the svc_simple_web program exactly for this purpose. To start, take a look at the web interface of this program:

Quite simple, isn’t it. The top line shows the current time; underneath it is the list of eight sprinkler stations. Clicking a button will turn on the corresponding station, and clicking the same button again will turn it off. To make it a bit more useful, you can set a timer (i.e. duration) for each station. The duration is specified by the number of hours following by minutes (hh:mm). Once a station is turned on, the program will keep track of the running time and stop that station when the duration time is reached. Meanwhile, the webpage will display the remaining watering time. You can set an individual time for each station, say 30 minutes for station 3, and 15 minutes for station 5. Setting the duration to 0:0 means there is no time limit: once on, the station will only be turned off when you manually click on ‘Turn it Off’. This way, you can either manually control the stations, or set a timer for it.

If you are interested, feel free to try this program and let me know your comments. The program can be downloaded on the following page:

OpenSprinkler Download Page

Note that the software is now released in GitHub for the purpose of better version control. The code will be regularly updated. You can sign up for the RSS feed on the GitHub update history page, in order to track the updates.

11 Responses to “OpenSprinkler Simple Web-based Control Program”

  1. Michael says:

    I downloaded the svc_simple_web and loaded it onto the 2 kits that I built. For my purposes this might actually be a better solution than the initial web app. I can now easily build a more sophisticated web site on another web server on my network and then have that web app turn on and off valves on my 2 controllers by placing calls to the svc_simpe_web app with the appropriate GET arguments. The benefit is that changes can easily be made to the web interface without having to reprogram the controllers.

    • ray says:

      Ah, that makes a lot of sense. With this option, you can do a lot more complex controls, not limited by the processing capability of the microcontroller.

  2. Martin says:

    Some countries (states/cities) regulate which days you can water depending on your house number. Odd house numbers get odd days, even house numbers get even days. Everyone may water on 31st.

    Using the GET command approach makes this easy to program via a PHP script that may also consider other conditions to make the judgement weather to start the sprinklers. In my projects I always provide a JSON feedback URL on the controller so the PHP scripts know all local parameters before making judgement and issuing commands.

    • ray says:

      Hi Marin, I haven’t used JSON myself, but I did a quick search and found a simple example in RESTduino. Seems like a simple and nice way to send information between microcontroller and host computer. Thanks for bringing it up.

  3. Tim says:

    I’ve been looking for a means to control my garden watering system from my computer for a long time and this looks like it may be my ideal solution if I can work out a couple details. I’m not an knowledgeable as I’d like to be with programming, but I have taught myself VB and VBA and I know what I want my interface to be like and how to do it with those tools. My missing link is to be able to send a command from a VB program to a device that turns the valves off and on. It sounds like opensprinkler running this simple program could be that solution from the other comments, but I don’t know if VB can issue these “GET” commands and if so, how to make that happen? Does anyone else know if this would work or how to do it?

    • ray says:

      Tim, http GET is basically in a form like this: ‘http://192.168.x.x/set?station=1&action=off’. In a word, it encodes a human-readable command to the link. It’s very standard and you can google about it.

      • Tim says:

        I guess it sounded harder than it actually was! Sounds easy and straightforward – looking forward to the latest version being available. Will it be possible to order the device with this “svc_simple_web” program pre-installed?

      • ray says:

        Yes, it’s possible. Just put it in the notes when you pay in paypal. Note that 1.2u has built-in USB programmer, so you can also re-flash it yourself.

  4. hvac mn says:

    It’s amazing for me to have a site, which is useful in favor of my know-how. thanks admin


  5. Novella says:

    Please, can you pm me and also tell me a few more thinks regarding this topic, I’m really a fan of your blog. Thank you so much, a wonderful job!

Leave a Reply