Thermal imaging is a process by which a thermal camera captures and creates a thermogram
or heat map image of an object by using infrared radiation emitted from the object.
The COVID-19 pandemic has demanded more non-contact temperature detection tools,
but even before then, commercial and industrial applications have
dramatically increased the use of thermal imaging in the past 50 years.
In this video, we'll show you how to create a thermal camera heat map application
on a Curiosity PIC32MZ EF 2.0 Development Board, using MPLAB Code Configurator.
We will develop the thermal camera heat map application using the software tools shown here.
This project is based on the PIC32MZ EF, our MIPS core 32-bit microcontroller.
For this video, we will use the Curiosity PIC32MZ EF 2.0 Development Board.
To learn more about this board, watch our video about creating your first project
with our PIC32MZ EF board using MPLAB Harmony version 3, linked in the description below.
In addition to our Curiosity PIC32MZ EF 2.0 Development Board, we will use the OLED-C and
the Grid-EYE click boards from Mikroelektronika.
This block diagram helps us understand how the OLED-C click and Grid-EYE click boards
interface with the PIC32MZ EF microcontroller to create a thermal camera-based object heat map.
The heat map has two major tasks. The first task is to acquire and
process the data from the Grid-EYE click board. The second task is to display a frame of colors
based on the temperature values measured in the first task. The Grid-EYE click board
detects absolute surface temperature without any contact or movement of people and objects.
It interfaces with the Curiosity PIC32MZ EF 2.0 Development Board via the I2C protocol.
The OLED-C click board uses the MPLAB Harmony version 3 Legato Graphics library
to display the thermal frame data measured using the Grid-EYE click board.
It interfaces with the Curiosity PIC32MZ EF 2.0 Development Board via the SPI protocol.
Mount the OLED-C click board on the mikroBUS connector 1,
and the Grid-EYE click board on the mikroBUS connector 2. The Curiosity PIC32MZ EF
2.0 Development Board is powered using a micro-USB cable, connected to the debug USB port.
To start developing the demo, download and refer
to the 'Thermal Camera Heat Map Demo' available in the link shown here.
Now, open the project in MPLAB X IDE.
Go to tools- embedded, and open MPLAB Code Configurator, or MCC.
Here you can open the project graph to see the configurations of the Curiosity PIC32MZ EF 2.0
Development Board's peripherals, as indicated in the block diagram.
The application uses MPLAB Harmony version 3's Legato Graphics library
to display on the OLED-C click board.
SPI1 is configured as SPI to interface with the OLED-C click board.
Click on the SPI1 module in the project graph and check the configuration options window to
see the configurations like operation mode, clock, data width and baud rate.
Every 50 milliseconds the system service with core timer
is used to acquire and process the data from the Grid-EYE click board.
I2C1 is configured as I2C to interface with the Grid-EYE click board.
Click on the I2C1 module in the project graph
and check the configuration options window to see the configured operation mode and speed.
You can use MCC to add other peripherals, reconfigure the project, and generate code.
Go to the project configuration path and check the
various files to understand the implementation of the project.
The following code initializes the thermal camera application. This
includes the initialization of the OLED-C click board routines, starting the screen,
and initialization of the Grid-EYE click board routines.
The heat map application has two tasks. The first is to acquire and process the data
from the Grid-EYE click board, and the second task is to display a frame of colors on the
OLED-C click board, based on the temperature values measured in the previous task.
Before you program the code, ensure that the Curiosity Starter Kits
'PKOB4' is selected under the project properties
in MPLAB X IDE as a hardware tool to program and debug the application.
Next, click "OK."
You can now build your project, and program the firmware on the Curiosity PIC32MZ EF
2.0 Development Board using MPLAB X IDE. After the board powers up,
the MPLAB Harmony logo should appear and remain on the screen for two seconds.
After the time has elapsed, the screen should change
showing small rectangles with different colors.
Place a finger above the Grid-EYE click sensor, and on the OLED-C click display. You can observe a
figure of the finger in a different color than the background, such as red or orange, as shown here.
You can find more application demos that use the Curiosity PIC32MZ EF 2.0 Development Board,
and other applications for different development boards or kits on MPLAB Discover.
Please also visit our MPLAB Harmony landing page for more information about
MPLAB Harmony version 3. We hope you have enjoyed this brief demonstration.
Thanks for watching!