kl3m3n's blog

Community Browser
cancel
Showing results for 
Search instead for 
Did you mean: 

Temperature measurements with MLX90620 IR array sensor, Arduino and LabVIEW

Klemen
Active Participant

The MLX90620 IR array sensor from Melexis (http://www.melexis.com/Infrared-Thermometer-Sensors/Infrared-Thermometer-Sensors/MLX90620-776.aspx) is factory calibrated and uses I2C communication protocol to send the calibration data stored on the EEPROM chip and the raw data from the IR (infrared) and PTAT (Proportional To Absolute Temperature) sensor. The sensor is thermopile based (16x4 array) and performs measurements in real-time. I will not go into details about the characteristics and the communication protocol of the sensor. For more information about the sensor refer to its datasheet (better than me copy-pasting it ).


As mentioned before, the sensor sends raw data, which needs to be properly handled in order to obtain the temperature (to program the MCU the Arduino IDE is used). To achieve this, some computations need to be performed. These could be potentially heavy for the MCU, so the best option is to perform the calculations on the computer. Just to give some reference – performing everything on the Arduino UNO R3 it takes about 30-40 ms to read, process the data and calculate the temperatures (using 400kHz I2C clock frequency).


First, the sensor needs to be properly connected to the Arduino. The sensor performs best at operating voltage of 2.6V, so a regulator needs to be used. The schematics to connect the sensor to the Arduino board are shown in Figure 1.


schematics.jpg

Figure 1. Schematics for the MLX90620 and Arduino.


To perform temperature calculations, EEPROM needs to be read as this is the place, where all calibration data is stored. For optimal performance,  the EEPROM data should be read only once at the beginning and stored in the memory (MCU or computer). To perform the data transfer the I2C library i2cmaster from Mr. Peter Fleury (http://homepage.hispeed.ch/peterfleury/avr-software.html) is used. This library is easy-to-use and supports repeated starts that are needed for proper communication.


All the raw data read from sensor is stored as a byte data type and sent to the serial port as such. To determine the beginning and the end of the sent data, two distinct ASCII characters are sent to wrap this data. In this way, the whole data can be read unambiguously from the serial port in LabVIEW.

After reading the raw data from the serial port and performing the calculations, the final output is shown on an intensity graph (see Figure 2).


IRtemp.jpg

Figure 2. Example of calculated temperatures displayed on an intensity graph in LabVIEW.


To summarize: LabVIEW serial communication library is used to read from the serial port where the MLX90620 raw temperature and EEPROM data (byte data types) is sent via the Arduino micro-controller. All processing and data visualization is performed inside the LabVIEW environment.


Thanks for reading.

Be creative.

Edit on 25.3.2013

By optimizing the code, less than 10 ms  refresh rate was achieved using the same setup (ON CHIP CALCULATION!). This includes reading, calculating and displaying values of all 64 pixels. The refresh rate of the sensor can be manually tuned by writing the Oscillator trimming value parameter to the MLX90620 chip.


https://decibel.ni.com/content/blogs/kl3m3n



"Kudos: Users may give one another Kudos on the forums for posts that they found particularly helpful or insightful."
Comments