Use BMI-270 to track how far a door has opened

The BMI-270 is a 6 axis IMU (accel + gyro). Trying to calulate the angle at which the door is opend and and use the gyro+accl ( complementary filter) to figure out the correct angle if the door rotation axis is horizontal to the earth ( for e.g in-earth trap door that opens upwards), but not able to do the same if the door rotation axis is vertial to the earth. The observation is that the accelerometer data remain virtually unchanged if the vertical door is swung open or closed gently. If it is opened such that there is some jerk then that data shows up but most of the motion is not captured.

Tried to set the the interrup for anymotion check but that only triggers when there is acceleration or deacceleration.

As described before, there is no problem if the door is opened horizontally.

It seems the accelerometer works correctly when the height of the sensor changes with respect to earth (gravity vector), but if there is no change in the gravity vector the small gentle motions are impossible to detect.

Any ideas on how to solve this problem.

 

 

4 replies