Skip to main content
Visitor II
September 14, 2021
Solved

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

  • September 14, 2021
  • 3 replies
  • 1119 views

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.
    Best answer by TSand.1

    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

    3 replies

    TSand.1Answer
    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.1Author
    Visitor 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?

    Visitor II
    September 16, 2021

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

    abali.1Author
    Visitor II
    September 17, 2021

    Thanks @TSand.1​