cancel
Showing results for 
Search instead for 
Did you mean: 

Flexible Tilt angle measurement/interrupt in LIS2DW12

Vsv.1
Associate II

Hi ,

. I uses LIS2DW12. I have seen that 6D orientation angle is from 45 or 50 degrees only. So setting an interrupt for this wont be useful for my purpose.

I would like to wake up on minimum angle that I sets, say 5degree/10 degree . How could I achieve It. Is there any pseudo code available for that Like one is for 6D orientation (DT0097)?. When checked the STmem driver, I have seen that WAKE_UP_THS(34h) API is available for setting threshold values.

How I can get interrupt for a the tilt value I set (say 10 degree) for only one axis by setting threshold in this register. Also how to calculate to and from mg to degree(getting from raw value and setting to threshold)?.

Awaiting for the earliest response.

regards,

SV

14 REPLIES 14

Hi @Vsv.1​ ,

for a "smart" use of the wake-up embedded feature, I suggest the DT0098 design tip, that explains how to enable and personalize the wake-up recognition feature for LIS2DW12, if it can be of any help for you.

Please let me know,

-Eleon

HI @Eleon BORLINI​ .

I followed the design tip and implemented as suggested .

What I experienced is the wake-up can be obtained through a shock or shake, but a slow tilt cannot generate an interrupt. When setting 6D orientation functionality, I have observed slow tilt in that range generates 6D interrupt.

For getting slow tilt in Wu functionality, If we set THS very low(1) and low ODR, it will detect very small shocks even but not a slow tilt/rotation.

My device will be getting intermittent shocks , but I don't want to wake micro controller up from sleep at that point. But when somebody tries to tilt it for picking it, accelerometer needs to interrupt the uC for wake up.

Regards,

VSV

Hi @Vsv.1​ ,

in order to cut (or, at least, to reduce) the effect of rapidly varying signals or shocks, you could introduce:

  • The second low pass filter (LPF2) in the acquisition chain, by enabling the BW_FILT[1:0] bits of CTRL6 (25h) register (see datasheet p.42);
  • A proper duration of the interrupt event. For example, if you configure the WAKE_DUR[1:0] bits of WAKE_UP_DUR (35h) register, as described in the application note AN5038, p.21:

"The duration parameter defines the minimum duration of the wake-up event to be recognized; its value is set using the WAKE_DUR [1:0] bits of the WAKE_UP_DUR register: 1 LSB corresponds to 1*ODR time, where ODR is the accelerometer output data rate. It is important to appropriately define the duration parameter to avoid unwanted wake-up interrupts due to spurious spikes of the input signal."

-Eleon

HI @Eleon BORLINI​ .

Thanks Eleon.

Yes I Have seen this. I will try with adding LPF2.

But Is the stated behavior in my previous post is correct?. i.e. it cannot wake up with a slow tilt/rotation,

(the requirement is ,ls2dw12 has to interrupt the microcontroller in sleep with a slow tilt/rotation. )

Hi @Vsv.1​ ,

uhm... I don't believe so, you should be able to generate the interrupt when you exceeds the predefined threshold...

Did you make (qualitative) tests on the rotational speed below which you cannot detect the interrupt?

You can try to increase the WAKE_UP_DUR register content an see if it can help.

-Eleon