Unlock the power of temperature data with our solution, enabling data-driven decisions that drive your success
A
A
Hardware Overview
How does it work?
Thermo 7 Click is based on the MCP9800, a high-accuracy temperature sensor IC with the 2-Wire interface, from Microchip. The Click board™ itself has a reasonably small number of components because most of the measurement circuitry is already integrated on the MCP9800 sensor. The I2C / SMBus compatible serial interface lines, along with the ALERT pin, which also works in the open drain configuration, are pulled up by the onboard resistors. The 2-Wire lines are routed to the respective I2C lines of the mikroBUS™ (SCK and SDA), while the ALERT pin is routed to the INT pin of the mikroBUS™. The sensor IC uses the I2C/SMBus compatible communication interface. There are four registers, used to set the temperature limit, temperature hysteresis for the interrupt events, configuration register used to store all the working parameters, and the read-only register which holds the sampled temperature data. More information about all the registers can be found in the MCP9800 datasheet. However, provided library contains functions that simplify the use of the Thermo 7 click. The included application example demonstrates their functionality and it can be used as a reference for custom design. An analog signal from the thermal sensor is sampled by the sigma-delta ADC converter, with the selectable resolution of 9, 10, 11 and 12 bits. The sampling resolution affects the temperature step sizes, as well as the time
required to complete the conversion. The step sizes vary between the 0.5°C with 30ms of conversion time for 9bit sampling, and 0.0625°C with 240ms of conversion time for 12bit resolution. The selectable resolution allows a compromise to be made between the resolution and the conversion time, depending on the application requirements. The ALERT pin is used to trigger an interrupt event on the host MCU. This pin has a programmable polarity: it can be set to be asserted either to a HIGH logic level or to a LOW logic level. Since the Click board™ features a pull-up resistor, it is advised to set the polarity so that the asserted state drives the pin to a LOW logic level. A special mechanism is employed to reduce false ALERT triggering. This mechanism includes queueing of the cycles in which the temperature limit is exceeded. As already described, the ALERT pin is routed to the INT pin of the mikroBUS™. The ALERT pin can be set to work in two different modes: Comparator mode and Interrupt mode. When working in the Comparator mode, this pin will be triggered whenever a temperature limit is exceeded. The ALERT pin stays asserted until the temperature drops below the hysteresis level. Both values are set in the respective temperature registers (limit and hysteresis). This mode is useful for thermostat-like applications: it can be used to power down a system in case of overheating or turn off the cooling fan if the temperature is low
enough. If set to work in the Interrupt mode, the ALERT pin will stay asserted after exceeding the temperature limit, until any internal register is read. When the temperature drops below the hysteresis level, the ALERT pin will be asserted again, waiting for the internal registers to be read once again. This mode is used to trigger an interrupt on the host MCU, which is supposed to read the sensor when the interrupt event is generated. The device can be set to work in several different power modes. It can be set to continuously sample the temperature measurements, it can be set to work in the one-shot mode, and it can be set to stay in the shutdown mode. The shutdown mode consumes the least power, keeping all the internal sections but the communication section, unpowered. The one-shot mode allows the device to stay in the shutdown mode, run a single conversion cycle on demand, and the revert back to the shutdown mode. This allows for a lower power consumption. The design of the Click board™ itself is such that the thermal radiation from other components, which might affect the environmental temperature readings of the sensor, is reduced. The onboard SMD jumper labeled as VCC SEL allows voltage selection for interfacing with both 3.3V and 5V MCUs.
Features overview
Development board
EasyPIC v8 is a development board specially designed for the needs of rapid development of embedded applications. It supports many high pin count 8-bit PIC microcontrollers from Microchip, regardless of their number of pins, and a broad set of unique functions, such as the first-ever embedded debugger/programmer. The development board is well organized and designed so that the end-user has all the necessary elements, such as switches, buttons, indicators, connectors, and others, in one place. Thanks to innovative manufacturing technology, EasyPIC v8 provides a fluid and immersive working experience, allowing access anywhere and under any
circumstances at any time. Each part of the EasyPIC v8 development board contains the components necessary for the most efficient operation of the same board. In addition to the advanced integrated CODEGRIP programmer/debugger module, which offers many valuable programming/debugging options and seamless integration with the Mikroe software environment, the board also includes a clean and regulated power supply module for the development board. It can use a wide range of external power sources, including a battery, an external 12V power supply, and a power source via the USB Type-C (USB-C) connector.
Communication options such as USB-UART, USB DEVICE, and CAN are also included, including the well-established mikroBUS™ standard, two display options (graphical and character-based LCD), and several different DIP sockets. These sockets cover a wide range of 8-bit PIC MCUs, from the smallest PIC MCU devices with only eight up to forty pins. EasyPIC v8 is an integral part of the Mikroe ecosystem for rapid development. Natively supported by Mikroe software tools, it covers many aspects of prototyping and development 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
PIC
MCU Memory (KB)
32
Silicon Vendor
Microchip
Pin count
40
RAM (Bytes)
2048
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 via UART Mode
1. Once the code example is loaded, pressing the "FLASH" button initiates the build process, and programs it on the created setup.
2. After the programming is completed, click on the Tools icon in the upper-right panel, and select the UART Terminal.
3. After opening the UART Terminal tab, first check the baud rate setting in the Options menu (default is 115200). If this parameter is correct, activate the terminal by clicking the "CONNECT" button.
4. Now terminal status changes from Disconnected to Connected in green, and the data is displayed in the Received data field.
Software Support
Library Description
This library contains API for Thermo 7 Click driver.
Key functions:
thermo7_get_hysteresis_temperature
- This fuction gets Hysteresis Temperature.thermo7_set_limit_temperature
- This fuction sets limit temperature.thermo7_get_interrupt
- This fuction reads state of interrupt pins.
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
* \brief Thermo7 Click example
*
* # Description
* This application reads ambient temperature.
*
* The demo application is composed of two sections :
*
* ## Application Init
* Initializes device.
*
* ## Application Task
* Reads ambient temperature and logs to USBUART every 1 seconds.
*
* \author MikroE Team
*
*/
// ------------------------------------------------------------------- INCLUDES
#include "board.h"
#include "log.h"
#include "thermo7.h"
// ------------------------------------------------------------------ VARIABLES
static thermo7_t thermo7;
static log_t logger;
// ------------------------------------------------------ APPLICATION FUNCTIONS
void application_init ( void )
{
log_cfg_t log_cfg;
thermo7_cfg_t cfg;
/**
* 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.
thermo7_cfg_setup( &cfg );
THERMO7_MAP_MIKROBUS( cfg, MIKROBUS_1 );
thermo7_init( &thermo7, &cfg );
thermo7_set_configuration( &thermo7, THERMO7_CONFIG_COMPARATOR_MODE | THERMO7_CONFIG_ALERT_POLARITY_ACTIVE_HIGH );
thermo7_set_resolution( &thermo7, THERMO7_CONFIG_ADC_RESOLUTION_12bit );
}
void application_task ( void )
{
float ambient_temperature;
ambient_temperature = thermo7_read_ambient_temperature( &thermo7 );
log_printf( &logger, " Ambient temperature : %f C\r\n", ambient_temperature
);
Delay_ms( 1000 );
}
void main ( void )
{
application_init( );
for ( ; ; )
{
application_task( );
}
}
// ------------------------------------------------------------------------ END
Additional Support
Resources
Category:Temperature & humidity