The MLX90640 Adafruit Thermal Sensor is a high-resolution infrared (IR) thermal camera module designed for non-contact temperature measurement and thermal imaging. Manufactured by Adafruit, this sensor features a 32x24 pixel IR sensor array, enabling it to detect temperature variations across a wide field of view. It is compact, versatile, and ideal for applications requiring precise thermal data.
The following table outlines the key technical details of the MLX90640 Adafruit Thermal Sensor:
Parameter | Value |
---|---|
Manufacturer | Adafruit |
Part ID | Adafruit MLX90640 IR Thermal Camera |
Sensor Resolution | 32x24 pixels |
Field of View (FoV) | 55°x35° (Standard) or 110°x75° (Wide Angle) |
Temperature Range | -40°C to 300°C |
Accuracy | ±1°C (typical, for 0°C to 50°C range) |
Interface | I2C |
Operating Voltage | 3.3V to 5V |
Current Consumption | ~23mA |
Refresh Rate | 0.5Hz to 64Hz |
Dimensions | 20mm x 20mm x 5mm |
The MLX90640 module has the following pinout:
Pin | Name | Description |
---|---|---|
1 | VIN | Power input (3.3V to 5V) |
2 | GND | Ground |
3 | SDA | I2C data line |
4 | SCL | I2C clock line |
VIN
pin to a 3.3V or 5V power source and the GND
pin to ground.SDA
and SCL
pins to the corresponding I2C pins on your microcontroller (e.g., Arduino UNO).0x33
. If using multiple sensors, ensure address conflicts are resolved.Below is an example of how to use the MLX90640 with an Arduino UNO:
#include <Wire.h>
#include <Adafruit_MLX90640.h>
// Create an instance of the MLX90640 object
Adafruit_MLX90640 mlx;
// Define the frame buffer to store temperature data
float frame[32 * 24]; // 32x24 resolution
void setup() {
Serial.begin(115200);
while (!Serial); // Wait for Serial Monitor to open
Serial.println("Initializing MLX90640...");
// Initialize the MLX90640 sensor
if (!mlx.begin(0x33)) { // Default I2C address is 0x33
Serial.println("Failed to find MLX90640 sensor. Check wiring!");
while (1);
}
// Set the refresh rate to 8Hz
mlx.setMode(MLX90640_INTERLEAVED);
mlx.setRefreshRate(MLX90640_8_HZ);
Serial.println("MLX90640 initialized successfully!");
}
void loop() {
// Read thermal data into the frame buffer
if (mlx.getFrame(frame) != 0) {
Serial.println("Failed to read frame data!");
return;
}
// Print the temperature data
for (int i = 0; i < 32 * 24; i++) {
Serial.print(frame[i], 2); // Print temperature with 2 decimal places
Serial.print(" ");
if ((i + 1) % 32 == 0) { // Newline after every 32 pixels
Serial.println();
}
}
delay(125); // Delay to match the refresh rate (8Hz = 125ms)
}
Sensor Not Detected
Inaccurate Temperature Readings
Data Read Errors
Slow Refresh Rate
setRefreshRate()
function, but note the trade-off with power consumption.Can the MLX90640 detect humans? Yes, the sensor can detect humans based on their thermal signature.
What is the maximum distance for accurate readings? The effective range depends on the field of view and target size, but it is typically a few meters.
Can I use multiple MLX90640 sensors on the same I2C bus? Yes, but you must configure each sensor with a unique I2C address.
Is the sensor waterproof? No, the MLX90640 is not waterproof and should be protected from moisture.
Does the sensor require calibration? The sensor is factory-calibrated, but additional calibration may improve accuracy for specific applications.