Anda di halaman 1dari 30

Contents

Page No.
1. Introduction to Temperature Monitoring Alarm 1-3

1.1. Introduction 1

1.2. Working Principle 1

1.3. Circuit Diagram 1

1.4. Hardware Figure 2

1.5. Required Spare Parts 3
2. Data Sheets 4-24

2.1. 89c51 ( Microcontroller ) 4

2.2. 85c91( 8-Bit A/D And D/A Converter ) 6

2.3. LM35 ( Precision Centigrade Temperature Sensors ) 9

2.4. 7805 ( 3-Terminal 1A Positive Voltage Regulator ) 14

2.5. Transformer 16

2.6. LCD 17
3. Programming 18-23
3.1. C-Coding 18
3.2. Hex-code 20
4. Compiler 24-25
4.1 Introduction 24
4.2 Features 24
4.3 Process 25
5. Program Loader 26
5.1. Introduction 26
5.2. Figure 26
6. Applications 27
7. Conclusion 28
Reference 29

Contents

Page | 1



1.1. Introduction
This is a microcontroller-based temperature indicator that displays the temperature. Besides
AT89C51 microcontroller, it uses a temperature sensor chip, LCD module and converter. The
indicator outputs the calibrated data in digital form. The program for the microcontroller is
written in C and not in Assembly language. The power supply for the circuit is regulated by
IC 7805 and supplied to different parts. The microcontroller unit (MCU) reads the
temperature from the sensor. The temperature data is compared with certain user-defined
temperature values and processed inside the MCU as per the program and then sent to the
LCD for display.

1.2. Working Principle
The circuit of the temperature monitoring alarm is consists of Microcontroller 8951, Temperature
sensor LM 35, Regulator 7805, LCD module & a few discrete components. 230 V AC is stepped
down by transformer to 9 V, 50mA which is rectified by full wave bridge rectifier & regulated
by IC 7806 LED act as an DC indicator, we also use 6 V rechargeable battery as a backup
supply. The 8951 is a low powered 8 bit microcontroller based on the AVR in hence
architecture. Port A pin Pa0 of the microcontroller is used as the ADC to interface the
temperature sensor, which converts signals into digital equivalent. Capacitor C5 protects the
ADC input from voltage fluctuations & resistor R6 is used as the current limiter. Port d is used
to interface the LCD module, which displays the temperature value and the pin 4 provide the
PWM output which is used to control the device.

1.3. Circuit Diagram

1. Introduction to Temperature Monitoring Alarm
Page | 2

1.4. Hardware Figure

Fig. On conditioned circuit showing present temperature. LED & Buzzer remains off.



Fig. Temperature reaches to set point. LED & Buzzer gets on at same time.
Page | 3

1.5. Required Spare Parts
Components Quantity Specification
Power

Transformer 1 I/P=230 V A.C, O/P=9-0-9 V, 500 Ma
Diode 2 In4007
Capacitor 1 100 Uf, 25 V(Electrolytic)
Voltage Regulator 1 Lm7805
Display

Lcd 1 16*2, 16 Pin.
Converter

Adc 1 Pcf8591, 4 Channel (Follows I2c Protocol)
Sensor

Temperature Sensor Ic 1 LM35, 10mv/1 V (-50 C To 125 C)
Controller

Microcontroller Ic 1 Atmel 89c51
Sound Generator

Buzzer 1 3 V D.C To 27 V D.C (Operating Range)
Others

Bjt 1 Bc557(P-N-P)
Reset Switch 1
Set Switch 1
Led 1 Green
Crystal 1 11.0592 Mhz
Capacitor 3 2(33pf), 1(10uf), 25 V
Preset 1 10 K
Resistance 6 2(1.2 K), 3(10 K), 1(68)
Circuit Board 1

4
4

4
3

4
2

4
1

4
0

3
9

3
8

3
7

3
6

3
5

3
4

1
2

1
3

1
4

1
5

1
6

1
7

1
8

1
9

2
0

2
1

2
2

(
W
R
)
P
3
.
6

(
R
D
)

P
3
.
7

X
T
A
L
2

X
T
A
L
1

G
N
D

G
N
D

(
A
8
)

P
2
.
0

(
A
9
)

P
2
.
1

(
A
1
0
)

P
2
.
2

(
A
1
1
)

P
2
.
3

(
A
1
2
)

P
2
.
4

P
1
.
4

P
1
.
3

P
1
.
2

P
1
.
1

(
T
2

E
X
)

P
1
.
0

(
T
2
)

N
C

P
0
.
0

(
A
D
0
)

P
0
.
1

(
A
D
1
)

P
0
.
2

(
A
D
2
)

P
0
.
3

(
A
D
3
)

6

5

4

3

2

1

4
4

4
3

4
2

4
1

4
0

1
8

1
9

2
0

2
1

2
2

2
3

2
4

2
5

2
6

2
7

2
8

(
W
R
)
P
3
.
6

(
R
D
)

P
3
.
7

X
T
A
L
2

X
T
A
L
1

G
N
D

N
C

(
A
8
)

P
2
.
0

(
A
9
)

P
2
.
1

(
A
1
0
)

P
2
.
2

(
A
1
1
)

P
2
.
3

(
A
1
2
)

P
2
.
4

P
1
.
4

P
1
.
3

P
1
.
2

P
1
.
1

P
1
.
0

N
C

P
0
.
0

(
A
D
0
)

P
0
.
1

(
A
D
1
)

P
0
.
2

(
A
D
2
)

P
0
.
3

(
A
D
3
)






2.1. 89c51 ( Microcontroller )
2.1.1. Features
Compatible with MCS-51

Products
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
2.1.2. Description
The AT89C51 is a low-power, high-performance CMOS 8-bit microcomputer with 4K
bytes of Flash programmable and erasable read only memory (PEROM). The device
is manufactured using Atmels high-density nonvolatile memory technology and is
compatible with the industry-standard MCS-51 instruction set and pinout. The on-chip
Flash allows the program memory to be reprogrammed in-system or by a conven-
tional 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.

PDIP


2.1.3. Pin Configurations





PQFP/TQFP









P1.5 1 33 PO.4(AD4)
P1.6 2 32 P0.5(AD5)
P1.7 3 31 P0.6(AD6)
RST 4 30 P0.7(AD7)
(RXD) P3.0 5 29 EA/VPP
NC 6 28 NC
(TXD) P3.1 7 27 ALE/PROG
(INT0) P3.2 8 26 PSEN
(INT1) P3.3 9 25 P2.7(A15)
(T0) P3.4 10 24 P2.6(A14)
(T1) P3.5 11 23 P2.5(A13)

P1.0 1 40 VCC
P1.1 2 39 P0.0(AD0)
P1.2 3 38 P0.1(AD1)
P1.3 4 37 P0.2(AD2)
P1.4 5 36 P0.3(AD3)
P1.5 6 35 P0.4(AD4)
P1.6 7 34 P0.5(AD5)
P1.7 8 33 P0.6(AD6)
RST 9 32 P0.7(AD7)
(RXD) P3.0 10 31 EA/VPP
(TXD) P3.1 11 30 ALE/PROG
(INT0) P3.2 12 29 PSEN
(INT1) P3.3 13 28 P2.7(A15)
(T0) P3.4 14 27 P2.6(A14)
(T1) P3.5 15 26 P2.5(A13)
(WR) P3.6 16 25 P2.4(A12)
(RD) P3.7 17 24 P2.3(A11)
XTAL2 18 23 P2.2(A10)
XTAL1 19 22 P2.1(A9)
GND 20 21 P2.0(A8)

PLCC








P1.5 7 39 PO.4(AD4)
P1.6 8 38 P0.5(AD5)
P1.7 9 37 P0.6(AD6)
RST 10 36 P0.7(AD7)
(RXD) P3.0 11 35 EA/VPP
NC 12 34 NC
(TXD) P3.1 13 33 ALE/PROG
(INT0) P3.2 14 32 PSEN
(INT1) P3.3 15 31 P2.7(A15)
(T0) P3.4 16 30 P2.6(A14)
(T1) P3.5 17 29 P2.5(A13)



2. Data Sheets





2.1.4. Block Diagram

P0.0 - P0.7 P2.0 - P2.7


VCC


GND







RAM ADDR.
PORT 0 DRIVERS





PORT 0
PORT 2 DRIVERS





PORT 2
REGISTER RAM LATCH LATCH FLASH











B
REGISTER










ACC






TMP2 TMP1





ALU











STACK
POINTER










PROGRAM
ADDRESS
REGISTER




BUFFER






PC
INCREMENTER


INTERRUPT, SERIAL PORT,
AND TIMER BLOCKS

PROGRAM




PSEN
ALE/PROG
EA / VPP
RST






TIMING
AND
CONTROL









OSC
PSW





INSTRUCTION
REGISTER



PORT 1 PORT 3
LATCH LATCH





PORT 1 DRIVERS PORT 3 DRIVERS
COUNTER





DPTR




P1.0 - P1.7 P3.0 - P3.7




2.2. 85c91( 8 -Bit A/D And D/A Converter )
2.2.1. Features
Single Power Supply
Operating Supply Voltage 2.5 V To 6 V
Low Standby Current
Serial Input/Output Via I
2
C-Bus
Address By 3 Hardware Address Pins
Sampling Rate Given By I
2
C-Bus Speed
4 Analog Inputs Programmable As Single-Ended
Or
Differential Inputs
Auto-Incremented Channel Selection
Analog Voltage Range From V
SS
To
V
DD
On-Chip Track And Hold Circuit
8-Bit Successive Approximation A/DConversion
Multiplying DAC With One Analog Output.
2.2.2. Applications
Closed Loop Control Systems
Low Power Converter For Remote Data Acquisition
Battery Operated Equipment
Acquisition Of Analog Values In Automotive, Audio
And
TV Applications.
2.2.4. Ordering Information
2.2.3. General Description
The PCF8591 Is A Single-Chip, Single-Supply Low
Power 8-Bit CMOS Data Acquisition Device With
Four Analog
Inputs, One Analog Output And A Serial I
2
C-Bus
Interface. Three Address Pins A0, A1 And A2 Are Used
For
Programming The Hardware Address, Allowing The
Use Of Up To Eight Devices Connected To The I
2
C-
Bus Without
Additional Hardware. Address, Control And Data To And
FromThe Device Are Transferred Serially Via The Two-
Line
Bidirectional I
2
C-Bus.
The Functions Of The Device Include Analog
Input
Multiplexing, On-Chip Track And Hold Function,
8-Bit
Analog-To-Digital Conversion And An 8-Bit Digital-To-
Analog Conversion. The Maximum Conversion Rate Is
Given By The Maximum Speed Of The I
2
C-Bus.
TYPE
PACKAGE
NUMBER
NAME DESCRIPTION VERSION
PCA8591P DIP16 Plastic Dual In-Line Package; 16 Leads (300 Mil); Long Body SOT38-1
PCA8591T SO16 Plastic Small Outline Package; 16 Leads; Body Width 7.5 Mm SOT162-1
T
h
i
s

t
e
x
t

i
s

h
e
r
e

i
n
w
h
i
t
e

t
o

f
o
r
c
e

l
a
n
d
s
c
a
p
e

p
a
g
e
s

t
o

b
e

r
o
t
a
t
e
d

c
o
r
r
e
c
t
l
y

w
h
e
n

b
r
o
w
s
i
n
g

t
h
r
o
u
g
h

t
h
e

p
d
f

i
n

t
h
e

A
c
r
o
b
a
t

r
e
a
d
e
r
.
T
h
i
s

t
e
x
t

i
s

h
e
r
e

i
n
_
w
h
i
t
e

t
o

f
o
r
c
e

l
a
n
d
s
c
a
p
e

p
a
g
e
s

t
o

b
e

r
o
t
a
t
e
d

c
o
r
r
e
c
t
l
y

w
h
e
n

b
r
o
w
s
i
n
g

t
h
r
o
u
g
h

t
h
e

p
d
f

i
n

t
h
e

A
c
r
o
b
a
t

r
e
a
d
e
r
.
T
h
i
s

t
e
x
t

i
s

h
e
r
e

i
n
T
h
i
s

t
e
x
t

i
s

h
e
r
e

i
n
w
h
i
t
e

t
o

f
o
r
c
e

l
a
n
d
s
c
a
p
e

p
a
g
e
s

t
o

b
e

r
o
t
a
t
e
d

c
o
r
r
e
c
t
l
y

w
h
e
n

b
r
o
w
s
i
n
g

t
h
r
o
u
g
h

t
h
e

p
d
f

i
n

t
h
e

A
c
r
o
b
a
t

r
e
a
d
e
r
.

w
h
i
t
e

t
o

f
o
r
c
e

l
a
n
d
s
c
a
p
e

p
a
g
e
s

t
o

b
e

F
i
g
.
1


B
l
o
c
k

d
i
a
g
r
a
m
.
2.2.5. Block Diagram
2.2.6. Pinning
SYMBOL PIN DESCRIPTION
AINO 1
AIN1 2
Analog Inputs
AIN2 3 (A/DConverter)
AIN3 4
A0 5
A1 6 Hardware Address
A2 7
V
SS
8 Negative Supply Voltage
SDA 9 I
2
C-Bus Data Input/Output
SCL 10 I
2
C-Bus Clock Input
OSC 11 Oscillator Input/Output
EXT 12 External/Internal Switch For Oscillator
Input
AGND 13 Analog Ground
V
REF
14 Voltage Reference Input
AOUT 15
V
DD
16
Analog Output (D/A Converter)
Positive Supply Voltage
Fig.2 Pinning Diagram.







2.3. LM35 ( Precision Centigrade Temperature Sensors )
2.3.1. General Description
The LM35 series are precision integrated-circuit temperature
sensors, whose output voltage is linearly proportional to the
Celsius (Centigrade) temperature. The LM35 thus has an
advantage over linear temperature sensors calibrated in
Kelvin, as the user is not required to subtract a large
constant voltage fromits output to obtain convenient Centi-
grade scaling. The LM35 does not require any external
calibration or trimming to provide typical accuracies of 14C
at room temperature and 34C over a full 55 to +150C
temperature range. Low cost is assured by trimming and
calibration at the wafer level. The LM35s low output imped-
ance, linear output, and precise inherent calibration make
interfacing to readout or control circuitry especially easy. It
can be used with single power supplies, or with plus and
minus supplies. As it draws only 60 A fromits supply, it has
very low self-heating, less than 0.1C in still air. The LM35 is
rated to operate over a 55 to +150C temperature range,
while the LM35C is rated for a 40 to +110C 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 avail-
able in an 8-lead surface mount small outline package and a
plastic TO-220 package.
2.3.2. Features
n Calibrated directly in Celsius (Centigrade) n
Linear + 10.0 mV/C scale factor
n 0.5C accuracy guaranteeable (at +25C) n Rated
for full 55 to +150C range
n Suitable for remote applications
n Low cost due to wafer-level trimming
n Operates from4 to 30 volts
n Less than 60 A current drain
n Low self-heating, 0.08C in still air
n Nonlinearity only 14C typical
n Low impedance output, 0.1 for 1 mA load
2.3.3. Typical Applications

DS005516-4
DS005516-3
FIGURE 1. Basic Centigrade Temperature Sensor
(+2C to +150C)
ChooseR1 = VS/50 A
V OUT=+1,500 mV at +150C
= +250 mV at +25C
= 550 mV at 55C
FIGURE 2. Full-RangeCentigrade Temperature Sensor




























L
M
3
5




2.3.4. Connection Diagrams


TO-46 SO-8
Metal Can Package* Small OutlineMolded Package












DS005516-1 DS005516-21
*Caseis connected to negativepin (GND) N.C. =No Connection
Order Number LM35H, LM35AH, LM35CH, LM35CAH or Top View
LM35DH Order Number LM35DM
See NS PackageNumber H03H See NS PackageNumber M08A

TO-92 TO-220
Plastic Package Plastic Package*












DS005516-2
Order Number LM35CZ,
LM35CAZ or LM35DZ
See NS PackageNumber Z03A




DS005516-24
*Tab is connected to thenegativepin (GND).
Note: TheLM35DT pinout is different than thediscontinued LM35DP.
Order Number LM35DT
See NS PackageNumber TA03F









































2.3.5. Absolute Maximum Ratings
If Military/Aerospace specified devices are required, pleasecontact
the National Semiconductor Sales Office/ Distributors for availability
and specifications.
Supply Voltage +35V to 0.2V
Output Voltage +6V to 1.0V
Output Current 10 mA
StorageTemp.;
TO-46 Package, 60C to +180C
TO-92 Package, 60C to +150C
SO-8 Package, 65C to +150C
TO-220 Package, 65C to +150C
Lead Temp.:
TO-46 Package,
(Soldering, 10 seconds) 300C
2.3.6. Electrical Characteristics
(Notes 1, 6)



TO-92 and TO-220 Package,
(Soldering, 10 seconds) 260C
SO Package(Note12)
Vapor Phase(60 seconds) 215C
Infrared (15 seconds) 220C
ESD Susceptibility (Note11) 2500V
Specified Operating Temperature Range: T
MIN
to T
MAX
(Note2)
LM35, LM35A 55C to +150C
LM35C, LM35CA 40C to +110C
LM35D 0C to +100C
LM35A LM35CA
Parameter Conditions Tested Design Tested Design Units
Typical Limit Limit Typical Limit Limit (Max.)
(Note4) (Note5) (Note4) (Note5)
Accuracy
TA
=+25C
0.2 0.5 0.2 0.5 C
(Note7)
TA
=10C
0.3 0.3 1.0 C
TA
=T
MAX
0.4 1.0 0.4 1.0 C
TA
=T
MIN
0.4 1.0 0.4 1.5 C
Nonlinearity T
MIN
T
A
T
MAX
0.18 0.35 0.15 0.3 C
(Note8)
Sensor Gain T
MIN
T
A
T
MAX
+10.0 +9.9, +10.0 +9.9, mV/C
(Average Slope) +10.1 +10.1
Load Regulation
TA
=+25C
0.4 1.0 0.4 1.0 mV/mA
(Note 3) 0I
L
1 mA T
MIN
T
A
T
MAX
0.5 3.0 0.5 3.0 mV/mA
Line Regulation
TA
=+25C
0.01 0.05 0.01 0.05 mV/V
(Note3) 4VV
S
30V 0.02 0.1 0.02 0.1 mV/V
Quiescent Current
VS
=+5V,+25C
56 67 56 67 A
(Note9)
V
S
=+5V
105 131 91 114 A
VS
=+30V,+25C
56.2 68 56.2 68 A
V
S
=+30V
105.5 133 91.5 116 A
Changeof 4VV
S
30V, +25C 0.2 1.0 0.2 1.0 A
Quiescent Current 4VV
S
30V 0.5 2.0 0.5 2.0 A
(Note3)
Temperature +0.39 +0.5 +0.39 +0.5 A/C
Coefficient of
Quiescent Current
MinimumTemperature In circuit of +1.5 +2.0 +1.5 +2.0 C
for Rated Accuracy Figure1, I
L
=0
Long TermStability
TJ
=T
MAX
,for
0.08 0.08 C
1000 hours











L
M
3
5




2.3.7. Electrical Characteristics

LM35 LM35C, LM35D
Parameter Conditions Tested Design Tested Design Units
Typical Limit Limit Typical Limit Limit (Max.)
(Note4) (Note5) (Note4) (Note5)
Accuracy,
TA
=+25C
0.4 1.0 0.4 1.0 C
LM35, LM35C
TA
=10C
0.5 0.5 1.5 C
(Note7)
TA
=T
MAX
0.8 1.5 0.8 1.5 C
TA
=T
MIN
0.8 1.5 0.8 2.0 C
Accuracy, LM35D
TA
=+25C
0.6 1.5 C
(Note7) T
A
=T
MAX
0.9 2.0 C
T
A
=T
MIN
0.9 2.0 C
Nonlinearity T
MIN
T
A
T
MAX
0.3 0.5 0.2 0.5 C
(Note8)
Sensor Gain T
MIN
T
A
T
MAX
+10.0 +9.8, +10.0 +9.8, mV/C
(Average Slope) +10.2 +10.2
Load Regulation
TA
=+25C
0.4 2.0 0.4 2.0 mV/mA
(Note 3) 0I
L
1 mA T
MIN
T
A
T
MAX
0.5 5.0 0.5 5.0 mV/mA
Line Regulation
TA
=+25C
0.01 0.1 0.01 0.1 mV/V
(Note3) 4VV
S
30V 0.02 0.2 0.02 0.2 mV/V
Quiescent Current
VS
=+5V,+25C
56 80 56 80 A
(Note9)
V
S
=+5V
105 158 91 138 A
VS
=+30V,+25C
56.2 82 56.2 82 A
V
S
=+30V
105.5 161 91.5 141 A
Changeof 4VV
S
30V, +25C 0.2 2.0 0.2 2.0 A
Quiescent Current 4VV
S
30V 0.5 3.0 0.5 3.0 A
(Note3)
Temperature +0.39 +0.7 +0.39 +0.7 A/C
Coefficient of
Quiescent Current
MinimumTemperature In circuit of +1.5 +2.0 +1.5 +2.0 C
for Rated Accuracy Figure1, I
L
=0
Long TermStability
TJ
=T
MAX
,for
0.08 0.08 C
1000 hours
Note1: Unless otherwise noted, these specifications apply: 55CTJ +150C for the LM35 and LM35A; 40TJ+110C for the LM35C and LM35CA; and 0TJ+100C for
theLM35D. VS=+5Vdc and ILOAD=50 A, in thecircuit of Figure2. Thesespecifications also apply from+2C to TMAX in thecircuit of Figure1. Specifications in boldfaceapply over
thefull rated temperaturerange.
Note2: Thermal resistanceof theTO-46 package is 400C/W, junction to ambient, and 24C/W junction to case. Thermal resistance of the TO-92 packageis 180C/W junction to
ambient. Thermal resistance of the small outline molded package is 220C/W junction to ambient. Thermal resistance of the TO-220 package is 90C/W junction to ambient. For
additional thermal resistanceinformation seetablein theApplications section.
Note 3: Regulation is measured at constant junction temperature, using pulse testing with a low duty cycle. Changes in output due to heating effects can be computed by
multiplying theinternal dissipation by thethermal resistance.
Note4: Tested Limits areguaranteed and 100% tested in production.
Note5: Design Limits areguaranteed (but not 100% production tested) over theindicated temperatureand supply voltageranges. Theselimits arenot used to calculate outgoing quality
levels.
Note6: Specifications in boldfaceapply over thefull rated temperaturerange.
Note 7: Accuracy is defined as the error between the output voltage and 10mv/C times the devices case temperature, at specified conditions of voltage, current, and temperature
(expressed in C).
Note 8: Nonlinearity is defined as the deviation of the output-voltage-versus-temperature curve from the best-fit straight line, over the devices rated temperature
range.
Note9: Quiescent current is defined in thecircuit of Figure1.
Note10: AbsoluteMaximumRatings indicatelimits beyond which damageto thedevicemay occur. DC and AC electrical specifications do not apply when operating thedevicebeyond its
rated operatingconditions. SeeNote1.
Note11: Human body model, 100 pF discharged through a 1.5 k resistor.
Note12: SeeAN-450 SurfaceMounting Methods and Their Effect on Product Reliability or thesection titled SurfaceMount found in a current National Semiconductor
Linear DataBook for other methods of soldering surfacemount devices.






2.3.8. Typical Performance Characteristics

Thermal Resistance
Thermal Time Constant
Thermal Response
Junction to Air in Still Air





















DS005516-26
DS005516-25 DS005516-27

Thermal Response in MinimumSupply Quiescent Current
Stirred Oil Bath Voltagevs. Temperature vs. Temperature
(In Circuit of Figure1.)




















DS005516-28 DS005516-29
DS005516-30

Quiescent Current
Accuracy vs. Temperature
Accuracy vs. Temperature
vs. Temperature
(Guaranteed)
(Guaranteed)
(In Circuit of Figure2.)



















DS005516-32 DS005516-33
DS005516-31













2.4. 7805 ( 3-Terminal 1A Positive Voltage Regulator )
2.4.1. Features
Output Current up to 1A
Output Voltages of 5, 6, 8, 9, 10, 12, 15, 18, 24V
Thermal Overload Protection
Short Circuit Protection
Output Transistor Safe Operating AreaProtection
2.4.3. Internal Block Digram
2.4.2. Description
The MC78XX/LM78XX/MC78XXA series of three
terminal positive regulators are available in the
TO-220/D-PAK package and with several fixed output
voltages, making themuseful in a wide range of
applications. Each type employs internal current limiting,
thermal shut down and safe operating area protection,
making it essentially indestructible. If adequate heat sinking
is provided, they can deliver over 1A output current.
Although designed primarily as fixed voltage regulators,
these devices can be used with external components to
obtain adjustable voltages and currents.
TO-220
1
D-PAK
1
1. Input 2. GND 3. Output
2.4.4. Absolute Maximum Ratings
Parameter Symbol Value Unit
Input Voltage (for VO=5V to 18V) VI
35 V
(for VO=24V) VI 40 V
Thermal Resistance Junction-Cases (TO-220) RJC 5
o
C/W
Thermal Resistance Junction-Air (TO-220)
RJA
65
o
C/W
Operating Temperature Range
TOPR
0 ~+125
o
C
Storage Temperature Range TSTG -65 ~+150
o
C
2.4.5. Electrical Characteristics (MC7805/LM7805)
(Refer to test circuit ,0C <TJ <125C, IO=500mA, VI =10V, CI 0.33F, CO 0.1F, unless otherwise speciIied)
MC7805/LM7805
Parameter Symbol Conditions Unit
Min. Typ. Max.
TJ =+25
o
C 4.8 5.0 5.2
Output Voltage VO 5.0mA Io 1.0A, PO 15W
VI =7V to 20V 4.75 5.0 5.25
V
Line Regulation (Note1) Regline TJ=+25
o
C
VO =7V to 25V
VI =8V to 12V
- 4.0 100
- 1.6 50
mV
Load Regulation (Note1)
IO=5.0mA to1.5A
Regload TJ=+25
o
C IO=250mA to
750mA
- 9 100
- 4 50
mV
Quiescent Current IQ TJ =+25
o
C - 5.0 8.0 mA
Quiescent Current Change IQ
IO =5mA to 1.0A
VI=7V to 25V
- 0.03 0.5
- 0.3 1.3
mA
Output Voltage Drift
VO/T IO=5mA
- -0.8 - mV/
o
C
Output Noise Voltage VN f =10Hz to 100KHz, TA=+25
o
C - 42 - V/Vo
Ripple Rejection RR
f =120Hz
VO=8V to 18V
62 73 - dB
DropoutVoltage
VDrop IO=1A, TJ =+25
o
C
- 2 - V
Output Resistance rO f =1KHz - 15 - m
Short Circuit Current ISC VI =35V, TA =+25
o
C - 230 - mA
Peak Current IPK TJ =+25
o
C - 2.2 - A
Note:
1. Load and line regulation are specified at constant junction temperature. Changes in Vo due to heating effects must be taken
into account separately. Pulse testing with low duty is used.
Page | 16

2.5. Transformer


2.5.1. Mains Transformer Specification

500mA 9-0-9V AC
Input : 240v Ac 50hz
No Load Current : 20ma Max
Output Voltage : 9 - 0 - 9v Ac
500ma Max Output

2.5.2. Figure

2.5.3. Features
Mains transformers are a common and in-demand transformer style. They are used as step down transformers
in order to reduce voltages from the supply voltage of 230-240 in the UK or 115-120V in the U.S. and other
countries that use that standard of voltage. Their secondary voltage will be a lower safe voltage for common use
in a multitude of low voltage applications. While they may not be of 4 coil winding pattern; many are. Some
may only be 3 wire, or 2 wire. But the difference in winding for 2 , 3 or 4 wires is so negligible, and the
benefits so great, that the usual is to see a 4 coil pattern used.

Page | 1 7


2.6. LCD
2.6.1. Features
Liquid Crystal Display screen is an electronic display module and find a wide range of applications. A 16x2
LCD display is very basic module and is very commonly used in various devices and circuits. These modules
are preferred over seven segments and other multi segment LEDs. The reasons being: LCDs are economical;
easily programmable; have no limitation of displaying special & even custom characters (unlike in seven
segments), animations and so on.
A 16x2 LCD means it can display 16 characters per line and there are 2 such lines. In this LCD each character is
displayed in 5x7 pixel matrix. This LCD has two registers, namely, Command and Data.
The command register stores the command instructions given to the LCD. A command is an instruction given to
LCD to do a predefined task like initializing it, clearing its screen, setting the cursor position, controlling display
etc. The data register stores the data to be displayed on the LCD. The data is the ASCII value of the character to
be displayed on the LCD.
2.6.2. Pin Description

Pin No Function Name
1 Ground (0V) Ground
2 Supply voltage; 5V (4.7V 5.3V) Vcc
3 Contrast adjustment; through a variable resistor

V
EE

4 Selects command register when low; and data register when high Register Select
5 Low to write to the register; High to read from the register Read/write
6 Sends data to data pins when a high to low pulse is given Enable
7
8-bit data pins
DB0
8 DB1
9 DB2
10 DB3
11 DB4
12 DB5
13 DB6
14 DB7
15 Backlight V
CC
(5V) Led+
16 Backlight Ground (0V) Led-

2.6.3. Pin Diagram

Page | 18




3.1. C-Coding
#asm
.equ __lcd_port=0x12 ;PORTD
#endasm
#include <mega16.h>
#include <lcd.h>
#include <delay.h>
#include <stdio.h>
#define ADC_VREF_TYPE 0x00
// Read the AD conversion result
unsigned int read_adc(unsigned char adc_input)
{
ADMUX=adc_input|ADC_VREF_TYPE;
// Start the AD conversion
ADCSRA|=0x40;
// Wait for the AD conversion to complete
while ((ADCSRA & 0x10)==0);
ADCSRA|=0x10;
return ADCW;
}
void main(void)
{
unsigned char key;
unsigned int temp, temp_set=70; char buf[80];
PORTB=0x00; DDRB=0xFF;
PORTC=0xFF;
// ADC initialization
// ADC Clock frequency: 1000.000 kHz
// ADC Voltage Reference: AREF pin
// ADC High Speed Mode: Off
// ADC Auto Trigger Source: None
ADMUX=ADC_VREF_TYPE;
3. Programming
Page | 19

ADCSRA=0x83;
SFIOR&=0xEF;
lcd_init(16);
lcd_clear();
delay_ms(100);
while (1)
{
temp =read_adc(0);
temp =temp*48/100;
//lcd_clear();
lcd_gotoxy(0,0); sprintf(buf,"Set val:%i Deg ",temp_set); lcd_puts(buf);
lcd_gotoxy(0,1); sprintf(buf,"Temper :%i Deg ",temp); lcd_puts(buf);
key=PINC;
if(key==254){temp_set=temp_set-1; if(temp_set<5) temp_set=5; }
else if(key==253){temp_set=temp_set+1; if(temp_set>40) temp_set=40;}
if (temp<temp_set-1) {PORTB.0=1;}
else if(temp>temp_set+1) {PORTB.0=0;}
delay_ms(20);
}
};
















Page | 20

3.2. Hex-code
:100000000202A332000000000000003200000000E5
:10001000000000320000000000000032000000007C
:10002000000000320000000000000032000000006C
:10003000000000320000AE02E6F70809DEFA22C036
:10004000E0741B1470FDD0E0002274C81200581236
:100050000058D5E0F7D8F322C0E0741912003F141D
:1000600070FAD0E022D292C293A2E49294A2E592D6
:1000700095A2E69296A2E79297D293C293A2E092BB
:1000800094A2E19295A2E29296A2E39297D293C2B1
:100090009312003F12003F22C29280CBC292C293C1
:1000A000120058C297C296D295D294D293C293129C
:1000B0000058120058D293C293120058D293C293A0
:1000C000120058C294D293C293120058742812009E
:1000D00098740E120098740612009822740112008F
:1000E000981200587480120098220022D29111EACE
:1000F000D29011EA7F0AD330910C309009DFF8C218
:100100009011EAC291C3920422C29011EAD29111D5
:10011000EAD29022929011EA500C7F0A209007DFD9
:10012000FBD291D38013D29111EA7F0A209107DF8D
:10013000FBD290D38003C291C322D29011EAD29114
:1001400011EA7F0A209105DFFBD38007A29092D5A8
:10015000C291C3227E08333114400CDEF9313A409B
:1001600006A2D55002310992042233FD7E08313AAD
:10017000400CA2D533DEF7CD13CD3114D2909204CA
:1001800022F874AD04000000000000000070F500CB
:10019000D8F022AE02760008DEFB22780C319320E4
:1001A0000111C2D574082A14F8E630E706B2D578F2
:1001B00008511620010F74102A14F8E630E706B231
:1001C000D5781051167810790875F008EAA4FBE686
:1001D00026F6C0D0BA0104D0D0800BD0D0AE021E1B
:1001E00008E633F6DEFA780CAE02E633F608DEFAFD
:1001F000AE02780CE6970908DEFA197810401279F9
:1002000008C3780CAE02E697F60908DEF9781019F3
:10021000067908DBBA22AE02D3E6F43400F608DE33
:10022000F822C0017910120036D001C00174102AE2
:1002300014F8E6C0E0780831937808760AE9240FCC
:10024000F9E4F719C001319B780CD001E62430F7AE
Page | 21

:100250007810AE02E44608DEFC70E8D0E02001072A
:1002600030E704742D19F7A801D0017A1012027139
:1002700022E6F760040809DAF8E4F722E6600612DD
:1002800000650880F722BA0104797F8010BA020461
:1002900079BF8009BA0304798F800279CFE925F00C
:1002A00002009878FFE4F6D8FD75813575200012BC
:1002B000009C7532007533007534001200DC740C3C
:1002C000120098797F75F00112029D780BE8836027
:1002D000061200650880F60202EB54656D706572C7
:1002E00020496E64696361746F720079BF75F001B3
:1002F00012029D780BE88360061200650880F60202
:10030000031143756D20636F6E74726F6C6C657250
:1003100000780312004A1200DC797F75F0011202A6
:100320009D780BE88360061200650880F602033FA3
:10033000456E74722054656D702056616C3A0020D1
:10034000B0FD749012018175F001E53425F0C0E034
:100350007834D0E0F6797F75F00F12029D78347A08
:10036000017921D201120222C201782112027CE518
:1003700034B42702800250030203810203A1020366
:100380008402033F75331F79BF75F00E12029D780A
:10039000337A017921D201120222C201782112029C
:1003A0007C74901200ECC2E01201547440120154AB
:1003B00012010974911200ECD2E0120154D312011F
:1003C0006A120109F53279BF75F00112029D780BAE
:1003D000E88360061200650880F60203EB50726540
:1003E00073656E742054656D703A0079BF75F010B6
:1003F00012029D780BE88360061200650880F60201
:10040000040520200079BF75F00E12029D780BE8DC
:100410008360061200650880F602041F33310078FD
:100420000112004A74911200ECD2E0120154D3126E
:10043000016A120109F532E532B41F02800240035D
:1004400002049575332079BF75F00E12029D780B6A
:10045000E88360061200650880F60204612020200F
:100460000079BF75F00E12029D78337A017921D29E
:1004700001120222C201782112027C7464120181ED
:10048000E532B41E02800240030204920204980284
:10049000049502042402042474911200ECD2E012A8
:1004A0000154D312016A120109F532E532B41E0279
:1004B0008002400302050875332179BF75F00E12E2
Page | 22

:1004C000029D780BE88360061200650880F602043E
:1004D000D420200079BF75F00E12029D78337A0186
:1004E0007921D201120222C201782112027C7464A5
:1004F000120181E532B41D028002400302050502AB
:10050000050B02050802049802049874911200EC8D
:10051000D2E0120154D312016A120109F532E53218
:10052000B41D028002400302057B75332279BF753A
:10053000F00E12029D780BE88360061200650880B9
:10054000F602054720200079BF75F00E12029D7853
:10055000337A017921D201120222C20178211202DA
:100560007C7464120181E532B41C028002400302F3
:10057000057802057E02057B02050B02050B7491CE
:100580001200ECD2E0120154D312016A120109F5F3
:1005900032E532B41C02800240030205EF753323BA
:1005A00079BF75F00E12029D780BE8836006120089
:1005B000650880F60205BB2020200079BF75F00E8B
:1005C00012029D78337A017921D201120222C201EE
:1005D000782112027C7464120181E532B41B02801E
:1005E0000240030205EC0205F20205EF02057E025D
:1005F000057E74911200ECD2E0120154D312016A0C
:10060000120109F532E532B41B02800240030206F2
:100610006375332479BF75F00E12029D780BE88361
:1006200060061200650880F602062F20202000795F
:10063000BF75F00E12029D78337A017921D2011232
:100640000222C201782112027C7464120181E53217
:10065000B41A0280024003020660020666020663C4
:100660000205F20205F274911200ECD2E01201547C
:10067000D312016A120109F532E532B41A0280027E
:1006800040030206D875332579BF75F00E12029D1E
:10069000780BE88360061200650880F60206A42045
:1006A0002020200079BF75F00E12029D78337A0168
:1006B0007921D201120222C201782112027C7464D3
:1006C000120181E532B41902800240030206D5020C
:1006D00006DB0206D802066602066674911200EC7A
:1006E000D2E0120154D312016A120109F532E53247
:1006F000B419028002400302074C75332679BF7596
:10070000F00E12029D780BE88360061200650880E7
:10071000F60207182020200079BF75F00E12029D06
:1007200078337A017921D201120222C20178211292
Page | 23

:10073000027C7464120181E532B418028002400325
:1007400002074902074F02074C0206DB0206DB7470
:10075000911200ECD2E0120154D312016A12010985
:10076000F532E532B41802800240030207C1753346
:100770002779BF75F00E12029D780BE88360061290
:1007800000650880F602078D202020200079BF75C3
:10079000F00E12029D78337A017921D201120222E1
:1007A000C201782112027C7464120181E532B4170F
:1007B00002800240030207BE0207C40207C102070B
:1007C0004F02074F74911200ECD2E0120154D31281
:1007D000016A120109F532E532B4170280024003C2
:1007E0000207E874010207E9E4C0E0E532B415024B
:1007F000800240030207FC74010207FDE4D0F055BB
:10080000F0B4010280030208687419120181753383
:100810002879BF75F00E12029D780BE883600612EE
:1008200000650880F602082D202020200079BF7581
:10083000F00E12029D78337A017921D20112022240
:10084000C201782112027C7464120181E532B41273
:1008500002800250030208657419120181C2B202BB
:10086000086B0208680207C40207C474911200EC06
:10087000D2E0120154D312016A120109F532E532B5
:10088000B41602800250030208DC75332779BF7565
:10089000F00E12029D780BE8836006120065088056
:1008A000F60208A82020200079BF75F00E12029DE4
:1008B00078337A017921D201120222C20178211201
:1008C000027C7464120181E532B417028002500385
:1008D0000208D90208DF0208DC02086B02086B7408
:1008E000911200ECD2E0120154D312016A120109F4
:1008F000F532E532B4170280025003020953753312
:100900002679BF75F00E12029D780BE883600612FF
:1009100000650880F602091D202020200079BF759F
:10092000F00E12029D78337A017921D2011202224F
:10093000C201782112027C7464120181D2B2E532C4
:10094000B41802800250030209500206DB02095368
:100950000208DF0208DF00000000000000000000C5
:00000001FF
Page | 24


4.1. Introduction
The purpose of this application note is to guide the user through the preparation of an example C program using
the CodeVisionAVR C Compiler. The example, which is the subject of this application note, is a simple
program for the Atmel microcontroller on the starter kit.





The source code is written in the IDE window. If compile button is clicked, the code will be converted in the
hex code ; in that case source code should be error free.
4.2. Features
Installing and Configuring CodeVisionAVR to Work with the Atmel Starter Kit and AVR Studio Debugger
Creating a New Project Using the CodeWizardAVR Automatic Program Generator
Editing and Compiling the C Code
Loading the Executable Code into the Target Microcontroller on the Starter Kit

4. Compiler
Page | 25

4.3. Process
1. Create a new project by selecting: File New Select Project
2. Specify that the CodeWizard AVR will be used for producing the C source and project files: Use the
CodeWizard? Yes
3. In the CodeWizard AVR window specify the chip type and clock frequency.
4. Configure the I/O Ports.
5. Configure Timer1: TimersTimer1 Clock Value, Interrupt on: Timer1 Overflow
6. Generate the C source, C project and CodeWizard AVR project files by selecting: File Generate, Save and
Exit Create new directory: C:\cvavr\led Save: led.c, Save: led.prj , Save: led.cwp
7. Edit the C source code
8. View or Modify the Project Configuration by selecting Project Configure After Build Program the
Chip SCK Frequency
9. Compile the program by selecting: Project Build
10. Automatically program the chip on the STK500 starter kit: Apply power Information Program chip.



Page | 26


5.1. Introduction
The controller which we use in the project, is IC-89C51.When IC is running condition, then
its ALE pin is kept logic high. But in program mode, ALE pin must be kept in +12 v dc
supply. When this condition meet ,the serial data which is coming from level converter(max
232),is entered into the controller through its Rx pin. Finally, hex coded program is loaded
in ICs flash memory. It can be reprogrammed according need.
5.2. Figure




5. Program Loader ( Pro-Load 4.1 )
Page | 27


6.1. Utility
When we are going to sense, indicate, control any temp. for observation or
recording or monitoring or alarming or measure ,then this device is very much
essential. Here only one channel is used for a single temperature sensor. Other
paths can be utilized by attaching more temp. sensor or different sensors like
humidity, flow of air, pressure of air etc. These can be done easily by little
program changing in IC. So, this device is very important for any industry and
plant. The project development is also very simple and it is low cost device.

6.2. Future Scope
Heat control panel.
Induction cooker.
Industry purpose: a. Food industry
b. Process control industry
c. Steel industry
d. Diary industry
e. Boiler plant
etc.
6. Applications
Page | 28




After finishing the whole project, we can conclude that this is

Easy for up gradation of any plant, if properly utilised.
Time saving process.
Easy for manual operation.
Cost reducing for plant monitoring.
Good for security purposes.

Therefore, this is an easy & cheap idea for a plant in case for temperature
monitoring.
7. Conclusion


Page | 29



Anil Kumar Sharma ( Assistant Professor, A.I.E.M. ).
Nirban Kumar Saha ( Teacher-In-Charge, A.I.E.M. ).
Embedded Programming by BJ T.
Embedded Systems & Control by D. Razah.
www.google.co.in.
www.datasheet.com.
www.efymag.org.
www.allaboutcircuit.com.
www.circuitidea.com.
www.dkdynamics.com.



References

Anda mungkin juga menyukai