Thursday, September 17, 2009

Is the Garage Door Closed?


After the second time my neighbor had to tell me that I left my garage door open, I thought I'd throw a little technology at my senility.


I could have gone the route of using a PSC01 "PowerFlash" but I had a few problems with that:

  • It requires a "normally closed" reed switch (which opens when the door is closed and next to the magnet. 
  • It only sends the X10 command one time. 
  • It would plug into the same outlet as the door opener - not a good time or place to send X10 signals on the power line. 
  • I wanted to make my own. :-) 
So this ugly little board above was my solution. It consists of an ATmega168 (running on it's internal oscillator), and a CM17A "Firecracker" (removed from it's jacket). It's wire-tied to it's wall wart.

When the normally open reed switch closes - because the door is open - it causes a pin based interrupt in the ATmega168. The CM17A then sends a preset House + Unit + ON wirelessly to a TM751 receiver and it's put on the power line and picked up by the X10 Book (see below). The command is sent 3 times with a delay in between to make sure the signal gets through. When the door closes, an OFF signal is sent 3 times.

(get Arduino sketch)

On the X10 Book side, a timer is started when the first door open signal arrives. After a preset time, the X10 Book beeps every few seconds until it receives a door closed signal.

If the door is open late at night, the X10 Book will also turn on lights near the garage. (I could have it wake me up, but I'd be too tired and too scared to want that!)