Bosch Sensortec Community

    Showing results for 
    Search instead for 
    Did you mean: 

    BMX160 Mag data

    BMX160 Mag data

    Established Member

    Hi everyone,

    I am working with BMX160, Now i able to read Raw data of BMX160.

    1) In what format(units) should we get mag data? is it in uTesla?

    2) can i directly give that raw mag data to filters for converting in to roll,pitch and yaw? or should i divide it with some value?

    3) And also can you please provide me BSXLite library?

    Thank you in advance




    1 REPLY 1

    Community Moderator
    Community Moderator


    Thanks for your inquiry.

    BMX160 includes BMI160 IMU and BMM150 magnetometer inside, where BMM150 is connected to BMI160's secondary I2C interface. Please use BMI160 API source code online at to configure BMM150 and get BMM150 raw data in the unit of uT.

    You cannot directly use BMM150 raw data in the unit of uT to derive pitch/roll/heading angles, because those raw data is not compensated for offsets of x/y/z axes. This means that if you plot BMX160 mag data  in 3D space when you rotate your device randomly in 3D space, you will see a shifted sphere or ellipsoid. You will need to determine the offsets so that you can apply them to the collected BMM150 raw data to move the sphere or ellipsoid to the center [0, 0, 0]uT. Then in the future you can always apply thses offset to BMM150 raw data to derive heading angle. For pitch and roll angles you need an accelerometer for tilt compensation. BSXLite library can do mag calibration and tilt compensation for the final pitch/roll/heading Euler angles.

    BSXLite library can be downloaded online at You can also search this community here for similar topics.