# ADXL Accelerometer data to speed

• wa5211
In summary: Depending on the position of the vessel in the water, these accelerations can be quite large. So, it's not really possible to measure the speed of the vessel using just an accelerometer. You need some sort of reference system to keep track of the vessel's position.Hi, can you please elaborate on this? What do you mean by "reference system"?
wa5211
I am in need of a little guidance.
I am trying to calculate the speed of travel using an ADXL330 accelerometer, with values in the X Y and Z directions. I know this isn't a particularly accurate way of calculating the speed of travel but its this is the only component i have at my disposal

I have been trying different formulas for converting the three output values into a speed in MPH but so far i have been having no look. Is there a generic equation that i am overlooking.

Any guidance would be greatly appreciated

What type of vehicle are you trying to calculate the speed of?

Initially a car traveling in a straight line which accelerates from a motionless position to a set speed, and then decelerates back to 0 again.

You need to integrate the acceleration to get speed.
Measure the acceleration regularly in small time increments and multiply by the time

eg if you measure an acceleration of 2m/s^2 at 1ms then after another 1ms you are going = 2 m s^2 * 0.001 s = 0.002m/s faster

In practice you need a more complex scheme (like a Kalman filter) to smooth out noise in the data

Last edited:
That sounds good but how do i get from 3 accelerations in the three different axis, to one acceleration?

sqrt( x^2 + y^2 + z^2) gives you the overall acceleration

Or you mount the device with one axis (say X) pointing forward and just use that one for the forward speed. If you want accurate speed in corners you will need the x and y, sqrt(x^2 + y^2)
You probably don't want to include up and down bouncing on the road as part of your 'speed' so ignore Z.

Thats great, i have been playing around with that equation recently but will have another go tomorrow to see what i can get out of it.
I have sample data that i know acceleratesd to 60MPH so i will see if i can get some data relatively near that value

Thanks for you help so far!

I have been toying with this all day.

I have some sample data which i collected on a run in the car. The data is accelerometer values from the 3 axis of acceleration for a car journey in a straight line. The car accelerates from a standing start to 60 MPH and then decellerated back to a standing position. No matter what modifications i do to the calculation, it appears that the results tell me that the car is reversing very quickly at the end of the data i collected when i know for a fact the car was stationary.

If i post my data would anyone be willing to look at it and see if they get the same results i do?

File has been updated to a working version

#### Attachments

• 0-60 Raw Values.xls
99.5 KB · Views: 348
Last edited:
The file seems to be corrupted

File has been updated to a working version. Sorry for the problem

That looks about normal for accelerometer data.
Because of the noise and the small values you have to do more than just subtract the value from the previous one - take a look at Kalman filters.

Ok, il have a look at Kalman filters, thanks for your help

In file: 0-60 Raw Values.xls
I don't know why (Convert to G-Forces) = (Remove initial calibration error)/500?
what is 500?

Hi..
I've taken up project on Event data recorder as my final yr project. I want to log in the speed as well as the direction of motion of vehicle into a memory card . Firstly i want to calculate the vehicle's speed using a 3-axis accelarometer and micro-controller ( interfaced with RTC )& record those values into memory device along with vehicle's path ( left,right,straight ) Could anyone suggest me the proper devices to be used for this project so that i can get the max accuracy in my calculations ?? Please guide me. I request the ones who hav already tried this thing to please give me satisfactory replies.. Hope to hear from you soon

Hello, any idea how does it work at sea on a vessel? On land, it is relatively easy. But at sea, I found that all 3 axes (x, y and z) show positive and negative accelerations when the vessel is moving and even stationary at terminal.

## 1. What is an ADXL Accelerometer?

An ADXL accelerometer is a sensor that measures acceleration, tilt, and vibration of an object in 3 axes - x, y, and z. It is commonly used in electronic devices such as smartphones, fitness trackers, and gaming consoles.

## 2. How is ADXL Accelerometer data converted to speed?

The ADXL accelerometer measures acceleration, so to convert it to speed, we need to integrate the acceleration data over time. This can be done using mathematical formulas or specialized software.

## 3. What are the units of measurement for ADXL Accelerometer data?

The units of measurement for ADXL accelerometer data are usually in meters per second squared (m/s^2) or gravitational units (g). However, it can also be configured to measure in other units such as feet per second squared (ft/s^2).

## 4. Can ADXL Accelerometer data be used to measure velocity?

No, ADXL accelerometer data cannot directly measure velocity. It can only measure acceleration, which can then be integrated over time to calculate velocity. However, due to the accumulation of errors in the integration process, the velocity calculated from ADXL data may not be accurate.

## 5. Are there any limitations to using ADXL Accelerometer data for speed measurement?

Yes, there are limitations to using ADXL accelerometer data for speed measurement. The accuracy of the speed calculation depends on the accuracy of the acceleration data, which can be affected by external factors such as temperature, vibration, and noise. Additionally, the integration process can introduce errors, leading to inaccurate speed measurements.

• Mechanics
Replies
11
Views
23K
• Mechanics
Replies
1
Views
2K
• Mechanics
Replies
4
Views
2K
• Mechanics
Replies
4
Views
8K
• Mechanics
Replies
15
Views
1K
• Mechanics
Replies
10
Views
2K
• Mechanics
Replies
2
Views
11K
• Mechanics
Replies
11
Views
2K
• Mechanics
Replies
22
Views
7K
• Mechanics
Replies
2
Views
10K