Adafruit MLX90640 IR Thermal Camera

General project help for Adafruit customers

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
livwid
 
Posts: 7
Joined: Tue Feb 07, 2023 5:00 pm

Adafruit MLX90640 IR Thermal Camera

Post by livwid »

Hello! I am a student studying biomedical engineering, but this is a completely new topic to me. I only have experience in coding, not actually setting up a thermal camera. I am would appreciate some guidance on how to send data from the thermal camera to the computer. I have the Adafruit MLX90640 IR Thermal Camera and an Arduino Uno. Could I use the
'Adafruit EdgeBadge - TensorFlow Lite for Microcontrollers' and directly connect to the camera and Arduino Uno? I am wondering if this is the product I need to order, or if I should go with something like the Adafruit PyPortal - CircuitPython Powered Internet Display. I am unfamiliar with how these products connect/work.

User avatar
sj_remington
 
Posts: 998
Joined: Mon Jul 27, 2020 4:51 pm

Re: Adafruit MLX90640 IR Thermal Camera

Post by sj_remington »

I followed the Adafruit "Primary Guide" for the MLX90640, and it worked out of the box. MCU board was the Teensy 3.2.

Try some of the library examples.

User avatar
adafruit_support_carter
 
Posts: 29168
Joined: Tue Nov 29, 2016 2:45 pm

Re: Adafruit MLX90640 IR Thermal Camera

Post by adafruit_support_carter »

Take a look at the product guide to get a general sense of how the MLX90640 breakout is used:
https://learn.adafruit.com/adafruit-mlx ... mal-camera

What main board is "best" to use for connecting the MLX90640 depends on your application. Can you describe more how you want to acquire and use the sensor data?

User avatar
livwid
 
Posts: 7
Joined: Tue Feb 07, 2023 5:00 pm

Re: Adafruit MLX90640 IR Thermal Camera

Post by livwid »

I would like to capture thermal images and run them through a machine-learning algorithm in MATLAB (simple LDA classifier). While I would like to import and analyze this data in real time, I am not sure this is possible. If I could just save still thermal images that works too.

User avatar
sj_remington
 
Posts: 998
Joined: Mon Jul 27, 2020 4:51 pm

Re: Adafruit MLX90640 IR Thermal Camera

Post by sj_remington »

The MLX90640_simpletest example in the library captures and prints the image as text on the (Arduino) serial monitor.

Using a terminal program instead of the serial monitor, it is trivial to capture an image to a log file, or slightly more complicated, to read it in using serial comms in MATLAB. An entire frame is first captured, then transmitted over serial.

Image capture is not "real time" and if objects are moving during an exposure, artifacts will appear in the image.

To understand the limitations of the MLX90640 for your project or application, I recommend to buy one and learn by experimentation. As instructed in the getting started guide, you will need a more powerful MCU to interface with it, rather than the baseline Arduino Uno, Mega or the like.

User avatar
adafruit_support_carter
 
Posts: 29168
Joined: Tue Nov 29, 2016 2:45 pm

Re: Adafruit MLX90640 IR Thermal Camera

Post by adafruit_support_carter »

Check out these options:

https://learn.adafruit.com/circuitpytho ... th-mcp2221
https://learn.adafruit.com/circuitpytho ... o/overview

Going that route, you could bring the MLX90640 sensor data directly into the PC.

User avatar
livwid
 
Posts: 7
Joined: Tue Feb 07, 2023 5:00 pm

Re: Adafruit MLX90640 IR Thermal Camera

Post by livwid »

If I bring the MLX90640 sensor data directly into the PC with the pico using the circuitpython libraries/blinka, could I see the data as a thermal image on the computer rather than just the number values? I liked how the PyBadge would show the thermal image on its screen- would help make sure the data I want to capture is in frame. Could I still use PyBadge with the pico connection?

User avatar
sj_remington
 
Posts: 998
Joined: Mon Jul 27, 2020 4:51 pm

Re: Adafruit MLX90640 IR Thermal Camera

Post by sj_remington »

Write the numbers to a file, adding a suitable image header (e.g. .BMP file type), and then you can manipulate or display the resulting image any way you like. Or use it as NN training data.

I use a C program on a PC to do the conversion, modified from one described in this thread: https://stackoverflow.com/questions/265 ... -libraries

User avatar
adafruit_support_carter
 
Posts: 29168
Joined: Tue Nov 29, 2016 2:45 pm

Re: Adafruit MLX90640 IR Thermal Camera

Post by adafruit_support_carter »

Do all of that in Matlab, since that's your end goal. The sensor data will come in as a 2D array of values. Plot that as a "heat map" or similar contour plot in Matlab. XY are the pixel locations. Z is the value (heat) of each sensor pixel.

The PyBadge would not be of any use unless you just wanted to have some kind of stand alone visualizer gadget.

If you're not sold on Matlab, could use Jupyter Notebooks and do everything, including reading the MLX90640, in there:
https://jupyter.org/

Locked
Please be positive and constructive with your questions and comments.

Return to “General Project help”