ESP32 MLX90640 Thermal Camera
Interactive Infrared Dashboard

Explore Thermal Imaging with ESP32 and MLX90640

Turn your ESP32 and MLX90640 infrared sensor into an interactive thermal imaging camera! The free SensorLab Thermal Camera Dashboard displays real-time heat maps with 32 × 24 temperature measurement points, allowing you to visualize temperature differences and explore thermal radiation.

Connect your ESP32 via USB to view live thermal images, adjust color scales, rotate the image, and identify hot and cold spots. Pause the live display and move your mouse over individual pixels to read their temperatures in °C. You can also save thermal images as PNG files or export measurement data as CSV.

Ideal for physics education, STEM experiments, and hands-on investigations of heat transfer, thermal insulation, and infrared radiation. No additional software is required beyond a compatible web browser such as Chrome or Edge.

MLX90640 Thermal Camera for ESP32

Browser Compatibility

To use the SensorLab Weather Station with an ESP32 via USB, please use Google Chrome or Microsoft Edge. SensorLab uses the Web Serial API for direct communication with the ESP32, which is not supported by all web browsers.

Your IR Camera Dashboard

Pause the live thermal image using the Pause button, then hover your mouse over any pixel to display its temperature in °C.

SensorLab · Thermal Camera

MLX90640-D55 · 32 × 24 temperature pixels · USB Web Serial + Bluetooth LE
● Not connected
– °C
– °C
Minimum
–
Maximum
–
Average
–
Pause the image, then move the mouse over a pixel to read its temperature.
Waiting for sensor data · Rotation: 0°
Connection
USB: Chrome or Edge · 115200 baud
Bluetooth: Chrome / Edge (supported platforms), Bluefy (iOS)
HTTPS required
Auto scale: Blue marks the coolest pixel in the current frame; white marks the warmest. Colors therefore show relative temperature, not absolute heat.

Fixed scale: Use the same limits to compare different measurements. Image rotation changes only the display, not the measured values.
Sensor temperature: –
SensorLab.world · Measure. Export. Analyse.

Thermal Imaging Examples – Captured with the MLX90640

Discover what a 32 × 24 pixel infrared thermal camera can reveal! The following thermal images were captured using the MLX90640-D55 sensor connected to an ESP32 and visualized with the SensorLab Thermal Camera Dashboard.

These real-world examples demonstrate how infrared imaging makes temperature differences visible through color-coded heat maps. Explore the distribution of thermal radiation and discover how even a low-resolution infrared sensor can provide valuable insights into heat transfer and surface temperatures.

Example IR thermal Image 1
Thermal image 2
Thermal Image 3
Thermal Image 4

ESP32 Firmware – Arduino IDE for MLX90640

#include <Arduino.h>
#include <Wire.h>
#include <Adafruit_MLX90640.h>

// SensorLab.world – MLX90640-D55, 32 x 24 temperature pixels
// ESP32 Dev Module: SDA = GPIO 21, SCL = GPIO 22

constexpr int SDA_PIN = 21;
constexpr int SCL_PIN = 22;
constexpr uint32_t SERIAL_BAUD = 115200;
constexpr uint32_t I2C_CLOCK_HZ = 400000;
constexpr uint16_t FRAME_INTERVAL_MS = 500;

Adafruit_MLX90640 mlx;
float frame[32 * 24];

void setup() {
Serial.begin(SERIAL_BAUD);
delay(1200);

Serial.println("SensorLab MLX90640-D55 – starting");
Wire.begin(SDA_PIN, SCL_PIN);
Wire.setClock(I2C_CLOCK_HZ);

if (!mlx.begin(MLX90640_I2CADDR_DEFAULT, &Wire)) {
Serial.println("ERROR: MLX90640 not found at I2C address 0x33.");
Serial.println("Check 3.3V, GND, SDA=21, SCL=22 and reset ESP32.");
while (true) delay(1000);
}

mlx.setMode(MLX90640_CHESS);
mlx.setResolution(MLX90640_ADC_18BIT);
mlx.setRefreshRate(MLX90640_2_HZ);

Serial.println("MLX90640 detected – 32 columns x 24 rows");
Serial.println("Output: FRAME, ambient temperature, 24 CSV rows, END");
}

void loop() {
if (mlx.getFrame(frame) != 0) {
Serial.println("ERROR: Frame read failed");
delay(FRAME_INTERVAL_MS);
return;
}

Serial.print("FRAME,Ta_C,");
Serial.println(mlx.getTa(false), 2);

for (int row = 0; row < 24; ++row) {
for (int col = 0; col < 32; ++col) {
if (col > 0) Serial.print(',');
Serial.print(frame[row * 32 + col], 2);
}
Serial.println();
}
Serial.println("END");
delay(FRAME_INTERVAL_MS);
}