Faulty MLX90393?

I hesitate to call this part faulty, since I have never used any of this stuff before, but I have certainly surpassed my ability to trouble shoot.

I am attempting to use RedBoard, with the Qwicc Shield on top of it, and then plugging in the MLX90393 magnetometer sensor using the male to male qwicc cable. I attached a photo of the set up.

Really, I just followed the tutorial found at: Qwiic Magnetometer (MLX90393) Hookup Guide - SparkFun Learn. When I found this tutorial, I bought all the suggested equipment, plugged everything in the way the photo showed, and installed the github libraries listed in the tutorial. My computer is able to detect the redboard, but I don’t think it is connecting to the sensor somehow.

When I run the example codes from the github library listed in the tutorial (should just simply print x y and z component data along with temp), it DOES successfully upload, and the Serial Monitor does output data, but it is just the following same output for every time measurement:

magX[1323.98] magY[-1278.90] magZ[3332.22] temperature(C)[-636.19]

These values do not change at all and are clearly weird. I thought, maybe this is a calibration issue, but when I wave a magnet past the sensor, no values change at all. Maybe a communications issue with the sensor itself, and these are just funky initialization values?

So, I had ChatGPT put together a testing script to check if we can send or receive from the sensor. see the script below:

#include <Wire.h>
#include <MLX90393.h>

MLX90393 mlx;

void setup() {
Wire.begin();
Serial.begin(9600);
delay(1000);

Serial.println(“Starting MLX90393…”);
byte status = mlx.begin();
Serial.print(“Status: 0x”);
Serial.println(status, HEX);

if (status == 0) {
Serial.println(“:white_check_mark: Sensor initialized”);
} else {
Serial.println(“:cross_mark: Sensor failed to initialize”);
}
}

void loop() {}

The ouput of which can be seen below:
Starting MLX90393…

Status: 0xFF

:cross_mark: Sensor failed to initialize

My impression of this stuff was that it was as easy as plugging it in, running the example script, and the sensor would be reading live data. My use case is literally as simple as that. All I need is magnitude magnetometer data as a time series, so I really don’t need anything beyond what the example scripts are supposedly capable of.

I tired being as detailed as possible about my progress so far, but if there is any info that could further help anyone help me, I’m glad to share it.

Are your headers soldered to the Qwiic shield or just stuck through the holes?

Also: have you tried power-cycling after successfully uploading (with the first, almost working setup)?

It was as simple as soldering the pins on the shield. I had assumed that given this set up uses qwiic, and the point of qwiic is to avoid having to solder, that this set up would not need it. Like I said, I’m a novice with this stuff. I am receiving data normally now.

2 Likes