cancel
Showing results for 
Search instead for 
Did you mean: 

LIS2DW12 Accelerometer tilt angle detection

MIR.1
Associate II

Hi,

I am using LIS2DW12 Accelerometer for tilt angle detection

Is it possible to detect the tilt angle(A and B) in both directions as shown in figure and trigger the interrupt event in wakeup interrupt mode?

It is possible in 6d orientation mode, but I need wakeup interrupt mode since I have to detect the tilt angles from 10 degrees.

Please suggest a suitable solution.0693W000007ZujeQAC.png

1 ACCEPTED SOLUTION

Accepted Solutions
Eleon BORLINI
ST Employee

Hi @MIR.1​ ,

I'm afraid there is not a direct flag telling you the sign of the tilt angle, as happens for the 6D orientation feature.

However, when the tilt interrupt (with the wake-up feature) rises, in that instant you could capture the data from the X, Y and Z axis, and check the sign of these values and compare it to the reference system you have chosen, to gain an indication on the direction of the interrupt (in the case shown by your picture, for example, assuming you are showing the X and the Z axis, you'll might have ++ sign for the tilt with angle "A" and -+ for the tilt with angle "B". It's a simplification since you have to pay attention to the 1g gravity vector along Z axis when the device is planar, and to all the other components when it is tilted.

Let me please know if this solution might be useful for you.

-Eleon

View solution in original post

7 REPLIES 7
Eleon BORLINI
ST Employee

Hi @MIR.1​ ,

I'm afraid there is not a direct flag telling you the sign of the tilt angle, as happens for the 6D orientation feature.

However, when the tilt interrupt (with the wake-up feature) rises, in that instant you could capture the data from the X, Y and Z axis, and check the sign of these values and compare it to the reference system you have chosen, to gain an indication on the direction of the interrupt (in the case shown by your picture, for example, assuming you are showing the X and the Z axis, you'll might have ++ sign for the tilt with angle "A" and -+ for the tilt with angle "B". It's a simplification since you have to pay attention to the 1g gravity vector along Z axis when the device is planar, and to all the other components when it is tilted.

Let me please know if this solution might be useful for you.

-Eleon

MIR.1
Associate II

Hi Eleon,

Thank you for your response.

I think there is a misunderstanding in our communication.

I just want to get the interrupt event when the accelerometer tilted in both directions

with respect to the perpendicular axis in the above figure where A equals B.

Please let me know is it possible to realize it in wake up interrupt mode?

Prajin.I.R

Hi Eleon,

I would like to add one more point.

I used the interrupt event trigger from accelerometer to wake up my device.

So calculation after wakeup of accelerometer is not expected.

Regards,

Prajin.I.R

Eleon BORLINI
ST Employee

Hi Prajin,

ok, now is more clear. Since the wake-up threshold is an absolute value, you'll receive an interrupt both if the tilt is in the A direction or in the B direction, provided they are equal angles.

You might however face little asymmetry, if there is a slight residual offset on one side with respect to the other. In this case, you can compensate by applying a user offset determined by the X_OFS_USR (3Ch), Y_OFS_USR (3Dh), Z_OFS_USR (3Eh) register values and the USR_OFF_W bit in CTRL7 (3Fh) and send the result to the output using the USR_OFF_ON_OUT bit in CTRL7 (3Fh) (see datasheet, p.21).

-Eleon

MIR.1
Associate II

Hi Eleon,

Thank you very much for your response.

Presently I have modified the offset value and now I got the symmetric detection of tilt angle.

Still I have one more doubt.

Is there any provision for hardware rebasing in this accelerometer?

Regards,

Prajin.I.R

Hi Eleon,

Thank you very much for your response.

Your first answer itself is a solution.

Regards,

Prajin.I.R

MIR.1
Associate II

Hi Eleon,

Thank you very much for your response.

I think your first answer can be considered as a solution for hardware rebasing.

Please inform any other chance for more exploration.

Regards,

Prajin.I.R