Go Down

Topic: How to calculate velocity from accelerometer (LSM303DLM) !!!! (Read 3250 times) previous topic - next topic


I have  an accelerometer (LSM303DLM) and with Arduino UNO i want to find velocity

i try this formula  : Vf = Vi + a*t , but i found that my velocity it affected by acceleration angle ,and the other problem is my acceleration is very sensitive and affected my velocity ...

if i used gyroscope with combination the accelerometer i will take corrected velocity values ?


Sep 05, 2013, 03:49 am Last Edit: Sep 05, 2013, 03:51 am by 1ChicagoDave Reason: 1
How are you getting your values?
What are you using for time?

That formula is for "final velocity" after a certain amount of time. Is that what you want? 
Or instantaneous velocity (right now)?

What is "it" giving you?



i am getting the acceleration values  from accelerometer. The time that  i used  is the same of the delay time  t = 0.02 ... is correct ??
is verry sensitive the LSM303DLM and the values change very easy.... i think it happened from angle velocity...my project is to do balck box from car
which  is calculate the velocity . from this equation i take the final velocity but i am ton sure

my code is :

// velocity_i is the velocity initial
//acc1122.y is my accelaration
// 0.2 is the time 

   distance = (velocity_i * 0.2) + (0.5 * acc1122.y * 0.2*0.2);
   velocity_f = ((2 *distance)/0.2) - velocity_i ;

   velocity_f = abs (velocity_f);
   distance  = distance /(10 *10);

// velocity_i = velocity_f ;

   velocity_i = velocity_f - acc1122.y * 0.2 ;
   Serial.print("Velocity: ");
   Serial.println ( velocity_f);

Go Up