Compass Calibration

Does anyone have a good calibration routine for the compass module they can share with me? Looking to get meaningful readings for heading.


@ Duke Nukem - have you seen this:

@ RobvanSchelven - I saw that but I didn’t see any code for calibration. I’m just looking for simple heading so when something turns a bit in place I can get a rough idea how much it turned.

@ Duke Nukem - Not quite what you were asking for, but I just remembered that one of my only codeshare contributions was about tilt compensation of the compass using an accelerometer. I found that helped a hell of a lot as these things are very sensitive to tilt otherwise. That codeshare is here

Regarding the calibration itself… can you use a GPS and calibrate against that while’st moving?

@ KiwiSaner - Thanks but for the first round I think I’ll just remove the compass as while this can be expected to turn a bit in place, if it takes off at high speed such that I could use a GPS to calibrate the compass, I’ve got a way bigger problem then what direction it is pointing :slight_smile: