sparkfun / SparkFun_MLX90640_Arduino_Example

Controlling and reading from the MLX90640 IR array thermal imaging sensor
https://www.sparkfun.com/
Other
122 stars 35 forks source link

Parameter extraction failed #4

Closed ysshah95 closed 5 years ago

ysshah95 commented 6 years ago

Hello, I have been using MLX90640 with Arduino Due and after uploading the Basic_Reading program I get a message in serial monitor saying "Parameter extraction failed" and the pixel values are displayed as nanC.

Any ideas what I might try?

Thank You Yash Shah

nseidle commented 6 years ago

Hmm. That is odd. I'm not entirely sure but let's eliminate a handful of things:

It sounds kind of like I2C is not working but I would have expected the code to fail earlier.

ysshah95 commented 6 years ago
nseidle commented 6 years ago

Ok - The Qwiic board already has pull up resistors so you shouldn't need additional ones (shouldn't hurt though). Have you got a logic analyzer? Can you confirm the Due's I2C port is performing as expected?

ysshah95 commented 6 years ago

I don't have the logic analyzer but I will somehow confirm the working of Due's I2C port. Do you think changing the controller to Teensy 3.5 would be the perfect option if I2C of Due is not working?

ysshah95 commented 6 years ago

I took a help from this Arduino Forum (https://playground.arduino.cc/Main/I2cScanner) to check the working of I2C of Due, and to my surprise, the I2C of Due is working and it displays "I2C device found at address 0x33 !", message every 5 seconds.

nseidle commented 6 years ago

Good - that means the sensor is at least acknowledging I2C traffic.

Changing the controller to a Teensy would eliminate one unknown. I'll see if I can get a Due and test things out.

ysshah95 commented 6 years ago

Okay, that would be a great help. Thank you so much.

Eternia-Labs commented 6 years ago

Same problem as above with an ESP32

ysshah95 commented 6 years ago

Okay. So, is it recommended to change the sensor?

Eternia-Labs commented 6 years ago

No, the sensor is perfectly fine, so is the code here. I haven't tweaked it yet. Will get back with results for ESP32 Arduino .. Meanwhile this might help you with a raspberry pi https://github.com/pimoroni/mlx90640-library

ghost commented 6 years ago

The issue is definitively related to the Wire implementation in the Due. I had the same problem but switched to a Teensy 3.2. I didn't investigate the problem to the end but you can search the web for Due & I2C issues.

nseidle commented 6 years ago

Whew. I've spent some time on this and cannot reach a resolution. The Due I2C library and hardware seem buggy.

image

Above is an image of the Due glitching the clock line. Wire and Wire1 ports both exhibit this bad behavior.

Attached is the code I was using to test. This is as far as I can take it at the moment.

nseidle commented 6 years ago

Hmm. Here's the code again.

Example3_DueExample.zip

ysshah95 commented 6 years ago

Thank you so much for the help. I really appreciate your effort. I recently changed my controller from Due to Teensy 3.5, and the library works fine.

But, I also tried the latest Due example you attached in the last comment, but still, it doesn't work. I think it gets stuck in one of the function "MLX90640_DumpEE". I have attached the screenshot of the terminal.

capture

nseidle commented 6 years ago

Indeed, the Due Example I attached does not work, it's only an example of the changes that were started in an attempt to change the lib. The example can be used to inspect the clock glitches from the Due.