To ensure the data from the accelerometer, gyroscope, and magnetometer is accurate, follow these steps to calibrate the sensors.
To fully calibrate the magnetometer of the BNO055 sensor:
Hold the sensor parallel to the ground and move it in a figure 8 pattern.
Note
Ensure that the sensor is far away from any magnetic interference.

Use the readCalibrationStatus function to read
the calibration status of the sensor.
Repeat this process until the calibration value of the magnetometer is
full.
To fully calibrate the accelerometer of the BNO055 sensor:
Place the BNO055 sensor in these six stable positions for a few seconds each.

Use the readCalibrationStatus function to read
the calibration status of the sensor.
Repeat this process until the calibration value of the accelerometer
is full.
To fully calibrate the gyroscope of the BNO055 sensor:
Place the sensor in any stable position for a few seconds.
Use the readCalibrationStatus function to read
the calibration status of the sensor.
Repeat this process until the calibration value of the gyroscope is
full.