2018-08-29 01:54 AM
I try to use the LIS3DH as a fall sensor in an security device for elderly people.
I want to use a more elaborate detection method than just using the free fall interrupt and therefore I try to define a fall as first a free fall interrupt and then an activity or "wake-up" interrupt.
For the freefall everything works as expected. I set up the registers as follows:
Write (0x25): 0x02 //Change active high to active low
Write (0x20): 0x57 //Enable all axis with 100Hz
Write (0x22): 0x40 //Enable Interrupt on INT1
Write (0x23): 0x00 //fs 2g
Write (0x24): 0x08 //Latch interrupt
Write (0x33): 0x02 //Duration 20ms
Write (0x32): 0x1f //Threshold 16mg * 31 = 496mg
Write (0x30): 0x95 //AND of x,y,z low events
After I receive the Interrupt I then change the configuration to the following:
Write (0x20): 0x57 //Enable all axis with 100Hz
Write (0x22): 0x40 //Enable Interrupt on INT1
Write (0x23): 0x20 //fs - 10: ±8 g
Write (0x24): 0x08 //Latch interrupt
Write (0x33): 0x01 //Duration 10ms
Write (0x32): 0x20 //1 LSb = 62 mg @ FS = ±8 g -> Threshold 62mg * 32 = 1984mg
Write (0x30): 0x2a //OR of x,y,z high events
The problem I experience is that apparently the scale of the treshold register is not 62mg/LSB but 32mg/LSB as I get an interrupt if 1g is slightly exceeded and not 2g as expected.
If I set the threshold to 0x41 * 32mg = 2080mg I only get the interrupt if the acceleration exceeds 2g.
Do I have a false assumption somewhere? Or am I configuring something wrong?
Thanks for your help.
2018-08-29 05:15 AM
The configuration is correct and the threshold is 62mg/LSB, so in your case the threshold is really 2g.
How do you know the interrupt is triggered by 1g?
2018-08-30 04:35 AM
I looped over the acc_data and printed out the measured accelerations on each axis.
But I ran the test again and now found that indeed the acceleration exceeds 2g.
So probably the data output was previously too slow to capture the triggering acceleration.
Thank you for your reply.