[an error occurred while processing this directive]

Home Automation Tips and Tricks Archive
December 1999

Entry 1- Adding a watchdog timer to the Lynx10 Kit

Ido Bar-Tana ibartana@iil.intel.com

1. General

Ever wonder what to do with the empty right side of the Lynx10 kit board? Well, how about increasing the robustness of your home automation system by immunizing it to software lockups, operating system crashes, brownouts and hardware freezes.

This document describes a modification (actually addition) to the Lynx10 kit. The addition, called a watchdog timer, resets the PC if no X-10 commands were transceived in the last 4 minutes. In conjunction with a routine that sends a dummy X-10 command if no command was tranceived in the last 3 minutes, this device guarantees that the software is alive, that the Lynx10 is working, that the TW523 is tranceiving, that the operating system is running and that the PC is not frozen. If any of these or related cases occur, the watchdog 'pushes' the PC reset button.

Pros of the Lynx-10 watchdog timer:

  1. Very, very cheap. The parts cost around $2. Compare this to commercial PC watchdog timers by Adicon (makers of CPU-XA) that costs $100 and up.
  2. Directly uses signals and power from the Lynx-10 kit. Thus there is no need for any other PC resources: com-port, slot, IRQ, power plug, space. Everything that's needed is already on the Lynx-10 kit board.

Cons:

  1. The reset is a hard reset (warm boot), identical to pushing and releasing the PC reset button. No questions asked. No graceful shutdown. No NMI sent. Some NT machines may not like this. My win95 never had any problems with this.
  2. The expiration time is 'hard-coded' by resistors. It's not changeable thru software.

2. Principle of operation

Because the Lynx-10 kit includes most everything that's needed, the watchdog timer uses only 3 active components:


Figure 2-1 shows the schematic of the watchdog timer.

When there is no X-10 activity, The Lynx-10 RX LED voltage is low. This is true for both transmission and reception since all transmitted commands are immediately received by the TW523. Thus the reset port of the 4060B (4060:12) is at low and the 4060 is counting. Any activity on X10 flashes the RX LED, which in turn generates a rise-fall pulse on the 4060 Reset pin and the 4060 restarts the count. The line could equally be connected to the BUSY LED.

The expiration period of the watchdog is set by the combination of C1 and R1 according to the formula:

If the RX LED does not flash within the watchdog expiration time, the 4060 raises its pin 3 (4060:3), lowers N3:10 and raises pin N4:11. This in turn generates two events:

Thusly this is a self-terminating pulse:

The time length of this loop determines the length of the reset push (the time between depression and release of the reset button). It can be varied by changing the values of R3 and C2.

Finally, a manual switch or jumper is added to the output of BDX53 so that the watchdog could be disabled for times in which the Lynx10 routine responsible for the watchdog reset is not active.

3. Implementation

Figure 3-1 , Figure 3-2 and Figure 3-3 show the layout of the watchdog timer on the Lynx-10 board. If the resistors and caps look abnormally large, it's because they are. There is absolutely no need for such large ratings. They just happened to be around. There is no special reason for the sockets either.

The 4093 IC is lined north of 4060B and I ran the wire tracks parallel to the ICs first and then shorted on the backside of the board the perpendicular lines to the IC pins. My kit board sits inside the PC on the floor of the box. This makes accessing the PC reset switch easy.

The hook to the PC reset switch wire pairs is in parallel to the wire pair.


Figure 3-1: Layout of the lynx10 watchdog timer


Figure 3-2: layout from LED edge looking towards connector edge


Figure 3-3: Layout from Lynx10 side looking towards bredboard side

Switch

Give this point a little thought. I started with a simple jumper, but then it occurred to me that on my PC the front panel Turbo switch is unconnected to anything. My board doesn't support the ancient frequencies. This switch also toggles a front panel 7 segment LED display between two states, that on my PC displayed HI/LO. Finding this, I connected the switch to the Lynx10 watchdog timer and modified the jumpers on the LED panel to read OF/On.

4. Application notes

Dummy commands

The Lynx-10 command sent for the watchdog reset is a dummy command in that it's not intended to operate an X-10 receiver module. So as not to waste an X-10 address you can send a command to a module that will not respond to it. Some examples: sending an OFF command to a chime module; a dim command to a universal or appliance module; an "All Lights OFF" to a house code that doesn't have lights etc.

Software changes

There are several events when the software must support the watchdog timer:

Timer expiration options

The expiration time can be set from minutes to hours based on the formula in the equation above. The other outputs of the 4060 are derived from binary division of the base frequency that comes from pin 7 of the 4060. Each of the following pins have a frequency half that of its predecessor:

Pin 7, 5, 4, 6, 14, 13, 15, 1, 2, 3. The last one is used in the Lynx-10 watchdog timer. However, the others are available from these pins.

Entry 2 - Hawkeye for Temperature Control 

onfz@pacbell.net

I modified a hawkeye motion sensor. Instead of using the day/night sensor to detect light/dark (ie - it sends a ON command to sense dark and OFF for light). Using a modification shown in one application, for a window open detection. Using the same idea, I connected the relay of a room thermostat. This causes the hawkeye to send the ON command when the relay turns on. I use this to turn on a room air conditioner when the temperature gets too high. Then send the OFF when the relay opens signaling the correct temperature.

Entry 3 - Garage Parking Stop Light

Theodore M. Seeber seebert@teleport.com 

My wife and I are both new to the whole garage parking scene. I was going to buy a StopLight, but I had all this spare X-10 equipment lying around, so I figured out how to use it.

Setup is for a two-car garage. First, put the lights all on socket rockets, programmed to the same code. Park the cars in the garage. Plug in your transceiver module, set to the proper house code. Set your two motion detectors to the same house code and unit code as the lights. Now, on each wall beside the car, mount your motion detector at the same height and location as the front bumper. Mount the motion detector SIDEWAYS, so that you get a thin column of detection, rather than a wide view at the same height.

Now, when you park the car, the lights in the garage will come on when the car is in the right spot! Also, the motion detectors will automatically shut off the light after you're in the house, so there's no need to worry about it.

2 Hawkeye II motion detectors $20/ea (or get them like I did, free with orders from X-10) 
1 Tranciever Module (either one works) $20 (or you might have a spare lying around) 
3 Socket Rockets (<$20/ ea) (only need one per light bulb in your garage)

Entry 4 - Holiday and Front Lights Controller

Theodore M. Seeber seebert@teleport.com 

I personally like my yard lights to be on normally at dusk and off at dawn. In addition, to get the full effect of my Halloween & Christmas yard displays, the yard lights need to be off when the display is on.

So I got to thinking about it, and installed the following (use whatever house and unit codes make sense for you): 

I then did the following programming in Activehome Macros: 

This gives me the following behavior (for Halloween, but ought to look nice for the Christmas lights too):

At dusk the yard lights go on, Holiday lights get shut down (if I've had them left on for some reason). They stay on until someone comes up the walk, at which point, they go out and the holiday display comes on for one minute. If no further motion is detected within that minute, holiday lights go off and the yard lights come back on. If dawn occurs in that minute, Holiday lights and yard lights go off.

Components list:

Total $111 (if you don't already have the equipment)