15,121,597 members
1.00/5 (2 votes)
See more:
Hello, i have an accelerometer embaded with a micro controler, i want to calcultae speed using the value of accelerometer,
how we do that ?
thanks
Posted
Comments
Sergey Alexandrovich Kryukov 27-Jul-15 14:34pm

How about learning elementary classical mechanics at the level of high school?
—SA
Andreas Gieriet 27-Jul-15 19:12pm

@Member 11834243: Please remove your "solution" below! If you want to improve your question, use the appropriate "Improve question" below your initial question (move the mouse to the right of your name to see that link).
Regards
Andi

## Solution 1

Apparently, it is impossible to measure speed and distance using the accelerometer; it is prohibited by the fundamental physical principles: all phenomena in different reference system moving at uniform speeds go in the same way, so you cannot detect any difference between them from inside the system. In other words, you would detect the same acceleration in systems at different coordinates and speeds, it is principally impossible to tell one from another.

In principle, you can assume that, for example, at the moment of the start of your program, the device's coordinates and speed equal to zero, and integrate the accelerations starting from this point, adding estimated coordinates and speeds to this initial point, but the accuracy of this will be extremely low, and the errors can accumulate with time greatly. First of all, you can only take the measurements at some time interval, loosing the acceleration values in between. For any given accuracy and interval between measurements and given requirements for final accuracy, it is possible to design such motion plan which will cause the system to to fail to deliver required accuracy.

—SA
v3
Comments
Andreas Gieriet 27-Jul-15 19:21pm

My 5!
Cheers
Andi
Sergey Alexandrovich Kryukov 27-Jul-15 19:41pm

Thank you, Andi.
There is one more guy trying to detect the speed, at least to detect the fact of motion using the accelerator. I advised to use accelerator as a detector of vibrations...
—SA
Liju Sankar 28-Jul-15 0:06am

+5

Thank you.
—SA
CPallini 28-Jul-15 2:41am

My 5.

Thank you, Carlo.
—SA

## Solution 3

It is theoretically possible to calculate velocity and displacement using initial conditions and acceleration. The equations of motion facilitate this. In practice it is not done this way because of accuracy considerations. See here: chrobotics accel-position-velocity[^]
To get good results one needs very accurate accelerometers, a very accurate clock and a very high sampling rate. For small (very small) intervals however it may be possible to get useful values using off the shelf accelerometers. Here is an example:
AN3379 positioning[^]
Comments
CPallini 28-Jul-15 2:41am

My 5.
[no name] 28-Jul-15 3:01am

Thanks

## Solution 4

thanks for the replay i read the pdf file, but i didn't understand how to set the time ??
could you me write the code to how to get speed from accelerometr ?

while (1)
{

printf("%f",acc.z);
// i don't know how to write the functionn to get the speed please help me

}

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Top Experts
Last 24hrsThis month
 OriginalGriff 210 Richard MacCutchan 190 Dave Kreskowiak 70 RickZeeland 60 Gerry Schmitz 20
 OriginalGriff 710 Richard Deeming 365 Richard MacCutchan 300 Dave Kreskowiak 188 Stefan_Lang 180

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900