How to convert accelerometer data into G with the ADXL345 digital accelerometer

Thread Starter

ckkkk

Joined Apr 17, 2019
15
Am totally new to electronics and the datasheet is very confusing to me, so can anyone please guide me through the specification of the accelerometer? So that i can have a better understanding on the accelerometer and to be able to convert the accelerometer data into G.

X-axis Y-axis Z-axis -28 -26 218 These are the readings i get from the accelerometer with a +-2g range

This is the datasheet for the ADXL345 digital accelerometer [1]: https://www.analog.com/media/en/technical-documentation/data-sheets/ADXL345.pdf
 

jpanhalt

Joined Jan 18, 2008
11,088
Source: Datasheet
The ADXL345 is a small, thin, ultralow power, 3-axis accelerometer with high resolution (13-bit) measurement at up to ±16 g. Digital output data is formatted as 16-bit twos complement and is accessible through either a SPI (3- or 4-wire) or I2C digital interface. The ADXL345 is well suited for mobile device applications. It measures the static acceleration of gravity in tilt-sensing applications, as well as dynamic acceleration resulting from motion or shock. Its high resolution (3.9 mg/LSB) enables measurement of inclination changes less than 1.0°.
That device, like others with which I am familiar, reports directly in g . If you want angle or to correct for other than the stationary state, then you need to use trig or an approximation.
 

Thread Starter

ckkkk

Joined Apr 17, 2019
15
That device, like others with which I am familiar, reports directly in g . If you want angle or to correct for other than the stationary state, then you need to use trig or an approximation.
If it is already in g wouldn't the z-axis output close to 1? As i did some research and found out that when the sensor is stationary the z-axis should have a 1g output.
 

tsan

Joined Sep 6, 2014
116
On the datasheet, "Full resolution, where resolution increases with g range, up to 13-bit resolution at ±16 g (maintaining 4 mg/LSB scale factor in all g ranges)"
Which makes 0,004 g per bit. Your 218 would be 218*0,004 g = 0,872 g.
 

Thread Starter

ckkkk

Joined Apr 17, 2019
15
On the datasheet, "Full resolution, where resolution increases with g range, up to 13-bit resolution at ±16 g (maintaining 4 mg/LSB scale factor in all g ranges)"
Which makes 0,004 g per bit. Your 218 would be 218*0,004 g = 0,872 g.
Which means no matter what measurement range the accelerometer is on the output data should always multiply by 0.004g?
 

tsan

Joined Sep 6, 2014
116
I have not used ADXL345, but there seems to be different (user select-able) output resolutions that affects to scaling. Output resolution and sensitivity is on the table 1 in datasheet page 5. For example for +-4 g range, resolution can be 10 bits or 11 bits. 11 bits is full resolution. With 10 bit resolution scaling is 7,8 mg/LSB and with full resolution scaling is 3,9 mg/LSB. On a quick look, resolution is set with Register 0x31—DATA_FORMAT (Read/Write).
 

Thread Starter

ckkkk

Joined Apr 17, 2019
15
I have not used ADXL345, but there seems to be different (user select-able) output resolutions that affects to scaling. Output resolution and sensitivity is on the table 1 in datasheet page 5. For example for +-4 g range, resolution can be 10 bits or 11 bits. 11 bits is full resolution. With 10 bit resolution scaling is 7,8 mg/LSB and with full resolution scaling is 3,9 mg/LSB. On a quick look, resolution is set with Register 0x31—DATA_FORMAT (Read/Write).
Wait i don't understand, i thought with +-4g range it will be 11bits? Also why with 10bit resolution scaling is 7.8mg/lsb and with full resolution the scaling is 3.9 mg/lsb?
 
Top