How does it work?
Temp & Hum 14 Click is based on the HTU31D, a digital relative humidity sensor with temperature output from TE Connectivity. Both sensors inside of the HTU31D are individually calibrated, compensated, and tested. 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 125 °C. The typical accuracy for humidity is ± 2 %RH in the measuring range of 20 up to 100 %RH at ambient temperature and ±0.2 °C for temperature between 0 – 100 °C with power consumption down to 3.78μW.
This Click board™, an I2C configurable environmental sensor, is characterized by high reliability and full interchangeability with no calibration required in standard conditions. It has a quick recovery time after long periods in the saturation phase, low power consumption, and fast response time. Also, this sensor provides sustained performance even when exposed to extreme temperatures up to 125°C and humidity environments.
Temp & Hum 14 Click communicates with MCU using the standard I2C 2-Wire interface with a maximum frequency of 10MHz. The HTU31D can answer 2 I2C addresses and allows the choice of the least significant bit (LSB) by positioning SMD jumpers labeled as ADDR SEL to an appropriate position marked as 0 and 1. In addition to this feature, this Click board™ also contains additional functionality routed to the RST pin on the mikroBUS™ socket. The RST pin can be used to generate a reset of the sensor with a minimum pulse duration of 1 μs required to trigger this function.
The HTU31D also offers a diagnostic register that can be used to check whether the values for humidity and temperature are outside the specified range. The CRC check (Cyclic Redundancy Check) ensures secure data transmission. The humidity and temperature signal response time, as well as the recovery time (after complete condensation), are within a range of a few seconds.
This Click board™ is designed to be operated with both 3.3V and 5V logic voltage levels that can be selected via VCC SEL jumper. This allows for both 3.3V and 5V capable MCUs to use the I2C communication lines properly. However, the Click board™ comes equipped with a library that contains 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 relative humidity and temperature measuring applications, including weather stations, reliable monitoring systems, and more.
On-board modules
Temp & Hum 14 Click is based on the HTU31D, a digital relative humidity sensor with temperature output from TE Connectivity.
Key Features
High reliability and environmental robustness, full interchangeability with no calibration required in standard conditions, quick recovery after long periods in saturation phase, low power consumption, fast response, 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 14 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 | Power Supply Voltage Selection 3V3/5V: Left position 3V3, Right position 5V |
JP2 | ADDR SEL | Left | Communication interface selection: Left position 0, Right position 1 |
Temp&Hum 14 Click electrical specifications
Description | Min | Typ | Max | Unit |
---|---|---|---|---|
Supply Voltage | -0.3 | – | 6 | V |
Current consumption | – | – | 0.45 | mA |
Humidity Operating Range | 0 | – | 100 | %RH |
Relative Humidity Accuracy | – | ±2 | – | %RH |
Temperature Accuracy | – | ±0.2 | – | °C |
Operating Temperature Range | -40 | – | +125 | °C |
Software Support
We provide a library for the Temp&Hum 14 Click on our LibStock page, as well as a demo application (example), developed using MikroElektronika compilers. The demo can run on all the main MikroElektronika development boards.
Library Description
The library covers all the necessary functions to control Temp&Hum 14 Click board™. Library performs a standard I2C interface communication.
Key functions:
void temphum14_set_conversion ( uint8_t hum_osr, uint8_t temp_osr )
– Set conversion function.void temphum14_get_diagnostic ( temphum14_diagn_t *diag_data )
– Get diagnostic status function.void temphum14_get_temp_and_hum ( float *temp, float *hum )
– Get temperature and humidity data function.
Examples description
The application is composed of three sections :
- System Initialization – Initializes I2C, set RST as output and start to write log.
- Application Initialization – Initialization driver enables – I2C, hardware reset the device and read the serial number, also write log.
- Application Task – (code snippet) This is an example that demonstrates the use of the Temp & Hum 14 Click board™. Temp & Hum 14 Click board™ can be used to measure temperature and relative humidity. All data logs write on USB uart changes every 3 sec.
void application_task ( ) { temphum14_set_conversion( TEMPHUM14_CONVERSION_HUM_OSR_0_020, TEMPHUM14_CONVERSION_TEMP_0_040 ); Delay_ms( 10 ); temphum14_get_temp_and_hum( &temperature, &humidity ); Delay_ms( 10 ); FloatToStr( temperature, log_text ); mikrobus_logWrite( " Temperature : ", _LOG_TEXT ); mikrobus_logWrite( log_text, _LOG_TEXT ); mikrobus_logWrite( " C", _LOG_LINE ); FloatToStr( humidity, log_text ); mikrobus_logWrite( " Humidity : ", _LOG_TEXT ); mikrobus_logWrite( log_text, _LOG_TEXT ); mikrobus_logWrite( " %", _LOG_LINE ); mikrobus_logWrite( "-----------------------------", _LOG_LINE ); Delay_ms( 3000 ); }
Additional Functions :
- void display_diagnostic ( void ) – Display diagnostic.
The full application code, and ready to use projects can be found on our LibStock page.
Other mikroE Libraries used in the example:
- I2C
- UART
- Conversions
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. The terminal available in all MikroElektronika compilers, or any other terminal application of your choice, can be used to read the message.
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.