MLX90640 Thermal Camera and a Teensy 4.0

KrisKasprzak

Well-known member
As you may recall. I built a thermal camera using and 8x8 sensor and a Teensy 3.2, and while my interpolate routing to scale the 8x8 up to 70 x 70 to smooth the display, 8x8 is, well eh.

Melexis offers a 32 x 24 array and after 3 months of waiting due to back order, my unit finally arrived. I could not wait to connect it to my Teensy 4.0. I built a thermal camera using this MLX90640 camera and a Teensy 4.0, with the following capability

1. 32x24 pixel array scaled up to 310 x 230 using linear interpolation (linear is good enough since the display is only 16-bit color)
2. display on a 320 x 240 ILI9341 display
3. added a gradient legend
4. added a histogram to show quantities of temp ranges
5. added a cute icon to activate a menu with slider controls and option buttons for setting display and operating parameters
6. added a print screen function so you can save a snapshot of the display to an SD card (I'm able to get SD+Display+touch+pixel reading with a very specific 320x240 display)
7. added an option to interpolate the results or show 32 x 24 with 10x10 square pixels
8. touchscreen support
9. ability to set max and min temperature

Fun project but NOT possible without a Teensy.


Source code in the videos link

https://youtu.be/1EBoug27hrA


Sample images (of course I had to use hand gestures for the Teensy model number)

raw display where each pixel is scaled to a 10x10 rectangle
10px.jpg

Interpolated image with gradient legend
ThermalCamera.jpg

Interpolated image with histogram legend
Hdcam001.png
 
that would be good to have when checking someone for fever at entrances and their temperatures are high
 
Nice work Kris. I came across the video yesterday on Youtube and really looked good. Going to have to have to give it a try once done playing with MM. I actually picked up the one from Sparkfun, https://www.sparkfun.com/products/14844, before the global parts shortage so its already in my box of goodies :)
 
yep, easy. I thought about doing this in v1.0, not sure why I didnt't

Display.fillRect(293, 200 - (j * 3), Length, 2, GetColor( (MINTEMP + (inc * j)) ));
// Display.fillRect(293, 200 - (j * 3), Length, 2, ILI9341_BLACK);
Display.fillRect(293 + Length, 200 - (j * 3), 24 - Length, 2, ILI9341_WHITE);

Hdcam004.png
 
Looks good!

I recommend to give bicubic interpolation a try (it is correctly coded in the driver for the Adafruit AMG8333 module). It is slow, but image appearance is vastly improved over bilinear interpolation.
 
НЕ компилируется!
Очень много ошибок.
таких как эта и подобных ......\Arduino\libraries\ILI9341_t3_controls-master\ILI9341_t3_Controls.cpp:57:268: error: 'ILI9341_t3_font_t' does not name a type
void BarChartH::init(float GraphXLoc, float GraphYLoc, float GraphWidth, float GraphHeight, float ScaleLow, float ScaleHigh, float ScaleInc, const char *Title, uint16_t TextColor, uint16_t BorderColor, uint16_t BarColor, uint16_t BarBColor, uint16_t BackColor, const ILI9341_t3_font_t &TitleFont , const ILI9341_t3_font_t &ScaleFont ){
 
Back
Top