Skip to main content
Visitor II
May 27, 2018
Question

LIS2HH12 sensor output data

  • May 27, 2018
  • 1 reply
  • 2459 views
Posted on May 27, 2018 at 11:00

Hello,

we have connected the lis2hh12 accelometer with our linux board using i2c bus. I am able

to read the raw x,y,z values from sensor using sysfs interface. How can i convert these 

raw values to actual acceleration(m/s2) values.

Regards,

SHAMMI

    This topic has been closed for replies.

    1 reply

    ST Employee
    May 28, 2018
    Posted on May 28, 2018 at 07:03

    Hi SHAMMI,

    Please reference 

    http://www.st.com/resource/en/datasheet/lis2hh12.pdf

     , Table 3,

    According to your FS settings, the sensitivity can be:

    SensitivityFull Scale

    0.061 mg/digit±2.0 g

    0.122 mg/digit±4.0 g

    0.244 mg/digit±8.0 g

    Then convert it with 1 g = 9.8 m/s^2

    Best Regards,

    Winfred

    Visitor II
    May 28, 2018
    Posted on May 28, 2018 at 08:57

    Hi Winfred,

    current FS settings are +/- 2.0G

    and from sys interface i can read the following values. 

    cat /sys/bus/iio/devices/iio\:device0/in_accel_x_raw

    -398

    cat /sys/bus/iio/devices/iio\:device0/in_accel_y_raw

    519

    cat /sys/bus/iio/devices/iio\:device0/in_accel_z_raw

    19208

    How can i  convert these values to acceleration ?

    Regards,

    SHAMMI

    ST Employee
    May 28, 2018
    Posted on May 28, 2018 at 09:38

    Hi SHAMMI,

    x:

    -398

    *0.061 /1000 *9.8

     = 0.24 (m/s^2)

    y:

    519 *0.061 /1000 *9.8 = 0.31 (m/s^2)

    z:

    19208 *0.061 /1000 *9.8 = 11.48 (m/s^2)

    Best Regards,

    Winfred