2024-04-14 08:07 AM
Hello,
I have code working well on the LIS2DH12 that I'm having trouble porting to a LIS2DW12. Unfortunately my new supplier only has boards with the LIS2DW12 and not the H12 so I have to port over my detection code to it. I have a sensor connected to a mechanism that closes shut very quickly and basically just want to get an interrupt when the Z-axis has forceful feedback like this.
Using the LIS2DH12, I had the scale set at 16G, a threshold that worked well (0x5a on the INT1 register) and INT1_CFG it to a Z-axis high event, with 50Hz ODR. This worked perfectly.
Unfortunately, the LIS2DW12 doesn't seem to have settings similar to detect a Z-axis high event, so I'm trying to use the click interrupt instead, but it's not working. It fails to detect the shut mechanism unless is set it to a 2g scale and then it's too sensitive because I shouldn't get interrupts for slight movements but I do.
My settings for the LIS2DW12 are:
ctrl1 - 0b01000000 - 50hz low power
ctrl4 - 0b01000000 - single tap detection
ctrl6 - 0b00011100 - 16g, low noise
ctrl7 - 0b00100000
2024-04-30 01:47 AM
2024-04-30 07:03 AM
Federica,
Yes, I had tried that one as well as the application notes. The examples work for light taps, but what I need is to only detect very fast and sudden movement on the Z-axis. I would like the sensor to ignore light and small motions.