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

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

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

Introduction

The MLX90640 Adafruit Thermal Sensor is a high-resolution infrared (IR) thermal camera module designed for non-contact temperature measurement and thermal imaging. Manufactured by Adafruit, this sensor features a 32x24 pixel IR sensor array, enabling it to detect temperature variations across a wide field of view. It is compact, versatile, and ideal for applications requiring precise thermal data.

Explore Projects Built with MLX90640 Adafruit Thermal Sensor

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 4B and mlx90614 Infrared Thermometer with Logic Level Conversion
Image of thermal Sensor: A project utilizing MLX90640 Adafruit Thermal Sensor in a practical application
This circuit connects a Raspberry Pi 4B to an MLX90614 infrared temperature sensor using an Adafruit 4-channel I2C-safe Bi-directional Logic Level Converter. The level converter is used to safely step down the 5V I2C signals from the Raspberry Pi to the 3.3V needed by the MLX90614 sensor, ensuring compatibility between the devices. Ground connections are shared among all components, and the sensor is powered by the Raspberry Pi's 5V supply through the level converter.
Cirkit Designer LogoOpen Project in Cirkit Designer
Raspberry Pi 5 and MLX90640 Thermal Camera Imaging System with Battery Backup
Image of AI Thermal : A project utilizing MLX90640 Adafruit Thermal Sensor 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 MLX90640 Adafruit Thermal Sensor 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
ESP32-Based Battery-Powered Wi-Fi Temperature Monitoring System with MLX90614 and I2C LCD
Image of infrared thermometer 4: A project utilizing MLX90640 Adafruit Thermal Sensor in a practical application
This circuit is a temperature monitoring system using an ESP32 microcontroller, an MLX90614 infrared temperature sensor, and a 16x2 I2C LCD display. It includes a TP4056 module for charging a 18650 Li-Ion battery, a pushbutton for mode selection, and a buzzer for low battery alerts. The ESP32 reads temperature data, displays it on the LCD, and sends it to a server via Wi-Fi.
Cirkit Designer LogoOpen Project in Cirkit Designer

Explore Projects Built with MLX90640 Adafruit Thermal Sensor

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 thermal Sensor: A project utilizing MLX90640 Adafruit Thermal Sensor in a practical application
Raspberry Pi 4B and mlx90614 Infrared Thermometer with Logic Level Conversion
This circuit connects a Raspberry Pi 4B to an MLX90614 infrared temperature sensor using an Adafruit 4-channel I2C-safe Bi-directional Logic Level Converter. The level converter is used to safely step down the 5V I2C signals from the Raspberry Pi to the 3.3V needed by the MLX90614 sensor, ensuring compatibility between the devices. Ground connections are shared among all components, and the sensor is powered by the Raspberry Pi's 5V supply through the level converter.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of AI Thermal : A project utilizing MLX90640 Adafruit Thermal Sensor 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 MLX90640 Adafruit Thermal Sensor 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 infrared thermometer 4: A project utilizing MLX90640 Adafruit Thermal Sensor in a practical application
ESP32-Based Battery-Powered Wi-Fi Temperature Monitoring System with MLX90614 and I2C LCD
This circuit is a temperature monitoring system using an ESP32 microcontroller, an MLX90614 infrared temperature sensor, and a 16x2 I2C LCD display. It includes a TP4056 module for charging a 18650 Li-Ion battery, a pushbutton for mode selection, and a buzzer for low battery alerts. The ESP32 reads temperature data, displays it on the LCD, and sends it to a server via Wi-Fi.
Cirkit Designer LogoOpen Project in Cirkit Designer

Common Applications and Use Cases

  • Robotics: Thermal mapping and obstacle detection.
  • HVAC Systems: Monitoring temperature distribution and efficiency.
  • Smart Home Systems: Detecting human presence or heat sources.
  • Industrial Automation: Equipment monitoring and fault detection.
  • Medical Devices: Non-contact temperature measurement.
  • Research and Development: Thermal analysis and prototyping.

Technical Specifications

The following table outlines the key technical details of the MLX90640 Adafruit Thermal Sensor:

Parameter Value
Manufacturer Adafruit
Part ID Adafruit MLX90640 IR Thermal Camera
Sensor Resolution 32x24 pixels
Field of View (FoV) 55°x35° (Standard) or 110°x75° (Wide Angle)
Temperature Range -40°C to 300°C
Accuracy ±1°C (typical, for 0°C to 50°C range)
Interface I2C
Operating Voltage 3.3V to 5V
Current Consumption ~23mA
Refresh Rate 0.5Hz to 64Hz
Dimensions 20mm x 20mm x 5mm

Pin Configuration and Descriptions

The MLX90640 module has the following pinout:

Pin Name Description
1 VIN Power input (3.3V to 5V)
2 GND Ground
3 SDA I2C data line
4 SCL I2C clock line

Usage Instructions

How to Use the MLX90640 in a Circuit

  1. Power the Sensor: Connect the VIN pin to a 3.3V or 5V power source and the GND pin to ground.
  2. I2C Communication: Connect the SDA and SCL pins to the corresponding I2C pins on your microcontroller (e.g., Arduino UNO).
  3. Pull-Up Resistors: Ensure that the I2C lines have appropriate pull-up resistors (typically 4.7kΩ).
  4. Install Libraries: Use the Adafruit MLX90640 library for easy integration with Arduino or other platforms.
  5. Read Data: Use the library functions to read temperature data and process the thermal image.

Important Considerations and Best Practices

  • Power Supply: Ensure a stable power supply to avoid noise in the thermal readings.
  • I2C Address: The default I2C address is 0x33. If using multiple sensors, ensure address conflicts are resolved.
  • Refresh Rate: Higher refresh rates may increase power consumption.
  • Ambient Conditions: Avoid direct sunlight or reflective surfaces, as they can affect accuracy.
  • Calibration: The sensor is factory-calibrated, but additional calibration may be required for specific applications.

Example Code for Arduino UNO

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[32 * 24]; // 32x24 resolution

void setup() {
  Serial.begin(115200);
  while (!Serial); // Wait for Serial Monitor to open

  Serial.println("Initializing MLX90640...");

  // Initialize the MLX90640 sensor
  if (!mlx.begin(0x33)) { // Default I2C address is 0x33
    Serial.println("Failed to find MLX90640 sensor. Check wiring!");
    while (1);
  }

  // Set the refresh rate to 8Hz
  mlx.setMode(MLX90640_INTERLEAVED);
  mlx.setRefreshRate(MLX90640_8_HZ);

  Serial.println("MLX90640 initialized successfully!");
}

void loop() {
  // Read thermal data into the frame buffer
  if (mlx.getFrame(frame) != 0) {
    Serial.println("Failed to read frame data!");
    return;
  }

  // Print the temperature data
  for (int i = 0; i < 32 * 24; i++) {
    Serial.print(frame[i], 2); // Print temperature with 2 decimal places
    Serial.print(" ");
    if ((i + 1) % 32 == 0) { // Newline after every 32 pixels
      Serial.println();
    }
  }

  delay(125); // Delay to match the refresh rate (8Hz = 125ms)
}

Troubleshooting and FAQs

Common Issues and Solutions

  1. Sensor Not Detected

    • Cause: Incorrect wiring or I2C address mismatch.
    • Solution: Verify the connections and ensure the I2C address matches the one in the code.
  2. Inaccurate Temperature Readings

    • Cause: Reflective surfaces or environmental interference.
    • Solution: Avoid reflective surfaces and ensure the sensor is not exposed to direct sunlight.
  3. Data Read Errors

    • Cause: I2C communication issues.
    • Solution: Check pull-up resistors on the I2C lines and ensure proper clock speed (typically 100kHz or 400kHz).
  4. Slow Refresh Rate

    • Cause: Default refresh rate is too low.
    • Solution: Increase the refresh rate using the setRefreshRate() function, but note the trade-off with power consumption.

FAQs

  • Can the MLX90640 detect humans? Yes, the sensor can detect humans based on their thermal signature.

  • What is the maximum distance for accurate readings? The effective range depends on the field of view and target size, but it is typically a few meters.

  • Can I use multiple MLX90640 sensors on the same I2C bus? Yes, but you must configure each sensor with a unique I2C address.

  • Is the sensor waterproof? No, the MLX90640 is not waterproof and should be protected from moisture.

  • Does the sensor require calibration? The sensor is factory-calibrated, but additional calibration may improve accuracy for specific applications.