First of all thanks to @d8adrvn, It is amazing that someone would go thru all this trouble and share their awesome work with all of us. I will start by saying that I am a long time ST user but a newbie when it comes to the Arduino. That said I had a horrible time getting this smart irrigation system up and running partly because the readme file specified actions that are different, perhaps newer because of newer versions of the Arduino software and also because it mentions things in general terms and being the first time on Arduino anything made it a little confusing to me. So I don’t even know if I am out of place or not but I figured I post some of my experience and hopefully it help another newbie like me.
This is not a step by step, just a list of things that confused me and how I dealt with them.
FYI- I setup the 8 zone version - based on the Readme.md file.
Steps 1 – 4, are perfect no issues with the hardware. Note: In “power supplies” I ended up using a 12v power supply for the Arduino Uno my understanding is that it works fine with 9-12v and even up to 20v but that is not recommended. Someone correct if wrong.
Step 5 – “Arduino Code”
From the developers link https://github.com/d8adrvn/smart_sprinkler.git I just downloaded the zip file by clicking on the Download Zip link near the top right. Once downloaded extract the file if it did not do it automatically. Now this file contains the code for all versions 8,16 and 24 zones. You will just go to the corresponding folder to get the correct code for your project.
Note that the readme file states that the ino file is called (ArduinoSmartShieldIrrigationController.ino) it is not, when you download the zip file it is named differently, In my case it was (Arduino_8_Zone_Irrigation_Contoller.ino).
This is the file that you will load onto the Arduino using the Arduino IDE.
The zip file also contained the file Device_Type_8_Zone_Irrigation_Controller.groovy this file is used to assign the device type using the ST IDE, and in the root of the zip file is IrrigationSchedulerApp.groovy this file is used to setup the scheduler app on your Smartphone via the ST IDE.
The Arduino IDE Software
Ok now head on over to http://www.arduino.cc/en/main/software and download the Arduino IDE Software. My version was 1.6.8 and install it. Open the software. You will notice that it automatically names your sketch, mine was “sketch_apr27a” that is fine it’s just an automatic name based on your computer date.
Erase any code that automatically comes up on the window, you do not need it for this.
The Libraries
Here is where I got confused because the Arduino IDE software says it can load libraries from zip files and in addition the readme file does not Specify to extract the library zip files or leave them zipped. Maybe because some computers automatically do this. I ended up extracting all my files. It turns out that the Arduino IDE Software will accept a folder or a zip file when loading libraries.
Ok back to libraries, you need to get this https://github.com/JChristensen/Timer, just click on download zip as before. Now the readme file says “Timer library release downloads with the name: “Timer-master-2”. Before loading into the Arduino IDE, change the name to: “Timer” This is incorrect the file downloads as “Timer-Master.zip” , just go ahead and rename the zip file to “Timer.zip” and extract it. Now go into the extracted folder and rename the folder ”Timer-Master” to “Timer”. It is this folder that you will use to upload the Timer.cpp to the Arduino Libraries, you must upload the entire folder as it also uses Event.cpp.
Now go to http://cl.ly/ZMHh and download The St Shield library. Extract it , this will give you a folder structure of
Shield Library/Shield Library/SmartThings it is this SmartThings folder you will be using to upload the libraries
to the Arduino.
Note the readme says “SoftwareSerial library was default library provided with Arduino IDE” - Here you do nothing, this is automatic. Nothing to do here, just skip over this step.
Let me explain the two libraries you just downloaded need to be added to the Arduino IDE because they do not come with it by default. The SoftwareSerial library comes with the Arduino IDE, to verify goto Sketch | Include Library and you will see it listed there, but notice that the Timer and SmartThings libraries are missing?
Installing the libraries
The readme file might be outdated so the instructions to install the libraries are different from the current version of the Arduino IDE my was version 1.6.8.
Go to Sketch | Include Library | Add .ZIP library… it will open a select library dialogue box, find your “Timer” folder (Select the folder not individual files) you downloaded select it and click open. It will install it see status bar.
Go to Sketch | Include Library | Add .ZIP library… it will open a select library dialogue box, find your “SmartThings” folder (Select the folder not individual files) you downloaded the one you extracted from the Shield library zip select it and click open. It will install it see status bar.
Verify Library uploads, Go to sketch | Include Library and you will now see the Timer and SmartThings libraries in the list.
Now all your Libraries are loaded and ready to be compiled along with the Arduino code (Arduino_8_Zone_Irrigation_Controller.ino). This is done automatically because the Arduino code has includes statements that will load the libraries.
For example as coded in the Arduino code using the includes statements lines 214 -217.
SoftwareSerial.h
SmartThings.h
Event.h
Timer.h
Load the Arduino Code
Connect your Arduino to the computer via the USB cut and paste all the code from “Arduino_8_Zone_Irrigation_Controller.ino” you downloaded.
Make sure you got to Tools | Board and select the correct Arduino Board mine was “Arduino/Genuino Uno”
Make sure the COM port is set correctly , you can got to Tools | serial Monitor and see where your Board is (what COM is it on)
Go to To sketch | Upload, once uploaded you are done.
Disconnect the Uno and proceed with the readme instructions:
I will quickly mention the next steps, they were pretty straight forward, but if you need help just post a reply.
Next you will install the Device Handler type using the “Device_Type_8_Zone_Irrigation_Controller.groovy” you downloaded, go to SmartThings IDE under My devices.
Next you will install the Scheduler Smart App using the “IrrigationSchedulerApp.groovy” you downloaded , go to SmartThings IDE under My Smart Apps.
Next go to My Devices in ST IDE , select the “Arduino” or whatever it called it mine said “SmartThings Shield” and edit the Device Type and select the “Irrigation Controller device type” or whatever it called it mine said “Arduino_8_Zone_Irrigation_Controller”.
On your smartphone make sure to go to marketplace, | smart apps | scroll down to my apps and select and install or configure the Irrigation Scheduler.
Enjoy