• You've been granted Beta access to this site, allowing you to explore some of the new features while they're still under construction. More information can be found in the Beta forum.

[How-To] Control Your Sprinklers With X-10 Commands

BraveSirRobbin

Moderator
[How-To] Control Your Sprinklers Using X-10 Commands
(Using WGL Design's Relay-8, Though Other Methodologies Are Mentioned)

by BraveSirRobbin

WGL Designs makes an X-10 driven relay output module named the Relay-8. This unit has eight single pole, double throw relays that can be controlled via conventional X-10 signals over a homes power line. This makes a very handy low voltage controller without having to use a module like a RLY-8 or SECU16 module with an Ocelot, or multiple X-10 universal modules. Plus, this unit can be conveniently located where the wiring controls are terminated (usually inside your garage), thus eliminating extra wiring that would normally have to be extended to the control system.

devices.jpg

WGL Design's Controllers and X-10 Universal Module

This [How-To] will use the Relay-8 controller (of which a recent CocoonTech Review was written), but the techniques described could easily be used for other controllers such as WGL Designs Rain8II or Rain8wl (they were actually designed for the sole purpose of controlling 24volt AC sprinkler solenoid valves). An X-10 Universal Module could also be used, but not with the X-10 polling feature (which is described below) Again, the purpose of this (or any) How-To is to spark ideas for our memberships specific applications.

Before we start please refer to our general disclaimer. CocoonTech.com and its staff are NOT responsible for any injury or property damage resulting from anyone using this How-To guide or any associated pictures or links.

Most sprinkler solenoid valves need to be controlled with 24 volts AC (usually providing capability for around 300 milliamps). The Relay-8 will need this external voltage source as it is just comprised of relay outputs. When using the Rain8II or Rain8wl, this external source is not needed as these units provide a zoned 24 volt ac output.

I just used the 120 volt ac to 24 volt ac wall wart that was previously the source for my old sprinkler controller. The maximum current output of this particular wall wart is 300 milliamps.

I only have three solenoid valves running my sprinkler system. The wiring for these valves enter my garage interior near the garage door. Luckily there is an AC outlet near this location as well.


(Click on Picture for Full Sized Image)
Two Sprinkler Valve Assemblies

The Relay-8s relays can be wired in a normally open or normally closed configuration. The normally open configuration will be used here. This requires wiring the C or common and the NO or normally open contacts in line with one leg of valve wiring. Since all three zones will require switched 24 volts AC from the wall wart power source I will daisy chain this source to all three C contacts of the first three relay zones. An in-line fuse (purchased from Jameco or Radio Shack) was also installed between the wall wart and this daisy chain since again, the relay 8 is only providing a switch to the solenoid valves. Refer to the schematic diagram below.
    • sprinklerschematic.jpg
Wire your solenoid, 24Volt AC power source, and in-line fuse to your Relay-8s removable terminal strip. You will need a TW-523 or PSC05 power line interface in order for the Relay-8 to receive X-10 commands. Plug this interface in a receptacle near the Relay-8 and then plug the interface cable provided with this power line controller in the RJ-11 jacks of the controller and Relay-8. Note that although this cable ooks like a standard phone cable, it is wired differently from one. Also, plug the Relay-8s power adapter in a receptacle near the unit and route its input jack near the Relay-8.

Now you are ready to program your Relay-8. Take just the Relay-8 unit to your computer (i.e. you dont need the removable terminal strips nor its AC power supply. You will need to plug the serial port of the Relay-8 to a serial port of any computer using the supplied cable. Additional more detailed information of how to program the Relay-8 zones and its internal timers can be found HERE and HERE.

For this example lets use the following X-10 house and unit codes:

Solenoid Valve/Zone #1 L1 (Front Grass)
Solenoid Valve/Zone #2 L2 (Front Drip System)
Solenoid Valve/Zone #3 L3 (Back Drip System)

The internal timers that can be programmed for the zones are a nice feature of the Relay-8 (and are also available on the Rain8 products as well). Basically these timers will determine the number of minutes that a zone will remain ON and can be used as an emergency off signal just in case the Relay-8 never receives its X-10 OFF command from the power line. I wanted to adjust my sprinkler zones to run between six and eight minutes so I set all of the Relay-8 timers for each zone for ten minutes (i.e. no solenoid valve will ever remain on for more than a ten minute period once an X-10 ON command received). Of course you can always send an X-10 OFF command before this time period and the unit will close its relays, but its nice to have this piece of mind knowing you will not come home to a swimming pool in back of your house in case of a failure to receive an OFF command!

After you download the desired program options into the Relay-8 disconnect it from the computer and install it in your desired control location (in this case the garage). Connect the zone input terminal, the RJ-11 connector of the power line interface, and the units AC power adapter. Make sure a fuse is placed inside the in-line fuse holder. Details are pictured below.


(Click on Picture for Full Sized Image)
Relay-8 Unit Wired to Solenoid Valve Wiring

Now test the system by sending an L1 ON X-10 command through the power line using a Palm Pad remote or table top controller. You should now see your sprinklers in zone one come on. Turn the unit off and see if the sprinklers shut off. Now turn the unit back on and see if the sprinklers turn off via the Relay-8s internal timer (in this case ten minutes after they are turned on). Repeat this test for each sprinkler zone.

There are cases where I want to make sure the sprinklers do not come on. There are many ways of doing this. I chose to install an appliance module (capable of two way X-10 communications) between the 24 Volt AC solenoid wall wart and the electrical outlet. I assigned this an L16 X-10 house and unit code. Note that you could easily just use one of the Relay-8s zones for this purpose as well (just wire in a normally open relay in-line with the fuse holder). The reason I am using an appliance module is in case of a Relay-8 failure, I can still guarantee that the solenoid power will remain off (i.e. extreme paranoia).


(Click on Picture for Full Sized Image)
Relay-8, Wall Wart Supplies, and Palm Pad Remote


(Click on Picture for Full Sized Image)
AC Outlet, Appliance Module, & Wall Wart Supplies

Since I already own an Ocelot I decided to use it to send the X-10 commands to the Relay-8 unit. Plus I don't like tasks this critical delegated to a computer (I know others have different viewpoints with this concern). I just determined the time interval for each zone and the time(s) of day/night that I want the zone to run (times are kept track by the Ocelot). Then I send the zone's ON command and wait a few seconds. I then ask for that zone's status and if it is not ON, then I resend the ON command.

Since my Homeseer machine is monitoring my Ocelot, I set up a Homeseer event so all of the sprinkler related ON and OFF signals sent and received by the Ocelot are written to a text file. I also status the appliance module and record if it is on or off and also place this information at each 'status' line of the text file.

Note that this is an EXAMPLE of how to automate this system using the Ocelot and Homeseer. They are not a requirement for this How-To as just about ANY automation software/hardware configuration can be used.

Example codes and procedures of how to accomplish are below.

Ocelot C-Max Code:

Naming Convention for Code Examples Below:
Solenoid Valve/Zone #1 L1 "Sprinkler-Front-Grass"
Solenoid Valve/Zone #2 L2 "Sprinkler-Front-Drip"
Solenoid Valve/Zone #3 L3 "Sprinkler-Back-Drip"
Appliance Module (Switches 24 VAC) - L16

Code:
0313 - IF Time of Day becomes = 03:01 // If Time is 3:00 AM, Start Sprinkler Program
 0314 - THEN Skip to line 320 
 0315 - IF Time of Day becomes = 10:01  // If Time is 10:00 AM, Start Sprinkler Program
 0316 - THEN Skip to line 320  
 0317 - IF Time of Day becomes = 23:00  // If Time is 11:00 PM, Start Sprinkler Program
 0318 - THEN Skip to line 320 

 0319 - IF Time of Day becomes = 21:01 // If Time is 9:00 PM, Start Sprinkler Program
 0320 - THEN Sprinkler_Timer = 1 // Start Front Grass Cycle
 0321 - THEN Sprinklers-Front-Grass, Turn ON 
 0322 - IF Sprinkler_Timer becomes = 10  
 0323 - AND Sprinklers-Front-Grass, is OFF 
 0324 - THEN Sprinklers-Front-Grass, Turn ON 
 0325 - IF Sprinkler_Timer becomes = 300 // Front Grass Time is 300 Sec
 0326 - THEN Sprinklers-Front-Grass, Turn OFF 
 0327 - IF Sprinkler_Timer becomes = 310  
 0328 - AND Sprinklers-Front-Grass, Is ON 
 0329 - THEN Sprinklers-Front-Grass, Turn OFF // End Front Grass Cycle

 0330 - IF Sprinkler_Timer becomes = 400  // Start Front Drip Cycle
 0331 - THEN Sprinklers-Front-Drip, Turn ON  
 0332 - IF Sprinkler_Timer becomes = 410   
 0333 - AND Sprinklers-Front-Drip, Is OFF 
 0334 - THEN Sprinklers-Front-Drip, Turn ON  
 0335 - IF Sprinkler_Timer becomes = 700// Front Drip Time is 300 Sec
 0336 - THEN Sprinklers-Front-Drip, Turn OFF 
 0337 - IF Sprinkler_Timer becomes = 710   
 0338 - AND Sprinklers-Front-Drip, Is ON  
 0339 - THEN Sprinklers-Front-Drip, Turn OFF  // End Front Drip Cycle
 0340 - IF Sprinkler_Timer becomes = 800  // Start Back Drip Cycle
 0341 - THEN Sprinklers-Back-Drip, Turn ON  
 0342 - IF Sprinkler_Timer becomes = 810   
 0343 -   AND Sprinklers-Back-Drip, Is OFF  
 0344 - THEN Sprinklers-Back-Drip, Turn ON   
 0345 - IF Sprinkler_Timer becomes = 1300  // Back Drip Time is 500 Secs
 0346 - THEN Sprinklers-Back-Drip, Turn OFF   
 0347 - IF Sprinkler_Timer becomes = 1310 
 0348 - AND Sprinklers-Back-Drip, Is ON  
 0349 - THEN Sprinklers-Back-Drip, Turn OFF  // End Back Drip Cycle
 0350 - THEN Sprinkler_Timer = 0  // Reset Sprinkler Timer
 0351


Homeseer Event Code:
(For Creating the Log Text File)

First, create devices for each sprinkler zone (in this case devices were created with X-10 codes of "L1", "L2", and "L3" plus the "L16" appliance module). Then create an event in Homeseer for each sprinkler zone that is triggered by any change of state for that zones X-10 command as shown below:
event.jpg


script.jpg


Then create this script "L1 Sprinkler Log.txt"

Code:
sub main()

dim L1Status 'Sprinkler Valve in Zone #1
dim L1StatusText
dim L16Status 'Appliance Module
dim L16StatusText

hs.PollDevice "L1" 'Setup Poll Status Values for L1 (Sprinkler Zone #1 Front Grass)
L1Status = hs.DeviceStatus("L1")

	if L1Status = 2 then
 	L1StatusText = "ON"
	elseif L1Status = 3 then
 	L1StatusText = "OFF"
	end if

hs.waitsecs 3

hs.PollDevice "L16" 'Setup Poll Status Values for L16 (Appliance Module)
L16Status = hs.DeviceStatus("L16")

	if L16Status = 2 then
  	L16StatusText = "Sprinklers Enabled"
	elseif L16Status = 3 then
 	L16StatusText = "Sprinklers Disabled"
	end if

Dim fso,f1 'Open the Log File for Sprinkler Commands and Events
Const OpenFileForReading = 1
Const OpenFileForWriting = 2
Const OpenFileForAppending = 8


	Path = "C:\Program Files\HomeSeer\Sprinkler.log"
	Set fso = CreateObject("Scripting.FileSystemObject")
	Set file = fso.OpenTextFile(path, OpenFileForAppending,True)
	
	file.WriteLine(now() & "  Front Grass  " & L1StatusText & "  " & L16StatusText)
	file.Close

end sub

Continue this methodology for each sprinkler zone (but make sure to have each script write to the same log file).

Since I already have Main Lobby I decided to create a cool Main Lobby Scene for the sprinkler controls as shown below.


<span style='font-size:8pt;line-height:100%'>(Click on Picture for Full Sized Image)</span>
<span style='color:blue'> Main Lobby Reading Homeseer Devices via MLHSPlugin</span>

Here is a sample from the sprinkler log file below:

7/10/05 10:02:23 AM   Front Grass  ON   Sprinklers Disabled
7/10/05 10:07:20 AM   Front Grass   OFF   Sprinklers Disabled
7/10/05 10:09:03 AM   Front Drips   ON   Sprinklers Disabled
7/10/05 10:14:03 AM   Front Drips   OFF   Sprinklers Disabled
7/10/05 10:15:43 AM   Back Drips   ON   Sprinklers Disabled
7/10/05 10:24:04 AM   Back Drips   OFF   Sprinklers Disabled
7/10/05 4:46:34 PM   Front Grass  ON   Sprinklers Enabled
7/10/05 4:47:56 PM   Front Grass  OFF   Sprinklers Enabled
7/10/05 7:26:48 PM  Front Drips  ON   Sprinklers Enabled
7/10/05 7:36:33 PM   Front Drips   OFF   Sprinklers Enabled
7/10/05 7:40:41 PM   Front Drips  ON   Sprinklers Enabled
7/10/05 7:51:11 PM   Front Drips   OFF   Sprinklers Enabled
7/10/05 9:01:12 PM   Front Grass   ON   Sprinklers Enabled
7/10/05 9:06:18 PM   Front Grass   OFF   Sprinklers Enabled
7/10/05 9:07:52 PM   Front Drips   ON   Sprinklers Enabled
7/10/05 9:12:49 PM   Front Drips   OFF   Sprinklers Enabled
7/10/05 9:14:29 PM   Back Drips   ON   Sprinklers Enabled
7/10/05 9:22:50 PM   Back Drips   OFF   Sprinklers Enabled

As you can see the WGL line of products along with other home automation hardware makes incorporating sprinkler control with your system very possible! Plus it is nice to review the log of the polled values to see watering details of each zone to help determine watering needs and necessary adjustments based on your landscape's condition.

Also, you could incorporate rain sensors, wind measurement, and moisture sensors in with this system and have them influence the amount of watering times needed. There are many options and many ways of accomplishing this task. Hopefully this How-To will spark some ideas and get you started towards having an automated sprinkler system. Additional discussion threads of interest are HERE, HERE, and HERE.

As always, please feel free to reply with comments, ideas, questions, criticism, etc... :huh:

Regards,

BSR
 
Top