How does it work?
HTU21D Click is based on the HTU21D, an easy-to-use, highly accurate digital humidity sensor with temperature output from TE Connectivity. The HTU21D can read humidity over the full range of 0 to 100% RH with a typical accuracy of ±2% over the range of 5% to 95% RH, while its maximum temperature range is from -40 to 125°C. It has a typical accuracy of ±0.3°C over 0 to 70°C. The HTU21D makes a perfect choice for environmental sensing and data logging for weather stations or humidity control systems. It should be noted that this sensor isn’t recommended for harsh environments where it could come in contact with water (such as rain).
In its standard mode for humidity and temperature measurement, the HTU21D has a resolution of 0.7% RH and 0.040°C with conversion times of 2ms and 11ms, respectively. For more demanding requirements, the HTU21D allows users to increase the resolution at the expense of increased conversion time. For example, in full resolution mode, the HTU21D can provide 0.04% RH with a conversion time of 14ms and 0.01°C with a conversion time of 44ms. The HTU21D communicates with MCU using the standard I2C 2-Wire interface with a maximum frequency of 400kHz and a fixed I2C address set to 0x40.
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. However, the Click board™ comes equipped with a library containing functions and an example code that can be used, as a reference, for further development.
Specifications
Type
Temperature & humidity
Applications
Can be used for environmental sensing and data logging for weather stations or humidity control systems
On-board modules
HTU21D – digital humidity sensor with temperature output from TE Connectivity
Key Features
Low power consumption, high accuracy, covers extended operating humidity and temperature ranges, fully calibrated, fast response time, and more
Interface
I2C
Feature
No ClickID
Compatibility
mikroBUS™
Click board size
S (28.6 x 25.4 mm)
Input Voltage
3.3V
Pinout diagram
This table shows how the pinout on HTU21D 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 |
HTU21D Click electrical specifications
Description | Min | Typ | Max | Unit |
---|---|---|---|---|
Supply Voltage | – | 3.3 | – | V |
Operating Humidity Range | 0 | – | 100 | %RH |
Humidity Accuracy | – | ±2 | – | %RH |
Temperature Accuracy | – | ±0.3 | – | °C |
Operating Temperature Range | -40 | +25 | +125 | °C |
Software Support
We provide a library for the HTU21D 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 HTU21D Click driver.
Key functions
-
This function initializes click configuration structure to init state.
-
This function initializes all necessary pins and peripherals used for this click.
-
This function writes data to the desired register.
-
This function reads data from the desired register.
-
Function read 24-bit data from register address of HTU21D.
-
Function sends command to HTU21D.
-
This function reads data from the desired register.
-
Function read and calculate temperature in degrees Celsius from the HTU21D sensor.
-
Function read and calculate humidity percentage from the HTU21D sensor.
Example Description
The application is composed of two sections.
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.Htu21d
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.