[OBSOLETE] Smart Sprinkler System

Absolutely! I wish I had the coding skills to work on it myself, as I’m sure you guys are busy. I’d be happy to run it through whatever paces you’d like, if you decide to pursue it. I’ve got very different watering needs in my yards, so it’ll definitely get a work out!

@mattn, sounds like we are being tempted into adding more features :wink:

If you remember a couple years ago, we had talked about adding in an evapotranspiration model. The addition of an evapotranspiration model would be interesting although difficult to be accurate. For example, radiation intensity is typically an important factor and will be challenging to implement for shaded yards. The more simplified concept that @Rigging65 is suggesting may be rough but simple alternative. We already use the weather (rain) to stop an irrigation, why not use weather to enable an extra irrigation. Maybe we’ll have to look at this.

Forgive my ignorance, and I’m sure it’s much more complicated than this, but it seems as though if the user created ranges of temperature, just for example, every 10 degrees, then associated different sprinkler timing programs with each of these ranges, would in not just then be an issue of collecting the expected high temp for the irrigation day and comparing that temp to the ranges that had been established?

I wasn’t thinking so much of true algorithmic computations to figure watering times, just comparison based logic. Truly, the user has a better idea of how much water they need, based off daytime temp, sun hours, humidity, soil construct, etc (or at least you would think they do). Trying to take too many variables into the equation seems like it’s just an over complication. Let the user figure out the ranges, cycle times and number of events to occur each day based on their need. The app just needs to provide a framework for those numbers to fit in. No?

@d8adrvnm I was thinking of our conversation and had the same thought you did. This is much simpler, even if rough, solution to the more complicated evapotranspiration algorithm that we talked about. We would need to do a Kickstarter campaign to fund the implementation of the evapotranspiration algorithm. :wink:

@Rigging65 I think we are on the same page as far as the user needing to adjust according to their soil type and understanding of their watering needs. The app would just make adjustments to watering times based on daily temps, correct?

Another simple option would be to integrate the timer app with a moisture sensor device (like Eve). That would take the guesswork out of how much water is needed or when we should water or skip watering. @d8adrvn and I talked about this as well, but adding sensors could get expensive. I’m thinking about doing it this summer.

In my head, the app would adjust both duration and frequency of watering for each temp range. I’m not sure if it would be easier to hard code, say, 4 watering times (frequency) a day as a max, or if it could be made adjustable for as many times as the user wants.

I think of my use case:
During the Spring, our temps fluctuate from the 40s at night up into a very nice 70/80, with some (albeit infrequent) rain. - I’d like to vary my watering, once a day, prob 4 days a week, for between 5-8 minute per circuit. Ideally, if the temps are going to sit in the 60s, it’s closer to 5 min…in the high 70s it’s closer to 8. With a rain delay, of course. (Prob two temp ranges here)

Once the night temps start to come up (leaning into summer), we start seeing consistent daytime temps in the 80s ramping into the 100s at times. - I’d like to water every day, one or two times a day (depending on temp) for something like 10-12 minutes each time. We get no summer rain…ever… So I’d probably put a break point at about 95* where I’d step over into twice-a-day watering, but any given summer week can be in the low 90s’ so I’d like it to drop back to once a day. (Prob another two temp ranges here)

Fall is dry around here, and stays warm for a while before the night temps drop off and the day temps drop I into the 70s again, so I’d be back closer to my spring temp schedule. (Same two as Spring)

Winter is generally cool (50s or lower) but I still need to water because some years (like the past 12 or so) we’ve been in a drought, but I can get by with watering 2-3 times a week, 2-4 minutes each time…with a rain delay, of course. (Prob one temp range here)

So, I see it as USER DEFINED TEMP RANGE -> WATER TIMES PER DAY -> WATER TIME (DURATION) PER ZONE, then check for exceptions.

That works out to minimum of 4-5 definable temp range ‘slots’, although the type-A in my would love to see maybe as many as 10-12 slots. It’d be cool if you could user define the rain delay for each slot as well. I fill my chicken’s water dispenser using one of my circuits, so I’d just assume have no rain delay on the zone. When it’s cold and rainy, I’d still like that zone to run every other day for 1 minute…

The more I think about it, really what we’re talking about it running multiple instances of the app you guys already wrote, using a temp range as a confine to activate the app. Is it possible to simply compartmentalise what you’ve written as a sub-routine, then multiply it out for each temp range? That is, gathering the expected high temp for the next day and using it to select a user defined temp range is the primary routine, which then triggers any of a number of user defined subroutine ‘slots’. Does this make any sense at all? Or am I talking in circles…

@Rigging65,

Thanks for the additional explanation on these great use cases. Your final paragraph is very close to what I was thinking. It will be very simple to code in a weather threshold within the Irrigation Smart App. Lets say, only run this app if the weather is hot, sunny, dry and windy; otherwise skip. We can allow users to set the threshold for the app to trigger, for example at what temperature. Note: the irrigation doesn’t have to coincide with the temp. For example, a user could set up the app to run a second water at 6:00pm if the temp exceeded 90 at any point during the day. For the Type-A users, they can create as many instances of the Smart app, each being enabled only if the temp reached a certain max during the day.

This would not cover the use case of lets say, run 2x as long if the weather is above a certain temp. I will think about that use case as well.

Like I said, the first use case would be simple to implement. I will get with Matt and see if one of us can tackle it. I would have time in a few weeks. Right now I am slammed with my day job :slightly_smiling:

This sounds really cool. Living in New Mexico, Albuquerque, I really only have a use for my irrigation during part of the year. However the ranges of temps we deal with swing a lot and using this on a drip system, and a small lawn that takes me 10 minutes to cut, make things even more interesting. I would be willing to be a beta tester but only when the irrigation system is needed in a few months. Although I am a coder at heart I have never really got into coding with this yet due to time. I may start looking at your code and see if I can help into the implementation. I really appreciate that you put this together and disagree with going out and buying something off the shelf to use. Yea the cost is getting cheaper and cheaper but to be able to edit coding without waiting for system updates from a manufacturer makes this system more robust and takes all the fun out of it.

@d8adrvn @Matt_Nichols I am back :), spend last week getting my irrigation controller going using Arduino Uno, Smartshield and Sain 8-relay board. I also added a power supply that is using 24VAC input to convert to 12V for Arduino, hence I do not have to run another adapter from outside. I used the rest of the components as suggested by you. Wanted to share my feedback for those who are interested and I strongly suggest this solution over all others as there are a lot of great features this product has and willingness by great people like you to improve. I can always participate and provide help / recommendation on hardware side as well as help testing new features.

  • Please follow the procedure as detailed by Stan and Matt in the readme. I have used Arduino Uno as I have only 8 zones, Smartshield and Sainsmart Mechanical relay board (Please note that I ordered solid state relay board first, but that dint’e work with this code and I had to return it).

  • Instead of using 9V Arduino power supply, you can use [24VAC to 12VDC Converter] as in this link and as shown in the picture taken from my panel. The black power converter has input coming from the the 24VAC irrigation power unit, run wires parallel to your relay board and common. This will save you from the need to have additional adapter wire running into the box. It is just neater.

  • Please see the AC voltages before and after turning on the sprinklers. The range is approx 26-27VAC which is good for this adapter to output regulated 12V to drive Arduino. It’s input range is 24-36VAC, output is 12V regulated.

The overall setup was very easy with clear instructions on the github readme. The only issue I have now is that the Irrigation Scheduler Smartapp as suggested by @Stan is not working or scheduling after setup, not sure what is going on here. I installed and published the app. I am able to enter all details like days, skip, and timing etc., but the sprinkler system doesn’t turn on at scheduled time. I can manually schedule the sprinkler system fine but the automated scheduling doesn’t work. Any suggestions ???



2 Likes

@sahabjee Thanks for the info! I’m going to try adding the converter and one power source. Sorry to hear your scheduler isn’t working. I’m still running on an old version of the scheduler. I’m setting up another controller and I’m going to try it with the new device type and scheduler code. I’ll let you what I find.

Have you looked at the ST logs to see if the timer events are firing? Or being scheduled? We have seen Smart Things fail to fire scheduled events before. You might try adding some debug logging to the scheduler to see if you can pinpoint the issue. Let us know if you need assistance with that.

@Mark262 sorry. Looks like your question got buried. Did you figure out the wiring? Here is a picture of my setup.

The thick black wires with orange wire nuts are the 24VAC power source. One is wired to the center (common) post on the right relay and daisy gained across all used relays’ common posts. The other is connected to the neutral (usually white) from my valve box. The individual valve wires are connected to the normally open (NO) terminal on their respective relays.

An easy way to test it without constantly going to your valve box is to put a multimeter, set to AC Volts, with one end on the normally open terminal on one relay and the other on the common terminal on any relay. From the ST app, turn that valve on. Make sure that you get voltage (about 24volts) ONLY when the relay is on and lit. If you have voltage at any other time, then your wiring is wrong. Search comments above. I think @d8adrvn has given a pretty good explanation of the relay setup.

Post a picture of your wiring if you are still having trouble.

Issue resolved, had left a field blank “water every”. Since I had selected the watering days so i initially thought that this will skip the watering days. After setting the value at 1, everything kicked off as per plan … You should try the power supply converter 24vac to 12vdc that I mentioned in my post , will save you running another adapter running a cable inside the box. I am glad seeing the operation, will add any new features that you might add, the current features are more than enough, at least in my case. Thanks a lot again.

@sahabjee I’ve done the same thing with the schedule app! Unfortunately, there isn’t a really good way to validate input. Glad to hear you got it working. I have ordered a converter. I wanted to do that from the beginning, but never took the time to figure out what I needed to get.

Thanks for sharing!

@sahabjee,

Glad you have it working. We can set a default value for this preference and that should prevent others from having the issue in the future. I’ll add an update to the main branch this weekend.

@mattn @d8adrvn It looks like some great work has gone into this sprinkler system. Thanks for the hard work. Do you guys have any experience or know if it would be possible to use an Xbee module in place of the SmartThings Shield? Just curious if anyone has looked into it. I’m sure the SmartThings Shield probably simplifies hooking into the SmartThings system, but the Xbee would be more widely compatible and could reduce costs.

@erocm1231: we get lots of questions like this. :smile: Unfortunately the answer almost always starts with, “yes, but…”

Here goes… :smile:

Is it possible? Yes, but I’m not sure how much of the work we have done would be reusable. I suppose the Arduino sketch could be used with some modifications. But the scheduler, which is a significant part of our solution, is built for SmartThings and is not built into the Arduino sketch.

What system would you be interested in tying it into? Do you know if you could build the scheduler in that ecosystem?

Trying to figure out where you go to get the rain data. Can you point me into the right direction.

@mattn Thanks for the pic. I did figure out the wiring.

I have yet to get the scheduling portion to work. I have it published, but I don’t see it in my app. I haven’t had time to try to figure it out yet. But will over the next couple of weeks. I’ve got a little time before the Texas heat comes.

Thanks for all!

This is AWESOME! I was looking to upgrade my manual valve irrigation system to something automatic. This is cost effective and looks like a fun project!

1 Like

The rain data comes from Weather Underground. Simply provide the zip code (where your irrigation system resides) and the scheduler app will skip watering if it has rained or will rain soon.

[[edited]]