2025-05-15 8:22 AM - last edited on 2025-05-15 10:55 AM by Peter BENSCH
Hi,
I am, working with LIS2DH12 and I want to detect some variations of Z axis.
I don't need to detect accelerations just variations of its current positions over my threshold.
My current configuration is the following.
CTRL1 (0x20) -> 0x17
CTRL2 (0x21) -> 0x00
CTRL3 (0x22) -> 0x40
CTRL4 (0x23) -> 0x00
CTRL5 (0x24) -> 0x08
CTRL6 (0x25) -> 0x00
INT1_CFG (0x30) -> 0x20
INT1_THS (0x32) -> 0x30
INT1_DUR (0x33) -> 0x3C
Other registers set as default.
What I want is to detect Z axis variations in case it has changed its position from (typically around 60) to something around +-14. I want it only to trigger the interrupt if it keeps this way more than 60 seconds that is why I set an ODR of 1.
The problem is that my accelerometer is waking up my MCU every 60 seconds even when it is flat on the table and nothing is touching it. In case I read the axis, it gives me 60 for Z.
I think I have something wrong but I don't see what.
Also, I just set ZH but no ZL. In case I add ZL, it keeps triggering the interrupt every time. What is it for? Should it be enable?
Thanks in advance