Digital Thermometer Using 8051 Microcontroller Project Report
Digital Thermometer Using 8051 Microcontroller Project Report
OBJECTIVE
CIRCUIRT DESCRIPTION
CIRCUIT DIAGRAM
COMPONENT DESCRIPTION
LM35 Temperature Sensor
AT89C51
Seven Segment Display
ADC0804
741 op-amp
Preset
Resistors
Transistor 2N2222
Capacitors
DESIGN SPECIFICATIONS:
2. Types of PCB:
The objective of this project is to design a digital thermometer using 8051 microcontroller. Digital
thermometer displays the ambient temperature through a LCD display. It consists of two sections.
One is that which senses the temperature. This is a temperature sensor LM 35. The other section
converts the temperature value into a suitable number in Celsius scale which is done by the
ADC0804.
CIRCUIRT DESCRIPTION:
The circuit is based on LM35 analog temperature sensor, ADC0804 and AT89S51 microcontroller.
LM35 is an analogue temperature sensor IC which can measure a temperature range of -55 to
150°C. Its output voltage varies 10mV per °C change in temperature.
Celsius scale thermometer displays the ambient temperature through a LCD display. It consists of
two sections. One is that which senses the temperature.
This is a temperature sensor LM 35. The other section converts the temperature value into a suitable
number in Celsius scale which is done by the ADC0804.
The Output of the temperature sensor is analog in nature so we need an analog to digital convertor
for converting the analog input to its equivalent binary output.
ADC 0804 is an analog to digital convertor IC used in the project. 0804 is a single channel convertor
which converts the analog input up to a range of 5V to an equivalent 8-bit binary output.
The step size is defined by the voltage applied at the Vref/2 pin of the ADC IC. For example, if the
voltage at Vref/2 pin is set to 1.28V then ADC has a step size of 10 mV. So if the input voltage is 1V
the equivalent binary output of ADC will be 100 or 0110 0100 in binary.
The 8 bit binary output of the ADC is incremented by one for every 10 mV rise of input
voltage. Different step size can be selected by changing the voltage input to the Vref/2 pin. The step
size of the ADC is calibrated using a preset to match the actual temperature.
Once the ADC is calibrated it will give the correct output further. The binary output of ADC is fed
parallel to a port of the microcontroller .The microcontroller reads the input through ADC and displays
the corresponding decimal value on LCD indicating the temperature.
LIST OF COMPONENTS USED:
AT89C51 Microcontroller
ADC0804
IC 741
Potentiometer 200K
Resistors:
10k – 3
8.2k – 1
100 ohm – 10
Capacitors:
150Pf – 1
10 micro f – 1
2n2222 Transistors
CIRCUIT DIAGRAM:
HARDWARE DETAILS OF 8051 CIRCUIT TRAINER:
LM35 is a precision IC temperature sensor with its output proportional to the temperature (in oC). The
sensor circuitry is sealed and therefore it is not subjected to oxidation and other processes. With
LM35, temperature can be measured more accurately than with a thermistor. It also possess low self
heating and does not cause more than 0.1 oC temperature rise in still air.
The LM35 series are precision integrated-circuit LM35 temperature sensors, whose output voltage is
linearly proportional to the Celsius (Centigrade) temperature. The LM35 sensor does not require any
external calibration or trimming to provide typical accuracies of ±¼°C at room temperature and ±¾°C
over a full -55 to +150°C temperature range.
It can be used with single power supplies, or with plus and minus supplies. As it draws only 60 µA
from its supply, it has very low self-heating, less than 0.1°C in still air. The LM35 is rated to operate
over a -55° to +150°C temperature range, while the LM35C sensor is rated for a -40° to +110°C
range (-10° with improved accuracy).
Pin Diagram:
Pin Description:
AT89C51 is an 8-bit microcontroller and belongs to Atmel's 8051 family. ATMEL 89C51 has 4KB of
Flash programmable and erasable read only memory (PEROM) and 128 bytes of RAM. It can be
erased and program to a maximum of 1000 times.
In 40 pin AT89C51, there are four ports designated as P1, P2, P3 and P0. All these ports are 8-bit bi-
directional ports, i.e., they can be used as both input and output ports. Except P0 which needs
external pull-ups, rest of the ports have internal pull-ups. When 1s are written to these port pins, they
are pulled high by the internal pull-ups and can be used as inputs. These ports are also bit
addressable and so their bits can also be accessed individually.
Pin Diagram:
Pin Description:
Pin Diagram:
A seven segment display is the most basic electronic display device that can display digits from 0-9.
They find wide application in devices that display numeric information like digital clocks, radio,
The most common configuration has an array of eight LEDs arranged in a special pattern to display
Every LED is assigned a name from 'a' to 'h' and is identified by its name. Seven LEDs 'a' to 'g' are
used to display the numerals while eighth LED 'h' is used to display the dot/decimal.
A seven segment is generally available in ten pin package. While eight pins correspond to the eight
LEDs, the remaining two pins (at middle) are common and internally shorted.
These segments come in two configurations, namely, Common cathode (CC) and Common anode
(CA).In CC configuration, the negative terminals of all LEDs are connected to the common pins. The
common is connected to ground and a particular LED glows when its corresponding pin is given high.
In CA arrangement, the common pin is given a high logic and the LED pins are given low to display a
number.
ADC0804:
ADC0804 is a very commonly used 8-bit analog to digital convertor. It is a single channel IC. The
digital outputs vary from 0 to a maximum of 255. ADC0804 needs a clock to operate. The time taken
to convert the analog value to digital value is dependent on this clock source. An external clock can
be given at the Clock IN pin.
Pin Diagram:
Pin Description:
The 741 is a versatile op-amp IC. Commonly available 741 is an eight pin dual-in-line package op-
amp IC. It has only a single op-amp module inside it and it requires dual-power supply.
Pin-outs:
The pin-out of the 741 op-amp is shown below. Pin 2 & 3 are input pins and pin 6 is the output pin.
Pin-out of 741
An op-amp is supposed to have zero output voltage whenever the input difference voltage is zero.
But practically this is hard to achieve, because of certain current mismatch at the input terminals. The
741 has two terminals for setting the output voltage to zero, when the input voltage is zero. The pins
provided for this function are called offset null. Among the input pins, the pin2 is called inverting input
A preset is a three legged electronic component which can be made to offer varying resistance in a
circuit. The resistance is varied by adjusting the rotary control over it.The resistance does not vary
linearly but rather varies in exponential or logarithmic manner. Such variable resistors are commonly
used for adjusting sensitivity along with a sensor.The variable resistance is obtained across the single
terminal at front and one of the two other terminals. The two legs at back offer fixed resistance which
is divided by the front leg. So whenever only the back terminals are used, a preset acts as a fixed
Working of presets is quite simple. It works by having a resistive track and a small plate having dents
to short the track. This small plate can be rotated using a screw driver or some similar tool. Position of
the dents on the track determines the amount of resistance that is to be used in the circuit.
Pin Diagram:
RESISTORS:
Resistor is a passive component used to control current in a circuit. Its resistance is given by the ratio
of voltage applied across its terminals to the current passing through it. Resistors can be either fixed
or variable. Negative temperature coefficient (NTC), positive temperature coefficient (PTC) and light
dependent resistor (LDR) are some such resistors. These special resistors are commonly used as
sensors. Read and learn about internal structure and working of a resistor.
Pin Diagram:
The resistor color code is always read one band at a time starting from left to the right, with the larger
width tolerance band oriented to the right side indicating its tolerance. By matching the color of the
first band with its associated number in the digit column of the color chart below, the first digit is
identified and this represents the first digit of the resistive value. The second digit of the resistance is
obtained by matching again the color of the second band with its associated number in the digit
column of the color chart. The tolerance band is usually gold or silver but some may have none.
Transistor 2N2222:
Pin Diagram:
2N2222 is an NPN BJT transistor. It is used for general purpose low-power amplification and
switching applications. These are designed for high speed switching application at collector current
up to 800mA.It provides useful current gain over a wide range of collector current.
Other features include, low leakage currents and low saturation voltage. 2N2222A is another variant
with improved characteristics. The emitter leg of 2N2222 is indicated by a protruding edge in the
transistor case.
CAPACITORS:
A capacitor is a passive two terminal component which stores electric charge. This component
consists of two conductors which are separated by a dielectric medium. The potential difference when
applied across the conductors polarizes the dipole ions to store the charge in the dielectric medium.
The circuit symbol of a capacitor is shown below:
Pin Diagram:
As you turn on the power supply, the current begins to flow through the capacitor inducing the
positive and negative potentials across its plates. The capacitor continues to charge until the
capacitor voltage equalizes up to the supply voltage which is called as the charging phase of the
capacitor. Once the capacitor is fully charged at the end of this phase, it gets open circuited for DC. It
begins to discharge when the power of the capacitor is switched off. There are different types of
The term printed circuit board is derived from the original method where a printed pattern is used as
the mask over wanted areas of copper. The PCB provides an ideal baseboard upon which
to assemble and hold firmly most of the small components.
From the constructor’s point of view, the main attraction of using PCB is its role as the
mechanical support for small components. There is less need for complicated and time-
consuming metal work of chassis contraception except perhaps in providing the final
enclosure. Most straight forward circuit designs can be easily converted in to printed
wi r i n g la ye r t he thou gh t re qu i red to c ar r y ou t the i n ver s ion cab f oo ted h i
gh l i ght an possible error that would otherwise be missed in conventional point to point wiring .The
finished project is usually neater and truly a work of art. Actual size PCB layout for the circuit shown is
drawn on the copper board. The board is then immersed in FeCl3 solution for 12 hours. In this
process only the exposed copper portion is etched out by the solution.
Now the petrol washes out the paint and the copper layout on PCB is rubbed with asmooth sand
paper slowly and lightly such that only the oxide layers over th e Cu arer e m o ved. No w
th e ho le s are d r i l l ed at the resp ect i ve p la ces a cco rd in g to com po nent layout
as shown in figure.
(B) PCB LA YO U T D ES I G N :
It might be necessary to turn some components around to a different angular position so that
terminals are closer to the connections of the components. The scale can be checked by positioning
the components on the squared paper. If any connection crosses, then one can reroute to avoid such
condition.
All common or earth lines should ideally be connected to a common line routed around
the perimeter of the layout. This will act as the ground plane. If possible try to route the outer supply
line to the ground plane. If possible try to route the other supply lines around the opposite edge of
the layout through the centre. The first set is tearing the circuit to eliminate the crossover
without altering the circuit detail in any way.
P lan the la yout l ook in g at the top s i de to th i s boa rd. F i rs t th i s s hou
ld be t ran s la ted inversely; later for the etching pattern large areas are recommended to
maintain good copper adhesion. It is important to bear in mind always that copper track
width must be according to the recommended minimum dimensions and allowance must be
made for increased width where termination holes are needed. From this aspect, it can
become little tricky to negotiate the route to connect small transistors.
There are basically two ways of copper interconnection patterns underside the board. The first is the
removal of only the amount of copper necessary to isolate the junctions of the components to one
another. The second is to make the interconnection pattern looking more like conventional point
wiring by routing uniform width of copper from component to component.
Etching process requires the use of chemicals. Acid resistant dishes and running water
s u ppl y. Fer r i c c h lo r ide i s m ost l y u sed so lu t io n bu t o the r etch in g m ate r ia l
s s uch as ammonium per sulphate can be used. Nitric acid can be used but in general it is not used
due to poisonous fumes. The pattern prepared is glued to the copper surface of the board
using a latex type of adhesive that can be cubed after use. The pattern is laid firmly on the copper
using a very sharp knife to cut round the pattern carefully to remove the paper
corresponding to the required copper pattern areas.
Then apply the resistant solution, which can be a kind of ink solution for the purpose of
maintaining smooth clean outlines as far as possible. While the board is drying, test all the
components. Bef ore go in g t o ne xt stage , che ck t he who le pat te rn and cro ss chec k
wi t h the c i rcu i t diagram. Check for any free metal on the copper. The etching bath should be in
a glass or enamel disc. If using crystal of ferric- chloride these should be thoroughly
dissolved in water to the proportion suggested. There should be 0.5 lt. of water for 125 gm of
crystal.
To prevent particles of copper hindering further etching, agitate the solutions carefully by gently
twisting or rocking the tray. The board should not be left in the bath a moment longer than is
needed to remove just t h e r i g h t a m o u n t o f c o p p e r . I n s p i t e o f t h e r e b e i
n g a r e s i s t i v e c o a t i n g t h e r e i s n o protection against etching away through exposed
copper edges. This leads to over etching. Have running water ready so that etched board can
be removed properly and rinsed. This will halt etching immediately.
Drilling is one of those operations that call for great care. For most purposes a
0.5mmdrill is used. Drill all holes with this size first those that need to be larger can be
easily drilled again with the appropriate larger size.
From the greatest variety of electronic components available, which runs into thousands of different
types it is often a perplexing task to know which is right for a given job. T her e cou ld be dam age s
uch a s hai r l ine cr ac k on P CB. I f the re a re, th en the y ca n be repaired by soldering a short link
of bare copper wire over the affected part. The most popular method of holding all the items is to
bring the wires far apart after they have been inserted in the appropriate holes. This will hold the
component in position ready for soldering.
Some components will be considerably larger .So it is best to start mounting the smallest first and
progressing through to the largest. Before starting, be certain that no further drilling is
likely to be necessary because access may be impossible later. Next will probably be the resistor,
small signal diodes or other similar size components. Some capacitors are also very small but it
would be best to fit these afterwards. When fitting each group of components mark off each one
on the circuit as it is fitted so that if we have to leave the job we know where to recommence.
Although transistors and integrated circuits are small items there are good reasons
for leaving the soldering of these until the last step. The main point is that these components are very
sensitive to heat and if subjected to prolonged application of the soldering iron, they could be
internally damaged. All the components before mounting are rubbed with sand paper so
that oxide layer is removed from the tips. Now they are mounted according to the component
layout.
(E) SOLDERING :
This is the operation of joining the components with PCB after this operation the circuit will be ready
to use to avoid any damage or fault during this operation following care must be taken.
2. Types of PCB:
PCBs can be divided into three main categories:
Single Sided.
Double Sided.
Multi Layered.
It is an important process in the design of electronic equipment. The design of PCBs (Printed Circuit
Boards) depends on circuit requirements like noise immunity, working frequency and voltage levels
etc. High power PCBs requires a special design strategy.
The fabrication process to the printed circuit board will determine to a large extent the price and
reliability of the equipment. A common target aimed is the small series of highly reliable professional
quality PCBs with low investment.
The layout of PCB has to incorporate all the information of the board before one can go on the
artwork preparation. This means that a concept that clearly defines all the details of the circuit and
partly defines the final equipment is prerequisite before the actual layout can start. The detailed circuit
diagram is very important for the layout designer but he must also be familiar with the design concept
and with the philosophy behind the equipment.
PRACTICAL APPLICATIONS:
CONCLUSION:
The circuit is based on LM35 analog temperature sensor, ADC0804 and AT89S51 microcontroller. It
consists of two sections. One is that which senses the temperature i.e. LM 35. The other section
converts the temperature value into a suitable number in Celsius scale which is done by
the ADC0804.