Possible Duplicate:
How can I detect if a garage door is opened or closed?

I'm planning to make something to detect if our garage doors are opened or closed. We have a server where I'm going to program a software which I can use to read the doors' status. I think the best way to do this is to use reed relays. But the problem is, how can I transfer the status of the doors from the relays to the server? How can our server detect if the doors are closed or opened?

I'm really a beginner, so I need very detailed information. Thanks.

  • \$\begingroup\$ He's using Arduino, I'm not. \$\endgroup\$
    – MikkoP
    Commented Aug 13, 2012 at 15:06
  • 1
    \$\begingroup\$ @MikkoP the answers seem to not note the arduino at all, am I wrong? \$\endgroup\$
    – Kortuk
    Commented Aug 13, 2012 at 15:08
  • 1
    \$\begingroup\$ Is your reed switch connected to the server? is there a wireless link? What is "the server"? If you want detailed information, you need to provide detailed information on your scenario. \$\endgroup\$ Commented Aug 13, 2012 at 15:08
  • \$\begingroup\$ No it's not connected. The problem is how to get it connected and the server (which is a Windows PC) to understand the signal. The garage doors are more than 50 meters from the server. I'd prefer wired connection. So what I want to know is how do I connect the reed switch to the PC. \$\endgroup\$
    – MikkoP
    Commented Aug 13, 2012 at 15:23
  • 1
    \$\begingroup\$ Sounds like you are talking about a reed switch, a reed relay would be that with a coil to activate it, which isn't really a sensor. \$\endgroup\$ Commented Aug 13, 2012 at 15:39

2 Answers 2


There are many ways you could achieve this. Which you choose depends on how many you plan to build, your budget, skill level etc.

For a wired solution, I'd pick a microcontroller and reed switch to monitor the door, then have this connected to the PC using RS422 or RS485. Having a microcontroller at the far end gives you plenty of flexibility to monitor other signals, or control other systems. Using RS422 gives you a potential range of over 1km.

To get things going quickly, I'd use an Arduino and a ready-made shield. eg. http://www.robotshop.com/rs485-shield-arduino-3.html

At the PC end, I'd use an off-the-shelf USB to serial converter with the right voltage level conversion, eg. http://www.ftdichip.com/Products/Cables/USBRS485.htm


If you have anything that you can attach to the PC that detects a "key closure" then you can use it to read a reed relay or any other on/off sensor.

(1) The possibly cheapest solution is to use an old "mouse" and to wire across the contacts for a button. If you can "programmatically" detect button down then you can detect the door status.
The mouse could be USB or serial or PS/2 port connected [!!!]. USB probably makes the most sense.

(2) You can buy USB to serial port dongles for from under $5. These have typically two on/off status lines that can be read by the PC AND as a bonus two output bits that can be controlled. (RTS/CTS, DTR/DTS).
Some dingles do not bring these out to an edge connector or header but may still have them as solder connection points on the PCB. A little research may be needed to get ones that suits best.

(3) Similarly USB to printer port dingles are available and these have a number of status lines that may be able to be used. The serial port versions are probably slightly safer to use as the printer port versions are often not wholly compatible with the old PC on board parallel ports.

(4) Anything else that a PC can detect electrically can probably be used. You could wire across a standard keyboard switch etc.

A reed relay connected by 50 metres of wire can easily be detected electrically BUT the noise induced by mains etc on such a wire may cause problems if used directly as a USB dongle input. A "repeater" at the PC end is probably needed. This could be as little as a 10 cent transistor and a few cheap components. More on this if it proves to be the way you want to go.

If you want a low cost RF link you can often use a wireless doorbell for the purpose if it has adequate range. The bell operate voltage is used to create a contact closure at the PC interface (1 transistor as above). You need powering at each end, which may or may not be a problem.


Not the answer you're looking for? Browse other questions tagged or ask your own question.