Hello, I have a problem with my MMC5603. I read the data well but when I turn the magnetometer and I reverse the x and y axes I do not fall back on the same values.
Example x=15 and y=15, when I turn to the right the x axis is found on the y is therefore should have its same value but instead it shows me 72 uT.
Sincerely, Tony.
MMC5603 problem
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- adafruit_support_mike
- Posts: 67485
- Joined: Thu Feb 11, 2010 2:51 pm
Re: MMC5603 problem
Try moving the sensor around without rotating it. From your description, there may be some magnetic distortion in the area.
- TonyGe13
- Posts: 4
- Joined: Thu Nov 03, 2022 8:52 am
Re: MMC5603 problem
I tested in the meantime with the magnetometer of my phone and I do not fall at all on the same values and it falls on the same value to within 1/2 uT when the axes are rotated.
- adafruit_support_mike
- Posts: 67485
- Joined: Thu Feb 11, 2010 2:51 pm
Re: MMC5603 problem
Your phone has more advanced magnetometer software than your microcontroller. It may also have more than one magnetometer, but certainly will certainly go through a calibration process to identify local hard iron and soft iron distortion.
If you haven't done that same calibration, it's a comparison between apples and pasteurized cider.
If you haven't done that same calibration, it's a comparison between apples and pasteurized cider.
- TonyGe13
- Posts: 4
- Joined: Thu Nov 03, 2022 8:52 am
Re: MMC5603 problem
I understand, thank you for your answer.
How can I calibrate the MMC5603?
How can I calibrate the MMC5603?
- adafruit_support_mike
- Posts: 67485
- Joined: Thu Feb 11, 2010 2:51 pm
Re: MMC5603 problem
This tutorial covers our calibration software:
https://learn.adafruit.com/adafruit-sen ... alibration
I'm not sure it's been adapted for the MMC5603 though.
In general, two things can interfere with magnetometer readings. They're called 'hard iron distortion' and 'soft iron distortion'.
Hard iron distortion comes from other magnets near the magnetometer. Ideally, if you rotate a magnetometer around its center, the readings you get should plot as a circle centered on the magnetometer. External magnetic fields pull the center of that circle away from the magnetometer.
Soft iron distortion shows the way magnetic fields change near ferromagnetic materials. Just as electrons prefer to travel through metals like copper rather than air, magnetic flux prefers to travel through metals like iron rather than air. Because of that, magnetic fields will pinch together as they enter a piece of iron and spread out as they leave it. If you rotate a magnetometer around its center near a piece of iron, you'll see the readings plot out as an ellipse rather than a circle.
The calibration process involves rotating the magnetometer around all three axes, finding the amount of soft iron distortion pulling each set of readings into an ellipse, and finding the amount of hard iron distortion pulling the center of the readings away from the magnetometer.
The end result is six numbers: the amount of soft iron scaling along each axis, and the amount of hard iron offset along each axis. If you divide readings along the axes by their scaling values and shift them by their offset values, your corrected readings should make three circles centered around (0,0), the location of the magnetometer itself.
https://learn.adafruit.com/adafruit-sen ... alibration
I'm not sure it's been adapted for the MMC5603 though.
In general, two things can interfere with magnetometer readings. They're called 'hard iron distortion' and 'soft iron distortion'.
Hard iron distortion comes from other magnets near the magnetometer. Ideally, if you rotate a magnetometer around its center, the readings you get should plot as a circle centered on the magnetometer. External magnetic fields pull the center of that circle away from the magnetometer.
Soft iron distortion shows the way magnetic fields change near ferromagnetic materials. Just as electrons prefer to travel through metals like copper rather than air, magnetic flux prefers to travel through metals like iron rather than air. Because of that, magnetic fields will pinch together as they enter a piece of iron and spread out as they leave it. If you rotate a magnetometer around its center near a piece of iron, you'll see the readings plot out as an ellipse rather than a circle.
The calibration process involves rotating the magnetometer around all three axes, finding the amount of soft iron distortion pulling each set of readings into an ellipse, and finding the amount of hard iron distortion pulling the center of the readings away from the magnetometer.
The end result is six numbers: the amount of soft iron scaling along each axis, and the amount of hard iron offset along each axis. If you divide readings along the axes by their scaling values and shift them by their offset values, your corrected readings should make three circles centered around (0,0), the location of the magnetometer itself.
- TonyGe13
- Posts: 4
- Joined: Thu Nov 03, 2022 8:52 am
Re: MMC5603 problem
That almost solved my problem, thank you very much!
Can you tell me what you think of indoor location with magnetic field? Is it possible ? Do you have any sites to recommend?
Thanks !
Can you tell me what you think of indoor location with magnetic field? Is it possible ? Do you have any sites to recommend?
Thanks !
- adafruit_support_mike
- Posts: 67485
- Joined: Thu Feb 11, 2010 2:51 pm
Re: MMC5603 problem
Sure, there are lots of locations with magnetic fields. We live in a world full of electric current, and all current has a magnetic field.. the magnetic field holds the energy that makes the electrons move.
We also live in a world full of ferromagnetic materials because steel is such a good building material. It's easier to find sources of hard or soft iron magnetic interference than it is to find places with no interference.
We also live in a world full of ferromagnetic materials because steel is such a good building material. It's easier to find sources of hard or soft iron magnetic interference than it is to find places with no interference.
Please be positive and constructive with your questions and comments.