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.
When I rotate the magnetometer around Y-axis, ONLY the X-axis field (Gauss) changes.
When I rotate the magnetometer around X-axis, ONLY the Y-axis field (Gauss) changes.
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??
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..
Very sorry, my mistake. Y along longer side, X along shorter side. However, the observations remain same:
When I rotate the magnetometer around Y-axis, ONLY the X-axis field (Gauss) changes.
When I rotate the magnetometer around X-axis, ONLY the Y-axis field (Gauss) changes.
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.
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.