cancel
Showing results for 
Search instead for 
Did you mean: 

LIS2HH12 sensor output data

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

9 REPLIES 9
Winfred LU
ST Employee
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

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

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

Posted on May 28, 2018 at 11:18

Hi Winfred,

i tried to compare these value using smart phone  accelerometer , but z axis value on smart-phone is 9.7m/s^2, but i am getting 11.48 on my linux board.

Regards,

SHAMMI

Posted on June 01, 2018 at 05:23

Hi Winfred,

Can we use Lis2hh12 accelerometer  for processor wakeup. Our requirement is accelerometer should generate

interrupt, whenever there is change in x-axis and y-axis.  Is  this feasible ?

Regards,

SHAMMI

Posted on June 01, 2018 at 07:18

Hi SHAMMI,

It is possible that the device was moving when getting XYZ data or zero g offsets exist for your device.

Not an apple-to-apple comparison for your device and a smart phone.

Best Regards,

Winfred

Posted on June 01, 2018 at 07:21

Hi SHAMMI,

Yes. That would be one of its basic functions.

Please refer to

/external-link.jspa?url=http%3A%2F%2Fwww.st.com%2Fresource%2Fen%2Fapplication_note%2Fdm00165pdf

, Section 6.3

Best Regards,

Winfred

Posted on June 07, 2018 at 05:57

Hi Winfred,

I am able to read the values of TEMP_L, TEMP_H. How can i convert these values to

Celsius ?

Regards,

SHAMMI

Posted on June 11, 2018 at 11:09

Hi SHAMMI,

Please refer to Table 5 in 

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

 0690X0000060LDIQA2.png

8 digit = 1 degree Celsius

So,

temperature in Celsius = ((TEMP_H << 😎 + (TEMP_L)) / 8 + 25

Best Regards,

Winfred