As is well documented any stray magnetic fields or ferrous material (iron) close to the sensor will cause it to read out in error.
After experimenting with a module fitted with a QMC5883 I discovered the following.
- The right angle header plug is tin plated iron (this is located a few mm from the chip)
- The Dupont jumper leads and the female crimp sockets are tin plated iron (also located a few mm away)
Removing the header plug and soldering "real copper" wires to the board has improved stability and reduced errors.
Note: It appears that most ribbon cable used for Dupont jumper leads are tin plated iron, as are the crimp plugs and sockets..! (can be checked with a magnet) DO NOT PUT MAGNET NEAR THE SENSOR...!