

The Adafruit MLX90640 Thermal Camera (Part ID: 4407) is a high-resolution thermal imaging sensor designed to detect temperature variations across a wide field of view. This compact and powerful sensor provides real-time thermal data, making it ideal for applications such as temperature monitoring, surveillance, robotics, and scientific research. With its ability to measure temperatures without physical contact, the MLX90640 is a versatile tool for both hobbyists and professionals.








The Adafruit MLX90640 Thermal Camera is based on the MLX90640 sensor, which features a 32x24 pixel array for thermal imaging. Below are the key technical details:
| Parameter | Value |
|---|---|
| Sensor Resolution | 32x24 pixels |
| Field of View (FoV) | 55°x35° (Wide Angle) |
| Temperature Range | -40°C to 300°C (-40°F to 572°F) |
| Accuracy | ±1°C (typical, depending on conditions) |
| Refresh Rate | 0.5 Hz to 64 Hz (configurable) |
| Interface | I2C |
| Operating Voltage | 3.3V to 5V |
| Current Consumption | ~23mA |
| Dimensions | 25mm x 17mm x 2mm |
The Adafruit MLX90640 Thermal Camera breakout board has the following pin layout:
| Pin Name | Description |
|---|---|
| VIN | Power input (3.3V to 5V) |
| GND | Ground |
| SCL | I2C Clock Line |
| SDA | I2C Data Line |
| INT | Interrupt pin (optional, not required for basic use) |
To use the Adafruit MLX90640 Thermal Camera with an Arduino UNO, follow these steps:
Wiring:
VIN pin of the MLX90640 to the 5V pin on the Arduino.GND pin of the MLX90640 to the GND pin on the Arduino.SCL pin of the MLX90640 to the A5 pin on the Arduino (I2C clock line).SDA pin of the MLX90640 to the A4 pin on the Arduino (I2C data line).Install Required Libraries:
Upload Example Code: Use the following example code to read thermal data from the MLX90640:
#include <Adafruit_MLX90640.h>
Adafruit_MLX90640 mlx;
float frame[32 * 24]; // Array to store thermal data
void setup() {
Serial.begin(115200);
while (!Serial); // Wait for Serial Monitor to open
if (!mlx.begin()) {
Serial.println("Failed to find MLX90640 sensor!");
while (1);
}
Serial.println("MLX90640 initialized.");
mlx.setMode(MLX90640_CHESS); // Set to chess mode for better performance
mlx.setRefreshRate(MLX90640_8_HZ); // Set refresh rate to 8Hz
}
void loop() {
if (mlx.getFrame(frame)) {
Serial.println("Thermal data:");
for (int i = 0; i < 32 * 24; i++) {
Serial.print(frame[i], 2); // Print temperature values
Serial.print(" ");
if ((i + 1) % 32 == 0) Serial.println(); // New line after each row
}
delay(125); // Delay to match refresh rate
} else {
Serial.println("Failed to read frame.");
}
}
View Data:
115200.0x33. If you have multiple I2C devices, ensure there are no address conflicts."Failed to find MLX90640 sensor!" error:
0x33) or the configured address.No data or incorrect readings:
Thermal data appears noisy or inaccurate:
Q: Can the MLX90640 detect objects through glass?
A: No, the MLX90640 cannot detect thermal signatures through glass, as glass blocks infrared radiation.
Q: What is the maximum distance for accurate temperature readings?
A: The MLX90640 can detect temperature variations at distances of several meters, but accuracy decreases with distance.
Q: Can I use the MLX90640 with a Raspberry Pi?
A: Yes, the MLX90640 is compatible with Raspberry Pi. Adafruit provides Python libraries for easy integration.
Q: How do I change the I2C address of the MLX90640?
A: The I2C address is fixed at 0x33 and cannot be changed. Use an I2C multiplexer if multiple devices with the same address are needed.
By following this documentation, you can effectively integrate and utilize the Adafruit MLX90640 Thermal Camera in your projects.