MLX90640-D55 Thermal Camera

From Waveshare Wiki
Jump to: navigation, search
MLX90640-D55 Thermal Camera
MLX90640-D55-Thermal-Camera

MLX90640 IR Array Thermal Imaging Camera, 32×24 Pixels, 55° Field of View, I2C Interface
{{{name2}}}

{{{name3}}}

{{{name4}}}

{{{name5}}}

Overview

Introduction

This is a 32 × 24 pixel, 55° field of view, IR array thermal imaging camera, communicating via the I2C interface. It is compatible with 3.3V/5V operating voltage and supports host platforms such as Raspberry Pi/Arduino(ESP32)/STM32, etc. With MLX90640 far-infrared thermal sensor array, it can accurately detect target objects in specific regions and temperature ranges, and a small size for easy integration into miscellaneous industrial or intelligent control applications.

Features

  • Adopts MLX90640 far-infrared thermal sensor array, 32 × 24 pixels.
  • Communicating via I2C interface, configurable to fast mode (up to 1MHz data rate).
  • Noise Equivalent Temperature Difference (NETD) 0.1K RMS @1Hz refresh rate.
  • Onboard voltage translator, compatible with 3.3V/5V operating voltage.
  • Comes with online development resources and manual (examples for Raspberry Pi/Arduino(ESP32)/STM32).

Specification

  • Operating voltage: 3.3V/5V
  • Operating current: <23mA
  • Communication interface: I2C (address 0x33)
  • Field of view (Horizontal × Vertical):
  • Operating temperature: -40℃~85℃
  • Target temperature: -40℃~300℃
  • Resolution: ±1℃
  • Refresh rate: 0.5Hz~64Hz (programmable)
  • Dimensions: 28mm × 16 mm
  • Mounting hole size: 2.0mm

Hardware Description

MLX90640 05.jpg

Hardware Connection

The MLX9064x-Dxx Thermal Camera has 4 pins that need to be connected to the controller and currently supports the Raspberry Pi series, STM32F405R and ESP32 series. For details, please refer to the instruction section.

Interface

In the figure above, the MLX9064x-Dxx Thermal Camera has an onboard level shifter circuit.

  • VCC, GND pin for the power supply, VCC connected to the control 3.3V or 5V power supply, GND corresponds to the connection of the GND.
  • SDA is the data pin of I2C, connected to the GPIO of the controller, without an external pull-up resistor.
  • SCL is the clock pin of I2C, connected to the GPIO of the controller, without an external pull-up resistor.

Application

  • High-precision non-contact object temperature detection.
  • Infrared thermal imager, infrared thermometer.
  • Smart Home, Smart Building, Smart Lighting.
  • Industrial temperature control, security, intrusion/motion detection.

Communication Protocol

The communication protocol of MLX90640-D55 Thermal Camera is I2C, which supports I2C high-speed mode (up to 1MHz), and can only be used as a slave device on the I2C bus. The SDA and SCL ports can withstand 5V voltage and can be directly connected to the 5V I2C bus, the device address of the module can be programmed, there can be up to 127 addresses, and the factory default value is 0x33. Like the general I2C bus, there are three types of signals in the process of data transmission: start signal, end signal and response signal.
MLX90640-D55 Thermal Camera 020.jpg
Start signal: SCL is high level, SDA is converted from high level to low level.
End signal: SCL is high level, SDA is converted from low level to high level.
It can be seen that the start signal and the end signal are completed when the SCL bus is high.
MLX90640-D55 Thermal Camera 021.jpg
Response signal: During the 9th clock period after each byte transmission, the sending data end device releases the SDA bus, and the receiving data end device pulls down the SDA bus to indicate that bytes are received (ACK), or the SDA bus is high level with no acknowledgment (NoACK).

MLX90640 Thermal Camera manual-1.png

Device Address: The master addresses the slave by sending a 7-bit slave address after a START condition. The first seven bits are dedicated to this address, and the 8th is the read/write (R/W) bit. This bit indicates the transfer direction, The high level means that the master will read data from the slave, and the low level means that the master will send data to the slave.

MLX90640 Thermal Camera manual-2.png

The MLX90640-D55 Thermal Camera consists of a total of 768 IR sensors (also called pixels). The row and column positions of each pixel are identified as Pixel(i, j), where i is its row number (from 1 to 24), and j is its column number (from 1 to 32), the pixel specific to a certain plane can refer to the above figure.

  • It should be noted that the original sensor is allowed to have less than 4 dead points when the sensor leaves the factory, and each dead point is marked in the EEPROM table, so the module may have a certain probability of dead points, that is to say, this cannot be used as a basis for return or exchange. The original recommendation for this is to use the average value of adjacent pixels instead.

Dimensions

MLX90640 Dimension.jpg

Other Description

  • The MLX9064x-Dxx Thermal Camera utilizes thermopile technology, consisting of a total of 768 IR sensors. Each IR sensor is treated as a pixel. The row and column positions of each pixel in the field of view of the MLX9064x-Dxx Thermal Camera are identified as Pixel(i, j), where i represents its row number (ranging from 1 to 24), and j represents its column number (ranging from 1 to 32).
  • The sensor manufacturer allows for up to 4 defective pixels at the time of sensor production. Each defective pixel is identified in the EEPROM table. As a result, there is a possibility that the module may have some defective pixels. This means that the presence of defective pixels cannot be used as a basis for returning or exchanging the product. The manufacturer's recommendation for addressing this issue is to use the average value of adjacent pixels as a replacement.

Memory and registers

MLX90640 Thermal Camera manual-3.png

The above picture shows the distribution of RAM area and control registers of MLX90640, in which there are two data modes in RAM area, and EEPROM is used to store calibration constants and device configuration parameters, as shown in the following figure:

MLX90640 Thermal Camera manual-4.png

Refresh rate

This module support 8 kinds of refresh rate, up to 64Hz. The refresh rate is controlled by the control register 1 (0x800D), as shown below:

MLX90640 Thermal Camera manual-6.png

The settings of the 8 refresh rates are determined by bit 7, bit 8 and bit 9 of the control register 1 (0x800D), among which there are Chess mode (factory default setting) and TV interleave mode, as shown below:

MLX90640 Thermal Camera manual-7.png


MLX90640 Thermal Camera manual-8.png

The two modes differ in the way subpages are updated. As a standard the MLX90640 is calibrated in Chess pattern mode, this results in better fixed pattern noise behavior of the sensor when in Chess pattern mode. For best results, we advise to use Chess pattern mode. The setting of both modes depends on bit 12 in “Control register 1” (0x800D).

Temperature measurement principle and measurement distance

Temperature measurement principle

What is infrared temperature measurement?(quoted from OPTRIS).

Next to time, temperature is the most frequently measured physical property. Infrared temperature measurement devices define the temperature according to the radiation law of Planck and Boltzmann through infrared radiation released by the measured object. But how does non-contact temperature measurement work?

Each body, with a temperature above the absolute zero (0 K or -273.15°C) emits an electromagnetic radiation from its surface, which is proportional to its intrinsic temperature. A part of this radiation is infrared radiation which is used to measure temperature. The radiation of the body penetrates the atmosphere and can be focused on a detector element with the help of a lens. The detector element generates an electrical signal proportional to the radiation. This signal is amplified and, using successive digital signal processing, is transformed into an output signal proportional to the object temperature. The measuring value can be shown on a display or released as a signal.

The emissivity ε (Epsilon) has a central importance, if the temperature is measured through radiation. The emissivity defines the relation of the radiation value in real and of the black body. This is maximal 1 for a black body. But only few bodies meet the ideal of the black body. For the calibration of sensors, the contact faces of radiators are generally used, which consists of the favoured wave length of 0.99.

Many bodies have a constant emissivity regarding the wave length, but do emit far less radiation than black bodies. They are called grey bodies. Bodies whose emissivity depends on the temperature and the wave length, such as metals, are called selective radiator. The missing radiation part is compensated in both cases through the definition of emissivity. When using a selective radiator, one needs to bear in mind the measured wave length (short-wave for metal).

The infrared sensor receives the emitted radiation from the object surface, but also reflected radiation form the surroundings and perhaps penetrated infrared radiation from the measuring object.

Measurement distance

The FOV of this module is determined by 50% radiation signal which is received by the thermopile, it is also influenced by the main axis of the sensor. The temperature measured is the weighted average of the detected object's temperature in FOV. To improve the accuracy, you should make sure that the detected object is in the FOV totally.

MLX90640-D55 Thermal Camera 030.jpg

For the relationship between the measurement distance and the field of view, please refer to the calculation formula shown in the following figure mentioned by Melexis.
MLX90640-D55 Thermal Camera 036.jpg

Examples

Raspberry Pi 4B

Hardware Connection

MLX90640-D55 Thermal Camera 031.jpg

1. When using the sensor, please pay attention to avoiding direct contact with the onboard IC devices in your hands. Pay attention to preventing static electricity and checking the power supply to prevent reverse connection before powering on.

2. When the sensor is working, please avoid excessive vibration and do not plug or unplug cables. Since MLX90640 has EEPROM, it will easily be damaged by vibration and a hot plug. Do not use too long cables for communication, which may cause EEPROM writing errors and failure.

Pi-4B MLX90640 Thermal Camera
5V 5V
GND GND
SDA(BCM2) SDA
SCL(BCM3) SCL

Environment Setting

  • It is recommended to use an image with the library installed for testing, and the use of mirrors for testing, please ignore the following environment settings and other operations.
  • Raspberry Pi Drive-Google Drive, the image account and password both are "test".
  • Enable the Raspberry Pi I2C bus, and reboot it after setting. It is recommended to reboot after setting the next step.

Thermal Camera HAT Use03.jpg

  • Adjust the I2C rate, and add the speed parameter in the /boot/config.txt file. Reboot to take effect after changing. The commands are as shown below:
sudo nano /boot/config.txt
dtparam=i2c_arm=on,i2c_arm_baudrate=400000
  • If you want to install library and download the C/C++ example demo by yourself, you can refer to the following commands:
cd ~
wget https://files.waveshare.com/upload/c/c9/Mlx90640_thermal_camera.zip
unzip Mlx90640_thermal_camera.zip
cd mlx90640_thermal_camera/RaspberryPi/cpp/
chmod +x install.sh
sudo ./install.sh
  • If you install library and download the Python example demo by yourself, you can refer to the following commands:
sudo apt update
pip3 install opencv-python==4.6.0.66
pip3 install pithermalcam
sudo apt-get install libatlas-base-dev

C/C++ Example

  • Input the following commands in the Raspberry Pi terminal and execute the example program, the effect is shown below:
make
sudo ./main
#If you are using Windodws MSTSC to log in remotely, you will need to use the following commands:
sudo -E ./main

MLX90640 Thermal Camera -02.jpg

Python Example

  • Thanks to pithermalcam opern-source code, you can install it referring to this link.
  • Input the following commands in the Raspberry Pi terminal to execute the sample demo. After the execution of the local network video streaming example, other mobile devices or computers open the browser to enter the Raspberry Pi terminal to print the information, the effect is shown in the following figure:
python3
import pithermalcam as ptc
# Example of performing local network video push streaming
ptc.stream_camera_online()
# Example of executing real-time video streaming display, and reference terminal printing information operation
ptc.display_camera_live()

MLX90640 -03.jpg

STM32

Hardware Connection

MLX90640-D55 Thermal Camera 032.jpg

1. When using the sensor, please pay attention to avoiding direct contact with the onboard IC devices in your hands. Pay attention to preventing static electricity and checking the power supply to prevent reverse connection before powering on.

2. When the sensor is working, please avoid excessive vibration and do not plug or unplug cables. Since the MLX90640 has EEPROM, it will easily damaged by vibration and hot plug. Do not use too long cables for communication, which may cause EEPROM writing errors and failure.

STM32 MLX90640 Thermal Camera
5V 5V
GND GND
SDA(PB11) SDA
SCL(PB10) SCL

ESP32

Hardware Connection

MLX90640-D55 Thermal Camera 034.jpg

1. When using the sensor, please pay attention to avoiding direct contact with the onboard IC devices by your hands, Pay attention to preventing static electricity, and checking the power supply to prevent reverse connection before powering on.

2. When the sensor is working, please avoid excessive vibration and do not plug or unplug cables. Since the MLX90640 has EEPROM, it will easily be damaged by vibration and hot plug. Do not use too long cables for communication, which may cause EEPROM writing errors and failure.

ESP32 MLX90640 Thermal Camera
5V 5V
GND GND
SDA(P21) SDA
SCL(P22) SCL

Software Installation

#Arduino ESP32/8266 Online Installation

Operating Steps

  • Download the demo.
  • Unzip it, enter the following directory, double-click MLX90640_Thermal_Camera.ino file.

MLX90640-1.png

  • Click Tools to select the development board and port.

MLX90640-2.png

  • Click the arrow to upload.

MLX90640-3.png

  • After uploading, click Serial Monitor to view the output.

MLX90640-4.png
MLX90640-5.png

Resources

Documents

Demo codes

Software

Datasheet

FAQ

 Answer:

The official device manual does not give the measurement distance parameters. The test result of Waveshare Electronics is that when the indoor temperature is 22°C and the light is dim, the tester with a height of 178cm starts to wave at 1 meter away from the MLX90640-D55 Thermal Camera, and steps back to 11 meters, the MLX90640-D55 Thermal Camera captures the focus disappears, and the body contour cannot be recognized after 5 meters (about) away from the lens of MLX90640-D55 Thermal Camera. MLX90640-D55 Thermal Camera supports a maximum frame rate of 32Hz.
MLX90640-D55 Thermal Camera 001.gif

{{{5}}}


 Answer:
The official device manual does not give the measurement distance parameters. The test result of Waveshare Electronics is that the indoor temperature is 22°C and the light is dim. The tester with a height of 178cm starts to wave at 1 meter away from the MLX90640-D110 Thermal Camera and back to 9 meters. After the MLX90640 -D110 Thermal Camera captures the focus disappears, and when the lens is 2 meters away from the MLX90640-D110 Thermal Camera (about 2 meters), the silhouette of the human body cannot be recognized. The MLX90640-D110 Thermal Camera supports a maximum frame rate of 32Hz.

Thermal camera.gif

{{{5}}}


 Answer:

The wavelength is 5.5 to 14um.

{{{5}}}


Support



Technical Support

If you need technical support or have any feedback/review, please click the Submit Now button to submit a ticket, Our support team will check and reply to you within 1 to 2 working days. Please be patient as we make every effort to help you to resolve the issue.
Working Time: 9 AM - 6 PM GMT+8 (Monday to Friday)