

The MLX90621 is a compact, low-cost infrared thermal sensor designed for non-contact temperature measurement. It features a 16x4 pixel array, enabling the detection of temperature variations across a surface. This makes it ideal for applications such as thermal imaging, human body temperature monitoring, industrial process control, and home automation.








The MLX90621 is a highly versatile sensor with the following key technical details:
| Parameter | Value |
|---|---|
| Operating Voltage | 3.0V to 3.6V |
| Current Consumption | 12mA (typical) |
| Temperature Range | -40°C to +85°C (ambient) |
| Object Temperature Range | -40°C to +300°C |
| Field of View (FoV) | 120° x 25° |
| Pixel Resolution | 16x4 (64 pixels) |
| Communication Interface | I²C (up to 1 MHz) |
| Measurement Accuracy | ±1°C (typical, depending on conditions) |
The MLX90621 is typically available in a TO-39 package with the following pinout:
| Pin Number | Pin Name | Description |
|---|---|---|
| 1 | VDD | Power supply (3.0V to 3.6V) |
| 2 | SDA | I²C data line |
| 3 | SCL | I²C clock line |
| 4 | VSS | Ground |
The MLX90621 is straightforward to use in a circuit, especially with microcontrollers like the Arduino UNO. Below are the steps and best practices for integrating the sensor:
VDD pin to the 3.3V output of the Arduino and the VSS pin to the GND.SDA pin to the Arduino's A4 pin and the SCL pin to the A5 pin (for older Arduino boards) or the dedicated SDA/SCL pins on newer boards.The following code demonstrates how to read temperature data from the MLX90621 using the Arduino IDE. This example uses the Adafruit MLX90621 library.
#include <Wire.h>
#include <Adafruit_MLX90621.h>
// Create an instance of the MLX90621 object
Adafruit_MLX90621 mlx = Adafruit_MLX90621();
void setup() {
Serial.begin(9600); // Initialize serial communication for debugging
Serial.println("Initializing MLX90621...");
// Initialize the MLX90621 sensor
if (!mlx.begin()) {
Serial.println("Failed to initialize MLX90621. Check connections!");
while (1); // Halt execution if initialization fails
}
Serial.println("MLX90621 initialized successfully!");
}
void loop() {
float temperatures[64]; // Array to store temperature readings
// Read temperature data from the sensor
mlx.readPixels(temperatures);
// Print the temperature data to the Serial Monitor
for (int i = 0; i < 64; i++) {
Serial.print("Pixel ");
Serial.print(i);
Serial.print(": ");
Serial.print(temperatures[i]);
Serial.println(" °C");
}
delay(1000); // Wait 1 second before the next reading
}
Sensor Not Detected on I²C Bus:
Inaccurate Temperature Readings:
Arduino Freezes During Operation:
Q: Can the MLX90621 measure the temperature of multiple objects simultaneously?
A: Yes, the 16x4 pixel array allows the sensor to measure the temperature of multiple objects within its field of view.
Q: What is the maximum distance for accurate temperature measurement?
A: The effective distance depends on the size of the object and its emissivity. For small objects, the sensor should be placed closer for accurate readings.
Q: Is the MLX90621 compatible with 5V microcontrollers?
A: The MLX90621 operates at 3.3V. If using a 5V microcontroller, level shifters are required for the I²C lines to prevent damage to the sensor.
By following this documentation, you can effectively integrate and use the MLX90621 in your projects.