TOP Contributors

  1. MIKROE (2654 codes)
  2. Alcides Ramos (352 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 (136745 times)
  2. FAT32 Library (69953 times)
  3. Network Ethernet Library (55942 times)
  4. USB Device Library (46267 times)
  5. Network WiFi Library (41887 times)
  6. FT800 Library (41173 times)
  7. GSM click (28985 times)
  8. PID Library (26414 times)
  9. mikroSDK (26362 times)
  10. microSD click (25376 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

Humidity click

Rating:

0

Author: MIKROE

Last Updated: 2024-04-03

Package Version: 2.1.0.10

mikroSDK Library: 2.0.0.0

Category: Temperature & humidity

Downloaded: 95 times

Not followed.

License: MIT license  

Humidity Click is a compact add-on board used to sense the amount of water vapor in the air. This board features the HIH-5030, an analog output relative humidity sensor from Honeywell Sensing and Productivity Solutions. The HIH-5031 is a covered, condensation-resistant, integrated circuit humidity sensor that is factory-fitted with a hydrophobic filter allowing usage in many condensing environments.

No Abuse Reported

Do you want to subscribe in order to receive notifications regarding "Humidity click" changes.

Do you want to unsubscribe in order to stop receiving notifications regarding "Humidity click" changes.

Do you want to report abuse regarding "Humidity click".

  • Information
  • Comments (0)

mikroSDK Library Blog


Humidity click

Humidity Click is a compact add-on board used to sense the amount of water vapor in the air. This board features the HIH-5030, an analog output relative humidity sensor from Honeywell Sensing and Productivity Solutions. The HIH-5031 is a covered, condensation-resistant, integrated circuit humidity sensor that is factory-fitted with a hydrophobic filter allowing usage in many condensing environments.

humidity_click.png

click Product page


Click library

  • Author : Stefan Filipovic
  • Date : Oct 2021.
  • Type : I2C type

Software Support

We provide a library for the Humidity 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 Humidity Click driver.

Standard key functions :

  • humidity_cfg_setup Config Object Initialization function.

    void humidity_cfg_setup ( humidity_cfg_t *cfg );
  • humidity_init Initialization function.

    err_t humidity_init ( humidity_t *ctx, humidity_cfg_t *cfg );

Example key functions :

  • humidity_read_voltage This function reads raw ADC value and converts it to proportional voltage level.

    err_t humidity_read_voltage ( humidity_t *ctx, float *voltage );
  • humidity_voltage_to_rh This function calculates relative humidity percents based on the voltage input.

    float humidity_voltage_to_rh ( humidity_t *ctx, float voltage );
  • humidity_drv_interface_selection This function sets a serial driver interface which will be used further in the click driver.

    void humidity_drv_interface_selection ( humidity_cfg_t *cfg, humidity_drv_t drv_sel );

Example Description

This example demonstrates the use of Humidity click board.

The demo application is composed of two sections :

Application Init

Initializes the driver and logger. The I2C communication interface is selected by default.


void application_init ( void )
{
    log_cfg_t log_cfg;  /**< Logger config object. */
    humidity_cfg_t humidity_cfg;  /**< Click config object. */

    /** 
     * Logger initialization.
     * Default baud rate: 115200
     * Default log level: LOG_LEVEL_DEBUG
     * @note If USB_UART_RX and USB_UART_TX 
     * are defined as HAL_PIN_NC, you will 
     * need to define them manually for log to work. 
     * See @b LOG_MAP_USB_UART macro definition for detailed explanation.
     */
    LOG_MAP_USB_UART( log_cfg );
    log_init( &logger, &log_cfg );
    log_info( &logger, " Application Init " );

    // Click initialization.
    humidity_cfg_setup( &humidity_cfg );
    HUMIDITY_MAP_MIKROBUS( humidity_cfg, MIKROBUS_1 );
    if ( HUMIDITY_OK != humidity_init( &humidity, &humidity_cfg ) ) 
    {
        log_error( &logger, " Communication init." );
        for ( ; ; );
    }
    log_info( &logger, " Application Task " );
}

Application Task

Reads the ADC voltage and then calculates the relative humidity from it. The calculated value of relative humidity in percents is being displayed on the USB UART approximately once per second.


void application_task ( void )
{
    float voltage = 0;
    if ( HUMIDITY_OK == humidity_read_voltage ( &humidity, &voltage ) )
    {
        log_printf( &logger, " Relative Humidity [%%RH]: %.2f\r\n\n", humidity_voltage_to_rh( &humidity, voltage ) );
    }
    Delay_ms ( 1000 );
}

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

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.


ALSO FROM THIS AUTHOR

I2C Isolator 4 click

0

I2C Isolator 4 Click is a compact add-on board that offers completely isolated bidirectional communication. This board features the MAX14937, a two-channel, 5kVRMS I2C digital isolator from Analog Devices. The MAX14937 provides two bidirectional, open-drain channels for applications that require data to be transmitted in both directions on the same line. It supports data rates from DC up to 1.7MHz and can be used in isolated I2C busses with or without clock stretching.

[Learn More]

IR click

0

IR Click is an add-on board in mikroBUS form factor. It’s a compact and easy solution for adding infrared (IR) remote control module to your design.

[Learn More]

Button ALARM click

0

Button ALARM Click is a very interesting interactive gadget on a Click board™. It is an integrated capacitive touch sensor display in the form of a button. By utilizing an advanced capacitive touch sensing technology, the CTHS15CIC05ALARM sensor can successfully replace the traditional mechanical button, allowing very simplified yet reliable user interfaces to be developed. Besides the touch detection, this sensor also features a green power symbol icon with backlight, which makes the Click board™ very useful for building various stylized and visually appealing interfaces.

[Learn More]