TOP Contributors

  1. MIKROE (2659 codes)
  2. Alcides Ramos (356 codes)
  3. Shawon Shahryiar (307 codes)
  4. jm_palomino (112 codes)
  5. Chisanga Mumba (90 codes)
  6. S P (73 codes)
  7. dany (71 codes)
  8. MikroBUS.NET Team (35 codes)
  9. NART SCHINACKOW (34 codes)
  10. Armstrong Subero (27 codes)

Most Downloaded

  1. Timer Calculator (137000 times)
  2. FAT32 Library (70116 times)
  3. Network Ethernet Library (56027 times)
  4. USB Device Library (46347 times)
  5. Network WiFi Library (41966 times)
  6. FT800 Library (41286 times)
  7. GSM click (29055 times)
  8. mikroSDK (26489 times)
  9. PID Library (26447 times)
  10. microSD click (25413 times)
Libstock prefers package manager

Package Manager

We strongly encourage users to use Package manager for sharing their code on Libstock website, because it boosts your efficiency and leaves the end user with no room for error. [more info]

< Back
mikroSDK Library

Temp-Hum 13 click

Rating:

10

Author: MIKROE

Last Updated: 2019-07-02

Package Version: 1.0.0.0

mikroSDK Library: 1.0.0.0

Category: Temperature & humidity

Downloaded: 3028 times

Not followed.

License: MIT license  

Temp&amp;Hum 13 Click is a Click board which is perfectly suited for measuring the relative humidity (RH) and temperature. The Click boardâ„¢ is equipped with the HTU21DF, an accurate and reliable sensor IC, packed in a miniature 3x3mm DFN package.

No Abuse Reported

Do you want to subscribe in order to receive notifications regarding "Temp-Hum 13 click" changes.

Do you want to unsubscribe in order to stop receiving notifications regarding "Temp-Hum 13 click" changes.

Do you want to report abuse regarding "Temp-Hum 13 click".

  • mikroSDK Library 2.0.0.0
  • Comments (0)
DOWNLOAD LINK RELATED COMPILER CONTAINS
mikroBasic PRO for ARM
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for AVR
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for dsPIC30/33 & PIC24
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for FT90x
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for PIC
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for PIC32
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for ARM
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for AVR
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for dsPIC30/33 & PIC24
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for FT90x
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for PIC
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for PIC32
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for ARM
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for AVR
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for dsPIC30/33 & PIC24
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for FT90x
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for PIC
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for PIC32
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc

mikroSDK Library Blog

Temp-Hum 13 click

Temp-Hum 13 click

Native view of the Temp-Hum 13 click board.

View full image
Temp-Hum 13 click

Temp-Hum 13 click

Front and back view of the Temp-Hum 13 click board.

View full image

Library Description

Library contains functions for getting temperature and humidity. Library contains functions for getting and setting user register. Library contains functions for changing resolution and soft reset. Library contains functions for enabling/disabling heater and OTP.

Key functions:

  • float temphum13_getTemperature(void) - This function issues hold temperature measurement command, calculates CRC for temperature value, compares two CRC values and calculates temperature value.
  • float temphum13_getHumidity(void) - This function issues hold humidity measurement, calculates CRC for humidity value, compares two CRC values and calculates humidity value.
  • void temphum13_setUserRegister( uint8_t register_content ) - sets user register content.

Examples description

The application is composed of three sections :

  • System Initialization - Initializes I2C and LOG modules.
  • Application Initialization - Initializes I2C driver and issues soft reset command
  • Application Task - Measures temperature and humidity values, checks if they are valid and logs them if they are
void applicationTask( )
{
    temperature = temphum13_getTemperature( );
    humidity = temphum13_getHumidity( );
    
    if (temperature != 65536.0)
    {
        FloatToStr( temperature, text );
        FloatCut( );
        mikrobus_logWrite( "> Temperature : ", _LOG_TEXT );
        mikrobus_logWrite( text, _LOG_TEXT );
        mikrobus_logWrite( celsius, _LOG_LINE );
    }

    if (humidity != 65536.0)
    {
        FloatToStr( humidity, text );
        FloatCut( );
        mikrobus_logWrite( "> Humidity    : ", _LOG_TEXT );
        mikrobus_logWrite( text, _LOG_TEXT );
        mikrobus_logWrite( " %RH", _LOG_LINE );
    }
    
    mikrobus_logWrite( " ", _LOG_LINE );
    Delay_ms(500);
}

Additional Functions :

  • FloatCut() - Rounds float number to two decimals

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 clickUSB 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.

ALSO FROM THIS AUTHOR

Flicker click

0

FLICKER click is perfect, simple solution if you need to turn a device on and off at specific time intervals, like blinking LED commercials, alarm system lights, or any other signalling lights. This example shows how by using the button you can start time relay and configure it's duration of on and off period.

[Learn More]

I2C MUX 2 click

5

I2C MUX 2 Click is a quad bidirectional translating I2C and SMBus switch with reset and interrupt functions, intended for applications with I2C slave address conflicts. It features a quad bidirectional translating switch controlled via the I2C bus, labeled as TCA9545A from Texas Instruments.

[Learn More]

NFC Tag 4 click

5

NFC Tag 4 Click is NFC RFID tag device, offering 16 Kbit of electrically erasable programmable memory (EEPROM). This Click Board offer two communication interfaces. The first one is an I2C serial link and can be operated from a DC power supply.

[Learn More]