Author Options:

Need help making a door alarm that triggers actions on my computer. Answered

What I'm trying to do is make a door alarm that would be connected to my computer and triggers a wav or mp3 and also sends a text message to my phone. I was thinking of maybe using an arduino that I have. I need a script or program that would monitor serial ports and call up a program. I'm am not sure how to go about doing this. If anyone has any experience with this sort of thing your help would be greatly appreciated.



8 years ago

mac or pc?

Windows machine but I would like to be able to get this working on my linux server in the near future.


im thinking you will need a magnetic reed switch for the door...

look into http://processing.org

this coding is similar to the ardion and would act as the computer side of the software.

For mp3:

For email:

Note: the link im going to give you next would be easily modifiable to do what you want.


this site has all the code for the arduino to read buttons, and control servos. it also has the corresponding code to talk to the arduino over usb using the processing language. you would need to add the bots to make an mp3 play, but that should not be too difficult. The code autoatically sends tweets to twitter, so you could have your doorbell twitter. This would make it easy to have emails sent or txts sent to your phone.


8 years ago

the language is based on c/c++ and wiring. it doesnt have a super easy ability (imo) way to run external programs. it requires to create a serial console app or use processing to create a desktop connection to other apps.

Take an old mouse. Tap into the two push buttons that work the r/l clicks. They are just regular normal off. Attach a standard normal off alarm switch to the door. Run wire between them. Write a VB program to do what ever you want your computer do do when the door opens. Mouse clicks are easy to detect in almost all computer languages. Good luck.

I'm sorry I don't think I made it really clear what I'm trying to do. I'm trying to build a home automation system and this would be a small part of the over all system. I've thought of some ways to accomplish what I'm trying to do but I'm finding out that the easier ways aren't really scalable. What I need is a system that I could check the status, arm or disarm from a remote location and would alert me with a text message when it has been set off.

I'd suggest using a parallel port instead if you have one; you could just about plug the switch directly into the computer. (I know folks have also used the status bits on serial ports as simple on/off input lines.) The rest of it is all programming. I'd suggest you go looking for those pieces one at a time and grow this in stages, rather than trying to do it all immediately.