Jannik Svensson's Teensy 4.0 Thermal Camera Offers Live-View, Streaming Modes to Desktop and Mobile

Designed for both standalone and tethered use to desktop or mobile, this low-cost thermal camera comes with integrated interpolation.

Gareth Halfacree
2 years ago β€’ Photos & Video / Debugging / HW101

Computer and electronics engineer Jannik Svensson has put together a low-cost thermal imaging camera with on-device live-view and USB streaming, built around a Teensy 4.0 microcontroller and a Melexis MLX90640 thermal imaging sensor.

"This started with that I wanted to check the house for heat loss, but also be able to check electrical things for pre-failure," Svensson explains in a posting brought to our attention by Adafruit.

"[I] realized that MLX90640 was cheap, and after a lot of thinking I did finally buy that sensor. I first did a Raspberry Pi Pico [and] CircuitPython [version] as it already did exist a working example that was very basic, but it was as expected very slow (~1fps [frame per second])."

This smart thermal camera app streams from a Teensy 4.0-based handheld sensor. (πŸ“Ή: Jannik Svensson)

Using Visual Studio Code and Platform.IO, and working on existing published code examples, Svensson settled on a build that uses the MLX90640 imaging sensor with a Teensy 4.0 and an ST7789 or ILI9341 β€” switching to the latter after finding the original display a little too small.

Rather than simply display the raw data from the thermal camera, however, Svensson opted to add interpolation functionality β€” smoothing the chunky pixels of the relatively low-resolution 24Γ—32 sensor to provide a better image, complete with a choice of color palettes for interpretation of the temperature data.

Svensson has also built a simple mobile app, while the camera itself can be used standalone if required. (πŸ“Ή: Jannik Svensson)

Using threading to get the most out of the microcontroller, Svensson has been able to display footage from the camera at around seven frames per second β€” a considerable improvement over initial efforts β€” with bicubic interpolation.

As well as displaying the images on the on-board display, the camera can also stream out to a desktop application or the RoboRemo app running on an Android tablet or smartphone β€” both of which include an easy method to experiment with different palettes and interpolation options.

Full project details are available on the PJRC forum thread; source code has been released on GitHub under the permissive MIT license.

Gareth Halfacree
Freelance journalist, technical author, hacker, tinkerer, erstwhile sysadmin. For hire: freelance@halfacree.co.uk.
Latest articles
Sponsored articles
Related articles
Latest articles
Read more
Related articles