In order to prevent my venetian window blinds to go down on timer in front of my open window-style terrace door, potentially locking me out, I needed to know if the door handle was in the “open” position. However, I did not want to use a battery powered radio sensor, but the existing door open/close magnetic sensor in the door frame. Here’s my solution.
The BNO055 is a capable IMU that has on-chip sensor fusion and filtering. Interfacing can be done using I²C and UART. When used with the Raspberry via I²C, you get erroneous measurements because of the I²C clock stretching bug of the Raspberry. Using the UART, results are correct.