Hi,
Thanks for your inquiry.
The BMM150 data you got is so called raw data in the unit of uT. You cannot directly use these raw data to calculate heading. You need to performance BMM150 calibration by moving your PCB randomly in 3D space slowly. Please refer to a video clip at https://www.youtube.com/watch?v=yS0_EB4TIsA for more information. You may also do a Google search on magnetometer calibration online where you can find a lot of articles, libraries and source codes that you can use in your project.
After calibration you can test heading on a flat surface without any metal stuff nearby. If you want to get eCompass in 3D, then you also need an accelerometer to work together with BMM150 to get tilt compensated heading.
One more note is that BMM150 has been discontinued. You can find PDN document in this community. Please switch to new magnetometer BMM350. You can purchase a BHI360 shuttle board through Digikey where BMM350 is installed. You can then get accurate heading directly from BHI360 because the sensor fusion algorithm running inside BHI360 has already taken care of BMM350 calibration and tilt compensation. Please see the attached PDF file for more information.
Thanks.
... View more