The Click board™ is specially designed so it retains the specified characteristics of the sensor IC. Equipped with this sophisticated, accurate and simple to use sensor IC, it can be used for measuring and monitoring the temperature in a whole range of applications, such as the PC case and other internal components temperature monitoring, office equipment and entertainment systems thermal monitoring, general purpose thermal measurement, and similar digital thermal measurement applications, that require a precise thermal measurement and an overtemperature alert.
HOW DOES IT WORK?
The active temperature sensing component on Thermo 12 click is the ADT7420, a high accuracy temperature sensor IC with the 2-Wire interface, from Analog Devices. The Click board™ itself has a reasonably small number of components because most of the measurement circuitry is already integrated on the ADT7420 sensor. The I2C / SMBus compatible serial interface lines, along with the INT and CT pins, 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), INT pin is routed to the INT pin of the mikroBUS™, while the CT pin is routed to the CS pin of the mikroBUS™.
The sensor IC uses the I2C/SMBus compatible communication interface. There are thirteen registers, used to set the high and low temperature limits, temperature hysteresis for the interrupt events, configuration register used to store all the working parameters, status – read-only register which holds the sampled temperature data, and more. More information about all the registers can be found in the ADT7420 datasheet. However, provided library contains functions that simplify the use of the Thermo 12 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 internal ADC converter, with the resolution of 16 bits. Thanks to high resolution ADC, the step size can be as small as 0.0073°C. By default, the ADC resolution is set to 13 bits (0.0625°C step size), but it is a user programmable mode that can be changed through the serial interface (I2C) up to 16 bits. The INT 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 by setting POL bit in the configuration register. 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. There is also a CT pin which gives an alert when the measured temperature exceeds the limit value. A critical overtemperature value is stored in the TCRIT registers.
Both, the INT pin and CT pins can operate in comparator and interrupt event modes. When working in the Comparator mode, these pins will be triggered whenever a temperature limit is exceeded. The pins 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 therm mode, the INT and CT pins will stay asserted when the temperature exceeds the value in the high limit register. When the temperature drops below the hysteresis level, the INT pin will be cleared. 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, while the ADDR SEL jumper allows the user to switch between two different I2C addresses.
Specifications
Pinout diagram
This table shows how the pinout on Thermo 12 click corresponds to the pinout on the mikroBUS™ socket (the latter shown in the two middle columns).
Onboard settings and indicators
Label | Name | Default | Description |
---|---|---|---|
JP1 | VCC SEL | Left | Power supply voltage selection: left position 3V3, right position 5V |
JP2 | ADDR SEL | Left | I2C address selection: left position 0, right position1 |
LD1 | PWR | – | Power LED indicator |
Thermo 12 click electrical specifications
Description | Min | Typ | Max | Unit |
---|---|---|---|---|
Temperature Range (accuracy ±0.25˚C) | -20 | – | +105 | °C |
Temperature Range (accuracy ±0.2˚C) | -10 | – | +85 | °C |
Communication speed | 0 | – | 400 | kHz |
Software support
We provide a library for the Thermo 12 click on our LibStock page, as well as a demo application (example), developed using MikroElektronika compilers. The demo can run on all the main MikroElektronika development boards.
Library Description
Library contains functions for:
- getting INT and CS pin states
- getting and setting register values
- issuing soft reset command
- getting temperature value
- getting status register value
- setting high, low and critical threshold values
- setting hysteresis value
- evice initialization.
Key functions:
uint8_t thermo12_init(void)
– initializes the device.uint8_t thermo12_getStatus(void)
– returns status register value.float thermo12_getTemperature(void)
– returns temperature value.
Examples description
The application is composed of the three sections :
- System Initialization – Initializes INT pin, CS pin, I2C module and LOG module.
- Application Initialization – Initializes I2C driver, click board and sets thresholds.
- Application Task – Checks status register value, logs messages and temperature value.
void applicationTask( ) { status_register = thermo12_getStatus( ); if (( status_register & _THERMO12_RDY_MASK ) == _THERMO12_RDY_MASK ) { mikrobus_logWrite( "> Temperature : normal", _LOG_LINE ); temperature = thermo12_getTemperature( ); FloatToStr( temperature, text ); mikrobus_logWrite( "> Temperature : ", _LOG_TEXT ); mikrobus_logWrite( text, _LOG_TEXT ); mikrobus_logWrite( celsius, _LOG_LINE ); Delay_ms(500); } if (( status_register & _THERMO12_T_LOW_MASK ) == _THERMO12_T_LOW_MASK ) { mikrobus_logWrite( "> Temperature : low", _LOG_LINE ); temperature = thermo12_getTemperature( ); FloatToStr( temperature, text ); mikrobus_logWrite( "> Temperature : ", _LOG_TEXT ); mikrobus_logWrite( text, _LOG_TEXT ); mikrobus_logWrite( celsius, _LOG_LINE ); Delay_ms(500); } if (( status_register & _THERMO12_T_CRIT_MASK ) == _THERMO12_T_CRIT_MASK ) { mikrobus_logWrite( "> Temperature : critical", _LOG_LINE ); temperature = thermo12_getTemperature( ); FloatToStr( temperature, text ); mikrobus_logWrite( "> Temperature : ", _LOG_TEXT ); mikrobus_logWrite( text, _LOG_TEXT ); mikrobus_logWrite( celsius, _LOG_LINE ); Delay_ms(500); } else if (( status_register & _THERMO12_T_HIGH_MASK ) == _THERMO12_T_HIGH_MASK ) { mikrobus_logWrite( "> Temperature : high", _LOG_LINE ); temperature = thermo12_getTemperature( ); FloatToStr( temperature, text ); mikrobus_logWrite( "> Temperature : ", _LOG_TEXT ); mikrobus_logWrite( text, _LOG_TEXT ); mikrobus_logWrite( celsius, _LOG_LINE ); Delay_ms(500); } }
The full application code, and ready to use projects can be found on our LibStock page.
Other mikroE Libraries used in the example:
I2C
UART
Conversions
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. The terminal available in all MikroElektronika compilers, or any other terminal application of your choice, can be used to read the message.
mikroSDK
This click board is supported with mikroSDK – MikroElektronika Software Development Kit. To ensure proper operation of mikroSDK compliant click board demo applications, mikroSDK should be downloaded from the LibStock and installed for the compiler you are using.
For more information about mikroSDK, visit the official page.