Suppose we have a small box with a circutry and a set of sensors in it. Box is lying on the table, but it is light enough to be lifted into the air.

What I want to achieve is to switch off the circutry in a box if anybody lifts the box, and switch it on back when box is returned to the table.

  • Is it possible to detect if object is lying on the surface or is it lifted into the air with just accelerometer(s) and/or gyroscope(s)?

  • If not, what set of sensors can reliably do such a job? Proximity sensors? Distance sensors?

Thank you in advance.

  • \$\begingroup\$ A reed relay in the box, and a small magnet buried in the table top. \$\endgroup\$
    – Steve G
    Oct 31, 2016 at 10:29
  • \$\begingroup\$ @SteveG I don't want (and I can't) modify the surface itself. \$\endgroup\$ Oct 31, 2016 at 10:31
  • \$\begingroup\$ If the surface is reflective enough, you can use a LED+optical sensor (photodiode/phototransistor) in a configuration similar to optical mouses. \$\endgroup\$
    – dim
    Oct 31, 2016 at 10:49
  • \$\begingroup\$ @dim is there a universal solution? I don't know what the surface will be exactly. Ultrasound sensor? \$\endgroup\$ Oct 31, 2016 at 10:50
  • 2
    \$\begingroup\$ Use a microswitch. \$\endgroup\$
    – polwel
    Oct 31, 2016 at 11:04

3 Answers 3


Accelerometers will tell you if it moves, gyroscopes will tell you if it's rotated. Both of those can tell you if it's picked up - but will probably give you a false positive if someone picks up or bangs the table.

Have you considered a simple contact microswitch on the bottom of the object?

  • \$\begingroup\$ Yeah a microswitch would work assuming the OP doesn't come back with a new set of constraints but that's what the down vote button is for I guess LOL +1 \$\endgroup\$
    – Andy aka
    Oct 31, 2016 at 10:33
  • \$\begingroup\$ @pjc50 well... microswitch would work, but, as all mechanics, it is unreliable. I was hoping to rely on non-movable stuff mostly. \$\endgroup\$ Oct 31, 2016 at 10:41
  • \$\begingroup\$ It is for sure much more reliable than ultrasound, and easier to implement than IR. \$\endgroup\$
    – polwel
    Oct 31, 2016 at 11:07
  • \$\begingroup\$ @pjc50 just googles for microswitches - they seem pretty reliable these days. So I may consider them too, thanks. \$\endgroup\$ Oct 31, 2016 at 12:17
  • \$\begingroup\$ @pjc50 I've chosen your answer, as microswitches appear, to my surprise, as the most reliable method. Strange, but thank you :) \$\endgroup\$ Nov 8, 2016 at 11:18

An optical reflection using 5mm IR emitter and detector are most sensitive in the small gap controlled by narrow beam width and angle.

This pulse "signal" reduces by 2x inverse squared with distance.

Sensitivity with daylight blocking PD is tuned by voltage gain of the Load R and logic level.

  • there are Tons of examples of IR proximity methods for < $1

A simple light sensitive device would work in "normal" cases where the surface is opaque and there is ambient light. Ultrasonic would work regardless of the ambient light, but probably not if the surface is absorbent. There probably isn't a single, uniformly-acceptable, reasonable-cost solution for all cases


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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