Beginner
10 min
0

Experience the future of climate control today with HIH6130 and CEC1302

Precision in every degree, confidence in every percent

Temp&Hum 5 Click with UNI Clicker

Published Nov 09, 2023

Click board™

Temp&Hum 5 Click

Development board

UNI Clicker

Compiler

NECTO Studio

MCU

CEC1302

Our temperature and humidity measurement solution is designed to provide you with accurate data, ensuring your comfort and well-being.

A

A

Hardware Overview

How does it work?

Temp&Hum 5 Click is based on the HIH6130, a relative humidity and temperature sensor with I2C interface from Honeywell. This sensor IC integrates two very accurate sensing components: temperature sensor, and relative humidity sensor. The HIH6130 sensor integrates the complete temperature and humidity measurement system on a chip. Each sample is factory calibrated, providing an expected performance for each unit. The measurement results are available over the I2C interface. By applying simple conversion formulas, it is possible to obtain readings in physical units, directly. These conversion formulas are given in the HIH6130 datasheet and provide readings in °C and %RH. The HIH6130 features two ALARM outputs, which are used to indicate if the RH readings have exceeded, or fallen below a certain threshold, which can be programmed by the user, over the I2C. Besides the threshold values, the HIH6130 allows setting the polarity of the signal on these pins, as well as their driving topology (push-pull or open-drain). Temp&Hum 5 click does not feature any pull-up resistors, thus allowing the user to choose the most suitable method. ALARM pins are routed to the mikroBUS™ INT and PWM pins, which are labeled as ALH and ALL on this Click board™, respectively. The HIH6130 incorporates an accurate bandgap temperature sensor, which can measure the temperature in the range between -25°C and 85°C which is suitable for most

demanding applications. The accuracy is greater if the range is narrowed down: when used over the range between 0°C and 60°C, the typical accuracy is ±0.5°C. Also, the repeatability of the temperature measurement is very good, since each sensor unit is factory-calibrated. The HIH6130 sensor IC can be reliably used for prolonged periods of time, as it has a very low thermal drift of less than 0.05°C per five-year interval. After the measurement has been converted by a high-precision 14-bit ADC, it is fed to a logic back-end which applies factory-calibrated correction and converts the raw data into a compensated value. By applying a simple conversion formula, the temperature measurement can be read directly in °C. Please note that the sensor will take some time to accommodate to the ambient temperature, especially if the temperature changes quickly, considering the thermal conductivity of the PCB itself. However, the Click board™ surface is not very large, resulting in lower thermal inertia. The humidity sensor is a laser-trimmed capacitor-based sensor which changes the capacitance proportionally to the relative humidity. However, the capacitance of this sensor is affected by changes in the ambient temperature, as well. However, the HIH6130 IC features a multilayered design which protects the sensing element from various application hazards, including condensation, dust, dirt, oils, and other environmental hazards, making it very

robust and reliable, even in harsh conditions. The datasheet of the HIH6130 offers a map of the RH accuracy at different temperatures, covering a range of different values. The RH sensor accuracy varies in the range between ±1% and ±3%, depending on the measurement conditions. This table can be used to check the exact accuracy for some specific ℃ and %RH conditions. The industry-leading long-term stability of the humidity sensor is reflected in its low drift from 0.05% to 1.2%, during a 5-year interval. After the measurement has been converted by high-precision 14-bit ADC, it is fed to a logic back-end which applies factory-calibrated correction and converts the raw data into a compensated value. By applying a simple conversion formula, the temperature measurement can be read directly in %RH. Note that capacitor-based humidity sensors commonly suffer from a small hysteresis, which may occur if the sensor is used in very humid conditions for prolonged periods of time. However, this hysteresis is not irreversible. The HIH6130 datasheet specifies that its hysteresis should stay within the range of ±1 %RH. Temp&Hum 5 click uses the I2C communication interface. It has pull-up resistors for the I2C interface, connected to a voltage level that can be selected by moving the VCC SEL jumper to an appropriate position (3.3V or 5V), allowing the Click board™ to be interfaced with a wide range of different MCUs.

Temp&Hum 5 Click hardware overview image

Features overview

Development board

UNI Clicker 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 supports a wide range of microcontrollers, such as different ARM, PIC32, dsPIC, PIC, and AVR from various vendors like Microchip, ST, NXP, and TI (regardless of their number of pins), four mikroBUS™ sockets for Click board™ connectivity, a USB connector, LED indicators, buttons, a debugger/programmer connector, and two 26-pin headers for interfacing with external electronics. Thanks to innovative manufacturing technology, it allows you to build

gadgets with unique functionalities and features quickly. Each part of the UNI Clicker development kit contains the components necessary for the most efficient operation of the same board. In addition to the possibility of choosing the UNI Clicker programming method, using a third-party programmer or CODEGRIP/mikroProg connected to onboard JTAG/SWD header, the UNI Clicker board also includes a clean and regulated power supply module for the development kit. It provides two ways of board-powering; through the USB Type-C (USB-C) connector, where onboard voltage regulators provide the appropriate voltage levels to each component on the board, or using a Li-Po/Li

Ion battery via an onboard battery connector. All communication methods that mikroBUS™ itself supports are on this board (plus USB HOST/DEVICE), including the well-established mikroBUS™ socket, a standardized socket for the MCU card (SiBRAIN standard), and several user-configurable buttons and LED indicators. UNI Clicker is an integral part of the Mikroe ecosystem, allowing 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.

UNI clicker double image

Microcontroller Overview

MCU Card / MCU

default

Type

8th Generation

Architecture

ARM Cortex-M4

MCU Memory (KB)

32

Silicon Vendor

Microchip

Pin count

144

RAM (Bytes)

131072

Used MCU Pins

mikroBUS™ mapper

NC
NC
AN
NC
NC
RST
NC
NC
CS
NC
NC
SCK
NC
NC
MISO
NC
NC
MOSI
Power Supply
3.3V
3.3V
Ground
GND
GND
Low Level Alert
GP034
PWM
High Level Alert
GP201
INT
NC
NC
TX
NC
NC
RX
I2C Clock
GP024
SCL
I2C Data
GP025
SDA
Power Supply
5V
5V
Ground
GND
GND
1

Take a closer look

Schematic

Temp&Hum 5 Click Schematic schematic

Step by step

Project assembly

UNI Clicker front image hardware assembly

Start by selecting your development board and Click board™. Begin with the UNI Clicker as your development board.

UNI Clicker front image hardware assembly
Thermo 28 Click front image hardware assembly
SiBRAIN for STM32F745VG front image hardware assembly
Prog-cut hardware assembly
UNI Clicker MB 1 - upright/with-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
Necto image step 7 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

After loading the code example, pressing the "DEBUG" button builds and programs it on the selected setup.

Application Output Step 1

After programming is completed, a header with buttons for various actions available in the IDE appears. By clicking the green "PLAY "button, we start reading the results achieved with Click board™.

Application Output Step 3

Upon completion of programming, the Application Output tab is automatically opened, where the achieved result can be read. In case of an inability to perform the Debug function, check if a proper connection between the MCU used by the setup and the CODEGRIP programmer has been established. A detailed explanation of the CODEGRIP-board connection can be found in the CODEGRIP User Manual. Please find it in the RESOURCES section.

Application Output Step 4

Software Support

Library Description

This library contains API for Temp&Hum 5 Click driver.

Key functions:

  • temphum5_start_measurement - Functions for start measurement

  • temphum5_get_temperature - Functions for read Temperature data

  • temphum5_get_humidity - Functions for read Relative Huminidy data

Open Source

Code example

This example can be found in NECTO Studio. Feel free to download the code, or you can copy the code below.

/*!
 * \file 
 * \brief TempHum5 Click example
 * 
 * # Description
 * This application measures temperature and humidity.
 *
 * The demo application is composed of two sections :
 * 
 * ## Application Init 
 * Initialization device init
 * 
 * ## Application Task  
 * Reads Temperature and Humidity data and this data logs to USBUART every 1 sec.
 * 
 * \author MikroE Team
 *
 */
// ------------------------------------------------------------------- INCLUDES

#include "board.h"
#include "log.h"
#include "temphum5.h"

// ------------------------------------------------------------------ VARIABLES

static temphum5_t temphum5;
static log_t logger;

// ------------------------------------------------------ APPLICATION FUNCTIONS

void application_init ( void )
{
    log_cfg_t log_cfg;
    temphum5_cfg_t cfg;

    /** 
     * 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.

    temphum5_cfg_setup( &cfg );
    TEMPHUM5_MAP_MIKROBUS( cfg, MIKROBUS_1 );
    temphum5_init( &temphum5, &cfg );
}

void application_task ( )
{
    float temperature;
    float humidity;
    
    temphum5_start_measurement( &temphum5 );

    temperature = temphum5_get_temperature( &temphum5, TEMPHUM5_TEMP_DATA_IN_CELSIUS );
    log_printf( &logger, "Temperature: %.2f C \r\n ", temperature );
     
    humidity = temphum5_get_humidity ( &temphum5 );
    log_printf( &logger, "Humidity: %.0f RH \r\n ", humidity );
    
    log_printf( &logger, "------------------------ \r\n " );
    Delay_ms( 1000 );
}

void main ( void )
{
    application_init( );

    for ( ; ; )
    {
        application_task( );
    }
}

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

Additional Support

Resources