Example I2C Simple Measurements for MMC5983MA magnetometer

I am running Example I2C Simple Measurements for the MMC5983MA magnetometer. The axes drawn on the magnetometer show X along the longer side of the magnetometer, Y along the shorter side of the magnetometer and Z normal to X-Y.

  1. When I rotate the magnetometer around Y-axis, ONLY the X-axis field (Gauss) changes.

  2. When I rotate the magnetometer around X-axis, ONLY the Y-axis field (Gauss) changes.

  3. When I rotate the magnetometer around Z-axis, ALL X-Y-Z field (Gauss) values change.

Is this the correct behavior?? If it is, can somebody explain why??

Thanks in advance for any help. AA

I’m seeing the opposite for X (short) & Y (long) labels

Are there any nearby sources of EMF? Do you see the same in all testing environments?

Hi AA (@alejandro.allievi ),

It depends where you are on Earth, but the magnetic field is likely to be pointing down, into the ground. You can look up the magnetic inclination for your location on a NOAA website. Link below.

I am not sure if this explains what you are seeing? If one axis is aligned with the Earth’s magnetic field, the other two will read ~zero. Rotating around that axis will produce no change in the readings. The same would be true if you are aligned with a local magnetic field - from a magnet, ferrous metals, transformers etc..

I hope this helps,
Paul

Very sorry, my mistake. Y along longer side, X along shorter side. However, the observations remain same:

  1. When I rotate the magnetometer around Y-axis, ONLY the X-axis field (Gauss) changes.
  2. When I rotate the magnetometer around X-axis, ONLY the Y-axis field (Gauss) changes.
  3. When I rotate the magnetometer around Z-axis, ALL X-Y-Z field (Gauss) values change.

The magnetometer is on a drone next to two LiPo batteries (not used, not connected right now) and connected by Qwiic using 4 pin-cable (Red-Black-Blue-Yellow) to an Arduino UNO R3 powered through USB.

Hi AA,

Are you rotating the whole drone, while the magnetometer is mounted on it?

Could the magnetic field from the prop motors be causing this?

I hope this helps,
Paul

Motors are not running, batteries are not connected. What is the expected behavior if below behavior is not correct:

  1. When I rotate the magnetometer around Y-axis, ONLY the X-axis field (Gauss) changes.

  2. When I rotate the magnetometer around X-axis, ONLY the Y-axis field (Gauss) changes.

  3. When I rotate the magnetometer around Z-axis, ALL X-Y-Z field (Gauss) values change.

Could the static magnetic field from the permanent magnets in the prop motors be causing this?

I retract the magnets are there with or without the motors running

Move a standard compass around the drone and magnetometer. Does the needle move? Is it oriented to magnetic North? Or to some complex field between the motor magnets?

The MMC5983MA is 8 inches (21cm) from the motors. When I move my Silva compass around the MMC5983MA it does not move. The Silva does move if I place it within 1-2 inches of the motors.

Magnetometers must be calibrated before attempting to measure magnetic fields.

Best overview and tutorial: Tutorial: How to calibrate a compass (and accelerometer) with Arduino | Underwater Arduino Data Loggers

1 Like

I am running this example Qwiic Micro Magnetometer - MMC5983MA Hookup Guide - SparkFun Learn . Having a hard time understanding why this happens:

  1. When I rotate the magnetometer around Y-axis, ONLY the X-axis field (Gauss) changes.

  2. When I rotate the magnetometer around X-axis, ONLY the Y-axis field (Gauss) changes.

  3. When I rotate the magnetometer around Z-axis, ALL X-Y-Z field (Gauss) values change.

Calibrate the magnetometer and try again.