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 consumption device and it can work in two modes: sleep and active (measurement) mode. The device enters the sleep the mode as soon as possible, to save power. This makes the HDC2080 suitable to be used in battery-powered applications. In these applications, the HDC2080 spends most of the time in sleep mode, with the typical current consumption of 50 nA. While in the active mode, measurement can be configured either to automatic (with the predefined output data rate) or on-demand. In the automatic mode, the measurement is triggered in predefined time intervals, while on-demand measurement happens whenever the I2C command is sent. As soon as the single measurement is finished, the device falls back to the 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
Feature
No ClickID
Compatibility
mikroBUS™
Click board size
M (42.9 x 25.4 mm)
Input Voltage
3.3V
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).
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 datafloat 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:
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.