Bosch Sensortec Community

    Showing results for 
    Search instead for 
    Did you mean: 

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

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

    New Poster

    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 4

    Community Moderator
    Community Moderator

    How about use the any motion interrupt as trigger.

    when any motion fired, then calcualte the movement directly from respect axis of gyro.  gyro give you the rotation speed according to this axis.

    Then use no motion interrupt to stop the calculation. 

    Then in this time window,  based on gyro sensor output, you can get out how much angle the door rotated. 

    Combined with the original position stored in your MCU, you are able to get the angle postion of door.

    You can also introduce a magnetic sensor to tell you the original postion like door closed.  ( magnetic field with highest value, sensor clsoe to magnitude). 

    Unfortunately that does not work when the sensor moves horizontally to the ground. (as on a vertical axis door)

    The register 0x1c mostly reports 0x20, with the exception where there is sudden acceleration/deacceleration when it reports 0x40

    As described before, there is no problem if the location of the sensor (read distance from center of earth) vaires, but if the distance is constant then accelerometer cannot detect motion when there is no acceleration or deacceleration.

    Established Member

    Then use the gyro. As the door swings though its arc it will generate an angular rotation in the Z axis.

    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.