18 Apr 2011


Possibly (and probably) a very simple question. I've got an ADXL345 wired up in 4-wire SPI mode to the mbed, connected all properly. My output is of the format X,Y,Z, corresponding to the various accelerations. The values I'm receiving are, for example, {10,12,256}.

My question is how do you convert between the output values to give an actual acceleration (in g's or m/s^2)? I'm not too up on least significant bit etc.



19 Apr 2011

Have a look at the datasheet. Page four shows the conversion factors for LSB/g or mg/LSB.

For instance, to find the 'g' factor for a value of 256 look at the mg/LSB factor. For full resolution it is 3.9 mg/LSB. So the measured value of 256 counts represents:

256 counts * 3.9 mg/counts = 998.4mg or 0.998g

Once you have that, you can find the acceleration using 1g=9.81m/s^2

Note: 'g' in this sense means one unit of standard gravity (i.e. 1g=9.81m/s^2). Not to be confused with the mass unit gram.

19 Apr 2011

Thanks very much again Igor,exactly what I was looking for.