Skip to content

Releases: d8adrvn/smart_sprinkler

Smart Sprinkler

23 May 03:21
Compare
Choose a tag to compare

Hello, Smarter Lawn

A project by Stan Dotson ([email protected]) and Matthew Nichols ([email protected])

Background

Why would you buy a lawn sprinkler system controller when you can just build one? And the one you build will have even more cool features!! Let’s start by first making the your sprinkler system connected to the cloud. And of course, we will need iPhone controls. Then we need to make it smart. Smart like it knows when it has rained, is raining or will rain! Smart like it can run a second watering when it gets really hot! And then of course you will want voice recognition so that you can say "Alexa, turn on my sprinkler". Now that would be really smart!!!

Description

This project contains code and instructions for how we built irrigation controllers that work with SmartThings. You can control your lawn irrigation directly from your smartphone via the SmartThings app. Also, you can set up as many schedules as you like to precisely control your lawn irrigation. Hyperlocal weather forecasts make sure you save water when it rains!!!

###Project Features

  • Build your own irrigation controller for SmartThings
  • Flexibility to manage 1-24 irrigation zones
  • Directly control from your iPhone
  • Create one or more schedules to automatically run the irrigation system
  • Easily over-ride the schedule
  • Two options to control a master relay or pump
  • A virtual rain guage that uses local weather stations to measure recent and forecasted rain and skip irrigation when rain exceeds a threshhold
  • A virtual temperature guage gives you flexibility to set minimum temperature thresholds to initiate an irrigation
  • Voice controls via the SmartThings integration with Alexa (Amazon Echo)
  • Easty to follow documentation

###There are three subprojects:

  • 8 Zone Irrigation Controller
  • 16 Zone Irrigation Controller
  • 24 Zone Irrigation Controller

###Each project inlcudes:

  • Arduino sketch which transforms an Arduino and associated relays into an irrigation controller
  • Smart Device Type code to connect your Arduino irrigation controller to the SmartThings Physical Graph
  • README with all the step by step detail to build either project

###A SmartApp works for all three projects

  • Smart App allows you to schedule your irrigation and integrate hyperlocal weather forecasts
  • You can install the smart app multiple times to give you nearly unlimited schedules

Enjoy,
Stan and Matt

Smarter Lawn Sprinkler System - Choice of 8, 16 or 24 Zone Systems

20 Sep 03:23
Compare
Choose a tag to compare

Hello, Smarter Lawn

A project by Stan Dotson ([email protected]) and Matthew Nichols ([email protected])

Background

Why would you build a lawn sprinkler system controller when you can just buy one? But you can’t just buy one... at least not the sprinkler system we were thinking about!! Let’s start by first making the controller connected. And of course, we will need iPhone controls. Then we need to make it smart. Smart like it knows when it has rained, is raining or will rain! And then what if we could add cognition so that it actually learns how to water your lawn! Not that would be really smart!!!

Description

This project contains code and instructions for how we built irrigation controllers that work with SmartThings. You can control your lawn irrigation directly from your smartphone via the SmartThings app. Also, you can set up as many schedules as you like to precisely control your lawn irrigation. Hyperlocal weather forecasts make sure you save water when it rains!!!

###Project Features

  • Build your own irrigation controller for SmartThings
  • Flexibility to manage 1-24 irrigation zones
  • Directly control from your iPhone
  • Create one or more schedules to automatically run the irrigation system
  • Easily over-ride the schedule
  • Two options to control a master relay or pump
  • A virtual rain guage that uses local weather stations to measure recent and forecasted rain and skip irrigation when rain exceeds a threshhold
  • Easty to follow documentation

###There are three subprojects:

  • 8 Zone Irrigation Controller
  • 16 Zone Irrigation Controller
  • 24 Zone Irrigation Controller

###Each project inlcudes:

  • Arduino sketch which transforms an Arduino and associated relays into an irrigation controller
  • Smart Device Type code to connect your Arduino irrigation controller to the SmartThings Physical Graph
  • README with all the step by step detail to build either project

###A SmartApp works for all three projects

  • Smart App allows you to schedule your irrigation and integrate hyperlocal weather forecasts
  • You can install the smart app multiple times to give you nearly unlimited schedules

Enjoy,
Stan and Matt

Smarter Lawn Irrigation Controllers For SmartThings

19 Oct 01:18
Compare
Choose a tag to compare

This project provides code and instructions to build an 8 zone or 24 zone irrigation controller that works with the SmartThings physical graph. The irrigation controllers utilize an Arduino with relays board(s) to control your irrigation valves. An included Smart App uses hyper-local weather records and forecasts to help you save on your water bill!

This release contains lots of new features:

  • Code and instructions to build a 24 Zone Irrigation Controller!
  • The Smart Device-Type now includes a Schedule Over-ride tile that allows you to "Skip 1X" watering, "Expedite" your watering even if it rains or you had previously programed the schedule to alternate days, "Pause" the schedule, for example during yard renovations or during the winter months.
  • The Smart App now allows you to select which "rain" should be included in the virtual rain gauge

Smart Sprinkler

23 May 03:19
Compare
Choose a tag to compare

Hello, Smarter Lawn

A project by Stan Dotson ([email protected]) and Matthew Nichols ([email protected])

Background

Why would you buy a lawn sprinkler system controller when you can just build one? And the one you build will have even more cool features!! Let’s start by first making the your sprinkler system connected to the cloud. And of course, we will need iPhone controls. Then we need to make it smart. Smart like it knows when it has rained, is raining or will rain! Smart like it can run a second watering when it gets really hot! And then of course you will want voice recognition so that you can say "Alexa, turn on my sprinkler". Now that would be really smart!!!

Description

This project contains code and instructions for how we built irrigation controllers that work with SmartThings. You can control your lawn irrigation directly from your smartphone via the SmartThings app. Also, you can set up as many schedules as you like to precisely control your lawn irrigation. Hyperlocal weather forecasts make sure you save water when it rains!!!

###Project Features

  • Build your own irrigation controller for SmartThings
  • Flexibility to manage 1-24 irrigation zones
  • Directly control from your iPhone
  • Create one or more schedules to automatically run the irrigation system
  • Easily over-ride the schedule
  • Two options to control a master relay or pump
  • A virtual rain guage that uses local weather stations to measure recent and forecasted rain and skip irrigation when rain exceeds a threshhold
  • A virtual temperature guage gives you flexibility to set minimum temperature thresholds to initiate an irrigation
  • Voice controls via the SmartThings integration with Alexa (Amazon Echo)
  • Easty to follow documentation

###There are three subprojects:

  • 8 Zone Irrigation Controller
  • 16 Zone Irrigation Controller
  • 24 Zone Irrigation Controller

###Each project inlcudes:

  • Arduino sketch which transforms an Arduino and associated relays into an irrigation controller
  • Smart Device Type code to connect your Arduino irrigation controller to the SmartThings Physical Graph
  • README with all the step by step detail to build either project

###A SmartApp works for all three projects

  • Smart App allows you to schedule your irrigation and integrate hyperlocal weather forecasts
  • You can install the smart app multiple times to give you nearly unlimited schedules

Enjoy,
Stan and Matt

Smart Sprinkler v2

29 Jun 23:42
Compare
Choose a tag to compare

Hello, Smarter Lawn

A project by Stan Dotson ([email protected]) and Matthew Nichols ([email protected])

Background

Why would you build a lawn sprinkler system controller when you can just buy one? But you can’t just buy one... at least not the sprinkler system we were thinking about!! Let’s start by first making the controller connected. And of course, we will need iPhone controls. Then we need to make it smart. Smart like it knows when it has rained, is raining or will rain! And then what if we could add cognition so that it actually learns how to water your lawn! Not that would be really smart!!!

High Level Project Steps

  1. Order the hardware
  2. Add SmartThings hub to your home network, download app to your iPhone
  3. Obtain a Maker/Developer account for SmartThings (graph.api.smartthings.com)
  4. Assemble the Arduino controller, ThingShield and 8 Channel Relay.
  5. Download the Arduino developer environment and import the irrigation controller sketch as well as the required libraries for SmartThings and the Timer library.
  6. Add Arduino to your SmartThings hub using your iPhone app
  7. Go to graph.api.smartthings.com
    1. On My Device Types, create a new device type and paste in the device type code. Save & Publish
    2. On My SmartApps, create a new Smart App and paste in the smart app code. Save & Publish
  8. Go to My Devices, select the Arduino and edit the Device Type and select the Irrigation Controller device type (7.i.)
  9. Test out system
  10. Wire the Arduino to your irrigation system

You now have a smarter lawn!

The Hardware

All items from this project were easily obtained from Amazon and mostly available via Amazon Prime

An Arduino with SmartThing Shield

An *Arduino Uno was used as the controller and was stacked with the SmartThings ThingShield. Note, set the DIP switch to D2/D3 if not already.

8-Channel Relay

To control the sprinkler valves, we used a Sain Smart 8 channel relay.

Wiring

For the wiring, we ordered a 20 cm dupont cable male to female (Phantom YoYo 40P dupont cable 200mm male to female or similar from Amazon). We liked this cable since the wires are organized as a ribbon cable which keeps the project neat. We also used individual male to male jumper cables to wire the “COMMON” contacts together in parallel (see below). We found these at Amazon such as Male to Male Solderless Flexible Breadboard Jumper Cable Wires 65Pcs for Arduino by Sunkee.

Power Supplies

For a power supply to power up the relay and run the irrigation valves, we re-used the 24V power supply from our existing controller. We could have also used either a Rain Bird UT1 Sprinkler System Timer Electric Transformer Plug or the Orbit Sprinkler System Power Source Transformer 57040, both of which are available from Amazon Prime. We also needed a 9V power supply to run the Arduino+ThingShield+Relay. The Wall Adapter Power Supply - 9V DC 650mA Sold by Karnotech worked and is available on Amazon.

Project Housing

Finally, for the project housing, we just ripped out the guts of our existing controller and used the box to house our final project. Another option is the Arington EB0708 electronic equipment enclosure.

Wiring the Project

Wiring The Arduino Controller

  1. Stack the SmartThing ThingShield on top of the Arduino Uno.
  2. Connect a ground wire from the GND pin on ThingShield to the GND pin on the SainSmart 8 Channel relay.
  3. Connect another jumper wire from the +5V on the ThingShield to the VCC pin on the Relay.
  4. Make sure the jumper on the relay board bridges VCC to JD-VCC.
  5. Use 8 wires from your ribbon cable to connect pins 12-5 on ThingShield to pins 1 to 8 on the relay board.

1. Finally, using seven short jumper cable (male to male) we daisy chained the COMMON contact positions together across all 8 relays.

Note, the ThingShield pins are not labeled. So you can either identify the pins using labels on the Arduino or refer to a diagram. Here is a diagram for Arduino Uno V2 from Flikr: https://www.flickr.com/photos/28521811@N04/8520970405/

Wiring The Controller To The Irrigation System

The final wiring of the project to your irrigation system is straight forward. Irrigation sytems use a standard irrigation wire bundle which has multiple colored wires (one per valve + extras) and a white wire as a common ground. We connected “ground” wire from the 24V transformer to the common ground (white) wire in the irrigation wire bundle.

To connect the wires running to each valve, we used the Normally Open positions on the relay. Each colored wire for each valve was connected to one of the NO positions on a relay. One valve per relay. Up to 8 are possible with this hardware, however, you do not need to use all 8. We then connected the “hot” wire from the transformer to connect to the COMMON position (middle contact) on one of the relays. This provides power to all realys since they are daisy chained together (see Arduino wiring above)

The Software

The code for this project is in a few files which are posted on github:

https://github.com/d8adrvn/smart_sprinkler.git

Arduino Code

(ArduinoSmartShieldIrrigationController.ino):

In its most basic form, our controller manages a queue and turns on/off switches. That’s it. Nothing else. All other features are in the cloud!

Managing the queue only needs a few basic functions:

  1. Add or remove one or all irrigation zones to the queue
  2. Ensure only one zone is on at a time (need a traffic cop)
  3. Report out the status of the queue

The irrigation controller also has two basic protections

  1. Before turning on a zone, it requires knowing when to turn off, even if communication with the cloud is lost.
  2. If power goes out, the controller reverts to off

The code for the Arduino has the following features:

Creates a queue to turn on or off a specific zone or all zones

  • The queue holds the state for each zone: 0=off, 1=waiting, 2=on
  • A traffic cop feature ensures only one zone is running at once
  • Works with up to 8 zones, although you can use less
  • Allows zone times to be communicated as a string, which is parsed into an array
  • Once a zone is turned on, the Arduino knows when to turn it off (no additional communication needed)
  • Utilizes a timer function to run the zones. This keeps the CPU free to manage communication between Arduino and SmartThings while a zone is running
  • When wired correctly, the system turns off when power goes off and stays off until new commands are sent from SmartThings

To load the code onto the Arduino, you will need the Arduino developer environment:

http://arduino.cc/en/main/software

Once the software is installed, the first thing to do is obtain the required libraries.

  • Timer library was created by Simon Monk as modified by JChristensen https://github.com/JChristensen/Timer
    The KNOWN LIBRARY BUG (timer.cpp) - identified by mattnichols 5/20/14 - has no known affect on the code. Also, the Timer library release downloads as "Timer-master-2". Before loading into the Arduino IDE, change the name to "Timer"
  • SmartThings library available from https://www.dropbox.com/s/8hon320qmuio8fz/Shield%20Library.zip
  • SoftwareSerial library was default library provided with Arduino IDE

Once you have the zip files downloaded and you have changed the name for the Timer zip file, you can import them within the Arduino IDE. Go to the Sketch:Import Library;Add Library drop down menu. Once you have added the libraries, they will show up under Sketch:Add Library:Contributed as "Timer" and "SmartThings". Be sure the Timer library is installed as "Timer"

you can connect the Arduino Uno to your computer, create a new sketch, paste the code from github into the Arduino IDE and

Pairing instructions for the Arduino to the SmartThings hub can be found at SmartThings.com and are copied here:

“To join the shield to your SmartThings hub, go to “Add SmartThings” mode in the
SmartThings app by hitting the “+” icon in the desired location, and then press the Switch button on the shield. You should see the shield appear in the app.

To unpair the shield, press and hold the Switch button for 6 seconds and release. The shield will now be unpaired from your SmartThings Hub.”

Device Type Code

(IrrigationControllerDeviceType.groovy):

The device type code allows you to control the Arduino via the SmartThings physical graph. The Irrigation controller device type code has the following features:

The Ma...

Read more