TOP Contributors

  1. MIKROE (2784 codes)
  2. Alcides Ramos (392 codes)
  3. Shawon Shahryiar (307 codes)
  4. jm_palomino (123 codes)
  5. Bugz Bensce (97 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 (140530 times)
  2. FAT32 Library (73019 times)
  3. Network Ethernet Library (58014 times)
  4. USB Device Library (48208 times)
  5. Network WiFi Library (43816 times)
  6. FT800 Library (43274 times)
  7. GSM click (30338 times)
  8. mikroSDK (28983 times)
  9. PID Library (27106 times)
  10. microSD click (26702 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

Thermostat 5 Click

Rating:

0

Author: MIKROE

Last Updated: 2024-12-19

Package Version: 2.1.0.2

mikroSDK Library: 2.0.0.0

Category: Relay

Downloaded: 27 times

Not followed.

License: MIT license  

Thermostat 5 Click is a compact add-on board designed for precise temperature monitoring and control of external devices. This board features the MCP6022 operational amplifier and MCP3221 A/D converter, both from Microchip, ensuring accurate signal processing. The board features an NTC connector for temperature sensing, a dual-mode signal processing option (analog or digital) selectable via the V SEL jumper, and a high-current J1031C3VDC.15S SPDT relay for external load control. The relay supports up to 2A loads, with an orange LED indicating its active status, while the board operates with 3.3V or 5V logic levels.

No Abuse Reported

Do you want to subscribe in order to receive notifications regarding "Thermostat 5 Click" changes.

Do you want to unsubscribe in order to stop receiving notifications regarding "Thermostat 5 Click" changes.

Do you want to report abuse regarding "Thermostat 5 Click".

  • Information
  • Comments (0)

mikroSDK Library Blog


Thermostat 5 Click

Thermostat 5 Click is a compact add-on board designed for precise temperature monitoring and control of external devices. This board features the MCP6022 operational amplifier and MCP3221 A/D converter, both from Microchip, ensuring accurate signal processing. The board features an NTC connector for temperature sensing, a dual-mode signal processing option (analog or digital) selectable via the V SEL jumper, and a high-current J1031C3VDC.15S SPDT relay for external load control. The relay supports up to 2A loads, with an orange LED indicating its active status, while the board operates with 3.3V or 5V logic levels.

thermostat5_click.png

Click Product page


Click library

  • Author : Nenad Filipovic
  • Date : Feb 2024.
  • Type : ADC/I2C type

Software Support

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

Standard key functions :

  • thermostat5_cfg_setup Config Object Initialization function.

    void thermostat5_cfg_setup ( thermostat5_cfg_t *cfg );
  • thermostat5_init Initialization function.

    err_t thermostat5_init ( thermostat5_t *ctx, thermostat5_cfg_t *cfg );

Example key functions :

  • thermostat5_set_relay This function controls the relay by setting the state of the ON (PWM) pin.

    void thermostat5_set_relay ( thermostat5_t *ctx, uint8_t state );
  • thermostat5_get_temperature This function reads and calculates temperature in degrees Celsius [degC] using NTC thermistors.

    err_t thermostat5_get_temperature ( thermostat5_t *ctx, float *temperature );
  • thermostat5_read_voltage This function sets the voltage reference for Thermostat 5 Click driver.

    err_t thermostat5_read_voltage ( thermostat5_t *ctx, float *voltage );

Example Description

This library contains API for the Thermostat 5 Click driver for temperature measurement and relay control.

The demo application is composed of two sections :

Application Init

The initialization of the I2C or ADC module and log UART set the relay to an OFF state.

void application_init ( void )
{
    log_cfg_t log_cfg;  /**< Logger config object. */
    thermostat5_cfg_t thermostat5_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.
    thermostat5_cfg_setup( &thermostat5_cfg );
    THERMOSTAT5_MAP_MIKROBUS( thermostat5_cfg, MIKROBUS_1 );
    err_t init_flag = thermostat5_init( &thermostat5, &thermostat5_cfg );
    if ( ( ADC_ERROR == init_flag ) || ( I2C_MASTER_ERROR == init_flag ) )
    {
        log_error( &logger, " Communication init." );
        for ( ; ; );
    }

    thermostat5_set_relay( &thermostat5, THERMOSTAT5_RELAY_OFF );
    log_info( &logger, " Application Task " );
    Delay_ms ( 100 );
}

Application Task

The demo application measures temperature in degrees Celsius. If the temperature increases above 30 degrees Celsius, the relay will turn ON, otherwise it will turn OFF. Results are being sent to the UART Terminal, where you can track their changes.

void application_task ( void ) 
{
    float temperature = 0;
    if ( THERMOSTAT5_OK == thermostat5_get_temperature( &thermostat5, &temperature ) )
    {
        log_printf( &logger, " Temperatur : %.2f [degC]\r\n", temperature );
        if ( THERMOSTAT5_TEMPERATURE_LIMIT < temperature )
        {
            thermostat5_set_relay( &thermostat5, THERMOSTAT5_RELAY_ON );
            log_printf( &logger, " Relay: ON\r\n" );
        }
        else
        {
            thermostat5_set_relay( &thermostat5, THERMOSTAT5_RELAY_OFF );
            log_printf( &logger, " Relay: OFF\r\n" );
        }
        Delay_ms ( 1000 );
    }
}

Note

For temperature measurement, we used Semitec 103AT-2 NTC Thermistors.

  • Beta parameter: 3435 K
  • Resistance: 10 kOhms
  • Tolerance: 1 %

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

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

LR IoT Click

0

LR IoT Click is a compact add-on board that contains a long-range LoRa transceiver. This board features Semtech Corporation’s LR1110, an ultra-low power platform integrating a LoRa® transceiver, multi-constellation GNSS, and passive WiFi AP MAC address scanner. Alongside its sub-GHz capabilities, the LR1110 also has a multi-band front-end capable of receiving 802.11b/g/n WiFi Access Point MAC addresses and GNSS (GPS, BeiDou, geostationary) satellite raw data befitting geo-positioning purposes. The acquired information is then transmitted using an LPWAN network to a geolocation server, which analyzes it and correlates the position with data from a geolocation database, enabling a unique balance between low power and performance.

[Learn More]

Air quality 2 click

5

Air quality 2 click carries the iAQ-Core Indoor Air Quality sensor that measures VOC levels and provides CO2 equivalent and TVOC equivalent predictions. The click is designed to run on either 3.3V or 5V power supply. It communicates with the target MCU over I2C.

[Learn More]

Gaussmeter click

5

Gaussmeter click is a device that is used for measuring the magnetic field in X, Y and Z axes. This Click board features the MLX90393, a micropower magnetometer based on the proprietary Triaxis technology, from Melexis. It can detect the magnetic field down to 0.8 µT (8 mG) thanks to this technology.

[Learn More]