Keep your environment at the perfect temperature with our state-of-the-art temperature solution
A
A
Hardware Overview
How does it work?
Thermo 24 Click is based on the STS40-AD1B, a high-accuracy ultra-low-power 16-bit temperature sensor from Sensirion. This temperature sensor is characterized by high accuracy; a temperature range of -40°C to +120°C provides typical ±0.2°C accuracy. It integrates a digital temperature sensor with a 16-bit analog-to-digital converter (ADC), a data processing circuit, and serial interface logic functions in one package. The voltage is digitized and converted to a 16-bit temperature result in degrees Celsius, with a resolution of 0.01°C. The STS40-AD1B achieves the most
significant cost efficiency among comparable sensors. The STS40-AD1B communicates with MCU using a standard I2C 2-Wire interface. Given that this chip can be found in multiple versions with its unique I2C slave address, this version, specifically the STS40-AD1B, comes with the slave address of 0x44. Since the sensor for operation requires a 3.3V logic voltage level only, this Click board™ also features the PCA9306 voltage-level translator from Texas Instruments. The I2C interface bus lines are routed to the dual bidirectional voltage-level translator, allowing this Click board™
to work properly with 3.3V and 5V MCUs. This Click board™ can operate with either 3.3V or 5V logic voltage levels selected via the VIO SEL jumper. This way, both 3.3V and 5V capable MCUs can use the communication lines properly. However, the Click board™ comes equipped with a library containing easy-to-use functions and an example code that can be used, as a reference, for further development.



Features overview
Development board
STM32 M4 Clicker is a compact starter development board that brings the flexibility of add-on Click boards™ to your favorite microcontroller, making it a perfect starter kit for implementing your ideas. It comes with an onboard 32-bit ARM Cortex-M4 microcontroller, the STM32F415RG from STMicroelectronics, a USB connector, LED indicators, buttons, a JTAG connector, and a header for interfacing with external electronics. Thanks to its compact design with clear and easy-recognizable silkscreen markings, it provides a fluid and immersive working experience, allowing
access anywhere and under any circumstances. Each part of the STM32 M4 Clicker development kit contains the components necessary for the most efficient operation of the same board. In addition to the possibility of choosing the STM32 M4 Clicker programming method, using USB HID mikroBootloader, or through an external mikroProg connector for the STM32 programmer, the Clicker board also includes a clean and regulated power supply module for the development kit. The USB Mini-B connection can provide up to 500mA of current, which is more than enough to operate all
onboard and additional modules. All communication methods that mikroBUS™ itself supports are on this board, including the well-established mikroBUS™ socket, reset button, and several buttons and LED indicators. STM32 M4 Clicker is an integral part of the Mikroe ecosystem, allowing you to create a new application in minutes. Natively supported by Mikroe software tools, it covers many aspects of prototyping thanks to a considerable number of different Click boards™ (over a thousand boards), the number of which is growing every day.
Microcontroller Overview
MCU Card / MCU

Architecture
ARM Cortex-M4
MCU Memory (KB)
1024
Silicon Vendor
STMicroelectronics
Pin count
64
RAM (Bytes)
196608
Used MCU Pins
mikroBUS™ mapper
Take a closer look
Click board™ Schematic

Step by step
Project assembly
Track your results in real time
Application Output
1. Application Output - In Debug mode, the 'Application Output' window enables real-time data monitoring, offering direct insight into execution results. Ensure proper data display by configuring the environment correctly using the provided tutorial.

2. UART Terminal - Use the UART Terminal to monitor data transmission via a USB to UART converter, allowing direct communication between the Click board™ and your development system. Configure the baud rate and other serial settings according to your project's requirements to ensure proper functionality. For step-by-step setup instructions, refer to the provided tutorial.

3. Plot Output - The Plot feature offers a powerful way to visualize real-time sensor data, enabling trend analysis, debugging, and comparison of multiple data points. To set it up correctly, follow the provided tutorial, which includes a step-by-step example of using the Plot feature to display Click board™ readings. To use the Plot feature in your code, use the function: plot(*insert_graph_name*, variable_name);. This is a general format, and it is up to the user to replace 'insert_graph_name' with the actual graph name and 'variable_name' with the parameter to be displayed.

Software Support
Library Description
This library contains API for Thermo 24 Click driver.
Key functions:
thermo24_soft_reset
This function performs the software reset by sending the soft reset command by using I2C serial interface.thermo24_read_serial
This function reads the 4-byte chip serial number using I2C serial interface.thermo24_read_temperature
This function reads the temperature in Celsius with the specified measurement precision.
Open Source
Code example
The complete application code and a ready-to-use project are available through the NECTO Studio Package Manager for direct installation in the NECTO Studio. The application code can also be found on the MIKROE GitHub account.
/*!
* @file main.c
* @brief Thermo24 Click example
*
* # Description
* This example demonstrates the use of Thermo 24 Click board by reading and displaying
* the temperature measurements.
*
* The demo application is composed of two sections :
*
* ## Application Init
* Initializes the driver and logger, then performs the software reset of the Click board
* and reads and displays its serial number.
*
* ## Application Task
* Reads the temperature measurement in Celsius and displays the results on the USB UART
* approximately once per second.
*
* @author Stefan Filipovic
*
*/
#include "board.h"
#include "log.h"
#include "thermo24.h"
static thermo24_t thermo24;
static log_t logger;
void application_init ( void )
{
log_cfg_t log_cfg; /**< Logger config object. */
thermo24_cfg_t thermo24_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.
thermo24_cfg_setup( &thermo24_cfg );
THERMO24_MAP_MIKROBUS( thermo24_cfg, MIKROBUS_1 );
if ( I2C_MASTER_ERROR == thermo24_init( &thermo24, &thermo24_cfg ) )
{
log_error( &logger, " Communication init." );
for ( ; ; );
}
if ( THERMO24_ERROR == thermo24_soft_reset ( &thermo24 ) )
{
log_error( &logger, " Software reset." );
for ( ; ; );
}
uint32_t serial_num;
if ( THERMO24_OK == thermo24_read_serial ( &thermo24, &serial_num ) )
{
log_printf ( &logger, " Serial Number: 0x%.8LX\r\n", serial_num );
}
log_info( &logger, " Application Task " );
}
void application_task ( void )
{
float temperature;
if ( THERMO24_OK == thermo24_read_temperature ( &thermo24, THERMO24_MEASURE_PRECISION_HIGH, &temperature ) )
{
log_printf ( &logger, " Temperature: %.2f C\r\n\n", temperature );
Delay_ms ( 1000 );
}
}
int main ( void )
{
/* Do not remove this line or clock might not be set correctly. */
#ifdef PREINIT_SUPPORTED
preinit();
#endif
application_init( );
for ( ; ; )
{
application_task( );
}
return 0;
}
// ------------------------------------------------------------------------ END
Additional Support
Resources
Category:Temperature & humidity