Skip to main content
shammi kaplesh
Associate
May 27, 2018
Question

LIS2HH12 sensor output data

  • May 27, 2018
  • 9 replies
  • 2487 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.

9 replies

Winfred LU
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

shammi kaplesh
Associate
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

Winfred LU
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