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.
Please reference DS9965 , Table 3,
According to your FS settings, the sensitivity can be:
Then convert it with 1 g = 9.8 m/s^2
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_y_raw 519
cat /sys/bus/iio/devices/iio\:device0/in_accel_z_raw 19208
How can i convert these values to acceleration ?
-398 *0.061 /1000 *9.8 = 0.24 (m/s^2)
519 *0.061 /1000 *9.8 = 0.31 (m/s^2)
19208 *0.061 /1000 *9.8 = 11.48 (m/s^2)
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.
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.
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 ?
Yes. That would be one of its basic functions.
Please refer to AN4662 , Section 6.3
I am able to read the values of TEMP_L, TEMP_H. How can i convert these values to Celsius ?
Please refer to Table 5 in DS9665
8 digit = 1 degree Celsius
temperature in Celsius = ((TEMP_H << 8) + (TEMP_L)) / 8 + 25
Retrieving data ...