Yes, using the gyro (as stated at the start), but the gyro drifts (therefore used the complemenatry filter - accelerometer) and it works perfectly (opening angle is correct, but only when the door axis is horizontal to earth). Put it on your room door (axis perpendicular to earth) and it does not work. To fix the issue decided to stop integrating gyro data while not in motion, but detecting motion /no motion when the door is moving gently is leading to misleading results as accelerometer only detects accl /deaccel. My conclusion is tha that the accelerometer only detects motion when it is moving along a graviy vector ( i.e the height of the senor w.r.t center of the earth varies) . If the sensor moves at a uniform veloicity along a path with fixed height to center of the earth then it can only detect rate of change. How to use accelerometer+gyro to detct opening of a door that has a rotation axis perpenidicular to earth. Maybe BMI270 is not suitable for this problem and need a magnetic sensor instead.
... View more