This project implements a thermal imaging application using an ESP32-S3 development board (FeatherS3 from Unexpected Maker) and an MLX90640 thermal camera sensor. The application communicates with the sensor via I2C to capture thermal images and provides a console interface for controlling the camera and viewing the thermal data.
- Unexpected Maker FeatherS3 development board (ESP32-S3)
- MLX90640 Thermal Camera Breakout (connected via STEMMA QT socket)
- USB cable for programming and serial communication
Connect the MLX90640 thermal camera to the FeatherS3 board's STEMMA QT socket (LDO 1) using a 4-wire connection:
- VIN -> 3.3V
- GND -> GND
- SDA -> GPIO8 (I2C data line)
- SCL -> GPIO9 (I2C clock line)
- ESP-IDF development environment set up according to Espressif's instructions
- ESP-IDF environment variables set (run
. $HOME/esp/esp-idf/export.shif needed)
# Navigate to the project directory
cd ~/github/esp/thermal_camera
# Build the project
idf.py build
# Flash the project to the ESP32-S3
idf.py -p /dev/ttyACM0 flash
# Monitor the serial output
idf.py -p /dev/ttyACM0 monitorgraph TD
A[MLX90640 Thermal Camera] -- I2C --> B(ESP32-S3 FeatherS3);
B -- USB Serial --> C[PC/Console Interface];
B -- Wi-Fi --> D[Remote Monitoring Interface / App];
B -- SPI/GPIO --> E[External Display];
B -- SPI --> F[SD Card for Data Logging];
B --> G{Image Processing & Filtering};
G --> C;
G --> D;
G --> E;
G --> F;
subgraph "User Interaction"
C
D
end
subgraph "Data Storage & Display"
E
F
end
subgraph "Core Processing"
B
G
end
subgraph "Sensor"
A
end
end
The camera operates by wirelessly transmitting thermal images. Currently, it streams video continuously. The plan is to modify this to capture and transmit a still thermal image approximately every 2.5 seconds.
The primary interaction is wireless, and the previous serial console command-line interface is no longer the main method of operation.
When running the capture command, you'll see output similar to this:
Thermal Data:
Min temperature: 22.50°C
Max temperature: 28.75°C
Sample temperatures (°C):
24.3 23.8 23.5 24.1 24.6 25.0 25.3 25.1
23.9 23.5 23.8 24.3 25.1 25.7 26.2 25.8
24.1 24.0 24.5 25.2 26.3 27.1 27.5 26.9
24.8 24.9 25.5 26.4 27.5 28.2 28.5 27.8
25.2 25.4 26.1 27.0 28.0 28.7 28.6 27.9
24.9 25.1 25.8 26.5 27.3 27.8 27.5 26.8
In continuous mode, the application displays a simple ASCII representation of the thermal image, updating in real-time.
You can modify the following parameters in the code to match your specific setup:
- I2C GPIO pins: If your MLX90640 is connected to different pins, update the
I2C_MASTER_SDA_IOandI2C_MASTER_SCL_IOvalues inthermal_camera_main.c - Default settings: You can change the default resolution and refresh rate in
thermal_camera_main.c
- If the sensor is not detected, check your wiring connections and ensure the I2C pins are correctly configured
- Make sure the MLX90640 is properly powered (3.3V)
- Check that the I2C address matches (default is 0x33)
- Try reducing the I2C frequency if communication is unstable
- Add support for external display to show thermal images
- Implement data logging to SD card
- Add more advanced image processing and filtering
- Implement Wi-Fi connectivity for remote monitoring
This project is open source and available under the MIT License.# esp32-s3-thermal-camera-