TOP Contributors

  1. MIKROE (2650 codes)
  2. Alcides Ramos (350 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 (136552 times)
  2. FAT32 Library (69748 times)
  3. Network Ethernet Library (55850 times)
  4. USB Device Library (46189 times)
  5. Network WiFi Library (41811 times)
  6. FT800 Library (41003 times)
  7. GSM click (28930 times)
  8. PID Library (26386 times)
  9. mikroSDK (26291 times)
  10. microSD click (25303 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

TempHum 15 click

Rating:

0

Author: MIKROE

Last Updated: 2024-04-03

Package Version: 2.1.0.14

mikroSDK Library: 2.0.0.0

Category: Temperature & humidity

Downloaded: 208 times

Not followed.

License: MIT license  

Temp&Hum 15 Click is a compact add-on board that contains the 4th generation of best-in-class SHT humidity sensing solution from Sensirion. This board features the SHT40, a high-accuracy ultra-low-power 16-bit relative humidity, and temperature sensor.

No Abuse Reported

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

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

Do you want to report abuse regarding "TempHum 15 click".

  • Information
  • Comments (0)

mikroSDK Library Blog


Temp&Hum 15 click

Temp&Hum 15 Click is a compact add-on board that contains the 4th generation of best-in-class SHT humidity sensing solution from Sensirion. This board features the SHT40, a high-accuracy ultra-low-power 16-bit relative humidity, and temperature sensor.

temphum15_click.png

click Product page


Click library

  • Author : Stefan Nikolic
  • Date : jan 2021.
  • Type : I2C type

Software Support

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

Standard key functions :

  • temphum15_cfg_setup Config Object Initialization function.

    void temphum15_cfg_setup ( temphum15_cfg_t *cfg );
  • temphum15_init Initialization function.

    TEMPHUM15_RETVAL temphum15_init ( temphum15_t *ctx, temphum15_cfg_t *cfg );
  • temphum15_default_cfg Click Default Configuration function.

    void temphum15_default_cfg ( temphum15_t *ctx );

Example key functions :

  • temphum15_get_temp_and_hum This function reads temperature and humidity with the power consumption based on the precision mode selected.

    err_t temphum15_get_temp_and_hum ( temphum15_t *ctx, uint8_t precision_mode, float *temp_val, float *hum_val );
  • temphum15_soft_reset This function sends soft reset command to the sensor.

    err_t temphum15_soft_reset ( temphum15_t *ctx );
  • temphum15_read_serial This function reads unique serial number of the sensor.

    err_t temphum15_read_serial ( temphum15_t *ctx, uint32_t *serial_number );

Example Description

This demo app represents the performance of the Temp&Hum 15 click board. The log displays the temperature and humidity obtained from the sensor.

The demo application is composed of two sections :

Application Init

Initialization of UART LOG and I2C drivers. The application also performs reset upon init.


void application_init ( void ) {
    log_cfg_t log_cfg;              /**< Logger config object. */
    temphum15_cfg_t temphum15_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.

    temphum15_cfg_setup( &temphum15_cfg );
    TEMPHUM15_MAP_MIKROBUS( temphum15_cfg, MIKROBUS_1 );
    err_t init_flag = temphum15_init( &temphum15, &temphum15_cfg );
    if ( init_flag == I2C_MASTER_ERROR ) {
        log_error( &logger, " Application Init Error. " );
        log_info( &logger, " Please, run program again... " );

        for ( ; ; );
    }

    Delay_ms ( 100 );
    temphum15_default_cfg( &temphum15 );
    log_info( &logger, " Application Task " );
    Delay_ms ( 100 );
}

Application Task

Temperature and humidity data are being acquired every two seconds. If the acquisition fails, LOG states that no data is available.


void application_task ( void ) {
    err_t status_data;

    status_data = temphum15_get_temp_and_hum( &temphum15, TEMPHUM15_MODE_HIGH_PRECISION, &temperature, &humidity );
    if ( status_data == TEMPHUM15_SUCCESS ) {
        log_printf( &logger, "----------------------------\r\n" );
        log_printf( &logger, "> Temperature : %.2f C\r\n", temperature );
        log_printf( &logger, "> Humidity: %.2f %RH\r\n", humidity );
    } else {
        log_printf( &logger, "----------------------------\r\n" );
        log_printf( &logger, "> No data\r\n" );
    }
    Delay_ms ( 1000 );
    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.TempHum15

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

Magneto 11 click

0

Magneto 11 Click is a compact add-on board that contains an accurate and reliable magnetic sensing device. This board features the AS5510, a linear hall sensor with 10-bit resolution, and an I2C interface from ams AG. It can measure the absolute position of lateral movement of a simple 2-pole magnet. A lateral stroke of 0.5mm ~ 2mm can be measured with air gaps around 1.0mm, depending on the magnet size. The AS5510 may be switched to a Power-Down state when it is not used to conserve power. This Click board™ is suitable for position sensing applications requiring a small magnetic range where noise is a critical design parameter.

[Learn More]

LTE IoT 6 click

0

LTE IoT 6 Click is a compact add-on board that contains an IoT module with worldwide coverage.

[Learn More]

USB UART click

0

Simple example which demonstrates working with &lt;b&gt;USB UART&lt;/b&gt; click board in mikroBUS form factor. This code demonstrates how to use uart library routines. Upon receiving data via RS232, MCU immediately sends it back to the sender.

[Learn More]