Zbotic Logo Zbotic Logo
  • Home
  • Shop
  • Sale
  • 3D Print Service
  • PCB Service
  • B2B
  • Blogs
  • Contact Us
0 0

View Wishlist Add all to cart

0 0
0 Shopping Cart
Shopping cart (0)
Subtotal: ₹0.00

View cartCheckout

  • Shop
  • About Us
  • Contact Us
  • Reseller
  • Blogs
020 69134444
1800 209 0998
[email protected]
Help Desk
Facebook Twitter Instagram Linkedin YouTube
Zbotic Logo Zbotic Logo
0 0

View Wishlist Add all to cart

0 0
0 Shopping Cart
Shopping cart (0)
Subtotal: ₹0.00

View cartCheckout

All departments
  • 3D Print Service
  • 3D Printer
  • Batteries & Chargers
  • Development Boards
  • Drone Parts
  • EBike parts
  • Sensor Modules
  • Electronic Components
  • Electronic Modules
  • IoT and Wireless
  • Mechanical Parts and Workbench Tools
  • Motors & Drivers & Pumps & Actuators
  • DIY and Robot Kits
  • Show more
  • Home
  • Shop
  • Sale
  • 3D Print Service
  • PCB Service
  • B2B
  • Blogs
  • Contact Us
Return to previous page
Home Camera & Vision Modules

Thermal Imaging Camera for Electronics: MLX90640 Guide

Thermal Imaging Camera for Electronics: MLX90640 Guide

March 11, 2026 /Posted byJayesh Jain / 0

The MLX90640 thermal imaging camera opens a fascinating dimension of electronics — seeing heat distribution invisible to the naked eye. This 32×24 pixel infrared sensor array creates a thermal heatmap, enabling you to detect hot spots in circuits, find heat leaks, identify overheating components, and even build a primitive people detector. This guide covers wiring, configuration, and visualisation for both Arduino and Raspberry Pi.

Table of Contents

  • MLX90640 Overview and Specifications
  • Wiring to Arduino and Raspberry Pi
  • Arduino Code and Library
  • Python Visualisation on Raspberry Pi
  • Image Interpolation for Better Display
  • Practical Applications in India
  • Frequently Asked Questions

MLX90640 Overview and Specifications

  • Sensor array: 32×24 pixels (768 temperature measurements)
  • Temperature range: -40°C to +300°C (-40°C to +1000°C for high-temp version)
  • Temperature accuracy: ±1.5°C
  • Interface: I2C, up to 400 kHz
  • I2C address: 0x33 (default)
  • Field of view: 55°×35° (standard) or 110°×75° (wide)
  • Frame rate: 0.5–64 Hz (configurable)
  • India price: ₹1,500–3,500 for breakout board
Recommended: Arducam 8MP IMX219 Camera for Raspberry Pi — Combine a visible-light camera with the MLX90640 thermal sensor for a complete dual-camera thermal+visible imaging system on Raspberry Pi.

Wiring to Arduino and Raspberry Pi

MLX90640 Breakout to Arduino Uno:
  VIN -> 3.3V (some breakouts accept 5V via regulator)
  GND -> GND
  SDA -> A4 (SDA)
  SCL -> A5 (SCL)

MLX90640 Breakout to Raspberry Pi:
  VIN -> Pin 1 (3.3V)
  GND -> Pin 6 (GND)
  SDA -> Pin 3 (GPIO2, SDA1)
  SCL -> Pin 5 (GPIO3, SCL1)

I2C pull-up: Most breakout boards include 4.7kΩ pull-ups.
Enable I2C on Raspberry Pi: sudo raspi-config > Interface Options > I2C

Arduino Code and Library

#include 
#include 

Adafruit_MLX90640 mlx;
float frame[32*24];  // Temperature array

void setup() {
  Serial.begin(115200);
  Wire.begin();
  Wire.setClock(400000);  // 400 kHz I2C
  
  if (!mlx.begin(MLX90640_I2CADDR_DEFAULT, &Wire)) {
    Serial.println("MLX90640 not found!");
    while(1);
  }
  
  mlx.setMode(MLX90640_CHESS);          // Chess pattern interpolation
  mlx.setResolution(MLX90640_ADC_18BIT);
  mlx.setRefreshRate(MLX90640_2_HZ);    // 2 Hz (manageable for Arduino)
  Serial.println("MLX90640 ready");
}

void loop() {
  if (mlx.getFrame(frame) != 0) {
    Serial.println("Failed to get frame");
    return;
  }
  
  // Find min and max temperatures
  float minT = 999, maxT = -999;
  for (int i = 0; i < 768; i++) {
    if (frame[i]  maxT) maxT = frame[i];
  }
  
  Serial.printf("Min: %.1f°C  Max: %.1f°C
", minT, maxT);
  
  // Print thermal map as ASCII (useful for Serial plotter)
  for (int row = 0; row < 24; row++) {
    for (int col = 0; col < 32; col++) {
      float temp = frame[row * 32 + col];
      // Map temperature to ASCII gradient
      int idx = map(temp, minT, maxT, 0, 9);
      const char gradient[] = " .:-=+*#%@";
      Serial.print(gradient[idx]);
    }
    Serial.println();
  }
  Serial.println("---");
}

Python Visualisation on Raspberry Pi

import board
import busio
import adafruit_mlx90640
import numpy as np
import matplotlib.pyplot as plt
from scipy import ndimage
import time

i2c = busio.I2C(board.SCL, board.SDA, frequency=400000)
mlx = adafruit_mlx90640.MLX90640(i2c)
mlx.refresh_rate = adafruit_mlx90640.RefreshRate.REFRESH_2_HZ
frame = [0] * 768

fig, ax = plt.subplots()
plt.ion()

while True:
    try:
        mlx.getFrame(frame)
    except Exception as e:
        continue
    
    data = np.array(frame).reshape(24, 32)
    # Interpolate to higher resolution for display
    data_interp = ndimage.zoom(data, 10)  # 240x320 display
    
    ax.clear()
    im = ax.imshow(data_interp, cmap='inferno', 
                   vmin=20, vmax=40,  # Adjust for your range
                   interpolation='bilinear')
    ax.set_title(f'Thermal Camera | Max: {np.max(data):.1f}°C')
    plt.colorbar(im, ax=ax, label='Temperature (°C)')
    plt.draw()
    plt.pause(0.1)
Recommended: Arducam OV9281 Global Shutter Camera Module — Pair with MLX90640 for a machine vision system — global shutter captures fast-moving objects precisely while thermal sensor provides temperature data.

Practical Applications in India

  • Electronics diagnostics: Identify overheating components in PCBs — hot spots indicate failed capacitors, overloaded resistors, or failing ICs before they cause visible damage.
  • Electrical panel inspection: Detect overheating connections in switchboards — a common cause of electrical fires in Indian buildings. IR thermal cameras are used by licensed electricians for this purpose.
  • Building energy audit: Find heat leaks in walls, roofs, and around air conditioners in Indian buildings — the MLX90640 is basic but sufficient for identifying obvious thermal bridges.
  • People counting: The MLX90640’s 32×24 resolution is sufficient to detect and count people passing by a doorway — a low-cost alternative to computer vision for occupancy monitoring.
  • Solar panel inspection: Detect cracked cells or delamination hotspots on rooftop solar panels — hotspots reduce efficiency and indicate panel degradation.

Frequently Asked Questions

What is the resolution of MLX90640 in real terms?

32×24 pixels is very low — think of it as a 768-pixel thermal “image” with each pixel showing the average temperature of an area. At 1 metre distance with the standard 55°×35° lens, each pixel covers approximately 1.7cm × 1.5cm of the scene. This is sufficient to see a human silhouette, detect hot components on a PCB, or find a heat leak around a window — but not enough to read text or identify fine features.

Can the MLX90640 detect fever in humans?

Theoretically yes, but not reliably in practice without careful calibration. The ±1.5°C accuracy and environmental temperature effects make fever detection (±0.3°C accuracy required) unreliable without compensation algorithms. During COVID-19, specialised cameras with better accuracy (FLIR Lepton 3.5, ±0.05°C) were used for fever screening. The MLX90640 is not appropriate as a medical-grade fever detector.

Why is my MLX90640 reading taking too long on Arduino?

The MLX90640 requires two sub-pages of data to form a complete frame, and at 400 kHz I2C, reading 768 × 3 bytes takes approximately 50–100ms per frame. On Arduino Uno, the I2C library overhead makes this even slower. Use a faster board (Arduino Due, ESP32, or Raspberry Pi) for smoother thermal imaging. On ESP32, the MLX90640 at 8 Hz refresh is very practical.

Shop Camera & Sensor Modules at Zbotic →

Tags: infrared thermal sensor, MLX90640 Python, MLX90640 thermal camera, thermal camera India, thermal imaging Arduino
Share Post
  • Facebook
  • Linkedin
  • Whatsapp
Off-Grid Solar System Design: ...
blog off grid solar system design panel battery and inverter guide 598995
blog grid tied solar system net metering in india explained 599001
Grid-Tied Solar System: Net Me...

Related posts

Svg%3E
Read more

Endoscope Camera Module: PCB Inspection and Industrial Use

April 1, 2026 0
An endoscope camera module is an invaluable tool for PCB inspection, industrial equipment maintenance, and quality control tasks where direct... Continue reading
Svg%3E
Read more

Number Plate Recognition System: ESP32-CAM ANPR Project India

April 1, 2026 0
Building a number plate recognition system with ESP32-CAM is an affordable approach to automatic number plate recognition (ANPR) for Indian... Continue reading
Svg%3E
Read more

Machine Vision with OpenCV: Raspberry Pi Object Detection Guide

April 1, 2026 0
Running OpenCV on a Raspberry Pi for object detection opens up countless applications, from industrial quality inspection to smart doorbell... Continue reading
Svg%3E
Read more

Arducam vs Raspberry Pi Camera: Which Camera Module to Choose

April 1, 2026 0
Choosing between Arducam and Raspberry Pi camera modules is one of the first decisions for any vision project. Both connect... Continue reading
Svg%3E
Read more

360-Degree Camera Stitching Project with OpenCV and Pi

March 11, 2026 0
Creating a 360-degree camera using OpenCV image stitching with Raspberry Pi is an ambitious computer vision project that combines multiple... Continue reading

Add comment Cancel reply

Your email address will not be published. Required fields are marked

Facebook Twitter Instagram Pinterest Linkedin Youtube

Get the latest deals and more.

Download on Google Play Download on the App Store

Call us: 020 69134444 / 1800 209 0998

Monday - Saturday 09:30 AM - 06:00 PM
For Technical Supports Email: [email protected]
For Sales / Enquiries Email: [email protected]

  • My Account

    • Cart

    • Wishlist

    • Checkout

    • My Orders

    • Track Order

    • My Account

  • Information

    • FAQs

    • Blogs

    • Career

    • About Us

    • Contact Us

    • Payment Options

  • Policies

    • Privacy Policy

    • Terms & Conditions

    • GST Input Tax Credit

    • Shipping Return Policy

    • E-Waste Collection Points

    • Our Sitemap

© Zbotic.in is registered trademark of Moxie Supply Pvt Ltd – All Rights Reserved
Login
Use Phone Number
Use Email Address
Not a member yet? Register Now
Reset Password
Use Phone Number
Use Email Address
Register
Already a member? Login Now