First of all, allow me to apologize. I set up my Tweeting front door at the end of 2011. Its only about 6 weeks away from 2013 now!
So, what is a Tweeting front door? Well, its a regular front door that sends a tweet every time it is opened.
Why would anyone want to know when a door has been opened? I have actually got 2 front doors, but the outer porch door isn’t locked. Because I am out of the house most of the time I have got no idea if it opened while I’m not there. Is someone stealing my mail? Has the big thing I ordered from eBay been delivered? What time did Danny come in to feed the cats while I’m on holiday?
It has also come in handy for looking back at what time something happened. Eg the time I went to do my shopping then realised I left my wallet at home I was able to tell by the time I left and the time I got back that I had wasted 17 minutes (not including working that out!). Or when some friends left after a night of drinking and saw suspicious behavior, I could look back and see it was 02:19 they left (I knew it was after midnight, but time happens at odd speeds after midnight!) .
How does it work then? Well, sensing the door opening and closing is done by a reed switch mounted to the frame and a magnet on the door, similar to a burglar alarm. This is connected to a Nanode, which continuously monitors the state of the switch. The Nanode is an Arduino clone with built in Ethernet so it can connect to the internet. Every 15 seconds the Nanode uploads the state of the switch (0 for closed, 1 for open) to Cosm.com. Cosm (formerly known as Pachube) is a free data-logging website for the IOT (Internet of Things). If the door is opened, however, it will upload the change straight away. One of the things which Cosm can do is send a tweet if certain conditions are met, such as a value changing from 0 to 1. If that happens then my protected house automation Twitter account (yes, I have more than 1) sends a tweet to me to let me know. (I use a separate protected feed for this because I don’t want to advertise to everyone on Twitter when I leave the house)
Can you give me more detailed information about how it works? Sure, the sketch I’m running on the Nanode is available here, although it is just a slightly modified version of one I found by Wicked Devices (but with a lot of it rem’d out. I should get around to tidying it up, but, hey, there’s a lot of things I should get around to!)
As for wiring, its just a case of wiring the door switch between pin 2 and ground, and giving the Nanode power and an ethernet connection. I have also got a green and red LED for status.