2
\$\begingroup\$

I have a 3-axis accelerometer on my board and i was hoping to use it to detect when a user lifts the device up.

I would like to avoid false triggers when the table shakes or when the user nudges the device slightly.

I thought this would be a straightforward case of getting the magnitude from all 3 axis (which should on average give me around 1g acceleration) and then low pass filtering it to remove any high frequency noise. Leaving behind the low frequency content of gravity + the motion of lifting the device up. However, it seems a nudge creates a spread of frequncies some of which overlap in the region i am interested in (0Hz - 2 Hz). Any standard filters for accelerometer data?

Can accelerometers be used for such detection? Must i use a different sensor?

\$\endgroup\$
  • 1
    \$\begingroup\$ Do you care if a user purposely picks it up slowly to try and defeat it? \$\endgroup\$ – DKNguyen Nov 4 '19 at 21:32
  • 5
    \$\begingroup\$ Maybe you can integrate the signal over time (add them up)? So you'd be looking for a much larger signal due to human interaction vs short pulse from nudge or shock. \$\endgroup\$ – Aaron Nov 4 '19 at 21:32
  • \$\begingroup\$ "a spread of frequncies some of which overlap in the region i am interested in." what region are you interested in? \$\endgroup\$ – Bruce Abbott Nov 4 '19 at 23:38
  • 1
    \$\begingroup\$ @HassanNasir yes the errors add as well, BUT they add as the square root of the error, so the signal grows faster than the error does. This is how they count photons for distant stars (very noisy signals) \$\endgroup\$ – Aaron Nov 5 '19 at 18:17
  • 1
    \$\begingroup\$ @HassanNasir Integration will add error, but your application is a bit unusual in that it doesn't matter for very long. You can always just reset everything to zero when the acclerometer detects a constant acceleration with a magnitude that is more or less 1G for a sufficiently long period of time, and not start integrating unless the acceleration exceeds 1G. You're not exactly dead reckoning so accuracy barely matters. \$\endgroup\$ – DKNguyen Nov 5 '19 at 18:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.