1. Download our Official Android App: Forums for Android!

possible to build a speedometer using only the accelerometer?

Discussion in 'Android Apps & Games' started by GizmoDuck, Oct 17, 2010.

  1. GizmoDuck

    GizmoDuck Lurker
    Thread Starter
    Rank:
    None
    Points:
    5
    Posts:
    1
    Joined:
    Oct 17, 2010

    Oct 17, 2010
    1
    0
    5
    I'm tinkering around with trying to build a speedometer using only the accelerometer for use when I go snowboarding. I can read values from the accelerometer but I'm not sure how I would derive the velocity.

    I was thinking of taking the square root of (X^2 + Y^2 + Z^2) where X, Y, and Z are the values reported by the accelerometer in each axis but that only would only give me the amplitude of acceleration at any given instant. I could multiple that by the sampling frequency to get my instantaneous velocity but this approach fails when I'm moving at a constant speed. Any ideas?
     

    Advertisement

  2. firechicken

    firechicken Member
    Rank:
    None
    Points:
    16
    Posts:
    34
    Joined:
    Aug 23, 2010

    Aug 23, 2010
    34
    3
    16
    maybe when the acceleration drops to 0 use the last known velocity as the current speed until the acceleration changes again. can the accelometer read negative acceleration or tell when you are slowing down? maybe you can also reference the gps and use both as a test for speed?
     
  3. Hrethgir

    Hrethgir Android Expert
    Rank:
    None
    Points:
    163
    Posts:
    1,684
    Joined:
    Feb 16, 2010

    Feb 16, 2010
    1,684
    225
    163
    Male
    Intel fab tech
    Salem, OR
    Rate of acceleration over time should give you speed. That's how the old G-Tech meters worked for knowing when you hit 60 MPH or your trap speed at the end of the 1/4 mile. All it used was internal accelerometers, so you should be be able to do something similar with your phone. May not be the best for watching to know your speed, but should be OK for logging speeds, I would think. Might not be as accurate as GPS, but should work OK.
     
  4. completefailur

    Rank:
    None
    Points:
    5
    Posts:
    5
    Joined:
    Feb 15, 2011

    Feb 15, 2011
    5
    0
    5

Share This Page

Loading...