Pages: [1]   Go Down
Author Topic: Best way to tell if a lid is open.  (Read 961 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 29
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset


I need to notify my arduino when I open the lid of a box, wondering what is the best way to go about this?

I was thinking maybe some type of magnet setup but it would probably be much simpler to just have a button on the box that the lid presses on when it is closed. Any suggestions on the type of button I will need (what it's called)?
Logged

SE USA
Offline Offline
Faraday Member
**
Karma: 40
Posts: 3783
@ssh0le
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
but it would probably be much simpler to just have a button on the box that the lid presses on when it is closed.

thats my vote

Quote
Any suggestions on the type of button I will need (what it's called)?
snap action switch
leaver switch
microswitch
Logged


Offline Offline
Jr. Member
**
Karma: 0
Posts: 83
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Certainly using the micro switch/leaver switch is the simplest way.  In case if you don't want to use mechanical approach, you can do this with IR proximity sensor as well.
Logged

Dubuque, Iowa, USA
Offline Offline
Edison Member
*
Karma: 29
Posts: 2236
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

http://arduino.cc/playground/Learning/LEDSensor
http://www.thebox.myzen.co.uk/Workshop/LED_Sensing.html

Would be the cheapest route.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 9
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Alarm boxes use a standard little push switch ( liek on the arduino board) with a spring attached . the spring makes sure the switch closes correctly without having to have very tight tollerance.

Rob
Logged

North Queensland, Australia
Offline Offline
Edison Member
*
Karma: 52
Posts: 1770
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

If the lid is a swing style ( doesn't detach completely ) and object doesn't move too much, a mercury switch would be suitable.
Logged


USA
Offline Offline
God Member
*****
Karma: 14
Posts: 644
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset


I need to notify my arduino when I open the lid of a box, wondering what is the best way to go about this?

I was thinking maybe some type of magnet setup but it would probably be much simpler to just have a button on the box that the lid presses on when it is closed. Any suggestions on the type of button I will need (what it's called)?


In terms of the code, using a magnet and a reed switch would be identical to a push button. The hardware might be a little more expensive but again not really more complicated to install or use.  There is one slight advantage a magnet and reed switch have over a push button is it would be less likely to give a false closed reading, since it's more probable for the button to accidently be pushed while the lid is open than to have another magnet be waved near the reed switch.  Even then it might not be a worthwhile difference, depending upon if limiting these kind of false readings is important in your project.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 29
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Certainly using the micro switch/leaver switch is the simplest way.  In case if you don't want to use mechanical approach, you can do this with IR proximity sensor as well.

I'll check that out, thanks.


That is pretty cool, wasn't aware that was possible. Will take a look at that too.

If the lid is a swing style ( doesn't detach completely ) and object doesn't move too much, a mercury switch would be suitable.

Yeah it's a hinged lid, never heard of a mercury switch, I'll look it up.

Thanks for the suggestions everyone.

Logged

United Kingdom
Offline Offline
Tesla Member
***
Karma: 220
Posts: 6587
Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hall sensors are inexpensive now, so I'd use a Hall sensor and a magnet. Caution: some of them such as the US1881 turn on when they see a N pole and off when they see a S pole. This sort (bipolar) is ideal for rev counters, but not what you want for a proximity sensor (you need a unipolar one such as http://uk.rs-online.com/web/p/hall-effect-sensor-ics/7384743/).
Logged

Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

Santa Fe
Offline Offline
Full Member
***
Karma: 1
Posts: 201
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I've used a simple contact micro switch. with the pin as input, make sure you add a 10K pull down to ground and make the logic to trigger on the switch going HIGH. That means having a switch that you can wire as normally open. works fine and uses a little  less current.
Logged

Offline Offline
Edison Member
*
Karma: 27
Posts: 2033
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Mercury switches are probably illegal now.
Logged

USA
Offline Offline
God Member
*****
Karma: 14
Posts: 644
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Mercury switches are probably illegal now.

I can't speak for everywhere (this is an international forum), but I know they are still legal in the USA and I don't know of any serious effort to change that.
Logged

UK
Offline Offline
Full Member
***
Karma: 1
Posts: 127
mini mini mini
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Most people use the ball bearing tilt switches these days, similar in effect to the mercury ones, but you can sell em worldwide.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 8
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Not knowing anything about the box, I'll say security door/window contacts. Surface mount, with adhesive backing.
Logged

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 331
Posts: 16459
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

These days I would say the best method is to use a 3 terminal hall-effect electronic switch and a permanent magnet. These are very small and easy to hide into the box and easy to adjust the magnet spacing to make how high the lid has to move before indication. Very simple to interface with the arduino, just enable the internal pull-up for an input pin and wire it to the sensor's output pin, then just wire ground and +5vdc to the sensor. 95 cents at SparkFun:  https://www.sparkfun.com/products/9312

How could anything be better or easier?

Lefty
Logged

Pages: [1]   Go Up
Jump to: