How does it work?
Temp&Hum 20 Click as its foundation uses the CC2D23, a highly accurate, fully-calibrated relative humidity and temperature sensor from Amphenol. 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 80 %RH at ambient temperature, and ±0.3 °C for its operating temperature range with very low power consumption.
Temp&Hum 20 Click communicates with MCU using the standard I2C 2-Wire interface to read data supporting Standard Mode operation with a clock frequency up to 100kHz, providing factory-calibrated 14-bit data to the host controller. This Click board™ also possesses enabling function managed by SiP32431DN, a high side switch with reverse blocking capability. The Enable pin, labeled as EN and routed to the CS pin of the mikroBUS™ socket, activates the SiP32431DN, allowing and powering the main IC the CC2D23 (used for power ON/OFF purposes), and thus enables optimizes power consumption.
It also comes with alarm features, labeled as ALH and ALL and routed to the AN and PWM pins of the mikroBUS™ socket, for preset control at a minimum and maximum humidity, and additional data-ready signal routed on the INT pin of the mikroBUS™ socket indicating that new data is ready for the host.
This Click board™ can operate with both 3.3V and 5V logic voltage levels selected via the VCC SEL jumper. This way, it is allowed for both 3.3V and 5V capable MCUs to use the I2C 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 and a vast number of applications ranging from portable devices to products designed for harsh environments
On-board modules
CC2D23 – highly accurate, fully-calibrated relative humidity and temperature sensor from Amphenol
Key Features
Low power consumption, fully-calibrated and temperature-compensated, high precision and accuracy, I2C interface with alarm functions, reliable in harsh environments, 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 20 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 |
Temp&Hum 20 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.3 | – | °C |
Operating Temperature Range | -40 | +25 | +125 | °C |
Software Support
We provide a library for the Temp&Hum 20 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 Temp&Hum 20 Click driver.
Key functions
-
temphum20_write_command
This function writes a desired command data to the selected command byte. -
temphum20_get_measurement
This function waits for the data to be ready, and then reads the temperature and humidity data and converts them to Celsius and Percents, respectively. -
temphum20_set_operating_mode
This function sets the device operating mode.
Example Description
This example demonstrates the use of Temp & Hum 20 Click board™.
void application_task ( void )
{
float humidity, temperature = 0;
if ( TEMPHUM20_OK == temphum20_get_measurement ( &temphum20, &temperature, &humidity ) )
{
log_printf ( &logger, " Temperature: %.3f Crn", temperature );
log_printf ( &logger, " Humidity: %.3f %%rnn", humidity );
}
}
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.TempHum20
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.