2018-05-27 02:00 AM
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
2018-05-27 10:03 PM
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
2018-05-28 01:57 AM
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
-398cat /sys/bus/iio/devices/iio\:device0/in_accel_y_raw
519cat /sys/bus/iio/devices/iio\:device0/in_accel_z_raw
19208How can i convert these values to acceleration ?
Regards,
SHAMMI
2018-05-28 02:38 AM
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
2018-05-28 04:18 AM
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
2018-05-31 10:23 PM
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
2018-06-01 12:18 AM
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
2018-06-01 12:21 AM
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.3Best Regards,
Winfred
2018-06-06 10:57 PM
Hi Winfred,
I am able to read the values of TEMP_L, TEMP_H. How can i convert these values to
Celsius ?
Regards,
SHAMMI
2018-06-11 04:09 AM
Hi SHAMMI,
Please refer to Table 5 in
http://www.st.com/resource/en/datasheet/lis2hh12.pdf
8 digit = 1 degree Celsius
So,
temperature in Celsius = ((TEMP_H << 8) + (TEMP_L)) / 8 + 25
Best Regards,
Winfred