Temperature Controller Using 89c51project of E.C

You might also like

Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 61

` 1

CERTIFICATE

This to certify that

Shri PATEL AVANIKA.G Roll No.- 086500311048 of EC-1 Class


Shri PATEL BHOOMIKA.R Roll No.- 086500311051 of EC-1 Class
Shri PATEL JAIMINI.S Roll No.- 086500311063 of EC-1 Class

Has satisfactorily completed the course in


Project named by

TEMPERATURE CONTROLLER
USING AT89C51
Within Four walls of
SWAMI SACHCHIDANAND POLYTECHNIC, VISNAGAR
Date of Submission : _________________________________

Staff in Charge : _________________________________


Head of Department : _________________________________

` 2
ACKNOWLEDGEMENT:

Such kind’s fillings are taking place in heart as well as


mind. The help and support which our HOD sir
PANKAJ.P.PRAJAPATI has provided us whenever we are in need of
them.
We are very grateful to JATIN SIR & SUNIL SIR (E.C.
DEPARTMENT). For their guidance, which they have providing
right from the being.

They have been helping right from the beginning of this


project until the end. They have been providing the help, which we
were lacking and be fulfilled without their help.

Most of all, we want to thank our family because their


understanding and support that helped for successful completion of
this project.

Thanking all of them.

INDEX

` 3
CONTENT PAGE NO.

CH:-1 INTRODUCTION 6
1.1 GENERAL INTRODUCTION 6

CH:-2 COMPONENT LIST 7


2.1 MAIN COMPONENT OF TEMPERATURE CONTROLLER 7
CIRCUIT

CH:-3 CIRCUIT DIAGRAM & POWER SUPPLY 9

3.1 CIRCUIT DIAGRAM OF TEMPERATURE CONTROLLER 9


3.2 POWER SUPPLY 10
3.3 RELAY AND BUZZER DRIVE CIRCUIT 11
3.4 PCB LAYOUT 12
3.5 MAIN BOARD COMPONENT MOUNTING 13

CH:-4 WORKING OF TEMPERATURE CONTROLLER 14


4.1 WORKING OF CIRCUIT 14
CH:-5 DETAILS OF COMPONENT 17

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

CH:-7 APPLICATION OF TEMPERATURE 58


CONTROLLER
7.1 APPLICATION 58

CH:-8. ADVANTAGE & DISADVANTAGE 59

8.1 ADVANTAGE 59
8.2 DISADVANTAGE 59

` 5
CH:-1 INTRODUCTION

1.1 GENERAL INTRODUCTION:-

Many circuits available in the market to measure temperature-using sensors like


transistor, AD590, LM337 or PT100. Here we use LM35DZ as a temperature sensor. Apart
from displaying the temperature this circuit provides for temperature based relay activation
or controlling heaters, coolers or any electrical appliances. The trip point temperature, set for
activating the relay, can also be displayed with a simple flick of a switch. This circuit canbe
calibrated to have an accuracy of +/- 0.5 Celcious with an operating range of 0 Celcious to
150 Celcious.

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.

Here we use LM35DZ as a sensor. It is a precision centigrade temperature sensor. We


include data sheet of LM35DZ. The output of LM35DZ is 10 mv per digree centrigrade. The
output of sensor is fed to ADC0804. ADC0804 is an 8 bit analog to digital converter IC.
Reference voltage for ADC0804 is set to 1.28V by D1, R22 and P1. The binary output of
ADC0804 id fed to port to of 89C51. Port 0 and port 2 of 89C51 is declared as input port.
Port 1 is a output port. Port 3 is used as a bidirectional port. The output at set temperature is
variable on pin no. 14 of controller. It is used to drive a Darlington pair transistor form by Q4
and Q5. Display Dis1,Dis2, Dis3 are used to display the current or to set temperature. To
display: C a, b, c, d and pt. Pin of display DIS4 is grounded via register.

` 6
CH:-2 COMPONENT LIST

2.1 MAIN COMPONENT OF TEMPERATURE


CONTROLLER CIRCUIT

 Resistors:-

R1-R7, R11, R16, R19,R20 ---- 1 K – Brown Black Red Golden


R9, R10, R12-R15, R17 ---- 220 K – Red Red Brown Golden
R8 ---- 8.2K – Grey Red Red Golden
R18 ---- 470 – Yellow Violet Brown Golden
R21 ---- 10K – Brown Black Orange Golden
R22 ---- 330 – Orange Orange Brown Golden
RN1 ---- 10K –103J – Resistor Network Array
P1 ---- 2K – 202 – Trimmer Type Preset

 Capacitors:-

C1, C10 ---- 0.1 F – 104 – 100Kpf V Disc Capacitors


C2 ---- 100 F/16V – Electrolytic Capacitor
C3 ---- 150PF – Disc Capacitors
C4 ---- 100 F/25V Electrolytic Capacitor
CE1 ---- 10 F/25V Electrolytic Capacitor
CD1, CD2 ---- 33PF – Disc Capacitors

 Semiconductors:-

U1 ---- AT89C51/52 – Pre-Programmed controller


U2 ---- ADC0804 – Analogue to Digital Converter
U3 ---- LM7805 – +5V Regulator IC

` 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:-

SW2-SW5 ---- Tact tile Micro Switch (SW1 Not Used)


RL3 ---- 12V/1CO – Mini Sugar Cube OCB Mount Relay
IC Socket ---- 40 Pin-1, 20 Pin-1
0 – 12V/500mA Transformer
2–Pin Mains Cord
3–Pin Reliment Connector for LM35 Sensor

` 8
CH:-3 CIRCUIT DIAGRAM & POWER SUPPIY

3.1CIRCUIT DIAGRAM

FIG: CIRCUIT 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.

FIG: POWER SUPPLY

` 10
3.3 RELAY AND BUZZER DRIVER CKT:-

 A SPDT relay is connected to pin 22 of the micro controller through a driver


transistors and a buffer IC. The relay requires 12 volts at a current of around 50 mA,
which cannot provide by the micro controller. So the driver transistors are added. The
relay is used to operate the external siren of for operating any other electrical device.
Normally the relay remains siren or for operating any other electrical device.
Normally the relay remains off. As soon as pin 22 of the micro controller goes high,
the transistors turn ON and the relay operates.

FIG: RELAY & BUZZER DRIVE CIRCUIT

` 11
3.4 PCB LAYOUT:

FIG: PCB LAYOUT

` 12
3.5 MAIN BOARD COMPONENT MOUNTING

FIG: MAIN BOARD COMPONENT MOUNTING

` 13
CH:-4 WORKING OF TEMPERATURE CONTROLLER:-

4.1 WORKING:

 The transformer is used in automatic voltage stabilizer is autotransformer is different


tapping, which consist of a single winding with tapping for input & output of power
supply. The secondary winding is 12V for the supply of control circuit and relay
operation. The tapping of the transformer is used for step-up & step-down of the
voltage. When variation of supply voltage occur. This voltage is applied to the bridge
circuit.

 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.

 4KB of flash, 120bytes of RAM.


 32 input / output lines.
 Five vector 2 level interrupt architecture, a full duplex serial port and on chip oscillator
and clock security.

 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.

 PORT PIN ALTERNATE FUNCTION:-

 P3.O RXD (serial port)

 P3.1 TXD (serial output port)

 P3.2 INTO (external interrupt 0)

 P3.3 INT1 (external interrupt 1)

 P3.4 TO (timer 0 external input)

 P3.5 T1 (timer 1extenal input)

 P3.6 WR (external data memory write strobe)

 P3.7 RD (external data memory read strobe).

 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

 4K Bytes of In-System Reprogrammable Flash Memory

 Endurance: 1,000 Write/Erase Cycles

 Fully Static Operation: 0 Hz to 24 MHz

 Three-level Program Memory Lock

 128 x 8-bit Internal RAM

 32 Programmable I/O Lines

 Two 16-bit Timer/Counters

 Six Interrupt Sources

 Programmable Serial Channel

 Low-power Idle and Power-down Modes

 Description

 The AT89C51 is a low-power, high-performanceCMOS 8-bit microcomputer with 4K


bytes of Flash programmable and erasable read only memory (PEROM).

 The device is manufactured using Atmel’s high-density nonvolatile memory


technology and is

 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

P3.0 RXD (serial input port)

P3.1 TXD (serial output port)

P3.2 INT0 (external interrupt 0)

P3.3 INT1 (external interrupt 1)

P3.4 T0 (timer 0 external input)

P3.5 T1 (timer 1 external input)

P3.6 WR (external data memory write strobe)

P3.7 RD (external data memory read strobe)

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 . Oscillator Connections

Figure

Note: C1, C2 = 30 pF ± 10 pF for Crystals


= 40 pF ± 10 pF for Ceramic Resonators

Figure External Clock Drive Configuration

` 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

 Calibrated directly in ºCelsius (Centigrade)

 Linear +10.0 mV/ºC scale factor

 0.5ºC accuracy guaranteeable (at+25ºC)

 Rated for full -55º to +150ºC range

 Suitable for remote applications

 Low cost due to wafer-level trimming

 Operates from 4 to 30 volts

 Less than 60µA current drain

 Low self-heating, 0.08ºC in still air

 Non linearity only ±1/4ºC typical

 Low impedance output, 0.1 Ω for 1Ma load

` 29
5.3 ANALOG TO DIGITAL CONVERTER(ADC0804)

 THE ADC0801,ADC0803,ADC0804 AND ADC0805 are CMOS 8-bit successive


approximation A/D converts that use differential potentiometric ladder similar to
the 256R products.these converts are designed to allow operation with the NSC800
and ins8080A derivative control bus with TRI-STATE output latches directly driving
the data bus. These A/Ds apperar like memory location or I/O ports to the
microprocessor and no interfacing logic is needed.

FIG:8 ADC 0804

 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

 Technical Specifications – Characteristics:

Supply Voltage: ............. +/- 5 V (Symmetrical)


Power requirements: ..... 200 mA (maximum)
Measuring range: .......... +/- 0-1,999 VDC in four ranges
Accuracy: ....................... 0.1 %

 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.

i. Common cathode display

ii. Common anode display

 LED7-segment display interfacing is a very common requirement in any instrument


design. LED display is preferred whenever there are no strict constraints on the power
consumption. For example, in case of battery operated instruments, the power
available is limited and one may go for LCD displays, LED displays with proper
background effect can be visible from a distance, bit away from the instrument
location. Thus, it is very important that the designer must select proper display for the
specific application.

 Seven segments are made up of LED’s either in common anode or in common


cathode configuration. The current requirement of each segment is of 10mA. One
character is formed by selectivity illuminating LED segment of seven segment
display. It contains LED segments arranged as an 8 with one common lead and seven
individual leads for each segment. LED displays are cheaper than LCD display.

 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

It is one type of electronics operated mechanical switch.

 PRINCIPAL:-

 It is work on the principal of electromagnetic according to orated and emphases when


conductor carrier electric current magnetic fields produce around it in the of
concentrate cycle.

 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.

Connecting and Soldering:


Resistor may be connected either way round. They are not damaged by heat when
soldering.

• 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:

i. Stable, Low Cost Ceramic Capacitor


ii. Accuracy: ±20%
iii. Wide Operating Temperature Range –
+10oC to +85oC
iv. Dielectric Withstand - 2.5x Rated Voltage
v. Body Diameter - 4mm
vi. Pin Spacing - 5mm

5.8 TRANSFORMER:-

FIG:11 TRANSFORMERS

` 37
1. Transformer is an electrical device and works on the electromagnetic principle.

2. In its construction two winding are would on each other.

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:

In this Led two terminal one is anode and


second is cathode. Also there are different
colour type led available in market. This
project in three different colour type is used.

` 38
Red led yellow Led green LED

 feature:

i. High Brightness

ii. Low Current Consumption

iii. Large Operating Voltage Range

iv. Wide Operating Conditions

 Absolute maximum rating:

i. Supply voltage - 7V

ii. Inpute voltage - 5.5V

iii. Operating free air temperature - 0C to +70C

iv. Storage temperature range - -65C to +150C

 LED dimension:

` 39
5.10 SOCKET:

` 40
This is the socket to mount AT89C51.

 Feature

i. Tin plated contacts and connectors

ii. Current Rating 1A

iii. Dielectric Withstand Voltage: 300Vac

iv. Insulation Resistance: > 1000Mohm

v. Contact Resistance: < 5 Mohm

vi. Body Height: 4.5mm (.188")

5.11 TRANSISTOR(BC557):

This PNP type transistor.

 Feature

i. low power current (max 100mA)

ii. low voltage (max 65V)

` 41
 Application

i. General purpose switching and amplification.

 transistor dimension

` 42
5.12 LM7805 IC:

` 43
 General Description:

i. The LM140/LM340A/LM340/LM78XXC monolithic 3-terminal positive


voltage regulators employ internal current-limiting, thermal shutdown and
safe-area compensation, making them essentially indestructible.
ii. If adequate heat sinking is provided, they can deliver over 1.0A output current.
iii. They are intended as fixed voltage regulators in a wide range of applications
including local (on-card) regulation for elimination of noise and distribution
problems associated with single-point regulation. In addition to use as fixed
voltage regulators, these devices can be used with external components to
obtain adjustable output voltages and currents. Considerable effort was
expended to make the entire series of regulators easy to use and minimize the
number of external components.
iv. It is not necessary to bypass the output, although this does improve transient
response.
v. Input bypassing is needed only if the regulator is located far from the filter
capacitor of the power supply.
vi. The 5V, 12V, and 15V regulator options are available in the steel TO-3 power
package.
vii. The LM340A/LM340/LM78XXC series is available in the TO-220 plastic
power package, and the LM340-5.0 is available in the SOT-223 package, as
well as the LM340-5.0 and LM340-12 in the surface-mount TO- 263 package.

 Features:

i. Complete specifications at 1A load


ii. Output voltage tolerances of ±2% at Tj = 25°C and ±4% over the temperature
range (LM340A)
iii. Line regulation of 0.01% of VOUT/V of ÄVIN at 1A load (LM340A)
iv. Load regulation of 0.3% of VOUT/A (LM340A)
v. Internal thermal overload protection
vi. Internal short-circuit current limit
vii. Output transistor safe area protection
viii. P+ Product Enhancement tested

 Absolute Maximum Ratings:

i. DC Input Voltage 35V


ii. Internal Power Dissipation Internally Limited
iii. Maximum Junction Temperature 150°C
iv. Storage Temperature Range −65°C to +150°C
v. Lead Temperature (Soldering, 10 sec.)
1. TO-3 Package (K) 300°C
2. TO-220 Package (T), TO-263
3. Package (S) 230°C

` 44
vi. ESD Susceptibility 2 kV

 Operating Conditions:

i. Temperature Range (TA)


ii. LM140 −55°C to +125°C
iii. LM340A, LM340 0°C to +125°C
iv. LM7808C 0°C to +125°C

 Typical Applications:

i. Fixed Output Regulator


ii. Adjustable Output Regulator
iii. Current Regulator
iv. Positive and Negative Regulator
v. High Output Current, Short Circuit Protected

 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:

Diode dimention symbol

5.14 Switch:

` 47
.

This is a switch for


the clockwise rotating, the counter clockwise rotating or
making a motor stop.

 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.

 TO maintain temperature in server room.

 Electronic protection system.

 UPS/Invertors system.

 Industrial process control.

 Thermal management 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

You might also like