The SparkFun IR Array Breakout is a sophisticated sensor module designed to capture thermal images using infrared (IR) radiation. It utilizes the MLX90640 sensor to provide a thermal imaging solution with a 110-degree field of view (FOV). This breakout board simplifies the integration of the sensor with various microcontroller platforms, especially those compatible with the Qwiic connect system, which allows for easy daisy-chaining and requires no soldering.
Pin Name | Description |
---|---|
GND | Ground connection |
VCC | Power supply (3V to 3.6V) |
SDA | I2C data line |
SCL | I2C clock line |
INT | Interrupt pin (optional use) |
#include <Wire.h>
#include <Adafruit_MLX90640.h>
Adafruit_MLX90640 mlx;
void setup() {
Serial.begin(9600);
while (!Serial) delay(10); // wait for serial port to connect
Serial.println("MLX90640 IR Array Example");
// Initialize the MLX90640 sensor
if (!mlx.begin()) {
Serial.println("Failed to initialize MLX90640!");
while (1) delay(10);
}
// Set the refresh rate to 2Hz
mlx.setRefreshRate(MLX90640_REFRESH_2_HZ);
}
void loop() {
float mlx90640Frame[32 * 24]; // buffer for full frame of temperatures
// Capture an image frame
if (mlx.getFrame(mlx90640Frame)) {
for (int i = 0; i < 32 * 24; i++) {
Serial.print(mlx90640Frame[i]);
Serial.print(",");
if ((i + 1) % 32 == 0) {
Serial.println();
}
}
Serial.println();
} else {
Serial.println("Failed to read frame");
}
delay(500); // Delay between frames
}
Q: Can the MLX90640 sensor be used outdoors? A: Yes, but it should be protected from direct sunlight and harsh weather conditions to maintain accuracy.
Q: What is the maximum I2C bus length for the sensor? A: It is recommended to keep the I2C bus length as short as possible, ideally less than 1 meter, to ensure reliable communication.
Q: Can the sensor detect through glass or other materials? A: No, the MLX90640 cannot detect IR radiation through glass or similar materials as they block IR wavelengths.
Q: How do I change the I2C address of the sensor? A: The I2C address of the MLX90640 sensor is fixed and cannot be changed. If you need to use multiple sensors, you will need an I2C multiplexer.
Q: Is it possible to change the refresh rate of the sensor?
A: Yes, the refresh rate can be adjusted using the mlx.setRefreshRate()
function in the provided library.