Skip to content

atomic14/esp32-mlx90640-webcam

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MLX90640 USB Thermal Camera Using an ESP32S3

Demo Video

This firmware reads an MLX90640 thermal camera over I2C, renders a false-color thermal image into a 320×240 RGB565 framebuffer, encodes it as JPEG, and streams it to a host as a USB UVC camera.

What it does

  • Sensor: MLX90640 full-frame read (two subpages) using the Melexis reference library (main/third_party/mlx90640_ref)
  • Render: false-color colormap with optional fast integer upscaling (32×24 → 320×240)
  • Stream: JPEG over USB Video Class (UVC) (shows up as a webcam on the host)
  • On-video overlays (drawn by ThermalRenderer):
    • FPS (top-right)
    • min/max temperature (bottom)
    • center temperature (center)
  • BOOT button (GPIO0): cycles through colormaps (Gray → Iron → Jet → Rainbow)
  • Debug LED (GPIO21): toggles once per main loop iteration

Hardware

  • ESP32-S3 board (USB device capable)
  • MLX90640 module (3V3)

I2C pin assignment

Pins are configured via menuconfig:

Signal Config
SDA I2C_MASTER_SDA
SCL I2C_MASTER_SCL

Many MLX90640 breakouts already include pull-ups. If yours does not, external pull-ups (e.g. 4.7k to 3V3) are recommended for reliable reads.

Build, flash, monitor

idf.py -p PORT flash monitor

To exit monitor: Ctrl-]

Useful tuning knobs

  • Sensor refresh rate: set in main/main.cpp via cfg.refresh_rate (e.g. Hz4, Hz8, Hz16)
  • I2C speed: CONFIG_I2C_MASTER_FREQUENCY (menuconfig)
  • Colormap / range: CONFIG_MLX90640_COLORMAP (0=Gray, 1=Iron, 2=Jet, 3=Rainbow), CONFIG_MLX90640_AUTO_RANGE, CONFIG_MLX90640_RANGE_MIN_C, CONFIG_MLX90640_RANGE_MAX_C
  • Render speed: ThermalRenderer::Config::fast_integer_scale (fast path when output is an integer multiple of 32×24)

Notes

  • Text rendering is always transparent (alpha-blended over the framebuffer). If you want a solid background behind text, draw a filled rectangle first.

About

An Infrared USB WebCam using the ESP32S3 and MLX90640 Module

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages