Detect if door is opened or closed

Hi,

I'd like to use my arduino to track the state of my garage door (opened or closed). I'm wondering what type of sensor(s) I should use. I'd like to be able to query the device to determine the door state.

At one point I thought I read about someone using magnates (one one the device and one on the door rail) but I can't find it again.

Suggestions would be much appreciated!
-LK

Magnet and reed switch would work. OR magnet and hall effect transistor. OR plain old fashioned microswitch. optical slot detector and a tiny flag.

SOOOO many ways.

laser shining at a shiny spot on the door reflecting back to an optodiode.

Thank you for your response! I figured there were many ways to do this but I'm totally new to the Arduino stuff and didn't know if there was a canonical way to solve this problem. If you were going to do this what method would you use?

Thanks again!

Just don't use any of these ideas to trigger a booby trap for burglars. You'll get into trouble.

I would use a magnet and a reed switch. They are readily available for burglar alarm systems and they are simple and robust.

Of course you don't really need an Arduino. A resistor and an LED would give an immediate indication.

...R

Thanks Robin!