SparkFun Forums 

Where electronics enthusiasts find answers.

Have questions about a SparkFun product or board? This is the place to be.
By max246
#192701
I have got this sensor and it seems not to have a correct heading when rotate by 90/180/270 degree.

I tried to run the calibration from the library but maybe I am doing it wrong, what is the correct procedure? How long do I need to rotate on each axis? There is a script somewhere or video how to do it?
By max246
#192714
I was looking for a specific calibration of this model as it is very expensive and should just work out of the box
By jremington
#192722
Magnetometers NEVER work properly "out of the box".

They all need to be calibrated from time to time, and local magnetic fields must be compensated for by calibration in place.

The very least you need to do is activate the calibration procedure built in to the HMC6343, AFTER installing the sensor in your rover. Carefully follow the directions on page 12 of the sensor data sheet: https://aerocontent.honeywell.com/aero/ ... MC6343.pdf

In some environments, it is simply impossible to use a magnetometer to indicate North.
By max246
#192723
Ok thanks, will try that as well, I did run the calibration but with not much luck.

Lets see if I can do something about it.
By davidsi
#193639
re: "In some environments, it is simply impossible to use a magnetometer to indicate North."

I'm thinking of buying one of these but before I do, can you please explain what you mean? I'm planning on using it in a weather station on a boat. As the boat can move, North changes and I was thinking of putting this breakout in the system to allow me to constantly calculate where north is.

thx
By max246
#193647
I am not suggesting to use this sensor at all, have a GPS unit instead to get a true north or Bosch BNO055.

This sensor will not give you a stable heading if has some shakes.

I ended up to use a Bosch BNO055 and autocorrect with GPS true north and it worked out prefecly
By Valen
#193648
The magnetometer points along the line of magnetic flux toward magnetic north. Which is not necessarily pointing to the earth's axis of rotation (true north). Only when polar north happens to be between you and the magnetic pole (or behind it) can you count on that direction. And then only in some years as magnetic north wanders around the poles over the years, albeit slowly. This needs to be accounted for by the person reading (maritime) maps, since it is position dependent. All part of the basics of marine navigation.

Aside from that those magnetic flux lines are dependent on the presence of iron or ferromagnetic material in the immediate surroundings of the compas/magnetometer. So steel or iron components in the boat, electromagnetic fields from energized coils, or mountainous regions or soil with elevated iron content in the vicinity of the boat could distort your sense of magnetic north. Before you venture out on a voyage based on the compass it's behavior when pointing in all directions should be known or corrected. (=calibrated, including roll, tilt and yaw)

GPS cannot tell where (true) north is if your position and path wanders all over the place. Only when you follow a straight path or it has a history of distant points where you have been can it tell how far off from (true) north you were on average. A GPS has no sense of direction at the point where it is. It needs to know where it was, plotting a line through recent coordinates.
By max246
#193650
Yes GPs was used when going forward and did return the correct true north, I also used MuMetal to remove interference from motor below and it worked fine.

just dont waste your money on this sensor.
By davidsi
#193651
valen:

Thanks, I already know how to use a compass on a boat. My question really is, now far away does any material or an energized coil need to be to affect the compass.
By max246
#193653
I suggest to test it, then apply mu metal if it does affect. Anything metallic or motor will affect the reading