Showing results for 
Search instead for 
Did you mean: 

LIS3DH Tilt and upside down detection


Hi all,

I'm trying to use the LIS3DH to detect if the object is in a non-safe position, i.e. standing on a slope (tilted) or in the upside down position and generates an interrupt if it's one of these. 


  • Y-axis pointing downwards in the stable position (y-axis reads +1G)
  • ZH & XH whenever the threshold exceeds 480 mg for longer than 0.5 seconds
  • ODR on 100 Hz
  • Range +- 2g
  • LPM enabled

I've tried the postition detection function for this, but to my experience this only generates an interrupt when it's mostly in the known axis regardless of the set threshold. Maybe I've misinterpreted the datasheet.

For now I've got the tilt interrupt working, but whenever I want to detect upside down it generates an interrupt when it's in the stable position. I know this is due to the inertial interrupt triggering whenever the absolute value of the axis is above the threshold, so gravity triggers this interrupt. 

I'd rather have the remaining interrupt detect a free-fall so I want all of this in the first interrupt source. Is this combination even possible?



Federica Bossi
ST Employee

Hi @NativeLethalP ,

Welcome to ST Community!

You could look at our PID examples on Github where you can find an example for free fall detection.

Try to implement it in your code and let me know if this helps you.

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.