2024-03-27 06:36 AM
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.
Setup:
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?
Regards
NativeLethalP
2024-03-28 08:49 AM
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.