Sensors: Using the Accelerometer to detect motion

You may also like...

4 Responses

  1. Doofassa says:

    Thank you for such valuable information. Your site is great!
    I want to make an app that completes an action when you stop moving (driving). Is the Accelerometer the best tool for this. I have tried the code tutorial and cant get it to sense slow acceleration forward. I might be on the wrong track completely as my initial idea was to use GPS?

    • Edward M says:

      The accelerometer is best for detecting small movements and the GPS for larger movements.

      If I were to write this – and am thinking this sounds like a good tutorial idea! – I would probably start with GPS and detect when the GPS has not detected movement for a period of time.

      When driving, do we want to detect merely when we stop at a stop sign? Or when the car is parked? To detect if the car is parked, we will want to check to see if the GPS has shown no movement for, say, 5 or 10 minutes, to avoid detecting being stuck at a signal light or in traffic.

      Another item to keep in mind is that GPS is not 100% accurate. GPS works by measuring the time delay of signals coming from satellites. These signals can be delayed by very small amounts depending on atmospheric and other situations. Therefore, to detect a stop, you need to round off the GPS location to within, say, 30 feet (10 meters or even a greater circle size). While at a stop, the GPS location might return different values within that circle. That’s why you need to round off or assume an “error” of GPS measurement.

      Sounds like a fun project concept.

      Ed

LinkedIn Auto Publish Powered By : XYZScripts.com