Temperature Indicator Using AT89C52
Different temperature indicator project with discrete component is already published in www.electronicsproject.org. Now, here is a microcontroller based temperature indicator with LCD for better and precise reading. A temperature sensor DS1621 is used here for better result. As we know that programming language “C” is less complicated with well-defined syntax in compare to Assembly language so we write program for microcontroller in “C”.
The circuit of temperature indicator is designed around microcontroller AT89C52 where DS1621 is used as temperature sensor. The block diagram of temperature indicator using AT89C52 is shown in figure 1.
The temperature sensor IC3 is used to sense temperature and read as 9-bit value. The pin 1 and 2 of sensor (IC3) is connected to pin 11 and 10 respectively of microcontroller (IC2) as shown in circuit diagram. The sensor (IC3) activates its thermal alarm output in exceeding of user-defined high temperature until temperature drop below user-defined low temperature. Non-volatile memory is used to store user-defined temperature.
A crystal oscillator XTAL1 is connected to XTAL pin of microcontroller (i.e. pin 18 and 19) for operating of microcontroller. A high pulse on RST pin (pin 9) through capacitor C5 is given while the oscillator is running for reset the microcontroller. Pin 31 is also connected to +Ve supply for execution of internal program. During flash programming at 12V programming is selected pin 31 is also used to receive 12V programming enable voltage.
The 16*1 LCD is used as display where VR1 is used to control the intensity of display. The connection of LCD is given in table 2 where pin 15 and 16 is not used.
Software:- A cross-complier C51 version 7.10 from keil software is used here for compiling the program code written in C.
DS1621 Command Set
Reads last converted temperature value from temperature register.
Reads value of count remaining from counter.
Reads value of slope accumulator.
Start Convert T
Indicates temperature conversion.
Stop Convert T
Halts temperature conversion.
Reads or writes low temperature limit value into TH register.
Reads or writes low temperature limit value into TL register.
Reads or writes configuration data to configuration register.
Pin Connection of the LCD
V0 (display intensity control)
RS (connected to pin P3.2 of AT89C52)
R/W (connected to pin P3.3 of AT89C52)
EN (connected to pin P3.4 of AT89C52)
D0 (connected to pin P1.0 of AT89C52)
D1 (connected to pin P1.1 of AT89C52)
D2 (connected to pin P1.1 of AT89C52)
D3 (connected to pin P1.3 of AT89C52)
D4 (connected to pin P1.4 of AT89C52)
D5 (connected to pin P1.5 of AT89C52)
D6 (connected to pin P1.6 of AT89C52)
D7 (connected to pin P31.7 of AT89C52)
Backlight +Vcc (not used)
Backlight Gnd (not used)
Resistors (all ¼-watt, ± 5% Carbon)
R1 = 1 KΩ
R2 = 47 KΩ
R3 = 10 KΩ
R4, R5 = 4.7 KΩ
VR1 = 1 KΩ (Preset)
C1 = 470 µF/25V (Electrolytic)
C2 – C4 = 0.1 µF (Ceramic)
C5 = 10 µF/16V (Electrolytic)
C6, C7 = 33 pF (Ceramic)
IC1 = LM7805 (Voltage Regulator)
IC2 = AT89C52 (Microcontroller)
IC3 = DS1621 (Temperature Sensor)
D1 – D4 = 1N4007 (Rectifier Diode)
LED1 = RED