I have an HMC5883L magnetometer and will be attempting to calibrate it. Not sure this will help as it wanders even when not moving. Someone mentioned the magmaster program. I just wonder if there is a reasonably priced temperature compensated mag or if calibration might help. Thanks.
Hi WaterD,
The magnetometer must be calibrated before it can provide any meaningful results.
There's hard iron and soft iron calibration.
The values generated by the magnetometer for each of the axes: { X, Y, Z }, when plotted generate a 3D ellipsoid around a given point.
Hard iron calibration generates an offset to move the centre of ellipsoid to the origin: { 0, 0, 0 }, while soft iron calibration conpensates for any local distortions in the magnetic field and attempts to make the ellipsoid as spherical as possible.
In practice, and depending on your requirements, hard iron calibration is essential, while soft iron can sometimes be considered as optional.
Heading information in degrees or radians can be obtained from the compensated X and Y axis values. If however the magnetometer is to be used in a plane other than the horizontal, it'll need to be tilt compensated with a gyroscope/accelerometer (providing angle).
Honeywell for a time produced a temperature compensated version of the HMC5883L, called the HMC5983. Both devices however, have now sadly been discontinued.
The nearest equivalent is now the ST Microelectronics LIS3MDL.
All MEMS magnetometers are noisy and imperfect, and need calibration once in circuit (nearby
components on the PCB affect the calibration).
If you want a better performing sensor, MEMS is not the answer.
Hello Martini and MarkT,
Thanks for your replies. I will give the calibration a shot and then come back crying for help. LOL
As usual I got lost just trying to read through the calibration routine that says it's for dummies. Is there any hope for me? Maybe someone knows a routine for dumb dummies?