[OBSOLETE] Smart Sprinkler System

Hi @srschaecher,

I have posted a 24 zone sprinkler controller project on my github account. You can wire up hardware with 16 relays and use the 24 zone code as it is straight forward to modify the code back to 16 zones.

The code is in my master branch. I have it running successfully on a prototype in my house. So far it all looks good. I have not updated the instructions yet, however, I plan to do so over the weekend.

@srschaecher,

I forgot to mention, you need to buy the Arduino MEGA in order to have enough pins.

For those interested in building your own sprinkler system, we have released v3 of our Smarter Lawn irrigation controller.

####Some of the highlights in this release:

  • Code and instructions to build a 24 zone irrigation system
  • Just in time for winter! The Device-Type can now over-ride the irrigation schedule and put it on “Pause” during winter months. We included other over-rides as well. “Skip 1X” will skip a watering. “Expedite” will over-ride a rain delay or other delays and water anyway.
  • Ability to decide which “rain” should be included in your virtual rain gauge. For example, you may want the rain gauge to only measure actual precip and not include the forecasted precip.

Note: if you are upgrading an existing system, you should not have to upgrade your Arduino code, just the device-type and smart app.

Note: in our previous release, there was an optional scheduler accessory app which is no longer supported. The features are now built into the device type.

Enjoy!

1 Like

Thanks a lot for the hard work and willingness to post this here!

I have just spent the afternoon getting the latest version up and running for an 8-zone controller. Even though I develop Windows embedded software for a living, I have not done anything with Arduino before, so it was nice to play with something new.

So far I have the system up and running on my desk. Everything seems to be working.

A couple of observations:

  • I had to remove the huge comment block at the beginning of the .ino file. I kept getting a stack overflow error when compiling. This went away when I removed the comments.

  • When I set up the zone times in the irrigation scheduler app, the values don’t transfer to the device zone times. This confused me initially because from the device perspective, the zone times were undefined, so the relays were not switching on when I tried to test it from the device. When I added the zone times to the device, I was able to start “irrigating” from the device. This may be my confusion between what’s stored where. I guess you need to set the zones times in both the app and device if you want to run manually from the device?

  • The device state seems to require a refresh most of the time to show the state of the Arduino / shield. I most often see the zones off, then after a refresh the zones will show correctly. And for some or other reason, the zone 8 state is even more different. E.g. I’ll hit refresh, all zones will show correctly,and then zone 8 will revert to off, even though it should be queued or on. It’s almost as if there’s a timing issue that overrides zone 8.

  • I like the push notification when watering starts!

  • Has anyone thought to wire toggle switches in parallel with the relays to facilitate manual override for maintenance work? I saw the minimote posts above, but seems to be a bit of a waste to have another thing to lose that will be used a couple of times a season. I guess it would also be possible to modify the Arduino sketch to have a push button start zone 1 / advance each zone until the last one.

  • When I remove power and re-power the Arduino, the ThingShield light is off. It turns orange if I then start a zone and then blue when the zone turns off. It then seems to stay blue. Is that expected behavior?

I am very impressed with the possibilities, and this will be our sprinkler controller come spring. Last year when we were on vacation and had our sprinkler system turned off due to lots of rain just before, I was able to see our lawn dry out on the ip camera, without being able to do anything about it. This year will be different!

Thanks again for sharing the project!

Hi Dan999,

Glad to hear you finished your first Arduino project and the sprinkler system is up and running. Your observations provide some documentation for others building the project.

A couple quick comments to your questions:

  1. I have no problem compiling even with the comments included. This is the first time I have heard about an issue with the embedded code comments.
  2. Yes, the zone times in the device type are independent from the scheduler app. I run several scheduler apps each with different times.
  3. I have not noticed the zone 8 issue and do not have an immediate suggestion.
  4. The toggle is a good idea and on our backlog, if we ever get some time.
  5. As you observed, after cycling the power, the LED will not re-light until a command is sent to the ThingShield. I don’t know why that happens. Otherwise, its orange when any zone is running and blue when all zones are off.
1 Like

I noticed this on a knockoff Arduino I got from eBay that has surface mount chip (using for cost sake). My real Arduino did not have this issue. Maybe the boot-loader on the knockoff??

I am also seeing this, I cannot recall if I seen this with the real Arduino board of if it is just on my low-cost alternative. I am only using 6 zones now and have not prioritized it.

Now that I see someone else is seeing similar ticks, I will try to see if this is happening on multiple Arduino cards.

@d8adrvn STAN, Thank you for ALL the hard work you have done on this project. it is SUPER!

I don’t think I have a knock-off, but I can’t be sure. It came in a little box that looked official, with the sheet of stickers and a “Thank you for supporting Arduino” pamphlet. It also has the black and gold “501K” component that is supposedly a good indicator of a real one.

I can get the compiler to take the header if I add a “/” at the end of line 40 to end the the first section of the comment, and then add a new “/*” on the line below. I am also running this on a very old computer (I bought it from a CompUSA store if that tells you something) running Vista. Not sure if that has anything to do with it. Is the bootloader involved when you just verify the code?

I also found that the main processor wasn’t fully pushed into the socket. I pushed it in all the way, and it looks like the status is slightly better in the phone app.

Couldn’t agree more!

I looked at the SmartApp a bit and zone 8 is different in that it seems to optionally control a pump. That may explain why the behavior is different for that zone. I’ll look into it some more at some point.

FYI some guy has the rachio controller and the parrot flower powers talking with smartthings. Looks interesting. Check out the Suggest a Device thread

I would like to start by saying AWESOME work @d8adrvn and @mattn, and others who have contributed to the creation of this project.

I was wondering how hard it would be to put a wifi receiver in the Adruino main unit, and then build a Moisture/ water sensor, with a wifi transmitter, to connect to it.

You can use something like the following, but add a wifi transmitter. I suggest wifi due to the distance, and it might be easier than adding the same with Zwave or Zigbee.

You can place these sensors in various areas of your lawn, look up how much moisture your lawn needs, and then only have the ST water your lawn, per zone, based upon the moister need.

Since I don’t code this stuff at present time, I am not sure how hard it would be to do. Maybe we can borrow some of the code that @pepbill discovered, and add it into what has been produced.

@Lupismaximus

Thanks for the shoutout! The ability to pull in hyper local weather goes a long way to optimizing your lawn. Adding in some moisture sensors could help optimize irrigation + rainfall and help further fine tune based on soil type, cultivation, shading, etc… To fine tune the irrigation, you still have to make a lot of assumptions, for example that water is evenly laid down within one or more zones, depending on the density of sensors.

With respect to wireless signals, Zigbee actually has several advantages to WiFi. Its much more efficient with power and the self-meshing protocol allows sensors to form their own network and work across a larger distance than Wifi.

In any case, I appreciate your enthusiasm for adding moisture sensors. There are couple smart ways this could be implemented and something to think about as we get closer to spring.

Our personal weather station uploads to Weather Underground. If you replace the zip code with your weather station id, E.g. “pws:YOUR_STATION_ID” in the schedule app preferences, the sprinkler scheduler code should pull data from your actual weather station. It’s not quite as granular as measuring the soil moisture, but it’s a lot more local than your zip code.

How are you doing your rain delay and how is that sensor and what kind of sensor are you using to bring into the system and how is the app/irrigation scheduler seeing it?

Anyone think about and tried to put a TFT Touch LCD screen on the outside of the cabinet to be able to access the settings locally?

Hi @zuperman4ever,

The rain delay is based on a “virtual rain gauge”. When an irrigation is scheduled to run, the SmartApp checks WeatherUnderground for yesterday’s precipitation, today’s precipitation and any remaining forecasted precipitation for that day. It adds them all together (or you can select which ones to add) and checks against a threshold. If the rain in the virtual gauge exceeds the threshold, the scheduled watering is skipped.

The “sensor” is actually the local weather as found on WeatherUnderground. WeatherUnderground has thousands of crowd sourced weather stations. In my case, there is one just a mile down the road. You can enter a zipped and let WeatherUnderground assign the nearest weather station or as @dan999 points out, you can select a weather station yourself with just a slight code modification.

So there is no way to use the water and humidity sensor and have that attached to the arduino and programmed in with the sprinkler system?

@zuperman4ever

Using an existing moisture sensor is an idea I am exploring. A key to the moisture sensor is a small footprint and excellent battery life. The SmartThing Moisture sensor and to some extent the FortrezZ offer these characteristics. As it turns out, both work as “on/off” switches vs moisture meters. As is, neither has a significant enough “probe” to provide good ground contact. I am exploring adding probe extensions as well as modules that adjust sensitivity. Its been pretty straight forward to make a working soil moisture sensor (on/off), however, I am still not sure how long the batter will last and trying to understand how finicky the meter will be.

Keep in mind, that if you go the sensor route, you will need sensors ($$) for each zone that has a different soil/shade/vegetation profile. Given the precision of a lawn irrigation system (lack thereof) and the variability that likely exists in your yard, the virtual rain gauge is still probably good enough, and a lot cheaper. The best use cases are likely in plantings or pots with drip irrigation and gardens.

I have attached a picture of the prototype that uses a SmartThings Temperature and Moisture Sensor, a soil probe and an adjustable potentiometer. Looking at PlantLink as a straight of the box solution as well. I will share any progress and certainly interested if others have ideas.

Well, what about the arduino water/rain sensor? I am not really that interested in the moisture, more so the water sensor if it rains.

@zuperman4ever,

Now I better understand your question. The advantage of the virtual rain gauge vs a “rain sensor” is the virtual rain gauge threshold can be set and it can include forecasted weather. A rain gauge does not have a threshold (even a little rain will turn off your sprinkler) and it only works when its raining. WeatherUnderground has 100,000+ weather stations across the US and should provide good coverage. Have you checked to see how close you are to a station? If you are ex-US or somehow a long ways away from a weather underground station, I can understand the need. I can add the item to my backlog and see if its straight forward to add in my next release.

I also heard that SmartThings may be integrating WeatherBug. If so, I was going to look at the advantages of that service vs WeatherUnderground.

I understand and see how that helps in regards to the weather station but I was just seeing to have the option to select either or and also to have at my house and not somewhere away from my house that may or may not get water. There are many times that it says it will rain and has shown it has rained but in all reality it did not rain at my house.