I did the magnetic calibration here on the LSM303DLHC for a field roughly 48 uT. The method seems to have worked in that the combined bias (b) values went from thousands to hundreds like the tutorial says they should

The readings are around 48uT indeed, but they vary by +/- 50% upon moving the sensor around. Is this the expected behaviour ?

From the comments:

  • Calibrated and tested in the same spot.
  • Was unable to obtain any better calibration values than those from the second run (meaning the first actual calibration run) - tried running the calibration program again and again but the combined bias (b) values from magneto12 software did not get any closer to 0 (neither did they stay the same).


I have read today about elevation and bank angle effects (collectively called tilt) on the magnetometer's axial sensitivities. I'll be diving deeper into it. Don't know if that is my issue indeed



Nope, seems that tilt effect is used for correcting heading readings (yaw angle around the z axis) and after doing the correction the overall field magnitude does not change. Just tried again calibrating it with some longer wires running from the Arduino to the module - same deal. Perhaps their accuracy is just not as good as their advertised precision is.

  • 1
    \$\begingroup\$ Current-carrying wires near the sensor can disrupt earth's field. Have you done calibration in the same magnetic environment? \$\endgroup\$ – glen_geek May 21 '17 at 11:47
  • \$\begingroup\$ @glen_geek Yes, calibrated and tested in the same spot. Then proceeded to test in other spots as well, including outside. \$\endgroup\$ – kellogs May 21 '17 at 11:51
  • 1
    \$\begingroup\$ @Kellogs: Where did you get your calibration values from? Are they the same as in the linked example? I guess they have to be specific for each particular sensor/device. \$\endgroup\$ – Curd May 22 '17 at 7:21
  • \$\begingroup\$ Is your question about the unstability of the reading (as the title suggests) or about the absolute calibration (reading != 48µT) as the further content of your post suggests? \$\endgroup\$ – Curd May 22 '17 at 7:25
  • \$\begingroup\$ @Curd It is about it being unstable - see the edit below. The values are specific to my device, not copied verbatim from that tutorial. \$\endgroup\$ – kellogs May 22 '17 at 12:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.