The MLX90640 is a 32x24 pixel thermal imaging sensor manufactured by Pimoroni Ltd (Part ID: PIM365). This advanced sensor provides non-contact temperature measurements by detecting infrared radiation. It is capable of measuring temperatures in the range of -40°C to 300°C, making it ideal for applications requiring precise thermal monitoring.
The following table outlines the key technical details of the MLX90640 sensor:
Parameter | Value |
---|---|
Manufacturer | Pimoroni Ltd |
Part ID | PIM365 |
Resolution | 32x24 pixels |
Temperature Range | -40°C to 300°C |
Field of View (FoV) | 55° x 35° (standard version) |
Spectral Response | 8-14 µm (infrared spectrum) |
Refresh Rate | 0.5 Hz to 64 Hz |
Operating Voltage | 3.3V |
Communication Interface | I²C |
Power Consumption | ~23 mA |
Dimensions | 21mm x 20mm x 5mm |
The MLX90640 sensor uses a standard I²C interface for communication. Below is the pinout description:
Pin | Name | Description |
---|---|---|
1 | VCC | Power supply (3.3V) |
2 | GND | Ground |
3 | SDA | I²C data line |
4 | SCL | I²C clock line |
0x33
. Ensure no address conflicts if multiple I²C devices are connected.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[768]; // 32x24 = 768 pixels
void setup() {
Serial.begin(115200); // Initialize serial communication
Wire.begin(); // Initialize I²C communication
// Initialize the MLX90640 sensor
if (!mlx.begin(0x33)) { // Default I²C address is 0x33
Serial.println("MLX90640 not detected. Check wiring!");
while (1); // Halt execution if sensor is not found
}
// Set the refresh rate to 8 Hz
mlx.setMode(MLX90640_INTERLEAVED);
mlx.setRefreshRate(MLX90640_8_HZ);
Serial.println("MLX90640 initialized successfully!");
}
void loop() {
// Read temperature data into the frame buffer
if (mlx.getFrame(frame) != 0) {
Serial.println("Failed to read frame data!");
return; // Skip this iteration if reading fails
}
// Print the temperature data for each pixel
for (int i = 0; i < 768; i++) {
Serial.print(frame[i]);
Serial.print(" ");
if ((i + 1) % 32 == 0) { // Print a newline after every 32 pixels
Serial.println();
}
}
delay(125); // Delay to match the refresh rate (8 Hz = 125 ms)
}
Adafruit_MLX90640
library must be installed in your Arduino IDE.Sensor Not Detected
0x33
) is used in the code.Inaccurate Temperature Readings
I²C Communication Errors
Overheating or Damage
Q: Can the MLX90640 detect objects through glass?
A: No, the MLX90640 cannot detect infrared radiation through glass, as glass blocks most IR wavelengths.
Q: What is the maximum distance for accurate temperature measurement?
A: The effective range depends on the size of the object and its emissivity. For small objects, the sensor should be placed closer for accurate readings.
Q: Can I use the MLX90640 with a Raspberry Pi?
A: Yes, the MLX90640 is compatible with Raspberry Pi. Use the appropriate Python libraries (e.g., adafruit-circuitpython-mlx90640
) for integration.
Q: How do I visualize the thermal data?
A: You can use software tools or libraries to map the temperature data to a color gradient and display it as a thermal image.