Magnetometer IC readings skewed by adjacent circuitry? - Page 1
Forum section: electronics / beginners

author: HwAoRrDk
author_rank: Super Contributor
timestamp: June 18, 2018, 07:53:27 pm
content: I was playing around with a magnetometer breakout board (using a QMC5883L chip - a licensed clone of the Honeywell HMC5883L) today, and noticed something strange. I have the aforementioned breakout board and an accelerometer breakout board (MMA8452Q) hooked up with some short jumper wires to make the I2C connection to an Arduino. The jumper wires are so that I can move the breakout boards around freely while observing the changing readings.They are working well, with the exception that I noticed that when I move the magnetometer sensor near to the accelerometer, the readings from the magnetometer are skewed by a varying amount. For example, calculating the azimuth from north is roughly correct (well, as far as I can ascertain when comparing to a little hand-held needle compass and an app on my phone), but when placed nearer than an inch or so from the accelerometer board, the bearing from north is skewed and no longer correct.What would be causing this? It's troubling because I was going to mount both breakouts right next to each other, as daughterboards onto a main board, and if one is going to interfere with the other, that complicates my plans.Could it perhaps be something to do with inductance in the hookup wires I'm using when testing?

author: Kleinstein
author_rank: Super Contributor
timestamp: June 18, 2018, 08:09:18 pm
content: Ferromagnetic materials can influence a magnetometer sensor. Some parts (especially LEDs and connectors) can be magnetic.It already needs quite some DC current to have a significant effect compared to the earths field. If in doubt it is a good idea to keep the loop area small to keep the magnetic field local.

author: rhb
author_rank: Super Contributor
timestamp: June 18, 2018, 09:16:32 pm
content: Lots of through hole parts use tin plated steel leads. If the field is from current flow, removing the power from the accelerometer board will test that possibility. Steel leads seem more likely.

author: HwAoRrDk
author_rank: Super Contributor
timestamp: June 18, 2018, 11:05:33 pm
content: Hmm, I did use the 0.1" headers that were supplied with the breakout boards, and checking them with a magnet shows that they are magnetically attracted.I don't know though, it seems unlikely to me that current flow in this situation could induce a magnetic field, because the chips on these break-out boards have stated power consumption measured in microamps.I will try with the accelerometer unpowered and see what effect that has.

author: amyk
author_rank: Super Contributor
timestamp: June 19, 2018, 02:04:02 am
content: Quote from: HwAoRrDk on June 18, 2018, 11:05:33 pm...and the strength of the Earth's magnetic field, which these sensors are designed to measure, is a few tens of microteslas.

author: HwAoRrDk
author_rank: Super Contributor
timestamp: June 19, 2018, 05:44:17 pm
content: I did some experimentation. I taped the magnetometer breakout board down to the bench to stop it moving (and thus giving false positives), and waved the accelerometer breakout board around the magnetometer in various positions to see what effect it had on the readings.The largest effect was when placing the pin headers of the accelerometer board at a perpendicular angle to the edge of the magnetometer board, within about 5mm distance. You can see on the graph below (orange line at the top) that it skewed the calculated azimuth figure by quite a few degrees.To test whether it was fields from the power or transmissions on the jumper wires going to the accelerometer board, I then unplugged it and simply waved around the board alone. Same result! So, it would appear to be the 0.1" pin headers I have attached to the board.I checked my parts bin, and I don't have any straight 0.1" header strips that are non-ferrous.The only non-ferrous headers I have are right-angle, which aren't suitable for my ultimate intended usage. I bought both types from the same source, so I guess you can't tell what you're going to get with the cheap stuff.So is a solution to this problem going to be to ensure I use non-ferrous headers on these breakout boards? e.g. copper alloy or bronze? Also, it seems provide most skew when the pin headers are moving, so I guess when both boards are fixed, that will mitigate any effects somewhat.

author: Kleinstein
author_rank: Super Contributor
timestamp: June 19, 2018, 06:25:10 pm
content: Non magnetic parts in the neighborhood of the magnetometer are important if one wants an accurate reading of the external field. Magnetic parts moving around are worse, but also a fixed magnetic part can effect the measurement. It is usually more than just a simple offset, but an error depending on the external field and possibly the history. Trouble starts with parts that are about 1/4-1/2 the size compared to the distance to the sensor.