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!)

12 comments:

  1. Hi,

    Great work on the Arduino and X10!

    In your opinion, is there a possibility to completely bypass CM17A and send X10 commands directly from the Arduino via a custom built RF transmitter??

    My problem with CM17A is that they're not produced anymore and although you can buy them on Ebay for 7$, the delivery to Europe (where I live) is almost triple of that price.

    Thanks!

    Regards,
    Andrei

    ReplyDelete
  2. By the way, is CM17A just for use in the USA? It probably operates at 300Mhz, whereas I need 433,92Mhz for my TM13 Transceiver. So my only option is still custom RF transmitter??

    ReplyDelete
  3. Andrei,
    I'm afraid I won't be much help.
    I goggled "CM17A Europe" and found some links that may interest you. Especially the first 2.

    As far as bypassing the CM17A, I'd be guessing but the X10 RF protocol appears to be well documented. It would one of those projects where you tear your hair out until suddenly it works.

    Sorry they make X10 so tough and expensive in Europe.

    The best knowledge base I found is:
    http://www.idobartana.com/hakb/

    and
    http://www.johnloomis.org/ece445/topics/x-10/x10.html

    But someware I ran across the RF description, but I can't find it. Sorry I couldn't be more help. Good luck.

    ReplyDelete
  4. Hi,

    Thanks a lot for the links!
    I'll let you know in case this works. ;)

    Cheers,
    Andrei

    ReplyDelete
  5. Hi,
    You can have a look on this application note from microchip : http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1824&appnote=en012050

    It explains how to make an simple X10 controller with a 16f877 device. It gives explanations on how to interface power line with the microcontroller. You can take inspiration of that for your application even if you does not use a pic.
    Regards, Phil

    ReplyDelete
  6. Very interesting link. I put it on the entry about the PSC05. If I could eliminate the PSC05 from my projects that would be great. Thanks Phil.

    ReplyDelete
  7. Hm. On the late-at-night thing maybe a way to automate garage door closure between certain hours if left open? That's what I love about hacking the home. Opens up all kinds of possibilities...

    ReplyDelete
  8. Do you think it is possible to add a CM17a to one of those 'affordable' x-10 switches in order to have two way communication for software monitoring purposes?

    ReplyDelete
  9. If I understand correctly, it would not be too practical. If you're talking about say a lamp module, you'd have to use the switched power to "turn on" an Arduino and transmit the RF via the CM17A. Seems like it would be cheaper to get a 2-way module.

    ReplyDelete
  10. No, I'm talking about a switch like this: http://www.x10.com/automation/index.html#automation_switches
    They can receive commands via remote and act upon that, but if used locally they don't transmit a changed status which defeats any monitoring software with programmed scripts/macros. There are more expensive switches like the switchlincs that can do this with x10 but they also do insteon making them too expensive for me.

    ReplyDelete
  11. There was an attempt to do this by Dr Cheung, but it looks like he gave up. I don't think he thought of using a Firecracker though, only a transformer: http://www.edcheung.com/automa/iwsp.htm

    ReplyDelete
  12. I have no idea! There is certainly a "switch" inside the switch that "could" be used to trigger the Arduino and CM17A to send a RF command. But I have no idea about what else that "switch" is connected to inside the X10 wall switch. They do some wonky things inside their modules. I know I wouldn't mess with it!

    The only safe way I know is to use the AC from the switch (or the light from the light) as a trigger for the Arduino and CM17A.

    BTW I think there are better alternatives to X10(dot)com. Check out eBay for X10 stuff.

    ReplyDelete