Jump to content
Sign in to follow this  
linuxha

Irrigation scheduling algorithm

Recommended Posts

I'm building a replacement sprinkler controller for an old unit which is difficult to use. My wife wants scheduling that the current unit doesn't support, every 4 days (for example). We've also seen drought conditions imposed (watering only on even day for even homes, etc.) so I need a decent algorithm that will still fit in the tiny space of a small micro-controller. For communication I'll be using a terminal server, then an XBee (multi-drop) and someday an Ethernet interface. Anyone have any pointers to code or white papers?

Share this post


Link to post
Share on other sites
I was thinking, how about two of RF2500T's, one inside and one outside. The one outside would be the main unit, the one inside could be used as a remote

I already have a set of thermostats that use the XBees so I'd like to use that existing interface on the server (my server is running Misterhouse). I do have a couple of ez430-RF2500s but I haven't started playing with them yet. Maybe I'll get a little time later for playing with them (too many things going on at once).

Share this post


Link to post
Share on other sites

Think about a processor that has an RTC inside of it already. That would make your work a lot easier.

 

It so happens that the dev board in this posting has an RTC on it and it's only $15 right now.

 

It also has two UARTs in it.

 

You could hook up your XBee to the UART and talk to the other XBees.

 

You could use the other UART to talk to a PC and have the PC do the scheduling. Or you could roll your own scheduler.

 

The MSP430FR5739 has 16K of FRAM storage so you have lots of program space for an irrigation controller.

 

For algorithms, I would mimic other low cost irrigation controllers on the market. Take a look at this list of manufacturers to see what's available.

 

I bet any money that gwdeveloper will be along at any time to educate us all on this topic. He's an irrigation expert.

Share this post


Link to post
Share on other sites
Think about a processor that has an RTC inside of it already. That would make your work a lot easier.

 

It so happens that the dev board in this posting has an RTC on it and it's only $15 right now.

 

It also has two UARTs in it.

 

You could hook up your XBee to the UART and talk to the other XBees.

 

You could use the other UART to talk to a PC and have the PC do the scheduling. Or you could roll your own scheduler.

 

The MSP430FR5739 has 16K of FRAM storage so you have lots of program space for an irrigation controller.

 

I need to roll my own scheduler, my wife want this thing to be able to stand alone in case there is a crash on the server. My test phase of the program will have the basic power, uart & soloenoid driver hardware and timers working (send an on & a time - run and turn off or maually turn off if given the command). At that point I'll work up the algorithm on the Linux server and then port it over to the micro-controller. I can write that in a number of languages (JS, Groovy, Perl, C, whatever) and get the logic working properly. The server will communicate via the terminal server or XBee at first.

 

I've already take a look at the Sprinkler controller manufacturers. Nothing really useful for building a cron like algorithm on a micro.

 

You've lost me on the F5529. I only see 1 UART but the ability to add the RF is pretty neat. I'll need to sit down and get Wireshark working then see if I can figure out how to make the RF2500 and the ZB XBees play nice (I also have the AVR ZB boards). Then I can grab one of thoise boards. Right now that isn't high on my (rather long) todo list.

Share this post


Link to post
Share on other sites

Expert? Thanks, Zeke.

 

Most to of the standard controllers are just using a basic 24hr period counter. You could, simply, set it to count full days and skip the necessary amount. You may want to consider skipping the scheduling algorithm altogether -go sensor based instead of time. Most drought-restricted areas do have some fine-print to the rules. Here in the Austin,TX area we've been under drought restrictions for quite some time -it's nasty dry here.

 

"Smart" controllers are the ticket as it's more important to keep a balanced moisture in the soil than to just water heavily once per week. If you can base your controller off of temperature, humidity and soil moisture sensors, you can bypass drought restrictions. Most commonly, the upper-end controllers use regional EvapoTranspiration. In Central, TX, our regional ET can be found two ways: 1) Broadcast over the powerlines (unsure of the protocol but requires special controllers to read the signal) 2) Download the charts from Texas A&M and manually set the controller times accordingly. http://texaset.tamu.edu/etinfo.php

http://en.wikipedia.org/wiki/Evapotranspiration

http://irrigation.tamu.edu/

 

Hunter Industries and Rainbird both have really nice equipment to monitor ET. However, the consumer controllers at the big-box stores don't have these functions. You'll need to go to a landscape/irrigation supply house and unfortunately (at least here in TX) you need to have a license to buy there.

http://www.hunterindustries.com/products/controllers/XCore.html

http://www.rainbird.com/landscape/products/controllers/ESP-SMT.htm

 

My plan for my Greenhouse and Garden controller is to have localized sensors to collect real-time data from conditions, not just predicted or based on history (A&M's charts are based on 30 year data). The sensors are based on RF2500Ts, with analog humidity, temperature, light frequency and simple moisture sensors. Eventually, I'm going to add pH and EC as well. My lot will have 8 sensors located around the yard. Even the most advance controllers from Hunter only allow 1 sensor and it is limited.

 

If you can, do a little Xeriscaping to avoid watering. Most HOAs will allow for this now, just need to ask the right people. My lot has at least 17 native grasses and 20 or so types of wildflowers. The native species are much more drought tolerant than the 'pretty' green waste of valuable soil. We don't water the grass, only trees, fruit vines and veggie gardens. (And man, my Roast Corn Yard Salsa is some super yummy stuff http://www.roundrockfunnyfarm.com/2011/06/salsa-bread-and-crackers.html)

 

And on a funny note, drought restrictions are a funny, funny thing. We're conserving water but the City of Austin lost revenue and wants to tax people for conserving or lift the restrictions. And even funnier... drought restrictions only apply to automatic sprinkler systems, you can hand water any time for any length of time. It makes me laugh to see people watering their grass at 3pm in 102^ heat and the water is steaming as it hits the ground. They wonder why the grass is brown the next day... they steam cooked it. :o

Share this post


Link to post
Share on other sites
Very good explanation, although I only have a window box. :mrgreen:

 

Hmm, I think you should consider upgrading to a Linux box, it has none of the restrictions and and fits nicely into a smaller space (yes, that's a joke).

Share this post


Link to post
Share on other sites

Zeke, thanks for the information/links. My wife and I are thinking about burying soaker hoses into parts of the garden. I'll have to take a look at the Evapotranspiration and other links you have. I hope to be building out the 'farm' soon (I still have to dig out the rocks the previous owner used to cover that section). I might also try to convince my wife to provide space for some blueberry bushes (they grow very well here in NJ).

 

You bring up some good points with the sensors. On that point I may take the kiss method and turn the controller into a simple timer system and allow my central HA box (Misterhouse - MH) to override it depending on the external sensors. That way if MH crashes the sprinkler system will still run in a backup mode. I'll also keep my wife happy with the keypad/LCD interface (I'll have a javascript version soon) and make the programming more flexible and useful. Let's face it MH can deal with complex information much better than a uC (micro-controller).

 

On the inappropriate water issue, I'm always surprised when I see people watering in the middle of the day. The way it was explained to me was that a drop of water is like a magnified glass. The sun hits it and can burn whatever the light concentrates on. The issue of 102 and steam bring the issue into a new light. ;-)

Share this post


Link to post
Share on other sites

Okay, I've seemed to have caused a great deal of confusion. My thoughts were on working on the scheduling algorithm. So I could have something like cron but for a uC. I'm still interested in that but I must say that my thoughts of the overall system have gone in another direction.

 

I know I need an RTC. I haven't quite decided on a 32k xtal or an external RTC chip. At the moment I'm going with the xtal. I'm not too worried about the accuracy as I can reset the time via the Linux system every once in a while to correct for drift. My concerns were for formats of the time storage to support complex rules. I'm still working on that. I'd like to fit the program into 8k flash and 256b ram, I also have 256 byte of flash to store events in. I need to think this through but I think it will work. Of course I may need to jump up to a chip with more ram.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...