Skip to main content
abali.1
Associate II
September 14, 2021
Solved

How can we use 3-D accel data to calculate the acceleration value?

We get three 16-bit value from the register of ISM330DLC, how to use the three values to calculate the acceleration? Please help.

This topic has been closed for replies.
TSand.1
TSand.1Best answer
Visitor II
September 14, 2021

Hi, you can check the datasheet for the conversion formula and the sensitivities, but I found a C sample code on GitHub that if maintained by ST, and where you can find the conversion formula. The "lsb" are the raw data to be inserted in:

float_t ism330dlc_from_fs2g_to_mg(int16_t lsb)

{

return ((float_t)lsb * 0.061f);

}

https://github.com/STMicroelectronics/ism330dlc/blob/80601233c2ec4b9e675d154bba0654329405ebc0/ism330dlc_reg.c

https://www.st.com/resource/en/datasheet/ism330dlc.pdf

4 replies

TSand.1
TSand.1Best answer
Visitor II
September 14, 2021

Hi, you can check the datasheet for the conversion formula and the sensitivities, but I found a C sample code on GitHub that if maintained by ST, and where you can find the conversion formula. The "lsb" are the raw data to be inserted in:

float_t ism330dlc_from_fs2g_to_mg(int16_t lsb)

{

return ((float_t)lsb * 0.061f);

}

https://github.com/STMicroelectronics/ism330dlc/blob/80601233c2ec4b9e675d154bba0654329405ebc0/ism330dlc_reg.c

https://www.st.com/resource/en/datasheet/ism330dlc.pdf

abali.1
abali.1Author
Associate II
September 15, 2021

Thanks for the reply @TSand.1​ . Do we need to use vector magnitude calculation formula to find the overall acceleration magnitude?

TSand.1
Visitor II
September 16, 2021

yes, you need the 3 spatial axis components to get the total acceleration magnitude in space

abali.1
abali.1Author
Associate II
September 17, 2021

Thanks @TSand.1​