Getting true north with the LIS2MDL and LSM6DSO sensors.
I use LIS2MDL and LSM6DSO sensors (with MotionMC and MotionEC libraries) for getting true north direction. I tested this configuration on IKS01A3 board and it works. But on my custom board, I'm having trouble with getting true north direction. After calibration the resulting azimuth differs from the true one by 70-150 degrees. Tilting the sensor plane by 5 degrees or more in the X or Y axes also affects the observed azimuth. Could this be due to incorrect routing of my custom board? I'm concerned about I2C line vias. Could vias be a source of parasitic magnetic induction? Power is also routing under the LIS2MDL (pic2). Any ideas are greatly appreciated.


