Using a Rain/Water Sensor with HomeVision


This article describes how to interface HomeVision or HomeVision-Pro to the Rain/Water Sensor made by Wadsworth Electronics (or similar devices from other manufacturers).

Sensor Mounting Location

The rain sensor must be mounted outside and located so rain can fall on it. It you put it near a wall and the wind is blowing away from the wall, it may not get wet. Here are some possible locations:

bulletThe roof (perhaps near an antenna or on top of a rain gutter)
bulletOn the top of a screen enclosure
bulletBy the pool (but where it won't get splashed on)
bulletOn or near a satellite dish
bulletThe top of an outdoor air conditioning unit
bulletThe mailbox
bulletA light post
bulletThe top of a fence
bulletA flagpole
bulletAt the bottom of a rain gutter downspout

 

Connecting To HomeVision

You can connect the sensor directly to a digital input, or through an X-10 Powerflash module. A direct connection is the most reliable method and is recommended where practical.

Direct Connection

Run two wires from the sensor to where HomeVision is located. Connect them to HomeVision Port C and configure Port C as an input. The connections are as follows:

                  

bulletConnect one wire to the desired input (terminal block inputs C-1 through C-8).
bulletConnect the other wire to ground (terminal block C-10).

When the sensor is dry, it will be electrically "open". This causes the input port to stay high (its normal state). When the sensor gets wet, it's resistance decreases and the input port will go low (to ground).

Note that this sensor will usually not work properly on HomeVision Port B. Port B requires that an input be shorted to ground through less than 500 ohms resistance in order to read the input as low. This sensor's resistance may only go as low as 10,000 ohms even when soaked in water. Therefore, the input will always be read as high even when wet. Port C is a much more sensitive input and will go low even when the sensor's resistance only drops to 100,000 ohms.

Through a Powerflash Module

The X-10 Powerflash module sends X-10 signals when the input to it closes. By connecting the sensor to in, you can avoid having to run wires to HomeVision. However, the X-10 signals may interfere with other X-10 signals. The connection process is as follows:

bulletUse two wires to connect the sensor to the Powerflash module.
bulletSet the Powerflash module to the desired house code and unit code.
bulletSet the Powerflash module "Mode" switch to "1".
bulletSet the Powerflash module "Input" switch to "B".

Note that the Powerflash module is not as sensitive as HomeVision Port C. If the sensor is only slightly wet, the Powerflash module may not trip where Port C would.

 

Programming

NOTE: This example assumes the sensor is connected directly to an input port, not through a Powerflash module. If you're using a Powerflash module, then you would use the X-10 ON and OFF signals as inputs instead of the input ports.

There are several ways to use the sensor in your schedule. The most obvious is to check the input port with an If-Then statement whenever you need to know if it's raining. Another method is to use a flag to store the current state and set or clear it every time the input port changes. However, both of these methods have the drawback that the sensor may switch back and forth frequently if it's only slightly wet.

A better way is to use a flag to hold the current state, but only change the flag after the input port has changed for a certain period of time. For example, you might change the state only if the input remains steady for one minute. Here's an example of how to accomplish this.

  1. Create a flag named "It's Raining".
  2. Create a timer named "Timing Rain Sensor".
  3. In the "Low Actions" for the sensor input (which are performed whenever the port goes low (it stops raining)), enter:
       Wait 1 minute with timer "Timing Rain Sensor", Then:
           Set flag "It's Raining"
       End wait                                   
  4. In the "High Actions" for the sensor input (which are performed whenever the port goes high), enter:
       Wait 1 minute with timer "Timing Rain Sensor", Then:
           Clear flag "It's Raining"
       End wait                                   
  5. Whenever you need to know if it's raining, check the state of the "It's Raining" flag. SET means it's raining, CLEAR means it's not.

How This Works

Assume it's not raining and the flag is CLEAR. When the rain starts, the port goes low, the low actions are performed, and the wait timer starts running. After one minute, the timer goes off and the flag is SET, indicating it's raining. When the rain stops and the sensor dries out, the port goes high. One minute later, the wait timer times out and the flag is changed to CLEAR. Thus, the flag indicates whether or not it's raining, but with a one minute delay.

Now let's assume again that it's not raining and the flag is CLEAR. The port then goes low, but only for a few seconds. When it first goes low, the wait timer starts running, waiting to set the flag. Before the timer expires, the input goes back high and the high actions are performed. Since the same timer is used for both sets of actions, this effectively cancels the first wait timer, then restarts it waiting to clear the flag. Thus, the flag will never be set by the low actions (since it's wait timer was canceled). After one minute, the second wait timer expires and clears the flag. Of course, the flag was already clear, so this has no real effect. With this schedule, changes in sensor state of less than one minute are effectively ignored.

If it's not clear why the wait timer works this way, carefully read the timer chapter of the HomeVision user's manual.

 

Conclusion

You can use the rain sensor to know when it's raining, adjust the sprinkler watering schedule, and close automated windows or skylights. With some creative programming you can even have HomeVision track how long it rains each day, week, or month and display the information on your TV!

The sensor can also be used as a water detector in a variety of situations, such as:

bulletUnder a hot water heater to detect a leak.
bulletIn a basement to detect flooding.
bulletUnder a washing machine to detect a leak or a broken hose.
bulletAnyplace else water may leak.
 

Back Up Next

Last updated:
01 October 2013

Copyright © 1996-2013, all rights reserved, by:
Custom Solutions, Inc.
1705 Canterbury Drive, Indialantic, FL 32903

HomeVision® is a registered trademark of Custom Solutions, Inc.