Introduction: Combining Security System With Phidges and Twitter for Awesomeness

I live in an apartment that is wired for a security system. I don't want to purchase a home phone line and local monitoring services lack in awesomeness.

I want know if anyone comes into my apartment while I am gone. I could use a motion sensor but my doors are already wired (most likely yours are also).

I want to be notified via twitter although sms, phone calls, siren, etc. would also work.

I have a phidges interface 8/8/8 on hand (http://www.phidgets.com) but we could also do this with amx (http://www.amx.com) or netburner (http://www.netburner.com).

Lets get started...

Step 1: How Security Systems Work

Here is a quick primer on how a typical residential security system works. When the front door open the LED for zone 1 lights up. The side door is zone 2.

Note: The trouble LED is light up because it doesn't have a phone line connected to it. There isn't anything I can about that.

Step 2: Door Contact (uninstalled)

This is a standard "dry" contact. The magnet completes the circuit when it comes near.

Step 3: Door Contact Installed and Painted

Here is the door contact installed in the door jam and painted over.

Step 4: Look in the Closet

Here is the security system enclosure. It is usually in the closet. It is standard to screw the door shut. It gets its power from the outlet below and has a 12volt backup battery in the enclosure.

Step 5: Inside the Enclosure

This looks scarier that it really is. You can use elimination to figure out what wires you want. The wires going to keypads usually contain four wires. Power comes from the wall outlet and battery. The only thing left are the door contacts.

Disconnect stuff and see what happens. If you only change one wire at a time you can always reconnect it.

Step 6: Connect to the Phidget

After you soft out which wires are the door contacts, connect them to the inputs of the phidgets interface kit. I connected both black wires to ground and the front door to input 4 and side door to input 5.

Step 7: The Python Part Is Easier

You'll need to google python-twitter and simple-json. They have easy instructions on installing those libraries. (I'm including them in the attached zip file)

You'll also need to get the python phidgets library.

We are starting with the InterfaceKit-simple.py.

You'll need to:

import twitter

twit = twitter.Api(username=, password=)

and replace def interfaceKitInputChanged(e): with this

def interfaceKitInputChanged(e):
#print "Input %i: %s" % (e.index, e.state)
#status = twit.PostUpdate('Door contact was open and now its closed')

if e.index == 4:
if interfaceKit.getInputState(e.index):
status = twit.PostUpdate('Front Door contact was open and now its closed')
else:
status = twit.PostUpdate('Front Door contact was closed and now its open')

if e.index == 5:
if interfaceKit.getInputState(e.index):
status = twit.PostUpdate('Side Door contact was open and now its closed')
else:
status = twit.PostUpdate('Side Door contact was closed and now its open')

return 0

Step 8: Test It and Enjoy

Make sure you have a valid twitter username and password.

The computer you connect your phidget to needs to have an internet connection.

ENJOY and let me know on twitter (mcotton) if you have comments

Epilog Challenge

Participated in the
Epilog Challenge