How does it work?
Temp&Hum 21 Click as its foundation uses the HIH8130-021-001, a highly accurate, fully-calibrated digital humidity and temperature sensor from Honeywell Sensing and Productivity Solutions. The humidity can be measured within a range of 0 to 100%RH, while the temperature sensor is designed for a range of -40 to +120°C. The typical accuracy for humidity is ±2%RH in the measuring range of 10 up to 90%RH at ambient temperature and ±0.5°C for its operating temperature range with very low power consumption.
The HIH8130-021-001 communicates with MCU using the standard I2C 2-Wire interface to read and write data supporting Fast Mode operation with a clock frequency up to 400kHz, providing factory-calibrated 14-bit data to the host controller. High 14-bit humidity and 14-bit temperature sensor resolution within the application help the user’s design detect the slightest relative humidity or temperature change.
It also comes with an alarm feature with configurable alarm thresholds, labeled as ALH and ALL routed to the INT and AN pins of the mikroBUS™ socket for preset control at a minimum and maximum humidity and temperature. These alarm thresholds are set to generate alarms when the actual values in the devices cross the defined threshold values. To activate the external setting of the alarm thresholds, it is necessary to populate resistors R4 and R5, which are not populated by default, to enable an external setting on an unpopulated header in the middle of the Click board™.
This Click board™ can operate with both 3.3V and 5V logic voltage levels selected via the VCC SEL jumper. Both mikroBUS™ power rails have protection in the form of diode MAX40200, controllable through an EN pin on the mikroBUS™ socket to prevent any unwanted back voltage, which also provides a Reset function to the main IC. This way, it is allowed for both 3.3V and 5V capable MCUs to use the communication lines properly. However, the Click board™ comes equipped with a library containing easy-to-use functions and an example code that can be used, as a reference, for further development.
Specifications
Type
Temperature & humidity
Applications
Can be used for various temperature and humidity-related applications in industrial, medical, and other applications
On-board modules
HIH8130-021-001 – digital humidity and temperature sensor from Honeywell Sensing and Productivity Solutions
Key Features
Industry-leading long-term stability and reliability, fully-calibrated and temperature-compensated, high precision and accuracy, I2C interface with alarm functions, low power consumption, and more
Interface
I2C
Feature
No ClickID
Compatibility
mikroBUS™
Click board size
S (28.6 x 25.4 mm)
Input Voltage
3.3V or 5V
Pinout diagram
This table shows how the pinout on Temp&Hum 21 Click corresponds to the pinout on the mikroBUS™ socket (the latter shown in the two middle columns).
Onboard settings and indicators
Label | Name | Default | Description |
---|---|---|---|
LD1 | PWR | – | Power LED Indicator |
JP1 | VCC SEL | Left | Logic Level Voltage Selection 3V3/5V: Left position 3V3, Right position 5V |
J1 | EXT_ALR | Unpopulated | External Alarm Threshold Connection Header |
Temp&Hum 21 Click electrical specifications
Description | Min | Typ | Max | Unit |
---|---|---|---|---|
Supply Voltage | 3.3 | – | 5 | V |
Humidity Measurement Range | 0 | – | 100 | %RH |
Humidity Accuracy | – | ±2 | – | %RH |
Resolution | – | – | 14 | bits |
Temperature Accuracy | – | ±0.5 | – | °C |
Operating Temperature Range | -40 | +25 | +120 | °C |
Software Support
We provide a library for the TempHum 21 Click as well as a demo application (example), developed using MikroElektronika compilers. The demo can run on all the main MikroElektronika development boards.
Package can be downloaded/installed directly from NECTO Studio Package Manager(recommended way), downloaded from our LibStock™ or found on Mikroe github account.
Library Description
This library contains API for TempHum 21 Click driver.
Key functions
-
temphum21_read_measurement
This function requests measurement and waits for a measurement to complete and after that reads temperature in Celsius and relative humidity in percents. -
temphum21_get_all_pin
This function returns the alarm low (ALL) pin logic state. -
temphum21_get_alh_pin
This function returns the alarm high (ALH) pin logic state.
Example Description
This example demonstrates the use of Temp & Hum 21 Click board™ by reading the temperature and humidity data.
void application_task ( void )
{
float temperature, humidity;
if ( TEMPHUM21_STATUS_NORMAL_OP == temphum21_read_measurement ( &temphum21, &temperature, &humidity ) )
{
log_printf ( &logger, " Temperature: %.2f Crn", temperature );
log_printf ( &logger, " Humidity: %.2f %%rnn", humidity );
Delay_ms ( 1000 );
}
}
The full application code, and ready to use projects can be installed directly from NECTO Studio Package Manager(recommended way), downloaded from our LibStock™ or found on Mikroe github account.
Other Mikroe Libraries used in the example:
- MikroSDK.Board
- MikroSDK.Log
- Click.TempHum21
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 MikroElektronika compilers.
mikroSDK
This Click board™ is supported with mikroSDK – MikroElektronika 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.