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

How to Use MLX90640: Examples, Pinouts, and Specs

Image of MLX90640
Cirkit Designer LogoDesign with MLX90640 in Cirkit Designer

Introduction

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.

Explore Projects Built with MLX90640

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
ESP32-Based Infrared Thermometer with I2C LCD Display
Image of infrared thermometer: A project utilizing MLX90640 in a practical application
This circuit features an ESP32 microcontroller powered by a 18650 Li-Ion battery, with a TP4056 module for charging the battery via a USB plug. The ESP32 reads temperature data from an MLX90614 infrared temperature sensor and displays it on an I2C LCD 16x2 screen. The ESP32, MLX90614 sensor, and LCD screen are connected via I2C communication lines (SCL, SDA), and the circuit is designed to measure and display ambient and object temperatures.
Cirkit Designer LogoOpen Project in Cirkit Designer
Battery-Powered Raspberry Pi Pico GPS Tracker with Sensor Integration
Image of Copy of CanSet v1: A project utilizing MLX90640 in a practical application
This circuit is a data acquisition and communication system powered by a LiPoly battery and managed by a Raspberry Pi Pico. It includes sensors (BMP280, MPU9250) for environmental data, a GPS module for location tracking, an SD card for data storage, and a WLR089-CanSAT for wireless communication. The TP4056 module handles battery charging, and a toggle switch controls power distribution.
Cirkit Designer LogoOpen Project in Cirkit Designer
Arduino Mega 2560-Based Autonomous Robot with GPS, Bluetooth, and Environmental Sensors
Image of botfinal: A project utilizing MLX90640 in a practical application
This circuit is a robotic system controlled by an Arduino Mega 2560, which uses multiple sensors including temperature sensors (MLX90614), gas sensors (MQ-136), a GPS module, and a Bluetooth module to navigate and detect environmental conditions. The system drives motors via an L298N motor driver and displays information on a 16x2 I2C LCD, with the ability to receive commands via Bluetooth.
Cirkit Designer LogoOpen Project in Cirkit Designer
Arduino Nano Based GPS Tracker with GSM Communication and Accelerometer
Image of Circuit Aayush: A project utilizing MLX90640 in a practical application
This circuit is designed for communication and location tracking purposes. It features an Arduino Nano interfaced with a SIM800L GSM module for cellular connectivity, a GPS NEO 6M module for obtaining geographical coordinates, and an AITrip ADXL335 GY-61 accelerometer for motion sensing. The LM2596 Step Down Module is used to regulate the power supply to the components.
Cirkit Designer LogoOpen Project in Cirkit Designer

Explore Projects Built with MLX90640

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 infrared thermometer: A project utilizing MLX90640 in a practical application
ESP32-Based Infrared Thermometer with I2C LCD Display
This circuit features an ESP32 microcontroller powered by a 18650 Li-Ion battery, with a TP4056 module for charging the battery via a USB plug. The ESP32 reads temperature data from an MLX90614 infrared temperature sensor and displays it on an I2C LCD 16x2 screen. The ESP32, MLX90614 sensor, and LCD screen are connected via I2C communication lines (SCL, SDA), and the circuit is designed to measure and display ambient and object temperatures.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of Copy of CanSet v1: A project utilizing MLX90640 in a practical application
Battery-Powered Raspberry Pi Pico GPS Tracker with Sensor Integration
This circuit is a data acquisition and communication system powered by a LiPoly battery and managed by a Raspberry Pi Pico. It includes sensors (BMP280, MPU9250) for environmental data, a GPS module for location tracking, an SD card for data storage, and a WLR089-CanSAT for wireless communication. The TP4056 module handles battery charging, and a toggle switch controls power distribution.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of botfinal: A project utilizing MLX90640 in a practical application
Arduino Mega 2560-Based Autonomous Robot with GPS, Bluetooth, and Environmental Sensors
This circuit is a robotic system controlled by an Arduino Mega 2560, which uses multiple sensors including temperature sensors (MLX90614), gas sensors (MQ-136), a GPS module, and a Bluetooth module to navigate and detect environmental conditions. The system drives motors via an L298N motor driver and displays information on a 16x2 I2C LCD, with the ability to receive commands via Bluetooth.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of Circuit Aayush: A project utilizing MLX90640 in a practical application
Arduino Nano Based GPS Tracker with GSM Communication and Accelerometer
This circuit is designed for communication and location tracking purposes. It features an Arduino Nano interfaced with a SIM800L GSM module for cellular connectivity, a GPS NEO 6M module for obtaining geographical coordinates, and an AITrip ADXL335 GY-61 accelerometer for motion sensing. The LM2596 Step Down Module is used to regulate the power supply to the components.
Cirkit Designer LogoOpen Project in Cirkit Designer

Common Applications

  • Thermal imaging cameras
  • HVAC (Heating, Ventilation, and Air Conditioning) systems
  • Robotics and automation
  • Fire detection and safety systems
  • Medical diagnostics and monitoring
  • Industrial process control

Technical Specifications

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

Pin Configuration

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

Usage Instructions

How to Use the MLX90640 in a Circuit

  1. Power Supply: Connect the VCC pin to a 3.3V power source and the GND pin to ground.
  2. I²C Communication: Connect the SDA and SCL pins to the corresponding I²C pins on your microcontroller (e.g., Arduino UNO).
  3. Pull-Up Resistors: Ensure that the SDA and SCL lines have pull-up resistors (typically 4.7kΩ) for proper I²C communication.
  4. Software Setup: Use a compatible library (e.g., Adafruit MLX90640 library) to interface with the sensor and retrieve temperature data.

Important Considerations

  • Power Supply: The MLX90640 operates at 3.3V. Do not connect it directly to a 5V power source to avoid damage.
  • I²C Address: The default I²C address of the MLX90640 is 0x33. Ensure no address conflicts if multiple I²C devices are connected.
  • Thermal Calibration: The sensor is factory-calibrated, but environmental factors (e.g., ambient temperature) may affect accuracy. Use software compensation if needed.
  • Field of View: Ensure the sensor is positioned correctly to capture the desired area within its 55° x 35° field of view.

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[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)
}

Notes on the Code

  • The Adafruit_MLX90640 library must be installed in your Arduino IDE.
  • Ensure the I²C pull-up resistors are properly connected for stable communication.
  • The frame buffer stores temperature data for all 768 pixels, which can be processed or visualized as needed.

Troubleshooting and FAQs

Common Issues

  1. Sensor Not Detected

    • Cause: Incorrect wiring or I²C address mismatch.
    • Solution: Verify the connections and ensure the correct I²C address (0x33) is used in the code.
  2. Inaccurate Temperature Readings

    • Cause: Environmental factors or improper calibration.
    • Solution: Use software compensation to account for ambient temperature variations.
  3. I²C Communication Errors

    • Cause: Missing or incorrect pull-up resistors on SDA/SCL lines.
    • Solution: Add 4.7kΩ pull-up resistors to the SDA and SCL lines.
  4. Overheating or Damage

    • Cause: Exceeding the operating voltage (3.3V).
    • Solution: Use a voltage regulator or level shifter if interfacing with a 5V system.

FAQs

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.