TOP Contributors

  1. MIKROE (2656 codes)
  2. Alcides Ramos (353 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 (136871 times)
  2. FAT32 Library (70000 times)
  3. Network Ethernet Library (55999 times)
  4. USB Device Library (46303 times)
  5. Network WiFi Library (41910 times)
  6. FT800 Library (41206 times)
  7. GSM click (29012 times)
  8. PID Library (26423 times)
  9. mikroSDK (26394 times)
  10. microSD click (25385 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

Environment 2 click

Rating:

0

Author: MIKROE

Last Updated: 2024-04-03

Package Version: 2.1.0.16

mikroSDK Library: 2.0.0.0

Category: Environmental

Downloaded: 145 times

Not followed.

License: MIT license  

Environment 2 Click is a compact add-on board containing best-in-class SHT humidity and SGP air-quality sensing solutions from Sensirion. This board features SHT40 and SGP40, a high-accuracy ultra-low-power relative humidity, and a temperature sensor combined with MOx based gas sensor. The SHT40 sensor offers linearized digital output, provides constant temperature accuracy, up to 0.1°C, and shows the best performance when operated within the temperature and humidity range of 5-60°C and 20-80%RH, while the SGP40, a digital gas sensor, features a temperature-controlled micro hot-plate providing a humidity-compensated VOC-based indoor air quality signal. This Click board™ is suitable for indoor air quality and various temperature and humidity-related applications

No Abuse Reported

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

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

Do you want to report abuse regarding "Environment 2 click".

  • Information
  • Comments (0)

mikroSDK Library Blog


Environment 2 click

Environment 2 Click is a compact add-on board containing best-in-class SHT humidity and SGP air-quality sensing solutions from Sensirion. This board features SHT40 and SGP40, a high-accuracy ultra-low-power relative humidity, and a temperature sensor combined with MOx based gas sensor. The SHT40 sensor offers linearized digital output, provides constant temperature accuracy, up to 0.1°C, and shows the best performance when operated within the temperature and humidity range of 5-60°C and 20-80%RH, while the SGP40, a digital gas sensor, features a temperature-controlled micro hot-plate providing a humidity-compensated VOC-based indoor air quality signal. This Click board™ is suitable for indoor air quality and various temperature and humidity-related applications

environment2_click.png

click Product page


Click library

  • Author : Nenad Filipovic
  • Date : Feb 2021.
  • Type : I2C type

Software Support

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

Standard key functions :

  • environment2_cfg_setup Config Object Initialization function.

    void environment2_cfg_setup ( environment2_cfg_t *cfg );
  • environment2_init Initialization function.

    ENVIRONMENT2_RETVAL environment2_init ( environment2_t *ctx, environment2_cfg_t *cfg );
  • environment2_default_cfg Click Default Configuration function.

    void environment2_default_cfg ( environment2_t *ctx );

Example key functions :

  • environment2_get_temp_hum Environment 2 get temperature and relative humidity function.

    err_t environment2_get_temp_hum ( environment2_t *ctx, float *humidity, float *temperature );
  • environment2_get_air_quality Environment 2 get air quality data function.

    err_t environment2_get_air_quality ( environment2_t *ctx, uint16_t *air_quality );
  • environment2_sgp40_measure_test Environment 2 SGP40 measurement test function.

    uint16_t environment2_sgp40_measure_test ( environment2_t *ctx );

Example Description

This library contains API for Environment 2 Click driver. The library contains drivers for measuring air quality, temperature and relative humidity.

The demo application is composed of two sections :

Application Init

Initializes I2C driver and triggers the built-in self-test checking, set heater off, performs sensors configuration and initialize VOC algorithm.


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

    // Logger initialization.

    LOG_MAP_USB_UART( log_cfg );
    log_cfg.level = LOG_LEVEL_DEBUG;
    log_cfg.baud = 115200;
    log_init( &logger, &log_cfg );
    log_printf( &logger, "\r\n    Application Init\r\n" );

    // Click initialization.

    environment2_cfg_setup( &environment2_cfg );
    ENVIRONMENT2_MAP_MIKROBUS( environment2_cfg, MIKROBUS_1 );
    err_t init_flag = environment2_init( &environment2, &environment2_cfg );
    if ( init_flag == I2C_MASTER_ERROR ) {
        log_error( &logger, " Application Init Error. " );
        log_printf( &logger, " Please, run program again... " );

        for ( ; ; );
    }

    log_printf( &logger, "    Application Task   \r\n" );
    log_printf( &logger, "-----------------------\r\n" );
    log_printf( &logger, "  Environment 2 Click  \r\n" );
    log_printf( &logger, "-----------------------\r\n" );

    if ( environment2_sgp40_measure_test( &environment2 ) == ENVIRONMENT2_SGP40_TEST_PASSED ) {
        log_printf( &logger, "    All tests passed\r\n" );
        log_printf( &logger, "      Successfully\r\n" );
    } else {
        log_printf( &logger, "    One or more tests have\r\n" );
        log_printf( &logger, "     Failed\r\n" );
    }
    log_printf( &logger, "-----------------------\r\n" );
    Delay_ms ( 100 );

    environment2_sgp40_heater_off( &environment2 );
    Delay_ms ( 100 );

    environment2_config_sensors( );
    Delay_ms ( 100 );
}

Application Task

This is an example that demonstrates the use of the Environment 2 Click board. Measured and display air quality ( raw data ), temperature ( degrees Celsius ), relative humidity ( % ) and VOC Index. Results are being sent to the Usart Terminal where you can track their changes. All data logs write on USB UART changes every 2 sec.


void application_task ( void ) {
    environment2_get_temp_hum(  &environment2, &humidity, &temperature );
    Delay_ms ( 100 );

    log_printf( &logger, " Humidity    : %.2f %% \r\n", humidity );
    log_printf( &logger, " Temperature : %.2f C \r\n", temperature );

    environment2_get_air_quality( &environment2, &air_quality );
    Delay_ms ( 100 );

    log_printf( &logger, " Air Quality : %d \r\n", air_quality );
    log_printf( &logger, "- - - - - - - - - -  - \r\n" );

    environment2_get_voc_index( &environment2, &voc_index );
    Delay_ms ( 100 );

    log_printf( &logger, " VOC Index   : %d  \r\n", ( uint16_t ) voc_index );
    log_printf( &logger, "-----------------------\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.Environment2

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

Stepper 19 click

0

Stepper 19 Click is a compact add-on board for precise control over stepper motors. This board features the DRV8424, a stepper motor driver from Texas Instruments designed to drive both industrial and consumer stepper motors. The DRV8424 has dual N-channel power MOSFET H-bridge drivers, a microstepping indexer, and integrated current sensing, eliminating the need for external power sense resistors. Operating on a 5V to 30V external power supply, the DRV8424 can deliver up to 2.5A of full-scale output current, with an internal PWM current regulation scheme that includes smart tune, slow, and mixed decay options to optimize performance. Ideal for applications in multichannel system monitoring, robotics, precision positioning, and automated manufacturing processes, this Click board™ appears as a versatile solution for sophisticated stepper motor control.

[Learn More]

Force 5 click

0

Force 5 Click is a compact add-on board that contains a stable and flexible compensated/amplified micro force sensor. This board features the FMAMSDXX025WC2C3, a piezoresistive-based force sensors offering a digital output for reading force over the specified full-scale force span and a temperature range from Honeywell Sensing and Productivity Solutions.

[Learn More]

AN to PWM 2 click

5

AN to PWM 2 Click is a compact add-on board that contains an easy-to-use component that converts the value of the input analog signal to a fixed frequency PWM voltage output, with a duty cycle proportional to the input voltage.

[Learn More]