cancel
Showing results for 
Search instead for 
Did you mean: 

Detecting fast Z movement on LIS2DW12

nemik
Associate

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

TAP_THS_X - 0b000
TAP_THS_Y - 0b11111111
TAP_THS_Z - 0b00111000
INT_DUR - 0b00000110
WAKE_UP_THS - 0b0

I hope I'm just missing something obvious and that this can work. I would have liked to use the wake-up threshold but it doesn't seem like it can be assigned to particular axis and just detects them all?
 
Thank you in advance for any help on this.
2 REPLIES 2
Federica Bossi
ST Employee

Hi @nemik ,

Welcome to ST Community!

Have you already tried to implement our official example?

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.

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.