Temperature Indicator Using AT89C52:-
Different temperature indicator project with discrete component is already published. 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”.
Circuit description:-
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.
TABLE 1
| ||
DS1621 Command Set
| ||
Instruction
|
Description
|
Protocol
|
Read Temperature
|
Reads last converted temperature value from temperature register.
|
Aah
|
Read Counter
|
Reads value of count remaining from counter.
|
A8h
|
Read Slope
|
Reads value of slope accumulator.
|
A9h
|
Start Convert T
|
Indicates temperature conversion.
|
EEh
|
Stop Convert T
|
Halts temperature conversion.
|
22h
|
Access TH
|
Reads or writes low temperature limit value into TH register.
|
A1h
|
Access TL
|
Reads or writes low temperature limit value into TL register.
|
A2h
|
Access Configuration
|
Reads or writes configuration data to configuration register.
|
Ach
|
TABLE 2
| |
Pin Connection of the LCD
| |
Pin No.
|
Functions
|
Pin 1
|
Ground (Gnd)
|
Pin 2
|
+Vcc
|
Pin 3
|
V0 (display intensity control)
|
Pin 4
|
RS (connected to pin P3.2 of AT89C52)
|
Pin 5
|
R/W (connected to pin P3.3 of AT89C52)
|
Pin 6
|
EN (connected to pin P3.4 of AT89C52)
|
Pin 7
|
D0 (connected to pin P1.0 of AT89C52)
|
Pin 8
|
D1 (connected to pin P1.1 of AT89C52)
|
Pin 9
|
D2 (connected to pin P1.1 of AT89C52)
|
Pin 10
|
D3 (connected to pin P1.3 of AT89C52)
|
Pin 11
|
D4 (connected to pin P1.4 of AT89C52)
|
Pin 12
|
D5 (connected to pin P1.5 of AT89C52)
|
Pin 13
|
D6 (connected to pin P1.6 of AT89C52)
|
Pin 14
|
D7 (connected to pin P31.7 of AT89C52)
|
Pin 15
|
Backlight +Vcc (not used)
|
Pin 16
|
Backlight Gnd (not used)
|
PARTS LIST
Resistors (all ¼-watt, ± 5% Carbon) |
R1 = 1 KΩ
R2 = 47 KΩ
R3 = 10 KΩ
R4, R5 = 4.7 KΩ
VR1 = 1 KΩ (Preset)
|
Capacitors |
C1 = 470 µF/25V (Electrolytic)
C2 – C4 = 0.1 µF (Ceramic)
C5 = 10 µF/16V (Electrolytic)
C6, C7 = 33 pF (Ceramic)
|
Semiconductors |
IC1 = LM7805 (Voltage Regulator)
IC2 = AT89C52 (Microcontroller)
IC3 = DS1621 (Temperature Sensor)
D1 – D4 = 1N4007 (Rectifier Diode)
LED1 = RED
|
No comments:
Post a Comment