Using a Rain/Water Sensor with HomeVision
Sensor Mounting LocationThe 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:
Connecting To HomeVisionYou 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 ConnectionRun 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:
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 ModuleThe 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:
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.
ProgrammingNOTE: 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.
Wait 1 minute with timer "Timing Rain Sensor", Then: Set flag "It's Raining" End wait Wait 1 minute with timer "Timing Rain Sensor", Then: Clear flag "It's Raining" End wait How This WorksAssume 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.
ConclusionYou 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:
|