SparkFun Forums 

Where electronics enthusiasts find answers.

Questions &/or issues related to products in the Imaging category should be posted in this forum.
User avatar
By nathan.toombs
I recently purchased some of the SparkFun MLX90640 breakout boards, but of the 5 I have, only 2 are working. The other three I can connect to the same microcontroller and program (as described in the Hookup Guide [ ... -guide/all]), but they all have the same error of "Parameter extraction failed." The pixels only read "nan" instead of temperature value.

Is there something that I can adjust on the sensors/in the program to allow these sensors to work, or should I just return them? Once again, two of the sensors (one V10 and one V12) work fine, but the other three (all V12's) have the above error when connected to the same MCU and program as the first two.
User avatar
By TS-Mark
Hi Nathan,

Sorry for the late reply. It definitely sounds like three of your MLX90640 Breakouts are not working properly but before we set up a return/testing ticket for your order I have a few quick questions and suggestions to try and identify what is causing the issue.

First, it sounds like the examples are initializing the sensors properly but just to double-check that your microcontroller is seeing the devices on the I2C bus, try running an I2C scanner like this. You should see the I2C address of a connected breakout (0x33) print in a terminal if it is detecting the device.

Next, what kind of microcontroller are you using with the MLX90640 breakouts and how are you connecting them to it? Along those lines, what version of Arduino are you using? Finally, can you take a couple of photos and possibly a screenshot of the error of your circuit and attach them to your reply?
Thanks for the response.

I used the I2C Scanner that you described, and all three sensors were detected at the 0x33 address.

I am using a Teensy 3.2, and I am following the same circuit and programming found at the Hookup Guide . I am using Arduino 1.8.9, with the latest version of Teensyduino as well.

The attached snip isn't too useful, but it shows the error I am receiving ("Parameter extraction failed"). This error only occurs on the 3 sensors from my last shipment. I slightly altered the original Sparkfun code to give a minimum temperature reading of 25, which is why all of the numbers are 25 (the original values would be NaN or 0 because of the above error). I have also tried running the original, unaltered code from sparkfun, and the issue is the same.

Thanks for the help!
You do not have the required permissions to view the files attached to this post.
User avatar
By TS-Mark
Interesting. So the bus is seeing the boards but they're not initializing properly. It definitely sounds like a problem with the sensors and not the cables or Qwiic connectors. I think at this point it would be best to have the three malfunctioning sensors sent back to SparkFun for testing, assuming you purchased them directly from SparkFun. If you did purchase these from SparkFun, please fill out the form on this page and in the "Why do you want an RMA?" box, fill in a brief description of the issue and link to this forum topic and we will follow up with further instructions. If you purchased these from one of our distributors, you will need to contact them directly for further assistance.
Thanks for the reply. I actually bought the sensors through Digikey, and am now waiting on them.

One last development though: I found that if I have my Teensy running, I can plug in a working IR Array sensor, let the parameter extraction run, then unplug it and plug in one of the defective ones and it will work. It seems like if the Teensy is able to have the parameter extraction from one of the sensors run, then even my "defective" sensors will be able to run.

I ended up copying the data values from a working sensor's parameter extraction and running those if the extraction fails on another sensor. The sensor ends up working fine. I am a little worried that there might be something important coming from the parameters that could be sensor specific, but at this point I would rather just use the sensors that I have instead of working to get them returned and new ones sent in.

Thanks for the help! And let me know if you have any concerns about my workaround, otherwise I'll just use this solution for the sensors.
User avatar
By TS-Mark
Hi again Nathan,

Interesting. I do not think there will be any lasting harm caused by "hot-swapping" these to skip that parameter extraction step. The only potential issue I can see is that by skipping the parameter step, the ones you are swapping in will be "piggybacking" off of the parameters from another sensor so your temperature data may have some minor errors. Depending on your application here, it may not affect your readings at all.

If you want to do a deep dive on what those parameters apply to, I would recommend taking a look at this portion if the cpp file for the MLX90640 examples and then compare the parameters listed there to their descriptions/formulas in the datasheet for the MLX90640.
I also have a MLX90640 (110 degree version) that I recently purchased that has the same problem. I purchased mine directly from Sparkfun. The batch number on the plastic envelope is 116039 if that is meaningful.

It does return the correct address when I run the I2C scanner. But when I run any of the example programs it returns the "parameter extraction failed".

I temporarily modified the code in the MLX90640_ExtractParameters routine to print the value returned from CheckEEPROMValid routine in MLX90640_API.cpp to print the value. The value returned is -7.

I know that the hardware and software setup is correct because I have another MLX90640 (55 degree version) that works correctly with the exact same hardware and software setup. I am using a Teensy 3.2 running with Arduino 1.8.9 and Teensyduino 1.46. I am using a Sparkfun qwiic connector so that I can power off and switch between the working and non-working devices without changing anything else. I have tried both qwiic connections on the failing MLX90640 and neither side works.

Thanks in advance for your assistance.
User avatar
By TS-Mark
Hi DarthJayHawk,

Sorry to hear you are having similar issues with your MLX90640 Breakout. We would like to get your sensor sent back to SparkFun for testing to try and identify what is causing this issue. Please fill out the form on this page and in the "Why do you want an RMA?" box, fill in a brief description of the issue and link to this topic. We will respond with further instructions.