Beginner
10 min

Measure temperature from a distance without physical contact with TPiS 1T 1386 L5.5 H and PIC32MZ2048EFH100

High-accuracy narrow FoV thermopile sensor

IR Thermo 4 Click with Flip&Click PIC32MZ

Published Oct 02, 2024

Click board™

IR Thermo 4 Click

Dev. board

Flip&Click PIC32MZ

Compiler

NECTO Studio

MCU

PIC32MZ2048EFH100

Monitor body temperature and measure skin temperature without physical contact, suitable for diverse applications

A

A

Hardware Overview

How does it work?

IR Thermo 4 Click is based on the TPiS 1T 1386 L5.5 H, a high-accuracy thermopile sensor from Excelitas, known for its precise temperature measurements in various applications. This sensor, part of the CaliPile™ family, includes factory-calibrated data stored in its EEPROM, ensuring reliable performance out of the box. It has a narrow 5° field of view (FoV), enclosed in an isothermal TO-39 package for rapid adaptation to ambient temperature changes. Additionally, the integrated lens hood minimizes stray light interference and provides thermal stabilization, making it suitable for use in challenging environmental conditions. Leveraging advanced thermopile technology, the TPiS 1T 1386 L5.5 H sensor offers much more than conventional remote temperature measurements. It can monitor remote object temperatures with fast over-temperature detection, which is ideal for

applications such as remote skin temperature monitoring, over-temperature protection, human presence sensing, motion detection, and passive light barriers for people counting. While temperature calculations are performed on the host using the sensor's calibration data, the sensor continuously monitors for rapid temperature changes, triggering an over-temperature alert when necessary. The sensor's output is digitized using a low-noise, high-resolution ADC, and alongside the reference PTAT temperature channel, the data is stored in the sensor's RAM, accessible via the I2C interface. A sensor's filter and event logic unit include multiple low-pass filter options and application-specific processing units, which can be configured to send interrupts to the host system. The factory-calibrated data is crucial for calculating both the sensor's temperature and the temperature

of remote objects, and this data must be recalled after each power-up. As mentioned, IR Thermo 4 Click uses a standard 2-wire I2C communication protocol to enable the host MCU to control the TPiS 1T 1386 L5.5 H. The I2C interface supports clock frequencies up to 400kHz, with the I2C address selectable via the ADDR SEL jumper. Once configured through the I2C interface, the INT pin allows the host to monitor rapid temperature changes and over-temperature conditions. This Click board™ can be operated only with a 3.3V logic voltage level. The board must perform appropriate logic voltage level conversion before using MCUs with different logic levels. Also, it comes equipped with a library containing functions and an example code that can be used as a reference for further development.

IR Thermo 4 Click hardware overview image

Features overview

Development board

Flip&Click PIC32MZ is a compact development board designed as a complete solution that brings the flexibility of add-on Click boards™ to your favorite microcontroller, making it a perfect starter kit for implementing your ideas. It comes with an onboard 32-bit PIC32MZ microcontroller, the PIC32MZ2048EFH100 from Microchip, four mikroBUS™ sockets for Click board™ connectivity, two USB connectors, LED indicators, buttons, debugger/programmer connectors, and two headers compatible with Arduino-UNO pinout. Thanks to innovative manufacturing technology,

it allows you to build gadgets with unique functionalities and features quickly. Each part of the Flip&Click PIC32MZ development kit contains the components necessary for the most efficient operation of the same board. In addition, there is the possibility of choosing the Flip&Click PIC32MZ programming method, using the chipKIT bootloader (Arduino-style development environment) or our USB HID bootloader using mikroC, mikroBasic, and mikroPascal for PIC32. This kit includes a clean and regulated power supply block through the USB Type-C (USB-C) connector. All communication

methods that mikroBUS™ itself supports are on this board, including the well-established mikroBUS™ socket, user-configurable buttons, and LED indicators. Flip&Click PIC32MZ development kit allows you to create a new application in minutes. Natively supported by Mikroe software tools, it covers many aspects of prototyping thanks to a considerable number of different Click boards™ (over a thousand boards), the number of which is growing every day.

Flip&Click PIC32MZ double image

Microcontroller Overview

MCU Card / MCU

default

Architecture

PIC32

MCU Memory (KB)

2048

Silicon Vendor

Microchip

Pin count

100

RAM (Bytes)

524288

Used MCU Pins

mikroBUS™ mapper

NC
NC
AN
NC
NC
RST
ID COMM
RA0
CS
NC
NC
SCK
NC
NC
MISO
NC
NC
MOSI
Power Supply
3.3V
3.3V
Ground
GND
GND
NC
NC
PWM
Interrupt
RD9
INT
NC
NC
TX
NC
NC
RX
I2C Clock
RA2
SCL
I2C Data
RA3
SDA
NC
NC
5V
Ground
GND
GND
1

Take a closer look

Click board™ Schematic

IR Thermo 4 Click Schematic schematic

Step by step

Project assembly

Flip&Click PIC32MZ front image hardware assembly

Start by selecting your development board and Click board™. Begin with the Flip&Click PIC32MZ as your development board.

Flip&Click PIC32MZ front image hardware assembly
GNSS2 Click front image hardware assembly
Prog-cut hardware assembly
GNSS2 Click complete accessories setup image hardware assembly
Flip&Click PIC32MZ MB1 Access - upright/background hardware assembly
Necto image step 2 hardware assembly
Necto image step 3 hardware assembly
Necto image step 4 hardware assembly
Necto image step 5 hardware assembly
Necto image step 6 hardware assembly
Flip&Click PIC32MZ MCU step hardware assembly
Necto No Display image step 8 hardware assembly
Necto image step 9 hardware assembly
Necto image step 10 hardware assembly
Debug Image Necto Step hardware assembly

Track your results in real time

Application Output

1. Application Output - In Debug mode, the 'Application Output' window enables real-time data monitoring, offering direct insight into execution results. Ensure proper data display by configuring the environment correctly using the provided tutorial.

2. UART Terminal - Use the UART Terminal to monitor data transmission via a USB to UART converter, allowing direct communication between the Click board™ and your development system. Configure the baud rate and other serial settings according to your project's requirements to ensure proper functionality. For step-by-step setup instructions, refer to the provided tutorial.

3. Plot Output - The Plot feature offers a powerful way to visualize real-time sensor data, enabling trend analysis, debugging, and comparison of multiple data points. To set it up correctly, follow the provided tutorial, which includes a step-by-step example of using the Plot feature to display Click board™ readings. To use the Plot feature in your code, use the function: plot(*insert_graph_name*, variable_name);. This is a general format, and it is up to the user to replace 'insert_graph_name' with the actual graph name and 'variable_name' with the parameter to be displayed.

Software Support

Library Description

This library contains API for IR Thermo 4 Click driver.

Key functions:

  • irthermo4_read_ambient_temp - This function reads and calculates the ambient temperature in degrees Celsius.

  • irthermo4_read_object_temp - This function reads and calculates the object temperature in degrees Celsius.

  • irthermo4_get_int_pin - This function returns the INT pin logic state.

Open Source

Code example

The complete application code and a ready-to-use project are available through the NECTO Studio Package Manager for direct installation in the NECTO Studio. The application code can also be found on the MIKROE GitHub account.

/*!
 * @file main.c
 * @brief IR Thermo 4 Click example
 *
 * # Description
 * This example demonstrates the use of IR Thermo 4 click board by reading and displaying
 * the ambient and object temperature measurements.
 *
 * The demo application is composed of two sections :
 *
 * ## Application Init
 * Initializes the driver and performs the click default configuration.
 *
 * ## Application Task
 * Reads the ambient and object temperature measurements twice per second and displays
 * the results on the USB UART.
 *
 * @author Stefan Filipovic
 *
 */

#include "board.h"
#include "log.h"
#include "irthermo4.h"

static irthermo4_t irthermo4;
static log_t logger;

void application_init ( void ) 
{
    log_cfg_t log_cfg;  /**< Logger config object. */
    irthermo4_cfg_t irthermo4_cfg;  /**< Click config object. */

    /** 
     * Logger initialization.
     * Default baud rate: 115200
     * Default log level: LOG_LEVEL_DEBUG
     * @note If USB_UART_RX and USB_UART_TX 
     * are defined as HAL_PIN_NC, you will 
     * need to define them manually for log to work. 
     * See @b LOG_MAP_USB_UART macro definition for detailed explanation.
     */
    LOG_MAP_USB_UART( log_cfg );
    log_init( &logger, &log_cfg );
    log_info( &logger, " Application Init " );

    // Click initialization.
    irthermo4_cfg_setup( &irthermo4_cfg );
    IRTHERMO4_MAP_MIKROBUS( irthermo4_cfg, MIKROBUS_1 );
    if ( I2C_MASTER_ERROR == irthermo4_init( &irthermo4, &irthermo4_cfg ) ) 
    {
        log_error( &logger, " Communication init." );
        for ( ; ; );
    }
    
    if ( IRTHERMO4_ERROR == irthermo4_default_cfg ( &irthermo4 ) )
    {
        log_error( &logger, " Default configuration." );
        for ( ; ; );
    }

    log_info( &logger, " Application Task " );
}

void application_task ( void ) 
{
    float ambient_temp = 0;
    float object_temp = 0;
    if ( IRTHERMO4_OK == irthermo4_read_ambient_temp ( &irthermo4, &ambient_temp ) )
    {
        log_printf ( &logger, " Ambient temperature: %.2f degC\r\n", ambient_temp );
        if ( IRTHERMO4_OK == irthermo4_read_object_temp ( &irthermo4, &object_temp, ambient_temp ) )
        {
            log_printf ( &logger, " Object temperature: %.2f degC\r\n\n", object_temp );
        }
    }
    Delay_ms ( 500 );
}

int main ( void ) 
{
    /* Do not remove this line or clock might not be set correctly. */
    #ifdef PREINIT_SUPPORTED
    preinit();
    #endif
    
    application_init( );
    
    for ( ; ; ) 
    {
        application_task( );
    }

    return 0;
}

// ------------------------------------------------------------------------ END

Additional Support

Resources

Love this project?

'Buy This Kit' button takes you directly to the shopping cart where you can easily add or remove products.