Wednesday, June 22, 2011

My Geeky Home Security System

Since we moved, we've been pestered by ADT salesmen. They offer to install a security system, then want to make you pay $30+ per month for "monitoring" service. I found that ridiculous, so decided to do it myself. I'm not worried about intruders while I'm home. That's what Smith & Wesson is for. I wanted a system I could customize, extend, and monitor remotely. After doing some research, I decided X10 was the way to go.

X10 has been around a long time. It's a standard protocol which sends signals across the electrical system. So, you have devices you set a "housecode" on like A5, B11, etc. Then the devices can receive "ON" and "OFF" signals when plugged in. Many X10 devices are Made-in-China components which can be bought for dirt cheap on eBay.

So, I drew it out and went X10 shopping on eBay:

  • 4 x motion detectors (MS16A) = $25
  • 3 x light switch modules (WS12A) = $30
  • 2 x remote keyfobs (KR19A) = $10
  • RF transceiver module (TM571) = $8
  • Lamp module, chime module = $15
  • Serial 2-way computer interface (CM11A) = $40
Now, here comes the magic. That last item, the CM11A, allows X10 signals to interface with a computer. With the right software and know-how... you can customize behavior with any rules and scripts you like. My first problem, however, was that I don't want to leave a desktop computer running 24/7/365 in order to have a home security system. 

Then I discovered this great little item: The SheevaPlug, $99. This is a self-contained linux computer, the size of 2 decks of cards, ready to plug in. It has an ethernet port and USB port, ready to login (via SSH) and configure remotely. It runs on just a few watts, so the idea is to leave this plugged in running all the time... controlling my X10 system (and whatever else I come up with later on).


The software I loaded on the SheevaPlug allows for advanced features ADT doesn't offer. I use a fantastic little free program called Heyu to handle all the CM11A X10 commands. Heyu allows you to set rules, conditions, and launch scripts. I also installed Apache web server, adding some simple CGI scripts to give me a remote interface, so I can check logs and control all home devices from my phone browser. One can use Linux cron schedules for house timers. I connected an old webcam I had lying around with a USB hub.... to add video monitoring and image capture to the security system.

My web interface:

There's a lot more detail to it... and of course some hair pulling involved troubleshooting, but I'm quite happy with how it's turned out. Of course, one must put a lock on the electrical breaker box with this type of approach. There is also some finesse involved with mounting ugly X10 motion detectors (I used PVC joiners to mount them adjustable, and painted them to match the background). Once past all the challenges of getting SheevaPlug configured... one can customize away. My wife and I can use the "keyfob" to arm/disarm the alarm system, and also to toggle the outside lights from motion-detection mode to timer mode (e.g. if we have guests). The chime and lamp modules are used as indicators when we arm/disarm. When the motion alarm is tripped... it will instantly text message both my wife and I, take a photo, and begin chiming and blinking lights inside and outside the house. We can check the motion logs and view the webcam image to investigate. There's more to it, and I'm sure I'll add more in the future. All in all, my system totaled somewhere over $200, which will pay for itself compared to ADT in a matter of months.

2 comments:

Unknown said...

WOW. What great success and creative use. If you post step by step recipe, many people would copy and enjoy the fruits of your labor/talent.

Fernando said...

The good thing with X-10 among other protocols is that they are affordable and easy to use through existing electrical wiring. By just sending a command to the receiver, and then transmitted to an actuator, it will make the alarm armed. No wonder you spent only around $200 worth of light and chimes which is 6-7 months worth of private monitoring service. I'm sure burglars who would sneak into your house won't notice your security system until they get busted.


Fernando Severns