LIS2DH12 configuration
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
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
- Labels:
-
Accelerometers
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2025-05-16 5:57 AM
Hi @P M,
By writing the register 24h (CTRL_REG5) to 0x08, you are enabling the LIR_INT1 bit:
This means that in order to clear the interrupt pin you need to read the INT1_SRC register (31h). If this is not your problem, can you please share some data?
Keep in mind that with your configuration the THS is 750 mg and DUR = 60s.
I tried to replicate the same configuration as your with UNICO GUI and nothing strange has been detected.
