Disclaimer: This project is intended for users that understand basic electronics and wiring. No warranty is included, use at your own risk.
Wifi-Irrigation allows for the control of up to four sprinkler valves using SmartThings and a Particle Photon. The build guide and parts list below are based on my build containing two sprinkler valves, but could be easily extended to support up to 4 valves/zones. Additional information, including a complete build guide is available at https://mike-greene.com/wifi-irrigation.
- 1x IP66 Rated Enclosure
- 1x 3-Outlet Grounded Adapter
- 1x U.FL Mini PCI to RP-SMA Antenna Pigtail
- 1x 7dBi RP-SMA Wifi Antenna
- 1x 7-Pin Waterproof Connector
- 1x Orbit 24VAC Transformer
- 1x Particle Relay Shield
- 1x Particle Photon
- 1x 12VDC, 2A Power Adapter
- 1x 20' Outdoor Extension Cord
- 1x PG9 Waterproof Cable Connector
- 3x P3 Wire Nuts
- 2x Pipe Strap
- 1x Garden Reel Leader Hose)
- 2x 3/4" Sprinkler Valve
- 2x Rain Bird Drip Irrigation 4-Port Manifold
- 1x 3/4" Garden Hose to 1/2" PVC Adapter
- 2x 90° Elbow Connector, 1/2" Schedule 40 PVC Fitting
- 1x Tee Connector, 1/2" Schedule 40 PVC Fitting
- 2x 3/4" MIPT to PVC Adapter
- 2x 3/4" to 1/2" Reducer Bushing
- 2x 3/4" to 1/2" Threaded Reducer Bushing
- 2x 1/2" x 1-1/2" Nipple
- 5x 1/2" PVC Pipe cut to 2" in length
- PVC Primer & Cement
- Teflon/PTFE Tape
- 1/4" Rain Bird Distribution Tubing
- Assorted Drip Irrigation Emitters
- Using one of your pieces of 2” PVC, connect the garden hose adapter to one end, and the tee connector to the other.
- With another piece of 2” PVC, connect an elbow connector to one side, and insert the other side into one of the 3/4" to 1/2" reducers (this is the reducer without any threads). Then insert the end with the reducer into one of the 3/4" to MIPT threaded adapters (which will later screw into one of the valves). Repeat this step so we have a second one for the second valve.
- Take one of the 1/2" x 1-1/2” nipples, and screw one side into one of the 3/4" to 1/2” threaded reducer bushing. Screw one of the 4-port drip irrigation manifolds onto the other side of the nipple. Repeat this step so we have a second one for the second valve.
- With one of the valves, connect one of the elbow subassemblies to the source side of the valve (as noted by the direction of the arrow). Connect one of the 4-port manifold subassemblies to the output side of the valve. Repeat this step with the second valve.
- Lastly, using the two remaining 2” pieces of PVC, connect the elbow ends of the valve subassemblies to each side of the tee connector.
- Start by drilling all of the holes in the waterproof enclosure. You'll need to drill a hole for the PG9 connector, one for the RP-SMA antenna connector, one for the 7-pin waterproof connector, and 4 holes for the pipe straps to mount the manifold to the enclosure.
- Mount the PG9 connector, RP-SMA antenna connector, and 7-pin waterproof connector.
- Using 4 machine screws with lock washers, mount the manifold to the top of the controller box using two pipe straps, being sure to place silicon sealant around the inside of the bolts to help ensure the waterproofing of the box.
- Cut your extension cord, approximately 2 feet from the female end, and thread the male end through the PG9 connector. Clamp down the outside of the connector, then strip and reconnect the two ends of the extension cord. Cap the wires with wire nuts. Connect the 3-outlet grounded adapter to the female end of the extension cord inside the enclosure. Connect the 24VAC transformer and 12VDC transformer to the 3-outlet adapter.
- Solder the valve wires to the male end of the 7-pin waterproof connector. I used pins 1/2 for valve 1 and 3/4 for valve 2. Also solder 4 wires to the matching pins of the female side of the 7-pin connector, and wire them (along with the 24VAC transformer) as shown in the schematic below. We'll use the "MAIN" (center) terminal on the relay and the "NO" (normally open) side of the relay to control the valves.
- Connect the 12VDC transformer's barrel jack to the connector on the relay shield, and insert the Particle Photon into its place on the relay shield.
- Connect the pigtail from the u.Fl to RP-SMA antenna connector to the u.Fl connector on the Particle Photon, and screw the external wifi antenna to the lid of the enclosure.
- Lastly, use a piece of double-sided tape to mount the relay shield to the underside of the enclosure's lid.
- Create a new Particle App
- Paste the contents of the Particle Photon sketch into the IDE's code window, and save the app as "wifi-irrigation".
- Click the "Libraries" icon at the bottom left of the screen, and include the "RelayShield" library in the project by selecting it, then clicking the blue "Include in Project" button, then select the "wifi-irrigation" app. Click the blue "Confirm" button to continue.
- Save the app, and click the checkmark icon to verify the sketch.
- Assuming no errors are discovered, click the devices icon at the lower left of the screen, click the star icon next to the Photon you wish to flash the code to, then click the lightening bolt at the top left corner to flash the code to the Photon.
Follow the steps below to manually import the wifi-irrigation device handler, or connect your SmartThings IDE to my SmartThings repo to install this device handler, or device handlers from other projects.
- Login to your SmartThings IDE by going to https://graph.api.smartthings.com.
- From the top navigation bar, select "My Device Handlers", then click "Create New Device Handler".
- Select the "From Code" tab, and paste the contents of the wifi-irrigation SmartThings Device Type into the box, then click the "Create" button.
- Click the "Publish" button at the top right.
- From the top navigation of the SmartThings IDE, select "My Devices".
- Click the "New Device" button.
- Enter a name for your valve (ie: Front Flower Beds), a device network id (this must be unique, so use something like "wifi-irrigation-1" where 1 is the number of the valve), and select "wifi-irrigation" at the bottom of the type list, then click the "Create" button.
- Select the device that you just created (ie: Front Flower Beds), and click the "edit" link in the preferences section.
- Enter the Device ID and Authorization Token that we noted when we setup the Photon, and the number of the valve/relay that this device is connected to, then click "Save".
- With the device created, and configured, you should now see it listed in the SmartThings app.
For a complete overview of the automation approach for this project, review the build guide at https://mike-greene.com/wifi-irrigation.