How does it work?
The sensor IC used on the Temp&Hum 12 click is the HDC2080, a Low Power Humidity and Temperature Digital Sensor from Texas Instruments. This sensor is factory calibrated to 2% relative humidity and 0.2°C temperature accuracy. It has an integrated heating element that is used to evaporate condensation, protecting the sensor that way. This heating element can be simply activated by setting a bit in the appropriate register. In the case when the heater is powered on, the typical current consumption is about 90mA.
Internally, two sensors are connected to the two separated ADC sections, which can be set to sample measurements with the resolution of 9, 11 or 14 bits, based on the measurement time. The OTP memory holds the calibration coefficients that are applied to the measured value and the results are stored on the output registers, in the MSB/LSB format. These values are then used in formulas found in the HDC2080 datasheet so that the final temperature or relative humidity data can be calculated. It is also possible to correct the offsets with custom values.
HDC2080 IC uses the I2C protocol to communicate with the host MCU. Its I2C bus pins are routed to the mikroBUS™ I2C pins and are pulled to a HIGH logic level by the onboard resistors. The final I2C address of this IC is already determined by setting ADDR pin to GND (LOW logic level for 0).
Temp&Hum 12 click supports programable temperature and humidity thresholds in the HDC2080 allow the device to send a hardware interrupt to wake up the microcontroller when necessary. In addition, the power consumption of the HDC2080 is significantly reduced, which helps to minimize self-heating and improve measurement accuracy. More information about these registers can be found in the HDC2080 datasheet.
HDC2080 IC itself is a very low power consuming device and it can work in two modes: sleep and active (measurement) mode. The device enters the sleep the mode as soon possible, to save power which makes the HDC2080 suitable in battery-powered or energy-harvesting applications. In these applications, the HDC2080 spends most of the time in sleep mode that has a typical current consumption of 50 nA. While in the active mode, measurement can be either automatic with predefined output data rate (ODR) or on-demand. In the automatic mode, the measurement is triggered in predefined time segments, while on-demand measurement happens whenever the I2C command is sent. As soon as the single measurement is finished, the device falls back to a sleep mode.
The provided click board™ library contains simple and easy to use functions, which simplify configuring and reading of the measurement data. These functions are demonstrated in the included example application and can be used as a reference for custom projects. These functions can be used in mikroC, mikroBasic and mikroPascal compilers for all MCU architectures, supported by MikroElektronika.
Specifications
Type |
Temperature / Humidity |
Applications |
An ideal solution for development of various applications, including battery operated weather stations, thermostats and humidistats, microenvironment centers, respiratory therapy applications, air conditioners, HVAC systems, and other similar applications. |
On-board modules |
HDC2080, a relative humidity and temperature sensor with I²C Interface, by Texas Instruments. |
Key Features |
High accuracy, good linearity, proven reliability, long-term stability, excellent repeatability, programmable interrupt thresholds, a low power consumption, etc. |
Interface |
I2C |
Input Voltage |
3.3V |
Click board size |
M (42.9 x 25.4 mm) |
Pinout diagram
This table shows how the pinout on Temp&Hum 12 click corresponds to the pinout on the mikroBUS™ socket (the latter shown in the two middle columns).
Notes |
Pin |
|
Pin |
Notes |
---|
|
NC |
1 |
AN |
PWM |
16 |
NC |
|
|
NC |
2 |
RST |
INT |
15 |
INT |
Interrupt output |
|
NC |
3 |
CS |
RX |
14 |
NC |
|
|
NC |
4 |
SCK |
TX |
13 |
NC |
|
|
NC |
5 |
MISO |
SCL |
12 |
SCL |
I2C Clock |
|
NC |
6 |
MOSI |
SDA |
11 |
SDA |
I2C Data |
Power Supply |
3.3V |
7 |
3.3V |
5V |
10 |
NC |
|
Ground |
GND |
8 |
GND |
GND |
9 |
GND |
Ground |
Temp&Hum 12 Click electrical specifications
Description |
Min |
Typ |
Max |
Unit |
---|
Temperature Accuracy |
- |
+/-0.2 |
+/-0.4 |
°C |
Humidity Accuracy |
- |
+/-2 |
+/-3 |
% RH |
Operating temperature |
-40 |
- |
85 |
°C |
Relative Humidity Operating Range |
0 |
- |
100 |
% RH |
I2C clock frequency |
10 |
- |
400 |
kHz |
Onboard settings and indicators
Label |
Name |
Default |
Description |
---|
LD1 |
PWR |
- |
PWR indication LED |
Software support
We provide a library for the Temp&Hum 12 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 initializes and defines the I2C bus driver and drivers that offer a choice for writing data in register and read data form register. The library includes function for read Temperature and Relative Huminidy data and function for read device ID and Manifactures ID. The user also has the function for configuration chip for measurement and read Interrupt (INT pin) state.
Key functions:
float temphum12_getTemperature(uint8_t tempIn)
- Temperature data
float temphum12_getHumidity()
- Relative Huminidy data
Examples description
The application is composed of the three sections :
- System Initialization - Initialization I2C module and sets INT pin as INPUT.
- Application Initialization - Initializes driver init, test comunication and configuration device for measurement.
- Application Task - Reads Temperature and Humidity data and this data logs to the USBUART every 1 sec.
void applicationTask()
{
float Temperature;
float Humidity;
char demoText[ 50 ] = {0};
Temperature = temphum12_getTemperature(_TEMPHUM12_TEMP_IN_CELSIUS);
FloatToStr(Temperature, demoText);
mikrobus_logWrite(" Temperature : ", _LOG_TEXT);
mikrobus_logWrite(demoText, _LOG_LINE);
Delay_1sec();
Humidity = temphum12_getHumidity();
FloatToStr(Humidity, demoText);
mikrobus_logWrite(" Humidity : ", _LOG_TEXT);
mikrobus_logWrite(demoText, _LOG_LINE);
mikrobus_logWrite("-------------------------", _LOG_LINE);
Delay_1sec();
}
The full application code, and ready to use projects can be found on our LibStock page.
Other mikroE Libraries used in the example:
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.