You are on page 1of 49

GANPAT UNIVERSITY

PROJECT REPORT
ON

TEMPRATURE
CONTROLLER AND
DISPLAY
PREPARED BY:
PATEL
PATEL
PATEL

DHIREN
JAY
PIYUSH

GUIDED BY:
(086440311526)
(086440311528)
(086440311536)

MR. H.H.AGRAWAL

Certificate
This is certified that
1. Patel Dhiren Bharatbhai
2. Patel Jay Sureshbhai
3. Patel Piyush Dashrathbhai

Of diploma
in Electronics and Communication Engineering (6 th
semester) of the academic year Dec-2009 as
satisfactory completed their term work in project on
TEMPRATURE CONTROLLER AND DISPLAY
They worked with full interest and here with
submit their report in partial fulfillment of the Diploma
in Electronics & Communication Engineering.
Date of submission:
Sign of Guide:
Head of department

We would like to thank respected dignitaries


for their valuable Cooperation. They have helped us in
completing the project work satisfactory and successfully
We are really very thankful to our Head of
the department Mr.B.S.Patel for giving us the opportunity
to take this project work on TEMPRATURE CONTROLLER
AND DISPLAY and encouraging us in completing the
project work successfully.
We are very thankful to our guide, Mr.
H.H.Agrawal for providing us his valuable guidance in
every aspects concerned with our project. His willingness
and deep knowledge have always helped us in conceiving
new ideas. We would also like to thank him for his co
operation He has always quietly and gladly answered all
our queries regarding to this project.
We are also thankful to our lab assistant
Mr.Shaileshbhai as well to provide us necessary
laboratory devices in working or running conditions.

WITH HEARTFULL OF GRATITUDE

EXPERIENCE IS THE BEST TEACHER. This


saying as played a guiding role in including information as a
part of the curriculum of the ELECTRONICS AND
COMMUNICATION programme of the GANPAT UNIVERSITY.
This practical training based on ELECTRONICS
AND COMMUNICATION programmed. Developed feeling
about the difficulties challenges in the engineering word. Only
theoretical knowledge does not impart complete education
parallel experience must accompany theoretical knowledge
admiring education.
In this direction we have try to our level best to
present a project report on TEMPRATURE CONTROLLER AND
DISPLAY.

1.

Introduction

2.

Circuit Diagram

3.

Circuit Description

4.

Component List

5.

Data sheets

6.

Reference

A simple introduction about the temperature controller


circuit.
This circuit project is mainly used used for
temperature
indicator, temperature controller
And in controlling device depend on temperature.
Controlling devices like air heater, factory, industrial,
application.
In temperature controller circuit there are two part consist
of
o ADC 0804 interface with at89s52.
o LCD interface with at89s52.
The hardware circuit of temperature controller with
controller to need the programming.
There are two possibilities FSO programming
assembly language programming
c language
Here we use the assembly language programming using
keil
(Vision4 IDE) software.
This programming usually load in the at89s52 controller
ic.
At89s52 is a family of 8051.
The programming
embedded system.

for

8051.this

system

is

called

The main principle of this project to indicate temperature,


analog to digital, to control the temperature & interfacing.

Working : How to interface ADC0804 using 8051 microcontroller


(AT89C52)
ADC0804 is one of the most commonly used analog to
digital converter IC. In many applications it is required
to convert the output of the sensor, which is analogue
in nature to a digital form. The data in digital format
can then be utilized for further processing by the digital
processors. Typical applications include sound
processing, temperature processing etc. This circuit
demonstrates the principle and operation of interfacing
a simple ADC 0804 using 8051 microcontroller
(AT89C52).
ADC0804 is connected as shown in the circuit diagram.
Here the input is taken from a preset, which gives
different analog signals to the ADC. The output pins of
the ADC are connected to LEDs. The control pins of the
ADC are connected to the microcontroller AT89C52.
ADC0804 is a single channel analog to digital convertor
i.e., it can take only one analog signal. An ADC has n bit
resolution (binary form) where n can be 8,10,12,16 or
even 24 bits. ADC 0804 has 8 bit resolution. The higher
resolution ADC gives smaller step size. Step size is
smallest change that can be measured by an ADC. For
an ADC with resolution of 8 bits, the step size is
19.53mV (5V/255).
The time taken by the ADC to convert analog data into
digital form is dependent on the frequency of clock
source. ADC0804 can be given clock from external
source. It also has an internal clock.
However the conversion time cannot be more
than110us. To use the internal clock a capacitor and
resistor is connected to pin 19 and 4 as shown in the
circuit diagram. The frequency is given by the relation
f= 1/ (1.1RC). The circuit uses a resistance of 10k and a
capacitor of 150pF to generate clock for ADC0804. Vin,
which is the input pin, is connected to a preset to
provide analog input.
Pin Description

1. CS, Chip Select: This is an active low pin and used


to activate the ADC0804.
2. RD, Read: This is an input pin and active low. After
converting the analog data, the ADC stores the result
in an internal register. This pin is used to get the data
out of the ADC 0804 chip. When CS=0 & high to low
pulse is given to this pin, the digital output is shown
on the pins D0-D7.
3. WR, Write: This is an input pin and active low. This
is used to instruct the ADC to start the conversion
process. If CS=0 and WR makes a low to high
transition, the ADC starts the conversion process.
4. CLK IN, Clock IN: This is an input pin connected to
an external clock source.
5.
INTR, Interrupt: This is an active low output pin.
This pin goes low when the conversion is over.
6.

Vin+ : Analog Input .

7.

Vin- : Analog Input. Connected to ground.

8.

AGND: Analog Ground.

9.
Vref/2: This pin is used to set the reference
voltage. If this is not connected the default reference
voltage is 5V. In some application it is required to reduce
the step size. This can be done by using this pin.
10. DGND: Digital Ground.
11-18. Output Data Bits (D7-D0).
19. CLKR: Clock Reset.
20. Vcc: Positive Supply

Controlling functions :-

The lcd display two temperature 1)current temperature


2)set point temperature
The set point increment & decrement using switch.
When we set the sp( set point ) less than the current
temperature , then trigger the pulse to base of transistor
by controller.
The collector current flow in coil. so the LED will be ON.
In ON condition of relay the common terminal is
connected with NO of relay.
Finally , the buzzer will be ON.
When sp is more than current temperature. in this
condition led & relay & buzzer will be off.

sfr
sfr
sfr
sfr

P0=0x80;
P1=0x80;
P1=0x90;
P2=0xA0;

sfr P3=0xB0;
sbit relay = P1^0;
Sbit inc = P1^1;
sbit dec = P1^2;
#define adcdata P3
sbit intr = P2^2; //5
sbit rd
= P2^0; //2
sbit wr
= P2^1; //3
sbit rs = P2^5;
sbit rw = P2^6;
sbit en = P2^7;
unsigned char line[4] = {0x80,0xC0,0x90,0xD0};
#define DBUS
P0
#define BLINKLCD 0x09
#define ONCURSOR
0x0A
#define ONLCD
0x0C
#define CLEARLCD
0x01
#define HOMELCD 0x02
#define ENTRYMODE
0x06
#define FUNCSET 0x38
void wrlcd_cmd(unsigned char cmd );
void wrlcd_data(unsigned char Data );
void delay(unsigned int count);
void wrmsg(char LineNo,char endloc, unsigned char msg[]);
void getdata();
static unsigned char sp=0;
code unsigned char scr5[2] [16] = {" Temp:
" SP:

",
"};

code unsigned char scr1[2] [16] = {" JAY Patel ",


" BSPP 2nd SHIFT "};
void main()
{
unsigned char i;
unsigned char x,d1,d2,d3,val,a=0;;
P3=0xff;
P0=0x00;

P2=0x0f;
relay=0;
wrlcd_cmd(FUNCSET);
//set data length,no of
disp,2-line display
wrlcd_cmd(ONLCD);
//display and cursor on
wrlcd_cmd(ENTRYMODE); //inc. DDram address,
wrlcd_cmd(CLEARLCD); //Clear display
for(i=0;i<2;i++)
{
delay(100);
wrmsg(line[i],16,scr1[i]);
}
for(i=0;i<15;i++)
delay(50000);
for(i=0;i<2;i++)
{
delay(100);
wrmsg(line[i],16,scr5[i]);
}
while(1)
{
wr=0;
delay(100);
wr=1;
while(intr != 1);
while(intr != 0);
rd=0;
delay(10);
val=adcdata;
rd=1;
wrlcd_cmd(line[0]+9);

x=val/10;
d1=val%10;
d2=x%10;
d3=x/10;

wrlcd_data(d3+0x30);
delay(10);
wrlcd_data(d2+0x30);
wrlcd_data(d1+0x30);
delay(10);
a=(d3*100)+(d2*10)+d1;
wrlcd_data('C');
wrlcd_cmd(line[1]+9);
wrlcd_data((sp/10)+0x30);
wrlcd_data((sp%10)+0x30);
if(inc==0)
{
while(inc==0);
sp++;
}
if( (dec==0) && sp>0 )
while(dec==0);
sp--;
}
if(a>sp)
relay=1;
else
relay=0;
delay(25000);
}
}
void wrlcd_cmd(unsigned char cmd )

{
DBUS = cmd;
delay(10);
rs = 0;

//select cmd reg

delay(10);
rw = 0;
delay(10);
en = 1;
delay(300);
en = 0;
delay(20);

//write mode

}
void wrlcd_data(unsigned char Data )
{
DBUS = Data;
delay(10);
rs = 1;
//select data reg
delay(10);
rw = 0;
delay(10);
en = 1;
delay(300);
en = 0;
delay(10);
rs = 0;
delay(20);
}
void wrmsg(char LineNo,char endloc, unsigned char msg[])
{
unsigned char i;
wrlcd_cmd(LineNo);
for(i =0;i<=endloc;i++)
{
wrlcd_data(msg[i]);
delay(50);
}
}
void delay(unsigned int dly)
{
while(dly>0)
dly--;
}

1. Resistor 1k, 10k, 8.2k, 10k pot


2. Capacitor - 155pf, 33pf, 10uf
3. DC power supply
4. LED
5. Switch
6. Transistor
7. Buzzer
8. Relay
9. Crystal
10. AT89S52
11. ADC 0804
12. 7805
13.Sensor- LM 35
14. Display
15. Socket

RESISTOR:Axial- lead resistors on tape. The


tape is removed during assembly
before the leads are formed and
the part is inserted into the board.
Three carbon composition resistors
in a 1960s valve (vacuum tube)
radio. A resistor is a two-terminal
electronic component that
produces a voltage across its
terminals that is proportional to the
electric current through it in
accordance with Ohm's law:

V = IR
Resistors are elements of electrical
networks and electronic circuits

and are ubiquitous in most electronic equipment. Practical


resistors can be made of various compounds and films, as well
as resistance wire (wire made of a high-resistivity alloy, such as
nickel/chrome).
The primary characteristics of a resistor are the resistance, the
tolerance, maximum working voltage and the power rating.
Other characteristics include temperature coefficient, noise,
and inductance. Less well-known is critical resistance, the value
below which power dissipation limits the maximum permitted
current flow, and above which the limit is applied voltage.
Critical resistance depends upon the materials constituting the
resistor as well as its physical dimensions; it's determined by
design. Resistors can be integrated into hybrid and printed
circuits, as well as integrated circuits. Size, and position of
leads (or terminals) are relevant to equipment designers;
resistors must be physically large enough not to overheat when
dissipating their power.

Resistor Color Coding

10k Variable
Resistor:-

Variable resistors consist of a resistance track with


connections at both ends and a wiper which moves along the
track as you turn the spindle. The track may be made from
carbon, cermets (ceramic and metal mixture) or a coil of wire
(for low resistances). The track is usually rotary but straight
track versions, usually called sliders, are also available.
Variable resistors may be used as a rheostat with two
connections (the wiper and just one end of the track) or as a
potentiometer with all three connections in use. Miniature
versions called presets are made for setting up circuits which
will not require further adjustment.
Variable resistors are often called potentiometers in
books and catalogues. They are specified by their maximum
resistance, linear or logarithmic track, and their physical size

CAPACITOR:Electronic symbol:Type: - Passive


A capacitor or condenser is a passive electronic
component consisting of a pair of conductors separated by a
dielectric. When a voltage potential difference exists between
the conductors, an electric field is present in the dielectric. This
field stores energy and produces a mechanical force between
the plates. The effect is greatest between wide, flat, parallel,
narrowly separated conductors.
The conductors and leads introduce an equivalent
series resistance and the dielectric has an electric field strength
limit resulting in a breakdown voltage.
Capacitors are widely used in electronic circuits to block the
flow of direct current while allowing alternating current to pass,
to filter out interference, to smooth the output of power
supplies, and for many other purposes. They are used in
resonant circuits in radio frequency equipment to select
particular frequencies from a signal with many frequencies.
Ceramic Capacitor:Ceramic capacitors are constructed with materials such as
titanium acid barium used as the dielectric. They can be used
in high frequency applications. Typically, they are used in
circuits which bypass high frequency signals to ground.
These capacitors have the shape of a disk. Their capacitance is
comparatively small.
The capacitor on the left is a 100pF capacitor with a diameter
of about 3 mm.The capacitor on the right side is printed with
103, so 10 x 103pF becomes 0.01 F. The diameter of the disk is
about 6 mm.
Ceramic capacitors have no polarity Ceramic capacitors should
not be used for analog circuits, Because distort the signal.

LED :Features: Water Clear Lens


850nm Wavelength
Forward Voltage - 1.7V

A light-emitting diode (LED) is an electronic light source.


LEDs are used as indicator lamps in many kinds
of electronics and increasingly for lighting. LEDs work by the
effect of electroluminescence, discovered by accident in 1907.
The LED was introduced as a practical electronic component in
1962. All early devices emitted low-intensity red light, but
modern LEDs are available across
the visible, ultraviolet and infra red wavelengths, with very high
brightness.
LEDs are based on the semiconductor diode. When the diode is
forward biased.
LEDs present many advantages over traditional light sources
including lower energy consumption, longer lifetime, improved
robustness, smaller size and faster switching. However, they
are relatively expensive and require more
precise current and heat management than traditional light
sources.
Applications of LEDs are diverse. They are used as low-energy
indicators but also for replacements for traditional light sources
in general lighting, automotive lighting and traffic signals. The
compact size of LEDs has allowed new text and video displays
and sensors to be developed, while their high switching rates
are useful in communications technology.

TRANSISTOR:-

RELAY:-

A relay is an electrical switch that opens and closes


under the control of another electrical circuit. In the original
form, the switch is operated by an electromagnet to open or
close one or many sets of contacts. It was invented by Joseph
Henry in 1835. Because a relay is able to control an output
circuit of higher power than the input circuit, it can be
considered
to be, in a broad sense, a form of an electrical amplifier.

Fig. 4.26 Sugar cube relay

Despite

the

speed

of

technological

developments,

some products prove so popular that their key parameters


and design features remain virtually unchanged for years.
One such product is the sugar cube relay, shown in the
figure above, which has proved useful to many designers
who needed to switch up to 10A, whilst using relatively little
PCB area
Since relays are switches, the terminology applied to
switches is also applied to relays. A relay will switch one or
more poles, each of whose contacts can be thrown by
energizing the coil in one of three ways:

1.Normally - open (NO) contacts connect the circuit when

the relay is activate d; the circuit is disconnected when the


relay is inactive. It is also called a FORM A contact or
make contact.
2.Normally - closed (NC) contacts disconnect the circuit
when the relay is activated ; the circuit is connected when
relay is inactive. It is also called FORM B contact or
break contact
3.Change-over or double-throw contacts control two
circuits ; one

normally open contact and one normally

closed contact with a common terminal. It is also called a


Form C transfer contact.

"C" denotes the common terminal in SPDT and DPDT types

SPST - Single Pole Single Throw: These have two


terminals which can be connected or disconnected.
Including two for the coil, such a relay has four
terminals in total. It is ambiguous whether the pole is
normally open or normally closed. The terminology
"SPNO" and "SPNC" is sometimes used to resolve the
ambiguity.

SPDT - Single Pole Double Throw: A common


terminal connects to either of two others. Including
two for the coil, such a relay has five terminals in
total.
DPST - Double Pole Single Throw: These have two
pairs of terminals. Equivalent to two SPST switches or
relays actuated by a single coil. Including two for the
coil, such a relay has six terminals in total. It is
ambiguous whether the poles are normally open,
normally closed, or one of each.
DPDT - Double Pole Double Throw: These have two
rows of change-over terminals.
Equivalent to two SPDT switches or relays actuated by a
single coil. Such a relay has eight terminals, including
the coil.
QPDT - Quadruple Pole Double Throw: Often
referred to as Quad Pole Double Throw, or 4PDT. These
have four rows of change-over terminals. Equivalent to
four SPDT switches or relays actuated by a single coil,
or two DPDT relays. In total, fourteen terminals
including the coil.

AT89S52 :-

SENSOR-LM35:-

IC-7805:-

LCD:-

LIQUID CRYSTAL DISPLAY


A liquid crystal display (LCD) is a thin, flat display device
made up of any number of color or monochrome pixels
arrayed in front of a light source or reflector. Each pixel
consists of a column of liquid crystal molecules suspended
between two transparent electrodes, and two polarizing
filters, the axes of polarity of which are perpendicular to
each other. Without the liquid crystals between them, light
passing through one would be blocked by the other. The
liquid crystal twists the polarization of light entering one filter
to allow it to pass through the other.
Many microcontroller devices use 'smart LCD' displays to
output visual information. LCD displays designed around
Hitachi's LCD HD44780 module, are inexpensive, easy to
use, and it is even possible to produce a readout using the
8x80 pixels of the display. They have a standard ASCII set of
characters and mathematical symbols.
For an 8-bit data bus, the display requires a +5V supply
plus 11 I/O lines. For a 4-bit data bus it only requires the
supply lines plus seven extra lines. When the LCD display is
not enabled, data lines are tri-state and they do not interfere
with the operation of the microcontroller.
Data can be placed at any location on the LCD. For 162
LCD, the address locations
are:
First line
8F

80 81 82 83 84 85 86

Second line
C0
C1 C2 C3 C4
through CF

SIGNALS TO THE LCD

through
C5

C6

The LCD also requires 3 control lines from the


microcontroller:

1) Enable (E)
This line allows access to the display through R/W
and RS lines. When this line is low, the LCD is disabled
and ignores signals from R/W and RS. When (E) line is
high, the LCD checks the state of the two control lines
and responds accordingly.

2) Read/Write (R/W)
This line determines the direction of data between
the LCD and microcontroller.
When it is low, data is written to the LCD. When it is high,
data is read from the
LCD
.

3) Register select (RS)


With the help of this line, the LCD interprets the type of
data on data lines. When it is low, an instruction is being
written to the LCD. When it is high, a character is being
written to the LCD.

Logic status on control lines:


E - 0 Access to LCD
disabled
- 1 Access to LCD enabled
R/W - 0 Writing data
to LCD
- 1 Reading data
from LCD
RS - 0 Instruction
- 1
Characte
r

Writing and reading the data from the


LCD:
Writing data to the LCD is done in several steps:
1) Set R/W bit to low
2) Set RS bit to logic 0 or 1 (instruction or character)
3) Set data to data lines (if it is writing)
4) Set E line to high
5) Set E line to low
Read data from data lines (if it is reading):
1) Set R/W bit to high
2) Set RS bit to logic 0 or 1 (instruction or character)
3) Set data to data lines (if it is writing)
4) Set E line to high
5) Set E line to low

PIN DESCRIPTION
Most LCDs with 1 controller has 14 Pins and LCDs with 2
controller has 16 Pins
(two pins are extra in both for back-light LED connections).

1. http://www.westfloridacomponents.com
2. http://www.futurlec.com
3. http://www.pdf-search-engine.com/
4. http://www.westfloridacomponents.com
5. http:// www.google.com
6. http://www.datasheetscatalog.com
Books:1. Electronic devices and circuits-2 (R.P Ajwaliya)
2. Mazidee