Table of contents

If you need a temperature sensor and relay in one device, you should look no further than Thermostat click. It can be used to measure environmental temperature and to directly switch ON/OFF cooling and heating devices, performing all the functions of a thermostat.

Thermostat click carries the MAX7502 IC digital temperature sensor, that also provides an overtemperature alarm/interrupt/shutdown output, and an SN74LVC1G126 single bus buffer from Texas Instruments. MAX7502 IC can measure temperatures from -25°C to +100°C, within the accuracy of ±1.5°C.

The click runs on either 3.3V or 5V power supply and communicates with the target MCU over I2C interface.

Temperature range

The IC can measure temperatures from -25°C to +100°C, within the accuracy of ±1.5°C.

MAX7502 temperature sensor

MAX7502 temperature sensor measures temperature, converts the data into digital form using a sigma-delta ADC, and communicates the conversion results through an I2C-compatible 2-wire serial interface.

It accepts standard I2C commands to read the data, set the overtemperature alarm trip thresholds, and configure other characteristics.

Low power consumption

The MAX7502 temperature sensor typically uses only around 250 µA, and in shutdown mode around 3 µA. With such low power consumption, it is very suitable for home automation devices.

Enable/disable thermostat functionality

There is also the TE (thermostat enable) pin on the mikroBUS™ pin socket for enabling (high level) or disabling (low) of the thermostat functionality. This is accomplished via the SN74LVC1G126 single bus buffer with 3-state output IC, which serves as an electronic switch between temperature sensor IC output pin and the relay driver circuit.

This way the relay can be permanently disconnected from the sensor IC output. A feature like this can be useful when the sensor IC is only used as an measuring device, or if the thermostat needs to be temporarily disabled.

Temperature sensor and relay in one device, it can measure environmental temperature and directly switch ON/OFF cooling and heating devices

Interface

GPIO,I2C

Input Voltage

3.3V or 5V

Compatibility

mikroBUS

Click board size

L (57.15 x 25.4 mm)

Pinout diagram

This table shows how the pinout on Thermostat click corresponds to the pinout on the mikroBUS™ socket (the latter shown in the two middle columns).

Notes

Pin

Pin

Notes

Hardware Reset for MAX7502

RST#

2

RST

INT

15

NC

Thermostat enable

TE

3

CS

TX

14

NC

NC

4

SCK

RX

13

NC

NC

5

MISO

SCL

12

SCL

Serial Data Input/Output Line

NC

6

MOSI

SDA

11

SDA

Serial Data Clock Input

Power supply

+3.3V

7

+3.3V

+5V

10

+5V

Power supply

Ground

GND

8

GND

GND

9

GND

Ground

Jumpers and settings

The table below gives information about the onboard jumpers.

Designator

Name

Default Position

Default Option

Description

JP1

PWR.SEL.

Left

3.3V

Power Supply Voltage Selection 3.3V/5V, left position 3.3V, right position 5V

LEDs, buttons and switches

The following table gives information about onboard LEDs, buttons and switches.

Designator

Name

Type (LED, BUTTON…)

Description

LD1

PWR

Power LED

CN1

2-pole PCB terminal block 5.08mm

For output device connection (heater/fan…)

Programming

Code examples for Thermostat click, written for MikroElektronika hardware and compilers are available on Libstock.

Code snippet

This code snipped for EasyMx PRO v7 for STM32F107VC MCU initializes the temperature sensor by writing into its registers and, then it reads the temperature in an endless loop. If the measured temperature gets below the hysteresis temperature, the output relay is ON.

The sensor is configured for heating, without fault queue bits, when OS output is active low, with comparator logic and in normal operation.