Skip to content

weinand/thermal-imaging-camera

Repository files navigation

Fast (23 fps) MLX90640 based Thermal Camera for Raspberry Pi Pico (RP2040)

A simple but fast Thermal Imaging Camera using the MLX90640 sensor, a 1.5 inch RGB OLED Display Module, and two optional touch sensor modules.

breadboard setup showing thermal image of a candle

Features

  • fast: 23 frames per second by employing both cores of the RP2040 (whereas a single core would only result in 11 fps):
    • core0 fetches the pages from the MLX90640 and scales the data down to 8-bit integers
    • core1 renders the data on the OLED after optionally smoothing the data by bilinear interpolation
  • configurable heat-map (predefined 7-colors, 5-colors, 2-colors, and grey map)
  • touch button for disabling interpolation
  • touch button for freezing the displayed image

Code Based on

Hardware

Wiring

Connect the MLX90640 and the OLED to the 3.3 V Pin 36 of the Raspberry PI Pico.

MLX90640 RP2040 GPIO Pin
SDA I2C0 SDA 16 21
SDC I2C0 SDC 17 22
OLED RP2040 GPIO Pin
DC SPI1 DC 9 12
CLK SPI1 SCK 10 14
DIN SPI1 TX 11 15
CS SPI1 CSn 13 17
RST RST 15 20
Touch Buttons GPIO Pin
Disable Interpolation 14 19
Freeze Image 18 24

Building

  • make sure the "Pico SDK" is installed and the environment variable "PICO_SDK_PATH" refers to it.
  • git clone https://github.com/weinand/thermal-imaging-camera
  • cd thermal-imaging-camera
  • git submodule init
  • git submodule update
  • mkdir build
  • cd build
  • cmake ..
  • make

More Images

breadboard setup showing thermal image of a candle

close-up of OLED display showing camera

About

Fast (23 fps) MLX90640 based Thermal Imaging Camera for Raspberry Pi Pico (RP2040)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published