The Adafruit MLX90640 Thermal Camera is a sophisticated infrared thermal imaging module that offers a 32x24 array of temperature readings, translating to 768 individual temperature measurements. This module is capable of detecting temperatures ranging from -40°C to 300°C, making it suitable for a wide array of applications including human presence detection, HVAC control, medical imaging, and more. Its I2C interface facilitates easy integration with microcontrollers such as the Arduino UNO.
Pin Number | Name | Description |
---|---|---|
1 | VDD | Power supply (3.3V to 5V) |
2 | SDA | I2C Data Line |
3 | SCL | I2C Clock Line |
4 | GND | Ground |
#include <Wire.h>
#include <Adafruit_MLX90640.h>
Adafruit_MLX90640 mlx;
void setup() {
Serial.begin(9600);
while (!Serial); // Wait for Serial to be ready
Serial.println("MLX90640 test");
if (!mlx.begin()) {
Serial.println("Failed to initialize MLX90640!");
while (1);
}
Serial.println("MLX90640 initialized successfully");
}
void loop() {
float mlx90640Frame[32 * 24]; // Buffer to store temperature readings
// Capture the frame at the lowest resolution to increase the frame rate
mlx.setMode(MLX90640_INTERLEAVED);
// Request a frame capture
if (mlx.getFrame(mlx90640Frame) == 0) {
for (int i = 0; i < 24; i++) {
for (int j = 0; j < 32; j++) {
float temp = mlx90640Frame[i * 32 + j];
Serial.print(temp);
Serial.print(",");
}
Serial.println();
}
} else {
Serial.println("Failed to read frame");
}
delay(1000); // Wait for 1 second before capturing next frame
}
Q: Can the MLX90640 be used to measure human body temperature? A: Yes, the MLX90640 can be used for human temperature detection, but it requires proper calibration and possibly additional optics for accurate measurements.
Q: What is the maximum distance at which the MLX90640 can accurately measure temperature? A: The maximum distance depends on the object size and the sensor's field of view. For small objects, the sensor should be closer to ensure accuracy.
Q: How can I increase the frame rate of the thermal camera? A: You can increase the frame rate by reducing the resolution or changing the refresh rate settings in the library, but this may affect the temperature accuracy and range.