1
\$\begingroup\$

I have several 3-axis magnetometers mounted on breadboards, and they all read correctly in the x and z directions.

The Y direction is very strange; when turned to read 0, then turned 90 degrees counter clockwise, it reads 0 again. Then the values gradually get larger, peaking at about SE.

What could cause this behaviour?

I thought I had determined the breadboard itself was magnetic but I can't reproduce that.

\$\endgroup\$
7
  • \$\begingroup\$ I was going to say some magnetic material nearby. Can you add some leads and move the sensor around? \$\endgroup\$ Commented Feb 24, 2015 at 2:12
  • \$\begingroup\$ Same issue with leads. If it was something nearby I would expect it to affect every axis. Thought it could be the breadboard because that was stationary relative to the board. \$\endgroup\$
    – user68472
    Commented Feb 24, 2015 at 2:15
  • \$\begingroup\$ Yeah I wanted to get it off the bread board? How sensitive is it? Nickel is magnetic ... though Nickel plating is thin. \$\endgroup\$ Commented Feb 24, 2015 at 2:15
  • \$\begingroup\$ Yep. It's on 10" leads now and same behaviour. \$\endgroup\$
    – user68472
    Commented Feb 24, 2015 at 2:16
  • \$\begingroup\$ It definetly isn't something in the area, when tipping the magnetometer on it's side the Z axis works as expected, and the Y (now Z) shows grossly different numbers when facing up vs facing down. \$\endgroup\$
    – user68472
    Commented Feb 24, 2015 at 2:22

1 Answer 1

1
\$\begingroup\$

I'm not 100% sure what the issue was, but found a better firmware that works much better, and even on the breadboard.

It calibrates the compass before using it, that's the only significant difference I see.

https://github.com/helscream/HMC5883L_Header_Arduino_Auto_calibration

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.