Triple Axis Magnetometer Breakout - MLX90393

Hi, I am using Triple Axis Magnetometer Breakout - MLX90393 with EPS32S-Wroom developmental board to measure magnetic field intensity. I am getting three values from bar magnet in magX[-738.60] magY[1309.20] magZ[1449.10] temperature(C)[30.62]. How can I convert it into mili/micro tesla in a single value? Previously I am using Vernier Lab Quest with Magento meter sensor getting single value.

To convert the X, Y and Z components to vector magnitude M
float M = sqrt(X*X + Y*Y + Z*Z);

The conversion factor to uT depends on the gain you have set. The details are in the data sheet – look for the table of “sensitivity values” which differ for the three axes.

Don’t forget to calibrate the magnetometer to remove the offsets, otherwise the measurements can have serious errors, to the point of being useless. See Tutorial: How to calibrate a compass (and accelerometer) with Arduino | Underwater Arduino Data Loggers

Thanks @ Jremington. I will check & back

Hello @ Jremington
I’m reaching out to request some additional information regarding the Triple Axis Magnetometer Breakout - MLX90393. I need some clarification on the following points:

  1. How should be the sensor orientation as there is a mark of X Y and Z on the breakout board?
  2. How to populate the hard iron and soft iron values in the compass calibrated example code?

Best Regards,
Harsha S

  1. To verify the magnetometer axis assignments as identified on the PCB, any axis pointing towards Earth magnetic North should report a positive value. You can compare that with the expected values for the Earth’s magnetic field at your geographic location, available on line.

  2. Surely you know how to edit code. Please rephrase the question.