10
\$\begingroup\$

The Problem:

I want to be able to detect if a garage door is opened or closed with my Arduino. I don't know what kind of sensor would be suitable for this task. The Arduino and the unknown sensor will be placed approximately 4 meters from the garage door.

Some Context:

I live at the second floor of a house and last weekend the garage door left opened the whole night by mistake. I want a method to detect the door is opened. My first thought (I'm newbie in electronics) has been to place the Arduino I own in the garage, and putting some sensor detect the door is opened and then send via wireless to another Arduino place at the second floor that the door is opened and reproduce some sound to warn the garage door is opened.

\$\endgroup\$
3
  • \$\begingroup\$ What type of door? \$\endgroup\$ May 2, 2011 at 14:59
  • \$\begingroup\$ A simple garage door that can be opened and closed via remote control. See below in one of my comments I'll explain deeper my 'problem' \$\endgroup\$
    – user4079
    May 2, 2011 at 15:27
  • 3
    \$\begingroup\$ @User4079 - This isn't a forum. There's no reason not to edit your original post to improve its clarity or add information! I've pulled your comment (which is way at the bottom right now) into the question, but feel free to do this yourself in the future. \$\endgroup\$ May 4, 2011 at 15:59

5 Answers 5

9
\$\begingroup\$

In many home security systems they use magnet switches to detect the state of the door.

You could also use something like IR to see if a certain part of the door frame is blocking the light.

And one more option is to sense if the door is horizontal or vertical, basically you would mount it to the inside of the door, when it opens it would be horizontal and closed would be vertical. This is actually how most of the off-the-shelve generic sensors work.

If you have a particular method that you prefer I can give some specific sensor recommendations as well.

Edit: I missed that you said you wanted it 4 meters from the door. I am not sure if you just want this because you don't want to deal with wireless, but the IR method can also work in which you put something that reflects IR on the door and then have your sensor look to see if your IR beam has been reflected or not.


Some more additions:

If it were me, I would get something like this, there are lots of other brands and methods that are used. Buying sensors and wireless modules can be pretty expensive when bought in quantity 1 and probably wont be worth the cost over just buying the off the shelf method.

Now if it were me wanting to tackle a fun project, I would use an accelerometer attached to the inside of the door (could even be a board just Velcro'd to the inside of the door). The accelerometer doesn't need to be anything special, just something that when attached can detect acceleration in the down direction when the door is vertical and the down direction when the door is horizontal. It so happens that the force of gravity will show up on an accelerometer. I would then use an Xbee module to transmit the status to an xbee that is inside.

Realistically you don't need to transmit very much very often, you could put everything into sleep mode when ever you aren't reading and then once every minute or so wake up and transmit the current state. Because of how little the device is on it could easily run off of a battery for a decently long time.

There may be other, better, methods of detection, but when ever I do a "for fun" project I like using parts that I might use in other projects. It helps to grow the intellectual property that I have, which is useful for the future.

\$\endgroup\$
1
  • \$\begingroup\$ See my comments below. There I'll explain my needs and maybe you can give me some help \$\endgroup\$
    – user4079
    May 2, 2011 at 15:33
4
\$\begingroup\$

If you really don't want the sensor on the door itself, you could opt for a Sharp GP2DXX IR sensor. There are different versions depending on the range, this document gives you an overview.

If the sensor can be on the door, there's microswitches like

microswitch

(Despite their name they're often not really micro, but rather for heavy duty industrial use. I guess the name derives from a Honeywell trade mark.)

\$\endgroup\$
1
  • \$\begingroup\$ yes, it can be placed on the door. But when I detect door opened I want to send this to the second floor. See my comment above. Thanks \$\endgroup\$
    – user4079
    May 2, 2011 at 15:35
2
\$\begingroup\$

This is interesting because it's something Ben Franklin solved with a string, a wire eyelet hammered into the door, a counterweight, and a semaphore flag he could see from the second floor. There are some interesting women's solutions from any era you like as well, used to check if heifers and chickens are in during rain, etc.

If it's an apartment, perhaps a lightly convex stainless mirror facing you and the garage door is not out of the question.

I think separate switches for the door and automatic opener are a good idea. It's pretty trivial to run a wire (or commonly a twisted pair) to the next floor; terminate the ends near grounded shunts so you don't have some kind of lightning antenna that zaps your Arduino or light semaphore circuit when there's a storm nearby! Then add an polling optoisolator (again for circuit protection) if you want the Arduino to check the garage for you. Then again, if you install a lightbox and camera in the garage, the radio thing would work and you could see how open the door was, maybe operate an illicit (or merely aseasonal) tomato growing operation, and/or decide whether you should have aired up the tires.

\$\endgroup\$
0
\$\begingroup\$

Why would you need to place the sensor 4 meters from the door? a simple limit switch or even a photo-eye placed by the door would be much simpler.

\$\endgroup\$
1
  • \$\begingroup\$ I'll try to explain it deeper, then you could advice me better. I live at the second floor of a house and last weekend the garage door left opened the whole night by mistake. I want a method to detect the door is opened. My first thought (I'm newbie in electronics) has been to place the arduino I own in the garage, and putting some sensor detect the door is opened and then send via wireless to another arduino place at the second floor that the door is opened and reproduce some sound to warn the garage door is opened. \$\endgroup\$
    – user4079
    May 2, 2011 at 15:22
0
\$\begingroup\$

You have two questions here - (1) how to detect that the door is open and (2) how to transmit that information to your room.

The detection part is simple and could be done for just a few cents - two wires touching and closing the circuit IS a sensor. Or you could use a tilt switch mounted on the door. You could also use a hall effect sensor and a magnet (I have two sensors on each of my garage doors - for "open", "closed" and "in between" state detection.) The possibilities are endless, really. If you remember that there are three types of events you could detect - direct (engaged switch means the door is closed), indirect (if the switch is off, the door is either open or in motion) and contextual (if the door is in motion, then someone have been playing with the switches) - you could use seemingly unrelated information to detect interesting events (I have garage parking sensors that flash leds as you approach the sensor mounted on the wall - if the car is not within its range, it means the person driving that car is probably not home).

The event transmission part is a bit trickier, but not rocket science either. You could use radios. I use XBee radios for my home automation system, they are $25 a piece, but you could find other alternatives for as little as $5 if many-to-many connections are not needed. Another possibility for your situation is to use X10 or a similar product. I have a couple of X10 lamp modules in my house and interfacing with them from Arduino was extremely easy (there is an X10 library for Arduino). For X10 to work, though, your room upstairs should be on the same circuit as your garage. Someone here mention IR - that could work as well. Mount an IR emitter outside the garage door and a receiver outside your window above the garage - cheap and effective.

\$\endgroup\$

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