Thermostat Click Board
Thermostat Click Board
The Thermostat Click Board™ is based on the Maxim MAX7502 IC digital temperature sensor. It also provides an over-temperature 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 G6D PCB power relay can control up to 5A, 250V AC/30V DC loads.
Software Support
Code examples for the Thermostat Click Board™, 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.
1 // Main program 2 void main() 3 { 4 5 // MAX7502 temperature controller IC 6 7 // MAX7502 Initialization 8 TEMP = 0; // Thermostat function disabled - Output Relay disconnected 9 TRES = 0; // Apply Reset procedure 10 delay_ms(150); 11 TRES = 1; // Temperature controller is in default state and ready for work 12 13 // MAX7502 Configuration 14 Set_CONFIG(0); // Set parameters in configuration register 15 // refer to MAX7502 datasheet and click board schematic in order to 16 // set right parameters for intended application: 17 // e.g. set OS output pin polarity for using the chip sensor in 18 // processes of Heating (bit1=0) or Cooling (bit1=1) 19 // or set the output function of the same pin to be Comparator (bit2=0) 20 // or Interrupt logic (bit2=1) in order to use the sensor for hysterezis 21 // temp ON/OFF control (real process) or trivial ON/OFF control 22 // In this example the chip is configured for heating 23 Set_TEMP_REF(REF_TEMP); // Set referent temperature T = 22 C (Output relay is ON until the environment 24 // temperature has reach that value) 25 Set_TEMP_HYST(HYST_TEMP); // Output Relay is OFF until the temperature falls below HYST value 26 27 TEMP = 1; // Thermostat enabled - Output Relay connected to OS output pin of MAX7502 28 29 30 31 current_temp = REF_TEMP; 32 old_MSB = 0; 33 temp_MSB = 0; 34 temp_changed = false; 35 36 37 // Temperature read loop - temperature controlling process 38 while (1) 39 { 40 Temp_read(); // Read 9-bit temperature value from MAX7502's register space 41 delay_ms(200); // +-0.5 C fraction neglected in this example 42 } 43 44 }
Thermostat Click Board
Frequently Asked Questions
Have a Question?
Be the first to ask a question about this.