The sensor is equipped with 2Kbit of EEPROM for storing the compensation and calibration parameters. The MLX90640ESF-BAA IR sensor array IC has I2C compatible digital interface, allowing it to be interfaced with a wide range of different MCUs. The sensor used on this Click board™ offers a summed field of view of 110°x75°. The sensor can output up to 64 frames per second (FPS).
Due to the small number of external components it requires, as well as the low pin count and widely used I2C digital interface, this sensor is an ideal solution for building a range of thermal detection applications. IR Grid 3 click can be used for a wide range of applications, including thermal scanners, precise contactless thermal measurement, thermal leaks in homes, industrial temperature control of moving parts, other types of heated object localization, human presence, and similar applications that require accurate contactless thermal measurement, or thermal imaging.
How does it work?
IR Grid 3 click is equipped with the MLX90640ESF-BAA, a 32×24 IR array sensor, from Melexis. This sensor contains 8 Kbit EEPROM, used to store all the compensation and calibration parameters, along with some editable user parameters, such as the config registers, I2C address and similar. These sensors can measure temperature relative to the cold junction temperature, and for this reason, the MLX90640ESF-BAA IR sensor incorporates a PTAT (Proportional to Absolute Temperature) compensation sensor. The device also contains the power supply voltage measurement unit, allow power supply monitoring. It is recommended that the supply voltage stay as accurate as possible, which is taken care of if used with the MikroElektronika development systems. The IR sensor array, as well as the PTAT sensor readings, are sampled by fast internal ADC and stored on the RAM, which can be accessed via the I2C. The resolution of the ADC can be programmed between 16bit and 19bit.
The MLX90640ESF-BAA IR sensor used on this Click board™ has a Field of View (FOV) of 110°x75°, with the IR sensing elements arranged in a 32×28 grid. Each sensor measures the temperature in its individual FOV, allowing the host MCU to build a thermal image or calculate the temperature at each spot of the viewed scene. The measurement results are stored in the onboard RAM. The entire RAM area is divided into two pages, with access patterns controlled by the configuration registers (chess pattern, or interleaved pattern). The configuration parameters are factory calibrated for chess pattern access, yielding the most accurate results when using this mode. The chess pattern mode is selected by default.
Two modes of operation are available: the device can continuously sample data from the IR elements, with the programmed refresh rate (up to 64 frames per second), or it can take one frame, by sampling the selected page. The status byte contains flags that indicate that the reading of a specific page is done.
The configuration and control registers allow configuring of the working parameters. These registers contain bits that control the behavior of the sensor IC: the refresh rate, ADC resolution, measurement mode (continuous or step mode), sleep mode, I2C mode (FM or FM+), etc. The data from the EEPROM registers is copied after the POR cycle to the working RAM registers, preparing the device to be instantly operated.
Besides the default working parameters, the EEPROM IC contains all the compensating parameters, necessary for completing the accurate thermal computations. A certain workflow has to be followed when operating this sensor. The workflow includes calculation of the compensation parameters that are stored in the EEPROM for each element. Those calculations include ambient temperature calculation, pixel offset calculation, pixel to pixel sensitivity difference compensation, object emissivity compensation, and object temperature calculation. The datasheet of the MLX90640ESF-BAA IR sensor contains these equations, which use the parameters stored in EEPROM. However, this Click board™ is supported by the library, which contains functions that simplify working with this sensor.
It should be noted that the sensor measures the IR emissivity of an object, so it is to expect that some materials cannot be accurately measured by this sensor due to their low emissivity, such as the aluminum. To better understand the emissivity property of the materials, a person wearing clothes, can be taken as an example: the measured temperature will reflect the clothes temperature, rather than the body temperature itself, which is known to be about 37 ˚C Care should be taken not to expose the Click board™ to a cold or hot air flow, as it will cause false readings of the real temperature. This sensor requires the temperature across the sensor package to be constant.
The MLX90640ESF-BAA IR sensor uses 3.3V for optimal results. While the power for the IR sensor itself is taken from the 3.3V mikroBUS™ rail, in order to support MCUs which use 5V compatible logic levels, the Click board™ comes equipped with PCA9306, a bi-directional I2C level translator IC, produced by Texas Instruments. This allows the logic voltage level to be selected by the SMD jumper labeled as VCC SEL. Besides I2C bus lines, no additional lines of the mikroBUS™ are used. I2C bus lines are routed to the respective pins of the mikroBUS™.
Specifications
Type
Optical
Applications
It can be used for thermal scanners, precise contactless thermal measurement, thermal leaks in homes, industrial temperature control of moving parts, other types of heated object localization, human presence, and other similar applications
On-board modules
MLX90640, a 32×24 IR grid array sensor with EEPROM, and FOV of 110°x75° from Melexis; PCA9306, a bi-directional I2C level translator, from Texas Instruments
Key Features
768 factory calibrated sensors, capable of contactless measuring of temperature up to 300˚C, integrated 8Kbit of EEPROM for storing configuration and compensation parameters, programmable refresh rate up to 64Hz, and more
Interface
I2C
Feature
No ClickID
Compatibility
mikroBUS™
Click board size
M (42.9 x 25.4 mm)
Input Voltage
3.3V or 5V
Pinout diagram
This table shows how the pinout on IR Grid 3 click corresponds to the pinout on the mikroBUS™ socket (the latter shown in the two middle columns).
Onboard jumpers and settings
Label | Name | Default | Description |
---|---|---|---|
PWR | PWR | – | Power LED indicator |
VCC SEL | VCC SEL | Left | Power supply voltage selection: left position 3.3V, right position 5V |
Software Support
We provide a library for the IR Grid 3 Click as well as a demo application (example), developed using MIKROE compilers. The demo can run on all the main MIKROE development boards.
Package can be downloaded/installed directly from NECTO Studio Package Manager (recommended), downloaded from our LibStock™ or found on MIKROE github account.
Library Description
This library contains API for IR Grid 3 Click driver.
Key functions
-
irgrid3_generic_write
This function reads a desired number of data bytes starting from the selected register by using I2C serial interface. -
irgrid3_get_frame_data
This function is used for getting frame data. -
irgrid3_get_pixel_temperature
This function is used for getting pixels temperature.
Example Description
The demo application displays a reading of ambient temperature and a 32×24 pixel object temperature matrix.
void application_task ( void ) {
float px_matrix[ 768 ];
float temp_ambient;
irgrid3_get_pixel_temperature( &irgrid3, &temp_ambient, px_matrix );
log_printf( &logger, "rn>> Pixel temperature matrix 32x24 <<rn" );
for ( uint16_t cnt = 1 ; cnt < 769 ; cnt++) {
log_printf( &logger, "%.2f", px_matrix[ cnt - 1 ] );
if ( ( ( cnt % 32 ) == 0 ) ) {
log_printf( &logger, "rn" );
} else {
log_printf( &logger, " | " );
}
}
log_printf( &logger, "rn** Ambient (sensor) temperature is %.2f Celsiusrn", temp_ambient );
Delay_ms ( 500 );
}
The full application code, and ready to use projects can be installed directly from NECTO Studio Package Manager (recommended), downloaded from our LibStock™ or found on MIKROE github account.
Other MIKROE Libraries used in the example:
- MikroSDK.Board
- MikroSDK.Log
- Click.IRGrid3
Additional notes and informations
Depending on the development board you are using, you may need USB UART click, USB UART 2 Click or RS232 Click to connect to your PC, for development systems with no UART to USB interface available on the board. UART terminal is available in all MIKROE compilers.
mikroSDK
This Click board™ is supported with mikroSDK – MIKROE Software Development Kit. To ensure proper operation of mikroSDK compliant Click board™ demo applications, mikroSDK should be downloaded from the LibStock and installed for the compiler you are using.
For more information about mikroSDK, visit the official page.