Professional Documents
Culture Documents
Temperature Controller Using 89c51project of E.C
Temperature Controller Using 89c51project of E.C
Temperature Controller Using 89c51project of E.C
CERTIFICATE
TEMPERATURE CONTROLLER
USING AT89C51
Within Four walls of
SWAMI SACHCHIDANAND POLYTECHNIC, VISNAGAR
Date of Submission : _________________________________
` 2
ACKNOWLEDGEMENT:
INDEX
` 3
CONTENT PAGE NO.
CH:-1 INTRODUCTION 6
1.1 GENERAL INTRODUCTION 6
5.1 IC 89C51 17
5.2 LM 35 (SENSOR) 26
5.3 ANALOG TO DIGITAL CONVERTER 29
5.4 DISPLAY 30
5.5RELAY 33
5.6 RESISTOR 34
5.7 CAPACITOR 35
5.8 TRANSFORMER 36
5.9 LED 37
5.10 SOCKET 39
5.11 TRANSISTOR (BC557) 40
` 4
5.12 LM7805 41
5.13 DIODE 1N4007 45
5.14 SWITCH 46
CH:-6 PROGRAMM OF TEMPERATURE 48
CONTROLLER
6.1 PROGRAMM 48
8.1 ADVANTAGE 59
8.2 DISADVANTAGE 59
` 5
CH:-1 INTRODUCTION
The circuit operates off a simple power supply using an IC 7805 regulator. A 12Vac is
rectified and filtered by using a bridge rectifier and filter capacitor. On the +12V rail, a 7805
regulator is used to regulate the output to a stable 5V.
` 6
CH:-2 COMPONENT LIST
Resistors:-
Capacitors:-
Semiconductors:-
` 7
U4 ---- LM35 – 3-Pin Temperature Sensor IC
D1 ---- 3V – Zener Diode
D5-D8 ---- 1N4007 – Rectifier Diode
Q1,Q2, Q3 ---- BC557 – PNP Transistor
Q4,Q5 ---- BC547 –NPN Transistor
DS1-DS4 ---- LT542 – 7- Segment Common anode display
X1 ---- 11.0592MHz Crystal
L8 ---- LED Any Color
Miscellaneous:-
` 8
CH:-3 CIRCUIT DIAGRAM & POWER SUPPIY
3.1CIRCUIT DIAGRAM
` 9
3.2 POWER SUPPLY:-
Bridge rectifier is use to convert 12 AC into DC voltage. Two supply voltage are
required for the circuit. A 12v AC fro transformer is connected to bridge rectifier
(D1-D4). All ICs are supplied with a regulated 5V from a LM7805 fixed voltage
regulator. The unregulated voltage of approximately 12V required for the relay
driving circuit.
` 10
3.3 RELAY AND BUZZER DRIVER CKT:-
` 11
3.4 PCB LAYOUT:
` 12
3.5 MAIN BOARD COMPONENT MOUNTING
` 13
CH:-4 WORKING OF TEMPERATURE CONTROLLER:-
4.1 WORKING:
The diode used in the circuit is IN4007 6V. The IN4007 is a semiconductor silicon
rectifier diode which from a full wave rectifier circuit which makes flow current in both
side and gives D.C. voltage to the control circuit.
The capacitor has been derived from the word capacity to store electrons. A number of
different types of electric materials. Such as vacuums, plastic, glass, ceramic, mica,
aluminum oxide and tantalum oxide etc. the application of capacitor has also been
growing with continuous improvement in characteristic of capacitor due to for blocking
DC but also used for application such as filtering of electrical singles, tuning, and
capacitor is one of the most used components in electronic circuits. In any circuit, the
tendency of the circuit to oppose any charges in voltage is define as its capacitance.
Most digital logic circuits and processor need a 5V power supply. To use these parts we
need to build a regulated 5v source. Usually you start with an urgently power supply
ranging from 9V to 24V DC (a 12V power supply is included with the
microcontroller.). To make 5V power supply, we use a LM7805 voltage regulator IC.
The LM7805 is simple to use. You simply connect the positive lead of your unregulated
DC power supply (anything from 5VDC) to the input port connected the negative lead
to the common port and then when you turn on the power, you get a 5V supply from the
output pin. The 5 voltage output is connected to the blue ground line of the breadboard
and a jumper wire is used to connected ground from there to the common (ground) port
of the 7805.
Now the IC 89C51 lower power high performance CMOS 8-Bit microcontroller with
4KB of flash programmable and erasable read only memory. The device is
manufactured using Atmels’ high density non-violating memory technology. On-chip
flash allows the program memory to be re-programmed in system or by conventional
` 14
no-volatile memory programmer. By combining a versatile 8-bit CPU with flash on a
monolithic chip. The 89C51 provides the following standard features.
In addition, the AT89C51 is designed with static logic for operation down to 0 frequency
and support two software selectable power saving modes. The ideal Modesto’s the CPU
while flowing the RAM, time/counters, serial port and interrupt system to continue
functioning.
In our circuit key pad is made using four paces of micro switches.
- Switch 1:- for reset
- Switch 2:- it is used to set cutoff temperature. Press SW2 switch and
Set the cutoff temperature with help of SW3 and SW4.
- Switch 3:- to decrease the set temperature.
- Switch 4:- to increase the set temperature.
` 15
In our circuit we have used ADC0804 which used to convert analog to digital and it
applied to the microcontroller IC and display the temperature on LED display using
sensor IC LM35DZ. LM35DZ temCperature sensor IC which is connected to the
ADC0804 for giving the analog signal. In this LM35DZ sense the temperature at
10mV per centigrade.
Using switch 2 set the cut off temperature with using switch 3 & 4.which is used to
increase or decrease the cutoff temperature. After temperature is set 50 centigrade
we can use it in application to control temperature.
Now when the temperature goes high more than 50 centigrade the relay start to
work through Darlington pair transistor and LED will be on at that time. Normally
relay is off but when the temperature goes high more than cutoff temperature the
relay start to work and temperature will be control.
` 16
CH:-5 DETAILS OF COMPONENT
5.1 IC89C51
Photograph
FIG: IC89C51
` 17
Features
Description
Compatible with the industry-standard MCS-51 instruction set and pin out.
` 18
The on-chip Flash allows the program memory to be reprogrammed in-system or by
a conventional nonvolatile memory programmer.
By combining a versatile 8-bit CPU with Flash On a monolithic chip, the Atmel
AT89C51 is a powerful microcomputer which provides a highly-flexible and cost-
effective solution to many embedded control applications.
Pin Configurations
The AT89C51 provides the following standard features: 4Kbytes of Flash, 128
bytes of RAM, 32 I/O lines, two 16-bit timer/counters, five vector two-level
interrupt architecture, a full duplex serial port, on-chip oscillator and clock
circuitry.
In addition, the AT89C51 is designed with static logic for operation down to zero
frequency and supports two software selectable power saving modes.
The Idle Mode stops the CPU while allowing the RAM, timer/counters, serial port
and interrupt system to continue functioning.
The Power-down Mode saves the RAM contents but freezes the oscillator
disabling all other chip functions until the next hardware reset.
` 19
Pin ConfiguratioNS
` 20
Pin Number Description
1-8 P1.0 - P1.7 - Port 1
9 RST - Reset
10 - 17 P3.0 - P3.7 - Port 3
18 XTAL2 - Crystal
19 XTAL1 - Crystal
20 GND - Ground
21 - 28 P2.0 - P2.7 - Port 2
29 PSEN - Program Store Enable
30 ALE - Address Latch Enable
31 EA - External Access Enable
32 - 39 P0.7 - P0.1 - Port 0
40 Vcc - Positive Power Supply
Pin Description:-
VCC
Supply voltage.
GND
Ground.
Port 0
i. Port 0 is an 8-bit open-drain bi-directional I/O port. As an output port, each
pin can sink eight TTL inputs.
ii. When 1s are written to port 0 pins, the pins can be used as high impedance
inputs.
iii. Port 0 may also be configured to be the multiplexed low order address/data
bus during accesses to external program and data memory. In this mode P0
has internal pull-ups.
iv. Port 0 also receives the code bytes during Flash programming, and outputs the
code bytes during program verification.
v. External pull-ups are required during program verification.
` 21
Port 1
i. Port 1 is an 8-bit bi-directional I/O port with internal pull-ups.
ii. The Port 1 output buffers can sink/source four TTL inputs.
iii. When 1s are written to Port 1 pins they are pulled high by the internal pull-
ups and can be used as inputs. As inputs, Port 1 pins that are externally
being pulled low will source current (IIL) because of the internal pull-ups.
iv. Port 1 also receives the low-order address bytes during Flash programming
and verification.
Port 2
i. Port 2 is an 8-bit bi-directional I/O port with internal pull-ups.
ii. The Port 2 output buffers can sink/source four TTL inputs.
iii. When 1s are written to Port 2 pins they are pulled high by the internal pull-ups
and can be used as inputs. As inputs, Port 2 pins that are externally being
pulled low will source current (IIL) because of the internal pull-ups.
iv. Port 2 emits the high-order address byte during fetches from external program
memory and during accesses to external data memory that uses 16-bit
addresses (MOVX @ DPTR). In this application, it uses strong internal pull-
ups when emitting 1s.
v. During accesses to external data memory that uses 8-bit addresses (MOVX @
RI), Port 2 emits the contents of the P2 Special Function Register.
vi. Port 2 also receives the high-order address bits and some control signals
during Flash programming and verification.
Port 3
i. Port 3 is an 8-bit bi-directional I/O port with internal pull-ups.
ii. The Port 3 output buffers can sink/source four TTL inputs.
iii. When 1s are written to Port 3 pins they are pulled high by the internal pull-ups
and can be used as inputs. As inputs, Port 3 pins that are externally being pulled
low will source current (IIL) because of the pull-ups.
iv. Port 3 also serves the functions of various special features of the AT89C51 as
listed below:
` 22
Port Pin Alternate Functions
Port 3 also receives some control signals for Flash programming and verification.
RST
Reset input. A high on this pin for two machine cycles while the oscillator is
running resets the device.
ALE/PROG
i. Address Latch Enable output pulse for latching the low byte of the address
during accesses to external memory.
ii. This pin is also the program pulse input (PROG) during Flash programming.
iii. In normal operation ALE is emitted at a constant rate of 1/6 the oscillator
frequency, and may be used for external timing or clocking purposes. Note,
` 23
however, that one ALE pulse is skipped during each access to external Data
Memory.
iv. If desired, ALE operation can be disabled by setting bit 0 of SFR location
8EH.
v. With the bit set, ALE is active only during a MOVX or MOVC instruction.
Otherwise, the pin is weakly pulled high. Setting the ALE-disable bit has no
effect if the microcontroller is in external execution mode
PSEN
i. Program Store Enable is the read strobe to external program memory.
ii. When the AT89C51 is executing code from external program memory, PSEN
is activated twice each machine cycle, except that two PSEN activations are
skipped during each access to external data memory.
EA/VPP
i. External Access Enable.
ii. EA must be strapped to GND in order to enable the device to fetch code from
external program memory locations starting at 0000H up to FFFFH.
iii. Note, however, that if lock bit 1 is programmed, EA will be internally latched
on reset.
iv. EA should be strapped to VCC for internal program executions.
v. This pin also receives the 12-volt programming enable voltage (VPP) during
Flash programming, for parts that require 12-volt VPP.
XTAL1
Input to the inverting oscillator amplifier and input to the internal clock
operating circuit.
XTAL2
Output from the inverting oscillator amplifier.
Oscillator Characteristics
i. XTAL1 and XTAL2 are the input and output, respectively, of an inverting
amplifier which can be configured for use as an on-chip oscillator, as shown in
Figure 5.
ii. Either a quartz crystal or ceramic resonator may be used. To drive the device
from an external clock source, XTAL2 should be left unconnected while
XTAL1 is driven as shown in Figure 5.
iii. There are no requirements on the duty cycle of the external clock signal, since
the input to the internal clocking circuitry is through a divide-by-two flip-flop,
` 24
but minimum and maximum voltage high and low time specifications must be
observed.
Figure
` 25
Block diagram:-
IC dimension
` 26
5.2 LM 35
The LM35 series are precision integrated-circuit temperature sensors, whose output
voltage is linearly proportional to the Celsius temperature. The LM35 thushasan
advantage over linear temperature sensors calibrated in a Kelvin as Kelvin, as the user
is not required to subtract a large constant voltage from its output to obtain
convenient Centi-grade scaling. The LM35 doesn’t require any external calibration or
trimming to provide typical accuracies of ±¼ ċ at room temperature and ±3/4 ċ Cover
a full -55to +150ċ temperature range. Low cost is assured by trimming and calibration
at the wafer level. The LM35‘s low output impedance, linear output, and precise in he
rent calibration make interfacing to readout or control circuitry especially easy.
It can be used with single power supplies, or with plus andminussupplies. As it draws
only 60µA from its supply, it has very low self-heating, less than 0.1 ċ in still air. The
LM35 is rated to operate over a -55º to +150 º C temperature range, while the LM35C
is rated for a-40 º to +110 º C range(-10 ºwith improved accuracy). The LM35 series
is available pack- aged in hermetic TO-46 transistor packages, while the LM35C,
LM35CA, and LM35D are also available in the plastic TO-92 transistor package. The
LM35D is also available in an 8-lead surface mount small outline package and a
plastic TO-220 package.
` 27
` 28
FIG:7 LM35 (SENSOR)
Features
` 29
5.3 ANALOG TO DIGITAL CONVERTER(ADC0804)
FEATURES
Eompatible with 8080 µp derivation –no inter facing logic needed-access time-135ns
Easy interface toall microprocessor,oroperates “stnd alone”
Differential analog voltage inputs
Logic input & output meet both MOS and TTL voltage level specifications
Works with 2.5v(LM336) voltage reference
On chip controller
0v to 5v analog input voltage range with saingle 5v supply
No zero adjust required
` 30
0.3”standard width 20-pin DIP package
Key Specification:-
Resolution 8-bits
Total error ±1/4Lsb, ±1/2Lsb and ±1 Lsb
Conversion time 100µs
5.4 DISPLAY
` 31
FIG: 9 DISPLAY
features
i. Small size
ii. Easy construction
iii. Low cost.
iv. Simple adjustment.
v. Easy to read from a distance.
vi. Few external components.
vii. Large 4" Digit, Easy to See and Read 3Easy to Connect with Pre-Installed
Connectors
viii. Driver IC and Resistors Pre-Installed
ix. Fully Assembled and Tested
x. Dimensions: PCB-Width - 62mm Height - 154mm,
xi. Digit-Width - 90mm Height - 123mm
xii. Low Current Consumption
xiii. High Brightness
xiv. Easy to Use
` 32
There is two type of LED.
Seven - segment display are available in two types: common anode and common
cathode ,but common anode display are most suitable for interfacing with 8051 port
pins can sink current better than sourcing it.
display dimension:-
5.5 RELAY:-
` 33
FIG:10 RELAY
PRINCIPAL:-
OPERATION:-
In relay coil is would on iron cylinder when voltage is applied to the coil the contact
of relay is strongly magnetic attract the armature at that time circuits on armature is a
mover iron of the relay.
APPLICATION:-
Is work like a switch here we used 9v, single pole relay. The input of indicator lamp
is given to relay and
` 34
5.6 RESISTOR:
FUNCTION:
Resistors restrict the flow of electric current, for example a resistor
is placed in series with alight emitting diode (LED) to limit the
current passing through the LED.
• Resistors limit or reduce the current passed across them. They do this by
having different densities of different materials within them, the most
common of which is carbon.
` 35
5.7 CAPACITOR:
FUNCTION:
Capacitors store electric charge. They are used with resistors in timing circuit because
it takes time for a capacitor to fill with change. They are used to smooth varying DC supplies
by acting as a reservoir of charge. They are also used in filter circuits because capacitors
easily pass AC (changing) signals but they block DC (constant) signals.
` 36
33 pF capacitor:
feature:
5.8 TRANSFORMER:-
FIG:11 TRANSFORMERS
` 37
1. Transformer is an electrical device and works on the electromagnetic principle.
3. When current passing through it the magnetic fields of each. Interacts with each
other and produces a voltage.
4. If the voltage at secondary is less than the input voltage than it known as a step
down transformer and vice versa.
5.9 LED:
` 38
Red led yellow Led green LED
feature:
i. High Brightness
i. Supply voltage - 7V
LED dimension:
` 39
5.10 SOCKET:
` 40
This is the socket to mount AT89C51.
Feature
5.11 TRANSISTOR(BC557):
Feature
` 41
Application
transistor dimension
` 42
5.12 LM7805 IC:
` 43
General Description:
Features:
` 44
vi. ESD Susceptibility 2 kV
Operating Conditions:
Typical Applications:
7805 dimension(mm):
` 45
5.13 Diode (1N4007):
` 46
This is the diode to protect a transistor from the back
electromotive force which occurs with the coil of the stepper
motor. It depends on the kind of the stepper motor but it is to
be OK if it is possible to pass a hundreds-of-mA electric
current.
Actual
Diode Dimention:
5.14 Switch:
` 47
.
Feature
i. Bounce Time: 10 msec.
ii. SPST momentary ON
iii. Contact resistance: 100mohm
iv. Lead type: PC
Specification
i. Rating: DC 12V 50mA
ii. Operating Force: 160±30 or 250±50gf
iii. Travel: 0.3±0.15mm
iv. Contact Resistance: 100mohm MAX.
v. Life Cycles: 100,000 Cycles MIN>
Switch Dimension
` 48
` 49
CH:-6 Program of Temperature Controller
6.1 Program
.globl _convert
.globl _main
.globl _timer_isr
.globl _count 1
.globl _delay
.globl _key
.globl _time
.globl _pro
.globl _opto
.globl _y
.globl _chipE
.globl _buffer
.globl _digit
.globl _i
.globl _chek
.globl _rm
.globl _ch
.globl _x
.globl _j
.globl _h
.globl _g
.globl _f
.globl _e
.globl _d
.globl _c
.globl _b
.globl _a
.globl _z
.globl _qz
.globl _temp
.globl _command
.globl _flag 1
.globl _temperature
.globl _water
.globl _scanLED
.globl _chip
.globl _distemp
globl _check_temp
.globl _keyexe
.globl _checkdata
.globl _setup
` 50
.globl _setdown
.globl _save
globl _manualOnOff
.globl _showOnce
.globl _comp
.globl _keydelay
.globl _pause
_P0 = 0x0080
_SP = 0x0081
DPL = 0x0082
_DPh = 0x0083
_PCON = 0x0087
_TCON = 0x0088
_TMOD = 0x0089
_TL0 = 0x008a
_TL1 = 0x008b
_TH0 = 0x008c
_TH1 = 0x008d
_P1 = 0x0090
_SCON = 0x0098
_SBUF = 0x0099
_P2 = 0x00a0
_IE = 0x00a8
_P3 = 0x00b0
_IP = 0x00b8
_PSW = 0x00d0
_ACC = 0x00e0
_A = 0x00e0
_B = 0x00f0
_p0_0 = 0x0080
_P0_1 = 0x0081
_P0_2 = 0x0082
_P0_3 = 0x0083
_P0_4 = 0x0084
_P0_5 = 0x0085
_P0_6 = 0x0086
_P0_7 = 0x0087
_ITO = 0x0088
_IE0 = 0x0089
_IT1 = 0x008a
_IE1 = 0x008b
_TR0 = 0x008c
_TF0 = 0x008d
_TR1 = 0x008e
_TF1 = 0x008f
_P1_0 = 0x0090
` 51
_P1_1 = 0x0091
_P1_2 = 0x0092
_P1_3 = 0x0093
_P1_4 = 0x0094
_P1_5 = 0x0095
_P1_6 = 0x0096
_P1_7 = 0x0097
_R1 = 0x0098
_T1 = 0x0099
_RB8 = 0x009a
_TB8 = 0x009b
_REN = 0x009c
_SM2 = 0x009d
_SM1 = 0x009e
_SM0 = 0x009f
_P2_0 = 0x00a0
_P2_1 = 0x00a1
_P2_2 = 0x00a2
_P2_3 = 0x00a3
_P2_4 = 0x00a4
_P2_5 = 0x00a5
_P2_6 = 0x00a6
_P2_7 = 0x00a7
_EX0 = 0x00a8
_ET0 = 0x00a9
_EX1 = 0x00aa
_ET1 = 0x00ab
_ES = 0x00ac
_EA = 0x00af
_P3_0 = 0x00b0
_P3_1 = 0x00b1
_P3_2 = 0x00b2
_P3_3 = 0X00b3
_P3_4 = 0X00b4
_P3_5 = 0X00b5
_P3_6 = 0x00b6
_P3_7 = 0x00b7
_RXD = 0x00b0
_TXD = 0X00b1
_INT0 = 0x00b2
_INT1 = 0x00b3
_TO = 0x00b4
_T1 = 0x00b5
_WR = 0x00b6
_RD = 0x00b7
_PX0 = 0x00b8
` 52
_PT0 = 0x00b9
_PX1 = 0x00ba
_PT1 = 0x00bb
_PS = 0x00bc
_P = 0x00d0
_FL = 0x00d1
_OV = 0x00d2
_RS0 = 0x00d3
_RS1 = 0x00d4
_F0 = 0x00d5
_AC = 0x00d6
_CY = 0x00d7
mov sp,#_start_stack – 1
1call mov a,dpl
1jmp mov rl,#1_XINIT
mov a,rl
orl a,#(1 XINIT >> 8)
mov r2,#((1_XINIT+255)>> 8)
mov dptr,#s_XINIT
mov r0,#s_XISEG
mov p2,3(s_XISEG>> 8)
movc a,@a+dptr
movx @r0,a
mov p2,#0xFF
mov r0,#1_XSEG
mov a,r0
orl a,#(1_XSEG>> 8)
mov r1,#((1_XSEG + 255)>> 8)
mov dptr,#s_XSEG
clr a
movx @dptr,a
inc dptr
mov @r0,a
mov _z,#0x00
ar2 = 0x0a
ar3 = 0x0b
ar4 = 0x0c
ar5 = 0x0d
ar6 = 0x0e
ar7 = 0x0f
ar0 = 0x08
ar1 = 0x09
` 53
push b
mov psw,#0x08
orl _TH0,#0Xdc
pop psw
pop dph
pop dpl
pop b
pop acc
reti
_main: ar2 = 0x02
ar3 = ox03
ar4 = 0x04
ar5 = 0x05
ar6 = 0x06
ar 7 = 0x07
ar0 = 0x00
ar1 = 0x01
mov _pro.#0x01
mov _rm,#0x01
mov _temp,#0x32
mov _count1,#0x00
mov _chipE,#0x8F
mov _P0,#0xFF
mov _ch,#0x00
crl c
mov a,pro
subb a,#0x03
mov _pro,#0x01
mov a,_pro
cjne a,#0x01,
mov a,_pro
mov _buffer,#0x00
mov (_buffer + 0x0001),#0x73
mov (_buffer + 0x0002),#0x00
mov _buffer,#0x00
mov (_buffer + 0x0001),#0x31
mov (_buffer + 0x0002),#0x00
mov _buffer,#0x00
mov (_buffer + 0x0001),#0x6D
mov (_buffer + 0x0002),#0x00
mov _buffer,#0x00
mov (_buffer + 0x0001),#0x6F
mov (_buffer + 0x0002),#0x00
mov _buffer,#0x00
mov (_buffer + oxoo01),#0x63
mov (_buffer + 0x0002),#0x00
` 54
mov _digit,#0x04
mov r2,#0x00
mov r3,#0x00
clr c
mov a,r2
subb a,#0x03
mov a,r3
xrl a,#0x80
subb a,#0x80
mov a,_digit
mov r4,a
mov a,_chipE
anl a,r4
anl a,_opto
mov _P3,a
mov a,r2
add a,#_buffer
mov r0,a
mov ar4,@r0
mov a,r4
cpl a
mov _P1,1
mov dptr,#0x0005
mov _P1,#0xFF
mov a,_digit
clr c
mov _digit,a
inc r2
inc r3
inc _time
clr a
inc (_time + 1)
clr c
mov a,time
subb a,#0xF4
mov a,(_time + 1)
subb a,#0x01
clr a
mov _time,a
inc _check
clr c
mov a,_check
subb a,#0x03
mov _check,#0x01
mov a,_check
cjne a,#0x01065
` 55
mov _chipE,#0x9F
mov a,_check
cjne a,#0x02,00109$
mov _chipE,#0x1F
mov b,#0x0A
mov a,_z
div ab
mov r2,b
mov a,r2
mov dptr,#_convert
movc a,@a+dptr
mov _buffer,r2
mov b,#0x0A
mov a,_z
mov r2,a
clr a
mov r3,a
mov (_modsint_PARM_2 + 1),a
mov dpl,r2
mov dph,r3
mov r2,dpl
mov r3,dph
mov a,r2
add a,#_convert
mov dpl,a
mov a,r3
addc a,#(_convert>> 8)
mov dph,a
clr a
movc a,@a+dptr
mov r2,a
mov (_buffer + 0x0001),r2
mov b,#0x64
mov a,_z
divab
mov r2,a
clr a
mov r3,a
mov (_modsint_PARM_2 _1),a
mov _modsint_PARM_2,#0x0A
movdpl,r2
mov dph,r3
1call _modsint
Mov r2,dpl
mov r3,dph
` 56
mov a,r2
add a,#_convert
mov dpl,a
mov a,r3
addc a,#(_convert>> 8)
mov dph,a
clr a
movc a,@a+dptr
mov r2,a
MOV(_BUFFER+0X002),r2
_chec_temp
mov _a,#0x01
mov _a,#0x00
mov _b,#0x02
mov _b,#0x00
mov _c,#0x04
mov _c,#0x00
mov _d,#0x08
mov _d,#0x00
mov _e,#0x10
mov _e,#0x00
mov _f,#0x20
mov _f,#0x00
mov _g,#0x40
mov _g,#0x00
mov _h,#0x80
mov _h,#0x00
mov a,_ch
mov a,_b
add a,_a
add a,_c
add a,_d
add a,_e
add a,_f
add a,_g
add a,_h
mov _z,a
keyexe:mov a,#0x80
anl a,_flag1
mov r2,a
orl _flag1,#0x80
mov _dealy,#0xC8
` 57
lcall _setup
lcall _setdown
mov _ch,#0x00
mov _ch,#0x01
lcall _checkdata
mov _temp,_qz
mov _z,_temp
mov _ rm,#0x00
clr _c
mov _a,_z
subb a,#0x97
mov _z,#0x00
clr c
clr a
subb a,_z
mov _z,#0x96
mov _temp_z
mov a,_ch
mov _qz,_temp
mov _rm,#0x01
_showOnce:
mov r2,#0xb0
mov r3,#oxo4
push ar2
push ar3
lcall _scanLED
pop ar3
pop ar2
dec r2
cjne r2,#0xff,00108$
dec r3
mov a,r2
orl a,r3
_comp: clr
mov a,_z
subb a,_qz
mov _opto,#0xff
mov _opto,#0xef
_keydelay:
mov a,#0x80
anl a,_flag1
mov r2,a
dec _delay
mov a,_delay
` 58
mov r2,_flag1
mov a,#0x7f
anl a,r2
mov _flag1,a
_pause:mov
mov r2,dpl
mov r3,dph
mov r4,#0x00
mov r5,#0x00
clr c
mov a,r4
subb a,r2
mov a,r5
xrl a,#0x80
mov b,r3
Xrl b,#0x80
subb a,b
inc r4
inc r5
.area CSEG (CODE)
_convert:
.db #0x3F
.db #0x0C
.db #0x76
.db #0x5E
.db #0x4D
.db #0x5B
.db #0x7B
.db #0x0E
.db #0x7F
.db #0x5F
.area XINT (CODE)
` 59
CH:-7 APPLICATION OF TEMPERTURE CONTROLLER:
7.1 APPLICATION:
Industrial boiler/furnace.
UPS/Invertors system.
` 60
CH:-8 ADVANTAGE, DISADVANTAGE & APPLICATION
8.1 ADVANTAGES
As we use microcontroller for our project then accuracy of Time is very high.
The systematic way of allocating resources. This should lead to a reliable software
program
As we use microcontroller processor, voltage regulator and power transistor hence
hardware is simple and compact.
Low cost of system.
8.2 DISADVANTAGES
As in project we do not use any type of battery backup so in case power Failure times
our project does not work.
As we use microcontroller port no of cable for each data line is also Increases, we do
not use wireless technique.
` 61