2018-03-07 12:33 AM
Hi
I�m working on a projekt where I have to measure the acceleration relative to the gravitation. I want to get an alert when there is an relative acceleration in any direction greater than x mg. I have tried with the build in high-pass filter and the click function, but I didn�t get results as expected. Does someone have an idea how i can use the build in functions of the sensor to get this working?
And I have a second question related to the sensor:
When i measure the temperature with the build in sensor, I get the values as 8bit two�s complement, left justified, but I haven�t found out how to convert them to the real temperature. I mostly get values of about -3 or -4 (converted from two�s complement into decimal) in a normal heated room. The temperature range is -40 to 85.
#relative-acceleration #lis2dh2018-03-07 05:33 AM
Please share you sensor configuration and what was exactly the problem. What results do you expect?
The temperature sensor can be used to measure temperature variations.
It isn't suitable to return absolute temperatures measures. The value represents difference respect to a reference not specified value.2018-03-08 06:32 AM
Thank you for your answer. I solved the questions above, but I have another problem with the 6D position detection.
First of all my configuration:
With this configuration the PIN INT1 is high, when the value of the z-axis is above about 900mg or below -900 mg, but the treshhold should be 500mg.
Have I made a mistake in the configuration?
Is there a calulation, to get the angle with the configured treshhold?
2018-03-12 08:57 AM
The angle and the threshold have following relation = × sin ( ) where A is acceleration in g, g is Earth?s gravity (1g) and ? is angle in degrees.
So for your value 0x20 (500mg) the interrupt is generated up to 30° deviation from landscape up or landscape down orientations (
Register 0x30=0xF0)
.To detect these two orientations the values in X and Y axis is compared with the threshold. You can check the INT1 pin is high only if the value in X and Y axis are bellow 500mg, Z axis value is not important.