TOP Contributors

  1. MIKROE (2779 codes)
  2. Alcides Ramos (376 codes)
  3. Shawon Shahryiar (307 codes)
  4. jm_palomino (118 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 (139559 times)
  2. FAT32 Library (72041 times)
  3. Network Ethernet Library (57254 times)
  4. USB Device Library (47607 times)
  5. Network WiFi Library (43219 times)
  6. FT800 Library (42551 times)
  7. GSM click (29930 times)
  8. mikroSDK (28292 times)
  9. PID Library (26930 times)
  10. microSD click (26309 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-Log 7 Click

Rating:

0

Author: MIKROE

Last Updated: 2024-10-31

Package Version: 2.1.0.10

mikroSDK Library: 2.0.0.0

Category: Temperature & humidity

Downloaded: 127 times

Not followed.

License: MIT license  

Temp-Log 7 Click is a compact add-on board used to measure and record the temperature of an environment over time. This board features the TMP1826, a high-accuracy, 1-Wire® compatible digital output temperature sensor from Texas Instruments with integrated 2-kbit EEPROM. It supports a wide operating temperature range from –20°C to +85°C with its high accuracy of ±0.1°C (typical)/±0.3°C (maximum) and comes with a factory-programmed 64-bit unique identification number for addressing and NIST traceability. Besides a programmable alarm function that outputs an interrupt signal to the MCU when a specific temperature event occurs, it also has three digital I/O pins configurable for general purposes or to identify the device's position on a shared bus.

No Abuse Reported

Do you want to subscribe in order to receive notifications regarding "Temp-Log 7 Click" changes.

Do you want to unsubscribe in order to stop receiving notifications regarding "Temp-Log 7 Click" changes.

Do you want to report abuse regarding "Temp-Log 7 Click".

  • Information
  • Comments (0)

mikroSDK Library Blog


Temp-Log 7 Click

Temp-Log 7 Click is a compact add-on board used to measure and record the temperature of an environment over time. This board features the TMP1826, a high-accuracy, 1-Wire® compatible digital output temperature sensor from Texas Instruments with integrated 2-kbit EEPROM. It supports a wide operating temperature range from –20°C to +85°C with its high accuracy of ±0.1°C (typical)/±0.3°C (maximum) and comes with a factory-programmed 64-bit unique identification number for addressing and NIST traceability. Besides a programmable alarm function that outputs an interrupt signal to the MCU when a specific temperature event occurs, it also has three digital I/O pins configurable for general purposes or to identify the device's position on a shared bus.

templog7_click.png

Click Product page


Click library

  • Author : Stefan Filipovic
  • Date : Mar 2023.
  • Type : One Wire type

Software Support

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

Standard key functions :

  • templog7_cfg_setup Config Object Initialization function.

    void templog7_cfg_setup ( templog7_cfg_t *cfg );
  • templog7_init Initialization function.

    err_t templog7_init ( templog7_t *ctx, templog7_cfg_t *cfg );
  • templog7_default_cfg Click Default Configuration function.

    err_t templog7_default_cfg ( templog7_t *ctx );

Example key functions :

  • templog7_read_temperature This function starts the one shot measurement and reads the temperature value in Celsius.

    err_t templog7_read_temperature ( templog7_t *ctx, float *temperature );
  • templog7_write_eeprom This function writes a desired number of data bytes to the EEPROM memory.

    err_t templog7_write_eeprom ( templog7_t *ctx, uint16_t address, uint8_t *data_in, uint16_t len );
  • templog7_read_eeprom This function reads a desired number of data bytes from the EEPROM memory.

    err_t templog7_read_eeprom ( templog7_t *ctx, uint16_t address, uint8_t *data_out, uint16_t len );

Example Description

This example demonstrates the use of Temp-Log 7 Click board by reading the temperature in Celsius, then writing the specified data to the memory and reading it back.

The demo application is composed of two sections :

Application Init

Initializes the driver and performs the Click default configuration which clears the EEPROM memory, sets the temperature resolution to 16-bit, enables alert interrupt and sets the temperature alerts to 5 degrees Celsius for low and 40 degrees for high level. Other three IO pins are configured as INPUT.


void application_init ( void )
{
    log_cfg_t log_cfg;  /**< Logger config object. */
    templog7_cfg_t templog7_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.
    templog7_cfg_setup( &templog7_cfg );
    TEMPLOG7_MAP_MIKROBUS( templog7_cfg, MIKROBUS_1 );
    if ( ONE_WIRE_ERROR == templog7_init( &templog7, &templog7_cfg ) ) 
    {
        log_error( &logger, " Communication init." );
        for ( ; ; );
    }

    if ( TEMPLOG7_ERROR == templog7_default_cfg ( &templog7 ) )
    {
        log_error( &logger, " Default configuration." );
        for ( ; ; );
    }

    log_info( &logger, " Application Task " );
}

Application Task

Reads the temperature in degrees Celsius and the gpio state. After that writes a desired number of bytes to the memory and then verifies if it is written correctly by reading from the same memory location and displaying the memory content. All data is displayed on the USB UART where you can track changes.

void application_task ( void )
{
    uint8_t eeprom_data[ 64 ] = { 0 };
    uint8_t gpio_state = 0;
    float temperature = 0;
    if ( TEMPLOG7_OK == templog7_read_temperature ( &templog7, &temperature ) )
    {
        log_printf( &logger, "\r\n Temperature: %.2f C\r\n", temperature );
    }
    if ( TEMPLOG7_OK == templog7_read_gpio ( &templog7, &gpio_state ) )
    {
        log_printf( &logger, " GPIO state: 0x%.2X\r\n", ( uint16_t ) gpio_state );
    }
    if ( TEMPLOG7_OK == templog7_write_eeprom ( &templog7, STARTING_ADDRESS, DEMO_TEXT_MESSAGE, 
                                                    sizeof ( DEMO_TEXT_MESSAGE ) ) )
    {
        log_printf ( &logger, " EEPROM write: %s\r\n", ( uint8_t * ) DEMO_TEXT_MESSAGE );
    }
    if ( TEMPLOG7_OK == templog7_read_eeprom ( &templog7, STARTING_ADDRESS, eeprom_data, 
                                                   sizeof ( DEMO_TEXT_MESSAGE ) ) )
    {
        log_printf ( &logger, " EEPROM read: %s\r\n", eeprom_data );
    }
    if ( !templog7_get_alert_pin ( &templog7 ) )
    {
        log_info( &logger, " ALERT detected " );
    }
    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.TempLog7

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

Cooler Click

0

Cooler Click is a compact add-on board designed as a cooling solution to manage heat in electronic systems efficiently. This board features the DRV8213, a brushless DC motor driver from Texas Instruments, ensuring a high-performance operation. This board also directly integrates a TMP007 temperature sensor and an MF25060V2-1000U-A99 cooling fan onto its platform, offering a compact and ready-to-use cooling system. It operates across a wide PWM frequency range from 0 to 100kHz, supports both 3.3V and 5V logic levels, and features several protection mechanisms, including undervoltage lockout, overcurrent protection, and overtemperature shutdown.

[Learn More]

RTC 9 click

5

RTC 9 Click is a real-time clock module which has an extremely low power consumption, allowing it to be used with a single button cell battery, for an extended period of time. This board features the M41T82, real-time clock (RTC) with battery switchover, from ST Microelectronics.

[Learn More]

Button R Click

0

Button R Click is the simplest solution for adding a single pushbutton to your design. The button itself is transparent, 6.8mm in diameter and has a red LED backlight. When pressed, it sends an interrupt signal to the target board microcontroller. The backlight LED is controlled separately through the mikroBUS PWM pin, so you can program all kinds of patterns (varying level of light intensity or rate of blinking on subsequent button presses). The board can use either a 3.3V or a 5V power supply.

[Learn More]