Cirkit Designer Logo
Cirkit Designer
Your all-in-one circuit design IDE
Home / 
Component Documentation

How to Use Adafruit MLX90640 Thermal Camera: Examples, Pinouts, and Specs

Image of Adafruit MLX90640 Thermal Camera
Cirkit Designer LogoDesign with Adafruit MLX90640 Thermal Camera in Cirkit Designer

Introduction

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.

Explore Projects Built with Adafruit MLX90640 Thermal Camera

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
Raspberry Pi 5 and MLX90640 Thermal Camera Imaging System with Battery Backup
Image of AI Thermal : A project utilizing Adafruit MLX90640 Thermal Camera in a practical application
This circuit features a Raspberry Pi 5 connected to an Adafruit MLX90640 Thermal Camera via I2C communication lines (GPIO 2 and GPIO 3 for SDA and SCL, respectively) and powered by a 24/12V buck converter. The buck converter steps down voltage from a 3S 10A Li-ion 18650 battery pack, which is managed by a charger protection board and charged through a lipo battery charger module. The Raspberry Pi runs code to capture and process thermal images from the camera.
Cirkit Designer LogoOpen Project in Cirkit Designer
Arduino Mega 2560 Based Motion-Activated Thermal Camera with Bluetooth Connectivity
Image of SEARCH: A project utilizing Adafruit MLX90640 Thermal Camera in a practical application
This circuit features an Arduino Mega 2560 microcontroller interfaced with a PIR motion sensor, a Bluetooth HC-06 module, and an Adafruit MLX90640 thermal camera. The Arduino controls an LED through a resistor, receives motion detection signals, communicates via Bluetooth, and processes thermal images. The microcontroller's code structure is set up but contains no specific functionality yet.
Cirkit Designer LogoOpen Project in Cirkit Designer
Raspberry Pi 4B and MLX90614-Based Temperature Sensing with Laser Emitter
Image of shit: A project utilizing Adafruit MLX90640 Thermal Camera in a practical application
This circuit integrates a Raspberry Pi 4B with an MLX90614 infrared temperature sensor and a KY-008 laser emitter. The Raspberry Pi reads temperature data from the MLX90614 via I2C communication and controls the KY-008 laser emitter through GPIO pins, enabling a potential application in temperature monitoring and laser-based signaling or targeting.
Cirkit Designer LogoOpen Project in Cirkit Designer
Arduino Mega 2560 Temperature Logging System with MLX90614 and Micro SD Card Module
Image of Copy of Gesamt Schaltplan: A project utilizing Adafruit MLX90640 Thermal Camera in a practical application
This circuit features an Arduino Mega 2560 microcontroller interfacing with an MLX90614 infrared temperature sensor and a Micro SD Card Module. The Arduino reads temperature data from the MLX90614 via I2C and logs it to the Micro SD card using SPI communication. The setup allows for temperature monitoring and data logging.
Cirkit Designer LogoOpen Project in Cirkit Designer

Explore Projects Built with Adafruit MLX90640 Thermal Camera

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
Image of AI Thermal : A project utilizing Adafruit MLX90640 Thermal Camera in a practical application
Raspberry Pi 5 and MLX90640 Thermal Camera Imaging System with Battery Backup
This circuit features a Raspberry Pi 5 connected to an Adafruit MLX90640 Thermal Camera via I2C communication lines (GPIO 2 and GPIO 3 for SDA and SCL, respectively) and powered by a 24/12V buck converter. The buck converter steps down voltage from a 3S 10A Li-ion 18650 battery pack, which is managed by a charger protection board and charged through a lipo battery charger module. The Raspberry Pi runs code to capture and process thermal images from the camera.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of SEARCH: A project utilizing Adafruit MLX90640 Thermal Camera in a practical application
Arduino Mega 2560 Based Motion-Activated Thermal Camera with Bluetooth Connectivity
This circuit features an Arduino Mega 2560 microcontroller interfaced with a PIR motion sensor, a Bluetooth HC-06 module, and an Adafruit MLX90640 thermal camera. The Arduino controls an LED through a resistor, receives motion detection signals, communicates via Bluetooth, and processes thermal images. The microcontroller's code structure is set up but contains no specific functionality yet.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of shit: A project utilizing Adafruit MLX90640 Thermal Camera in a practical application
Raspberry Pi 4B and MLX90614-Based Temperature Sensing with Laser Emitter
This circuit integrates a Raspberry Pi 4B with an MLX90614 infrared temperature sensor and a KY-008 laser emitter. The Raspberry Pi reads temperature data from the MLX90614 via I2C communication and controls the KY-008 laser emitter through GPIO pins, enabling a potential application in temperature monitoring and laser-based signaling or targeting.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of Copy of Gesamt Schaltplan: A project utilizing Adafruit MLX90640 Thermal Camera in a practical application
Arduino Mega 2560 Temperature Logging System with MLX90614 and Micro SD Card Module
This circuit features an Arduino Mega 2560 microcontroller interfacing with an MLX90614 infrared temperature sensor and a Micro SD Card Module. The Arduino reads temperature data from the MLX90614 via I2C and logs it to the Micro SD card using SPI communication. The setup allows for temperature monitoring and data logging.
Cirkit Designer LogoOpen Project in Cirkit Designer

Technical Specifications

Key Technical Details

  • Sensor Array: 32x24 IR sensor
  • Measurement Range: -40°C to 300°C
  • Interface: I2C
  • Field of View (FoV): 55° x 35° (typical)
  • Refresh Rate: 0.5Hz to 64Hz
  • Supply Voltage: 3.3V to 5V
  • Current Consumption: 23mA (typical)
  • Operating Temperature: -40°C to 85°C

Pin Configuration and Descriptions

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

Usage Instructions

Integration with a Circuit

  1. Power Supply: Connect the VDD pin to a 3.3V or 5V power supply from your microcontroller board.
  2. Data Line: Connect the SDA pin to the I2C data line (SDA) on your microcontroller.
  3. Clock Line: Connect the SCL pin to the I2C clock line (SCL) on your microcontroller.
  4. Ground: Connect the GND pin to the ground on your microcontroller.

Important Considerations and Best Practices

  • Ensure that the power supply is stable and within the specified voltage range.
  • Use pull-up resistors on the I2C data and clock lines if they are not already present on your microcontroller board.
  • Avoid exposing the sensor to direct sunlight or high reflective surfaces to prevent inaccurate readings.
  • For accurate temperature measurements, calibrate the sensor according to the manufacturer's guidelines.

Example Code for Arduino UNO

#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
}

Troubleshooting and FAQs

Common Issues

  • No Data on Serial Monitor: Ensure that the SDA and SCL connections are secure and that the correct I2C address is being used.
  • Inaccurate Temperature Readings: Check for any sources of heat or reflection that could be affecting the sensor. Calibrate the sensor if necessary.
  • Sensor Not Initializing: Make sure the power supply is within the specified range and that the sensor is not exposed to extreme temperatures.

Solutions and Tips

  • I2C Communication Issues: Use a logic analyzer to check the integrity of the I2C signals. Ensure pull-up resistors are correctly sized.
  • Calibration: Follow the calibration procedure outlined in the sensor's datasheet to adjust for emissivity and ambient temperature.
  • Updating Firmware: Keep the sensor's firmware updated to the latest version to ensure optimal performance.

FAQs

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.