Author Topic: Magnetometer IC readings skewed by adjacent circuitry?  (Read 1498 times)

0 Members and 1 Guest are viewing this topic.

Offline HwAoRrDkTopic starter

  • Super Contributor
  • ***
  • Posts: 1478
  • Country: gb
Magnetometer IC readings skewed by adjacent circuitry?
« on: June 18, 2018, 07:53:27 pm »
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?
 

Offline Kleinstein

  • Super Contributor
  • ***
  • Posts: 14206
  • Country: de
Re: Magnetometer IC readings skewed by adjacent circuitry?
« Reply #1 on: June 18, 2018, 08:09:18 pm »
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.
 

Offline rhb

  • Super Contributor
  • ***
  • Posts: 3483
  • Country: us
Re: Magnetometer IC readings skewed by adjacent circuitry?
« Reply #2 on: June 18, 2018, 09:16:32 pm »
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.
 

Offline HwAoRrDkTopic starter

  • Super Contributor
  • ***
  • Posts: 1478
  • Country: gb
Re: Magnetometer IC readings skewed by adjacent circuitry?
« Reply #3 on: June 18, 2018, 11:05:33 pm »
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.
 

Online amyk

  • Super Contributor
  • ***
  • Posts: 8275
Re: Magnetometer IC readings skewed by adjacent circuitry?
« Reply #4 on: June 19, 2018, 02:04:02 am »
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. :-//
...and the strength of the Earth's magnetic field, which these sensors are designed to measure, is a few tens of microteslas.
 

Offline HwAoRrDkTopic starter

  • Super Contributor
  • ***
  • Posts: 1478
  • Country: gb
Re: Magnetometer IC readings skewed by adjacent circuitry?
« Reply #5 on: June 19, 2018, 05:44:17 pm »
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. |O 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.
« Last Edit: June 19, 2018, 05:45:57 pm by HwAoRrDk »
 

Offline Kleinstein

  • Super Contributor
  • ***
  • Posts: 14206
  • Country: de
Re: Magnetometer IC readings skewed by adjacent circuitry?
« Reply #6 on: June 19, 2018, 06:25:10 pm »
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.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf