Did I lock the front door?
One of the first things we did when we moved to our apartment was replacing the default flimsy front door with a nice anti-break steel door. But even the most secure door is no good if you forget to lock it. We went back countless of times to double check the lock after leaving for work and when at home we check the door ever so often.
I started thinking about some kind of warning that the door is not locked so we could stop obsessing about it. This is the specification I came up with:
- Install two switches to sense open/closed door and locked/unlocked lock. I can afford to build the switches right into the door frame which is made out of steel rectangular tube.
- Have a piezzo buzzer on the inside to sound an alarm.
- Have a green/red LED on the inside. The green LED should blink once every second or two so one can check the door status from down the corridor. The red LED is there for silent alarm, since I don’t want to let buzzer go on indefinitely in case we already left the apartment and didn’t hear the alarm. That would just draw the attention of would-be thief.
- The buzzer would go off after 10 seconds of unlocking and opening the door. It would sound for 20 seconds and then go silent. This covers the case of somebody leaving the door open. When closing one should have 5 seconds to lock the door, otherwise the buzzer would activate for 20 seconds and then go silent again.
- I want blinking LEDs and pulsing buzzer (with the same frequency as LEDs).
- A way to disable the buzzer when we need the door to be open for some time (moving furniture or something).This can be done by manually toggling the lock switch when the door is open.
I decided to try to accomplish this door-alarm with a Microchip PIC10. This was two years ago. I learned how to program in assembly and picked up some nice programming techniques. It was a lot of fun (but also frustrating a lot of times) to learn about de-bouncing or figuring out how to make two timers (one for countdown and the other for blinking) out of the one on PIC10 (which doesn\’t even raise any interupts). But eventually it got too frustrating to bring that code to a closure and the idea lingered till the day I learned about JeeNodes.
The door-alarm revisited
I decided to implement the above specification with JeeNodes. Since they offer a lot more than a simple PIC10, I got some additional ideas:
- Report every change of the switches to a central JeeNode connected to LAN with EtherCard. This way I can check the door status via internet from anywhere.
- Hook the door bell button to the JeeNode and control the door bell with it. This way I can log the door-bell-ring event and maybe play with the ding-dong door bell and try to produce different melodies (ding-dong-dong or just dong etc.). I would also be able to check whether the postman really did rang when nobody was at home – or did he just leave the package at the post office being too lazy to carry it and just left the note in the post box. 🙂
- Maybe add a switch for silent door bell mode. The silent mode could also be automatically activated at night hours and the central JeeNode could power up a strobe light or something to let us know somebody is at the doors.
- Use a servo to ring a small ring bell instead of door bell.
So here I am waiting for my JeeNodes to arrive and in the meantime I got the idea to install the switches into the door frame using strong magnets and I inquired how to properly wire the switches to the JeeNode.