Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
46 views45 pages

Microcontroller Project 1

The document presents a project report on a microcontroller-based overheat detector that utilizes a temperature sensor and buzzer for indication, submitted by Miss Patil Shweta Ramkrushna for her Master's degree in Physics at Pune University. It includes sections on hardware description, circuit operation, and the functionality of various components like the microcontroller, temperature sensor, LCD display, and buzzer. The project aims to provide a solution for detecting overheating in industrial and household applications, enhancing safety and monitoring capabilities.

Uploaded by

shweta patil
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
46 views45 pages

Microcontroller Project 1

The document presents a project report on a microcontroller-based overheat detector that utilizes a temperature sensor and buzzer for indication, submitted by Miss Patil Shweta Ramkrushna for her Master's degree in Physics at Pune University. It includes sections on hardware description, circuit operation, and the functionality of various components like the microcontroller, temperature sensor, LCD display, and buzzer. The project aims to provide a solution for detecting overheating in industrial and household applications, enhancing safety and monitoring capabilities.

Uploaded by

shweta patil
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 45

Project report on

“MICROCONTROLLER BASED
OVERHEAT DETECTOR USING
TEMPERATURE SENSOR WITH BUZZER
INDICATION”
Submitted by
Miss. Patil Shweta Ramkrushna
A Dissertation report submitted to the university of Pune In partial
fulfillment of the award of the degree of
MASTER OF SCIENCE
IN
PHYSICS

Under the Guidance of

(Prof. B.M.Lawre) ( Prof. B.K.Pawse)


(Head) Dept.of Physics
Dept.Of Physics Prof.Ramkrishna More
Prof.Ramkrishna More College,Akurdi,Pune.
College,Akurdi,Pune.

Guide
Prof. P.S.Kand
Dept.of physics
Prof. Ramkrishna More
College,Akurdi,Pune.

1
Roll No - 441401 Exam Seat No-

CERTIFICATE

This is to certify that the project entitled “ MICROCONTROLLER


BASED OVERHEAT DETECTOR USING TEMPARATURE
SENSOR WITH BUZZER INDICATION “ which is being submitted
herewith for the Degree of Master Of Science in PHYSICS Of Pune
University, Pune is the result of original project work completed by
Miss.Patil Shweta Ramkrushna under our supervision and guidance and
to the best of our knowledge and belief the work embodied in this project
has not formed earlier the basis for the award of any Degree or similar
title of this or any other University or Examining body.
Place : Pune
Date : - -2022

(Prof. B.M.Lawre) Prof. P.S.Kand


(Head) Dept.of physics
Dept.Of Physics Prof.Ramkrishna More
Prof.Ramkrishna More College,Akurdi,Pune.
College,Akurdi,Pune.

Internal Examiner External Examiner

2
DECLARATION
I hearby declare that, the project entitled “ MICROCONTROLLER
BASED OVERHEAT DETECTOR USING TEMPARATURE
SENSOR WITH BUZZER INDICATION “ completed and written by
me has not previously formed te basis for the award of any degree or
Diploma or other similar title or any other University or Examination
body.

Place: PUNE (Project Student )

Date : - - 2022 Miss. Patil Shweta Ramkrushna

M.Sc II

3
ACKNOWLEDGEMENT

On the day of completion of this project. I offer sincere gratitude to those


who encouraged and helped me a lot at various stages of this work. 1 have
great pleasure to express my deep sense of indebtedness and heart full
gratitude to Prof. B.M.Lawre, Department of Physics,
Prof.R.M.College Akurdi, Pune. my project guide for his expert and
valuable guidance and continuous encouragement given to me during the
course of my project work He has alrendy been a source of strength for
me. I find in him a real researcher who through his own example and
devotion for scientific work inspired me towards a common goal of
achieving scientific knowledge and pursuit. I am highly grateful to Prof.
B.K.Pawse Prof. R. M. C. S. College Akurdi,Pune, for making
available the laboratory facilities and their encouragement during the
course of the project work.I wish to express my appreciation to
Prof.P.S.Kand Prof. R. M. C. S. College Akurdi,Pune, & all rescarch
students and all my friends. Department of Physics, Prof..M.A.C.S.
College Akurdi, Pune for discussion and co-operation in each and every
movement of my project work.My acknowledgement will be incomplete,
if I don't express my appreciation towards my family members.

Place: Pune

Date: - -2022

Miss. Patil Shweta Ramkrushna

M.Sc.Il

4
INDEX:

SR NO. CONTENT PAGE NO.


1. Certificate 2

2. Declaration 3

3. Acknowledgement 4

4. Chapter I 6

Introduction
5. Chapter II 7

Block Diagram
6. Chapter III 9

Hardware Description
7. Chapter IV 12

Basic Circuit Operation


8. Chapter V 15

Power Supply Mode


9. Chapter VI 20

Introduction to LCD display


10. Chapter VII 24

Circuit diagram layout


11. Chapter VIII 35

Software description
12. Chapter IX 36

Microcontroller programmer & code


13. Chapter X 40

PCB layout
14. Chapter XI 43

Debugging & Testing


15. Chapter XII 44

Component List
16. Conclusion and Reference 45-46

5
Chapter I

INTRODUCTION

A temperature sensor is a device that detects the degree of warmth or coolness


in an object. The voltage across the diode determines how well a temperature
metre works. The resistance of the diode is exactly proportional to the
temperature change. The resistance decreases when the temperature drops, and
vice versa. A temperature sensor is a device, usually a thermocouple or a
resistance temperature detector, that uses an electrical signal to deliver
temperature measurement in a readable form. A thermometer is the most basic
type of temperature meter, and it is used to determine how hot or cold. In the
geotechnical profession, temperature metres are used to monitor concrete,
structures, soil, water, bridges, and other structures for structural changes
caused by seasonal variations.

Temperature sensors are available of various types, shapes, and sizes. The two
main types of temperature sensors are: Contact Temperature Sensor: There are
several temperature measuring devices that measure the degree of heat or cold
of an object by making direct contact with the object. Such temperature sensors
fall into the contact type category. They can be used to detect solids, liquids,
or gases over a wide temperature range. Non-contact temperature sensor:
These types of temperature measuring devices are not in direct contact with an
object, but measure the degree of heat or cold by the radiation emitted by a
heat source.

Microcontroller-based overheat detector with temperature sensor and buzzer


indication can be used in a variety of applications, including industrial and
household. to detect overheating, a temperature sensor is employed. the
comparator receives the temperature sensor's output. microcontroller 89s51
receives the comparator ic's output. when the temperature reaches a certain
level, the liquid crystal display (lcd) displays a message. a buzzer has also been
activated to indicate overheating. we've included a potentiometer that may be
used to adjust the comparator's threshold level, the suggested system detects
overheated items by measuring their temperature. this project is especially
advantageous in regions where there are large machineries, such as factories
or industries.

6
CHAPTER II
BLOCK DIAGRAM

BLOCK DIAGRAM DESCRIPTION


1) Temperature sensor and amplifier:-
Temperature sensor is the sensor that measures the amount of heat that it
observes. There are contact and non-contact type of temperature sensors. The
commonly used contact type sensors are thermocouple RTDs, thermistors,
thermometers IC’s, diodes etc. The noncontact type sensors are radiation and
optical pyrometers. As the output signal of sensor is smaller in amplitude the
signal power is also low therefore amplifiers are used. The weak signals are
amplified using amplifiers.

2) Comparator:
The output voltage from sensor and voltage divider is given to the comparator.
This comparator compares the voltage from sensor and gives output to the
microcontroller.

3) MICRO-CONTROLLER (8051):-
It is the major part of the system. It maintains the temperature, humidity and
light intensity to the desired value. The 8051 has one serial port that receives
and transmits data. Transmission and reception can take place simultaneously.
The four communication modes possible with 8051 present the system
designer and programmer with opportunities to conduct very sophisticated data
communication network. It is the heart of the system which controls all the
inputs and the controlling action to be taken at the output. Microcontroller used
here is the AT89S51.

7
4) LCD DISPLAY:-

Liquid Crystal Display which is commonly known as LCD is an Alphanumeric


Display it means that it can display Alphabets, Numbers as well as special
symbols thus LCD is a user friendly Display device which can be used for
displaying various messages unlike seven segment display which can display
only numbers and some of the alphabets. The only disadvantage of LCD over
seven segment is that seven segment is robust display and be visualized from
a longer distance as compared to LCD. Here we have used 16 x 2
Alphanumeric Display which means on this display we can display two lines
with maximum of 16 characters in one line.

Figure: Photograph of A typical 16 by 2 alphanumeric LCD display

5) Buzzer:

We have used a piezoelectric buzzer in our project. It is used for alert


indication. The buzzer will be turned on when sensor value goes above the
desired value.

8
CHAPTER III

HARDWARE DESCRIPTION
MICROCONTROLLER
Design specification and Features of Microcontroller 89S51
• Compatible with MCS-51 (8051 series microcontroller) products.
• 4k bytes of I system reprogrammable flash memory.
• Endurance: 1000 write/erase cycles.
• Fully static operation: 0Hz to 24 MHz
• Three level program memory lock.
• 128*8 bit internal ram.
• 32 programmable I/O lines.
• Two 16 bit timers/counters.
• Six interrupt sources.
• Programmable serial channel.
• Low power idle and power down modes.
Description
The AT89s51 is a low power, high performance CMOS 8 bit microcomputer
with 4k bytes of flash programmable and erasable read only memory
(EEPROM). The device is manufactured using Atmel’s high density non
volatile memory technology and is compatible with the industry standard
MCS-51 instruction set and pin out. The on chip flash allows program memory
to be reprogrammed in system or by a conventional non volatile memory
programmer.By combining a versatile 8 bit CPU with flash on a monolithic
chip, the Atmel AT89S51 is a powerful microcomputer which provides a
highly flexible and cost effective solution to many embedded control
applications.
The AT89s51 provides the following standard feature: 4k bytes of flash, 128
bytes of ram, 32 I/O lines, two 16 bit timers/counters, five vector two-level
interrupt architecture, a full duplex serial port, and on-chip oscillator and clock
circuitry. In addition the AT89s51 is designed with a static logic for operation
down to zero frequency and supports two selectable power saving modes. The
IDLE mode stops the CPU while allowing the ram, timer/counter, serial port
and interrupts system to continue functioning.

9
PIN CONFIGURATION 40-lead PDIP
Pin description
1) VCC : Supply voltage : Pin no 40
2) GND : Ground : Pin no 20
3) XTAL1 : Crystal terminal 1 : Pin no 18
4) XTAL2 : Crystal terminal 2 : Pin no 19
5) RST : Reset Pin : Pin no 9
ARCHTECTURE:

Port0:
Port 0 is an 8 bit bi-directional I/O port. As an output port each pin can sink
eight TTL input. When 1’s are written to port 0 pins, the pins can be used as
high impedance inputs. Port 0 may also be configured to be the multiplexed
low order address/data bus during the access to external program memory. In
this mode p0 has internal pull ups. Port 0 also receives the code bytes during
the flash programming, and outputs the code bytes during program
verification. External pull ups are required during the program verification.
Port1:
Port 1 is an 8-bit bi-directional I/O port with internal pull-ups. The Port 1
output buffers can sink/source four TTL inputs. 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

10
(IIL) because of the internal pull-ups. Port 1 also receives the low-order
address bytes during Flash programming and verification.
Port2:
Port 2 is an 8-bit bi-directional I/O port with internal pull-ups. The Port 2
output buffers can sink/source four TTL inputs. 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. 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,
Port 2 uses strong internal pull-ups when emitting 1s. During accesses to
external data memory that uses 8-bit addresses (MOVX @ RI); Port 2 emits
the contents of the P2 Special Function Register. Port 2 also receives the high-
order address bits and some control signals during Flash programming and
verification.
Port3:
Port 3 is an 8-bit bi-directional I/O port with internal pull-ups. The Port
3 output buffers can sink/source four TTL inputs. When 1s are written to Port
3 pins, they are pulled high by the inter- Port Pin Alternate Functions P1.5
MOSI (used for In-System Programming) P1.6 MISO (used for In-System
Programming) P1.7 SCK (used for In-System Programming)5 2487D–
MICRO–6/08 AT89S51 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. Port 3 receives some control signals for Flash programming and
verification. Port 3 also serves the functions of various special features of the
AT89S51, as shown in the following table.
 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 (timer0 external input)
 P3.5: T1 (timer1 external input)
 P3.6: WR (external data memory write strobe)
 P3.7: RD (external data memory read strobe)

11
CHAPTER IV

BASIC CIRCUIT OPERATION: - The main circuitries involved in it are: -


1) CRYSTAL CIRCUIT: - This circuit gives the required clock pulses to the
microcontroller to give it the sense of the reference time.
XTAL1 - Input to the inverting oscillator amplifier and input to the internal
clock operating circuit.
XTAL2 - Output from the inverting oscillator amplifier
Diagram: -

Working: - The circuit consists of one crystal and two capacitors. The crystal
is used to give the microcontroller the required periodic pulses to make it
function properly. The crystal used in the project is of 12 MHz The two
capacitors are connected to two pins of the crystal and are grounded at the
other ends
Oscillator characteristics:
XTAL1 and XTAL2 are the input and output, respectively of an
inverting amplifier which can be configured for use as an on chip oscillator.
Either a quartz crystal or a 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. There are no requirements on the duty cycle of the
external clock signal, since the input to the external clock circuitry is through
a divide by two flip flops, but minimum & maximum voltage and high & low
time specification must be observed.
2) RESET CIRCUIT: - This circuit gives microcontroller the starting pulse
required to start the operation from the start. Unless this pulse is given,
microcontroller doesn’t start functioning.
A high on this pin for two machine cycles while the oscillator is running
resets the device. This pin drives High for 98 oscillator periods after the
Watchdog times out. The DIS-RTO bit in SFR AUXR (address 8EH) can be
used to disable this feature. In the default state of bit DISRTO, the RESET
HIGH out feature is enabled.
Diagram: -

12
Working: - The circuit gives the required starting
pulse to the microcontroller to start the operation
from the very beginning. The 89S51 microcontroller
requires the active high reset pulse. So the capacitor
is connected to positive supply and the resistor is
grounded.
3) Pull up Resistors: The pull-up resistors are required to source the required
current to the 7-segment display, which the microcontroller alone is not
capable of.
Diagram:

Working: - The microcontroller pins cannot be connected to the LCD directly


because the microcontroller cannot supply all the required current. So the
required remaining current is provided through the pull-up resistors. They are
designed to supply just the enough current to the motor driver circuit
4) ALE/PROG
Address Latch Enable (ALE) is an output pulse for latching the low byte
of the address during accesses to external memory. This pin is also the program
pulse input (PROG) during Flash programming. 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, however, that one ALE pulse is
skipped during each access to external data memory. If desired, ALE operation
can be disabled by setting bit 0 of SFR location 8EH. 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.
5) PSEN:
Program Store Enable (PSEN) is the read strobe to external program memory.
When the AT89S51 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.
6) EA/VPP:

13
EA means External Access Enable. 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. Note, however, that if lock bit 1 is
programmed, EA will be internally latched on reset. 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) 6 2487D–
MICRO–6/08 AT89S51 EA should be strapped to VCC for internal program
executions. This pin also receives the 12-volt programming enable voltage
(VPP) during Flash programming.
Idle mode:
In idle mode, the CPU puts itself to sleep while all the on chip peripherals
remain active. The mode is invoked by software.
Power down mode:
In the power down mode the oscillator is stopped, and the instruction that
invokes power down is the last instruction executed.

14
CHAPTER V

POWER SUPPLY MODULE


Block Diagram
5VDC
230v AC Rectifier Filter Voltage
Transformer (Bridge) Capacitor Regulator

Fig: Block diagram of Power Supply Module


The 230 AC mains supply is given to the transformer primary to get the
required voltage at the secondary. Then it is applied to the bridge rectifier,
which converts the sinusoidal input into full wave rectified output. The output
of the rectifier contains some ripple voltage. To remove this voltage filter
circuit is used. A ripple voltage is nothing but a small value of AC over DC
signal. Then a pure DC is given to the regulator. The function of the regulator
is to give the constant or stable output DC in spite of changes in the load
current.
The reasons for choosing IC regulator is that they are versatile in
operation and relatively inexpensive with features like programmable output,
current/voltage boosting, internal short circuit current limiting, thermal
shutdown. The 78XX are popularly known for regulation has been used. The
78XX series is a 3-terminal positive voltage regulator and 79XX series is a 3-
terminal negative voltage regulator. As name suggests it transforms the voltage
level from one level to another. Transformer used is the step down transformer
to step 230 V to +9 V. It provides isolation too from the mains.
1) TRANSFORMER:
Transformer is the main component of the power supply module. There are
two types of transformer namely Step up and Step Down. We have used Step
down transformer as we have to generate 5 volts and 12 volts DC supply from
the 230 volts input AC supply so we have used 15 volts / 500 mA transformers
which mean its output will be 15 volts AC with current rating of 500 mA.
Types of Transformer:
1) Core type Transformer
2) Shell type Transformer
3) Berry type Transformer
2) RECTIFIER:
Rectifier is used to rectify the negative half cycles of the output signal of the
secondary of the transformer. So at the input of the rectifier We have AC signal
with both positive and negative cycles and at the output of the rectifier We
have signal with only positive cycles but as this signal is also AC We have to
15
use capacitor to filter out the AC of the output signal. There are mainly three
types of rectifiers namely half wave, Full wave and Bridge rectifier. Out of
these three we have used Bridge rectifier since it give more efficiency. A full
wave rectifier converts the whole of the input waveform to one of constant
polarity (positive or negative) at its output by reversing the negative (or
positive) portions of the alternating current waveform .The positive (negative)
portions thus combine with the reversed negative (positive) portions to produce
an entirely positive (negative) voltage/current waveform. For single phase AC
is center tapped, and then two diodes back to back (i.e. anode to anode or
cathode to cathode) form a full wave rectifier.
Rectifier designing 1N4007 diodes are used to build circuit of full wave bridge
rectifier
• Surge overload rating - 50 amperes peak
• Ideal for printed circuit board
• Reliable low cost construction utilizing molded plastic technique results
in inexpensive product
• Mounting Position: Any
For diode design:-
PIV = Vm
Vm = E0 max + 2 Vf
= 10.7 + 1.4 V
= 12.1 V
I0 = Il/2
= 116.2 mA/ 2
= 58.1 mA
Peak repetitive current
Ifm = [Il (t1+t2)]/t2
T2 = time for 90° - time for θ1
= 5ms - 3.4ms
= 1.2ms
Ifm = 116.2mA (8.6ms+1.2ms) /1.2ms
= 833mA
From above specification diode 1N4007 is selected

3) FILTER CAPACITOR:
As mentioned above we have to use filter capacitor to remove the AC
signal from the output of rectifier. Filter capacitor is used in order to remove
ripples from the pulsating DC and convert it to unregulated DC.
A capacitor is an electrical device that can store energy in the electric field
between a pair of closely spaced conductors (called ‘plates’). When voltage is
applied to the capacitor, electric charges of equal magnitude, but opposite
polarity, build up on the plate.

16
Capacitors are used in electrical circuits as energy storage devices. They can
also be used to differentiate between high frequency and low frequency signals
and this makes them useful in electronic filters. These small deviations from
the ideal behavior of the device can become significant when it is operating
under certain conditions, i.e. high frequency, high current, or temperature
extremes.
PIV = 100V
I = 1A
For filter capacitor design:-
C = (I1 * t1)/Vr
Vr = ripple voltage
IL = load current
T1 = time during which the capacitor being discharge by load current
Vr = ripple voltage 10% of output voltage
Vr = 1.0 V
Frequency 50 HZ
T1 = 1/50 = 20 ms
T for 360° = 20ms
For 180° = 10ms
For 60° = 20ms * (60°/360)
= 3.4ms
For bridge:-
T1 = [time for 90° + time for θ1]
= 5ms + 3.4ms
= 8.4ms
I1 = load current supplied to various IC
I1 = current required for LCD + o/p current of 89S51 + o/p current of
max232 + current required for LM35 + Current required for heart beat sensor
+ current required
For GPS SR-87
= 3mA + 40mA + 8mA + 0.060mA + 22mA + 40mA
= 113.06Ma
C = I1 * T1/ Vr
= 113.06 * 8.4 * 10^-6 / 1
= 949.704 µF
Thus this 949.704 µF value can be approximated to 1000 µF. Thus we will use
1000 µF capacitor before IC 7805, which is used for improving Frequency
Response
4) VOLTAGE REGULATOR:
Two separate voltage regulators are used after the filter capacitor so as
to generate constant DC voltage supply of 5 volts and 12 volts. We have used
7805 and 7812 as a voltage regulator. Both of them are three pin IC which are
namely input, ground and output. We have to give output of filter capacitor to
the input of regulator, and we get 5 volts and 12 volts supply at the output pin
of the respective regulator.
Transformer selection: we require 12V for min input for IC 7805

17
= Drop across IC 7805 + Required Output voltage
= 3 V+ 5V
= 8V
So at Input of 7805 we required 8 V with margin
Consider drop across diode 0.7V so 2 diode conducts drop is 1.4 V
= 1.4 V +8 V
= 9.4 V
So at secondary we required 10 V
Fixed voltage regulator IC 7805 produces +5V regulated output voltage with
respect to the ground.
• Output Current in Excess of 1.0 A
• No External Components Required
• Internal Thermal Overload Protection
• Internal Short Circuit Current Limiting
• Output Transistor Safe–Area Compensation
• Output Voltage Offered in 2% and 4% Tolerance
• Available in Surface MountD2PAK, DPAK and Standard 3–Lead
• Transistor Packages
Power supply: -
Diagram: -

Working: - The power supply gives +5v and +12v supply to the circuit. The
power supply consists of four stages namely transformer, rectifier, filter, and
regulator. Transformer is a step-down transformer taking input of 230v AC and
giving output of 15v at the secondary. This 15v AC is rectified by bridge
rectifier consisting of four diodes, which converts the AC wave into fully
rectified wave. The next stage is the filter stage consisting of capacitor, which
converts the fully rectified wave into the DC wave with some ripple. Last stage
is the regulator stage. Regulator removes the entire ripple and gives pure DC.
The LED is connected to indicate that power supply is ON.

18
Waveforms for Power supply module

We get 230 volts A.C. supply from


the power grid (Electricity board).
The voltage amplitude is of 230
volts and the frequency is 50 Hz.

By using a Step down transformer


we are lowering the 230 volt AC
supply to a lower value (e.g., 15 V)
using a transformer. This lower
voltage is still AC. The voltage
amplitude is reduced but the
frequency is same, which is 50 Hz

Then rectification is done by a set


of 4 diodes (Bridge rectifier), this
rectifier transforms this AC voltage
into pulsating voltage. The
negative half cycles of transformer
output are converted to positive
half cycles.
The next step is filtering, which is
done by an electrolytic capacitor of
100microF, this filter capacitor
transforms this pulsating voltage
into almost DC. This is having
ripples.

The voltage obtained after the


capacitor oscillates a little bit (this
oscillation is called ripple), so a
voltage regulating stage is
necessary, done by a voltage
regulator IC. After this stage the
output is true DC voltage

19
CHAPTER VI

INTRODUCTION TO 16X2 LCD DISPLAY


LCD stands for Liquid Crystal Display. The most commonly used LCDs found
in the market today are 1 Line, 2 Line or 4 Line LCDs which have only 1
controller and support at most of 80 characters.
4.1 Pin Description
Most LCDs with two controllers has 16 Pins. Pin description is shown in the
table below.
Pin No. Name Description
Pin no. 1 GND Power supply (GND)
Pin no. 2 VCC Power supply (+5V)
Pin no. 3 VEE Contrast adjust
0 = Instruction input
Pin no. 4 RS
1 = Data input
0 = Write to LCD module
Pin no. 5 R/W
1 = Read from LCD module
Pin no. 6 EN Enable LCD
Pin no. 7 D0 Data bus line 0 (LSB)
Pin no. 8 D1 Data bus line 1
Pin no. 9 D2 Data bus line 2
Pin no.
D3
10 Data bus line 3
Pin no.
D4
11 Data bus line 4
Pin no.
D5
12 Data bus line 5
Pin no.
D6
13 Data bus line 6
Pin no.
D7
14 Data bus line 7 (MSB)
Pin no.
VCC
15 VCC Pin for Backlight
Pin no.
GND
16 GND Pin for Backlight

Table No.4.1: Pin description of the LCD


4.2 DDRAM - Display Data RAM
Display data RAM (DDRAM) stores display data represented in 8-bit
character codes. Its extended capacity is 80 X 8 bits, or 80 characters. The area
in display data RAM (DDRAM) that is not used for display can be used as

20
general data RAM. So whatever you send on the DDRAM is actually displayed
on the LCD.
4.3 BF - Busy Flag
Busy Flag is a status indicator flag for LCD. When we send a command
or data to the LCD for processing, this flag is set (i.e. BF =1) and as soon as
the instruction is executed successfully this flag is cleared (BF = 0). This is
helpful in producing and exact amount of delay. To read Busy Flag, the
condition RS = 0 and R/W = 1 must be met and The MSB of the LCD data bus
(D7) act as busy flag. When BF = 1 means LCD is busy and will not accept
next command or data and BF = 0 means LCD is ready for the next command
or data to process.

4.4 Instruction Register (IR) and Data Register (DR)


There are two 8-bit registers controller Instruction and Data register.
Instruction register corresponds to the register where you send commands to
LCD e.g. LCD shift command, LCD clear, LCD address etc. and Data register
is used for storing data which is to be displayed on LCD. When send the enable
signal of the LCD is asserted, the data on the pins is latched in to the data
register and data is then moved automatically to the DDRAM and hence is
displayed on the LCD.
4.5 Commands and Instruction set:
Only the instruction register (IR) and the data register (DR) of the LCD
can be controlled by the MCU. Before starting the internal operation of the
LCD, control information is temporarily stored into these registers to allow
interfacing with various MCUs, which operate at different speeds, or various
peripheral control devices. The internal operation of the LCD is determined by
signals sent from the MCU.
4.6 Sending Commands to LCD
To send commands we simply need to select the command register.
Everything is same as we have done in the initialization routine. But we will
summarize the common steps and put them in a single subroutine.
Following are the steps:
 Move data to LCD port
 Select command register
 Select write operation
 Send enable signal
 Wait for LCD to process the command

21
LCD DISPLAY INTERFACING
In market various displays are available like 7-segment, 5*7 matrix LED
and LCD, bar graph, LCD, etc. It’s important for deciding the required display
set for our project. Selection of display depends on various factors like power
consumption, ambient light conditions, surrounding temperature, visibility
from long distance, total information to be display, cost of display, circuit/lines
required for display interfacing, etc.
The most common way to accomplish this is with the LCD (Liquid Crystal
Display). LCDs have become a cheap and easy way to get text display for an
embedded system.
Common LCD displays are set up as 16 to 20 characters by 1 to 4 lines and
noted as 16*2, 20*2, 16*4, 20*4, etc. Following figure shows the basic pin
diagram of 16*2 LCD display.

Display Data RAM (DDRAM):


Display data RAM (DDRAM) is where you send the characters (ASCII code)
you want to see on the LCD screen. It stores display data represented in 8-bit
character codes. Its capacity is 80 characters (bytes). Below you see DD RAM
address layout of a 2*16 LCD.

Figure 3.5 DDRAM Address Layouts


In the above memory map, the area shaded in black is the visible display (For
16x2 displays). For first line addresses for first 15 characters is from 00h to
0Fh. But for second line address of first character is 40h and so on up to 4Fh
for the 16th character. So if you want to display the text at specific positions
of LCD, we require to manipulate address and then to set cursor position
accordingly.

22
CHAPTER VII

CIRCUIT DIAGRAM

REGISTERS:
It has two 8-bit registers, an instruction register (IR) and a data register
(DR). The IR stores instruction codes. The DR temporarily stores data to be
written into DDRAM or CGRAM and temporarily stores data to be read from
DDRAM or CGRAM. Data written into the DR is automatically written into
DDRAM or CGRAM by an internal operation. These two registers can be
selected by the register selector (RS) signal. See the table below:

Register Selection
RS R/W Operation
0 0 IR write as an internal operation (display clear, etc.)

23
0 1 Read busy flag (DB7) and address counter (DB0 to DB6)
DR write as an internal operation (DR to DDRAM or
1 0
CGRAM)
DR read as an internal operation (DDRAM or CGRAM
1 1
to DR)

Table 3.1: Register Selection


Busy Flag (BF):
When the busy flag is 1, the LCD is in the internal operation mode, and
the next instruction will not be accepted. When RS = 0 and R/W = 1 (see the
table above), the busy flag is output to DB7 (MSB of LCD data bus). The next
instruction must be written after ensuring that the busy flag is 0.
LCD Commands: The LCD’s internal controller accepts several commands
and modifies the display accordingly. These commands would be things like:
– Clear screen – Return home
– Shift display right/left
Instruction Decimal HEX
Function set (8-bit interface, 2 lines, 5*7 Pixels) 56 38
Function set (8-bit interface, 1 line, 5*7 Pixels) 48 30
Function set (4-bit interface, 2 lines, 5*7 Pixels) 40 28
Function set (4-bit interface, 1 line, 5*7 Pixels) 32 20
Entry mode set See Below See Below
Scroll display one character right (all lines) 28 1E
Scroll display one character left (all lines) 24 18
Home (move cursor to top/left character position) 2 2
Move cursor one character left 16 10
Move cursor one character right 20 14
Turn on visible underline cursor 14 0E
Turn on visible blinking-block cursor 15 0F
Make cursor invisible 12 0C
Blank the display (without clearing) 8 08
Restore the display (with cursor hidden) 12 0C
Clear Screen 1 01
Set cursor position (DDRAM address) 128 + addr 80+ addr
Set pointer in character-generator RAM (CG RAM
64 + addr 40+ addr
address)
Table 3.2: LCD Commands

LCD Display PINOUT and Description:

Data pins D7:D0: Pins 7-14:


Bi-directional data/command pins. Alphanumeric characters are sent in ASCII
format. As shown in figure lcd1.0, there are 8 pins, Pin No.7-14 used for data

24
lines.
RS: Register Select: Pin No.4:
RS = 0; Command Register is selected
RS = 1; Data Register is selected
R/W: Read or Write: Pin No.5:
R/W=0; Write.
R/W= 1; Read
E: Enable (Latch data): Pin No.6:
It is used to latch the data present on the data pins.
A high-to-low edge is needed to latch the data.
Vo: contrast control: Pin No.2:
It is used to control contrast of LCD.

Checking the Busy Flag:


We can use subroutine for checking busy flag or just a big (and safe) delay.
1. Set R/W Pin of the LCD HIGH(read from the LCD)
2. Select the instruction register by setting RS pin LOW
3. Enable the LCD by Setting the enable pin HIGH
4. The most significant bit of the LCD data bus is the state of the busy flag
(1=Busy, 0=ready to accept instructions/data). The other bits hold the
current value of the address counter.
If the LCD never comes out from "busy" status because of some problems, the
program will "hang," waiting for DB7 to go low. So in real applications it
would be wise to put some kind of time limit on the delay--for example, a
maximum of 100 attempts to wait for the busy signal to go low. This would
guarantee that even if the LCD hardware fails, the program would not lock up.

25
Temperature sensor LM35:
The LM35 is an integrated circuit sensor that can be used to measure
temperature with an electrical output proportional to the temperature (in oC).
The LM35 - An Integrated Circuit Temperature sensor
Detailed description about LM35:

Pin No Function Name


Supply voltage; 5V (+35V
1 Vcc
to -2V)
2 Output voltage (+6V to -1V) Output
LM35 plastic package
3 Ground (0V) Ground

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 from its
output to obtain convenient Centigrade scaling. The LM35's low output
impedance, 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 60mA 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 is
rated for - b40º to +110ºC. Range (-10º with improved accuracy). The LM35
series is available packaged 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-202 package.
Features
 Calibrated directly in º Celsius (Centigrade)
 Linear a 10.0 mV/ºC scale factor
 0.5ºC accuracy guarantee able (at a25ºC)
 Rated for full b55º to a150ºC range
 Suitable for remote applications
 Low cost due to wafer-level trimming
 Operates from 4 to 30 volts

26
Working
We can measure temperature more accurately than a using a thermistor. The
sensor circuitry is sealed and not subject to oxidation, etc.The LM35 generates
a higher output voltage than thermocouples and may not require that the output
voltage be amplified.It has an output voltage that is proportional to the Celsius
temperature.The scale factor is .01V/oC. The LM35 does not require any
external calibration or trimming and maintains an accuracy of +/-0.4 oC at
room temperature and +/- 0.8 oC over a range of 0 oC to +100 oC. Another
important characteristic of the LM35DZ is that it draws only 60 micro amps
from its supply and possesses a low self-heating capability. The sensor self-
heating causes less than 0.1 oC temperature rise in still air.

How to Measure Temperature


Using the LM35 is easy, simply connect the left pin to power supply vcc (5V)
and the right pin to ground. Then the middle pin will have an analog voltage
that is directly proportional (linear) to the temperature. The analog voltage is
independant of the power supply.
Testing a Temp Sensor:
Testing these sensors is pretty easy but you'll need a battery pack or power
supply. Connect a 5V power supply (or 4 battery cells used in remote control)
to pin 1 (left pin) Ground connected to pin 3 (right pin). Then connect
multimeter in DC voltage mode to ground and the remaining pin 2 (middle). If
room temperature is 25°C, the voltage should be about 0.25V. You can change
the voltage range by pressing the plastic case of the sensor with your fingers,
you will see the temperature/voltage rise. Or you can touch the sensor with an
ice cube, perferrably in a plastic bag so it doesn't get water on your circuit, and
see the temperature/voltage drop.

27
Circuit diagram

BUZZER
A buzzer is an audio signaling device, which may be mechanical,
electromechanical, or piezoelectric. Typical uses of buzzers and beepers
include alarm devices, timers and confirmation of user input. In simplest terms,
a piezo buzzer is a type of electronic device that’s used to produce a tone, alarm
or sound. It’s lightweight with a simple construction, and it’s typically a low-
cost product. Yet at the same time, depending on the piezo ceramic buzzer
specifications, it’s also reliable and can be constructed in a wide range of sizes
that work across varying frequencies to produce different sound outputs.The
use of the piezo ceramic buzzer was discovered thanks to an inversion of the
piezoelectricity principle that was discovered by Jacques and Pierre Curie back
in 1880.
We have used piezoelectric type of Buzzer. A
piezoelectric element may be driven by an
oscillating electronic circuit or other audio signal
source, driven with a piezoelectric audio
amplifier. Sounds commonly used to indicate that
a button has been pressed are a click, a ring or a
beep. It is a small 30mm round speaker that
operates around the audible 2 kHz range. We can use these speakers to create
simple music or user interfaces.
It requires an operating voltage of 3 to 12 V with a mean current of 50mAmp.
These speakers also have a typical sound output of 95 dBA and a coil resistance
of 42 ±6.3 ohms.

28
COMPARATOR
The comparator is an electronic decision making circuit that makes use
of operational amplifiers very high gain in its open-loop state, that is, there is
no feedback resistor. Comparator is a device that compares two voltages and
switches its output to indicate which is larger. As the name implies they are
used to compare two voltages. When one is higher than the other the
comparator circuit output is in one state, and when the input conditions are
reversed, then the comparator output switches.
The Op-amp comparator compares one analogue voltage level with
another analogue voltage level, or some preset reference voltage, VREF and
produces an output signal based on this voltage comparison. In other words,
the op-amp voltage comparator compares the magnitudes of two voltage inputs
and determines which is the largest of the two.When the non-inverting input
(V+) is at a higher voltage than the inverting input (V-), the op-amp causes the
output to saturate at the highest positive voltage it can output. When the non-
inverting input (V+) drops below the inverting input (V-), the output saturates
at the most negative voltage it can output. The op-amp's output voltage is
limited by the supply voltage.

A typical comparator circuit will have one of the inputs held at a given voltage.
This may often be a potential divider from a supply or reference source. The
other input is taken to the point to be sensed.

Circuit for a basic operational amplifier comparator


LM358
The LM358 op-amps are used in transducer amplifiers, dc gain blocks and all
the conventional op-amp circuits which now can be more easily implemented
in single power supply systems. For example, the LM358 op-amp can be
directly operated off of the standard +5V power supply voltage which is used
as a part of digital systems and will easily provide the required interface
electronics without needing the extra ±15V power supplies.
It comes in an 8-pin DIP package is shown in below.

29
Pin Description:
 Pin 1 and 7 are outputs of comparator
 Pin 2 and 6 are inverting inputs
 Pin 3 and 5 are non-inverting inputs
 Pin 4 is ground (GND)
 Pin 8 is VCC

Working of LM358:
The inverting input of the comparator LM358 i.e., pin 2 is given to the
fixed voltage i.e., in the ratio 47k:10k and the non-inverting input of the
comparator is pulled down and is given to sensing terminal. When the
resistance between the positive supply and the non-inverting input is high then
resulting is the non-inverting input less than the inverting input making
comparator output as logic low at pin1. And when the resistance falls making
available a voltage to the non-inverting input higher than inverting input, so
that the output of comparator is logic high.
RESISTOR
Resistor is an electrical component used to reduce current in a circuit. Its
resistance is given by the ratio of voltage applied across its terminals to the
current passing through it. Thus a particular value of resistor, for fixed voltage,
limits the current through it. They are omnipresent in electronic circuits. The
resistor's ability to reduce the current is called resistance and is measured in
units of ohms (symbol: Ω)
The different value of resistances are
used to limit the currents or get the
desired voltage drop according to the
current-voltage rating of the device to be
connected in the circuit. For example, if an LED of rating 2.3V and 6mA is to
be connected with a supply of 5V, a voltage drop of 2.7V (5V-2.3V) and
limiting current of 6mA is required. This can be achieved by providing a
resistor of 450 connected in series with the LED.
Carbon film resistors:

30
This resistor is formed by depositing a carbon film layer on an insulating
substrate. Helical cuts are then made through the carbon film to trace a long
and helical resistive path. The resistance can be varied by using different
resistivity carbon material and modifying the shape of the resistor. The helical
resistive path make these resistors highly inductive and of little use for RF
applications.They exhibit a temperature coefficient between -100 and -900
ppm/ °C. The carbon film is protected either by a conformal epoxy coating or
a ceramic tube. The operation of these resistors requires high pulse stability.
Metal Film resistor:
These resistors are made from small rods of ceramic coated with metal (such
as a nickel alloy) or metal oxide (such as tin oxide). The value of resistance is
controlled mainly by the thickness of the coating layer (the thicker the layer,
the lower is the value of resistance). A fine spiral groove can be cut along the
rod using a laser to split the carbon or metal coating effectively into a long and
spiral strip, which forms the resistor.
CAPACITOR
Capacitor is a passive component used to store charge. This component
consists of two conductors which are separated by a dielectric medium. The
charge (q) stored in a capacitor is the product of its capacitance (C) value and
the voltage (V) applied to it. Capacitors offer infinite reactance to zero
frequency so they are used for blocking DC components or bypassing the AC
signals. The capacitor undergoes through a recursive cycle of charging and
discharging in AC circuits where the voltage and current across it depends on
the RC time constant.

DIODE

A Diode is the simplest two-terminal unilateral semiconductor device. It


allows current to flow only in one direction and blocks the current that flows
in the opposite direction. The two terminals of the diode are called as anode
and cathode. The symbol of diode is as shown in the figure below.
LED
Light emitting diodes (LEDs) are semiconductor light
sources. The light emitted from LEDs varies from visible to
infrared and ultraviolet regions. They operate on low voltage and
power. LEDs are one of the most common electronic

31
components and are mostly used as indicators in circuits. They are also used
for luminance and optoelectronic applications.
Based on semiconductor diode, LEDs emit photons when electrons recombine
with holes on forward biasing. The two terminals of LEDs are anode (+) and
cathode (-) and can be identified by their size. The longer leg is the positive
terminal or anode and shorter one is negative terminal.
The forward voltage of LED (1.7V-2.2V) is lower than the voltage supplied
(5V) to drive it in a circuit. Using an LED as such would burn it because a high
current would destroy its p-n gate. Therefore a current limiting resistor is used
in series with LED. Without this resistor, either low input voltage (equal to
forward voltage) or PWM (pulse width modulation) is used to drive the
LED.They are available in various colors like red, yellow, green etc.
CRYSTAL OSCILLATOR
A quartz crystal resonator plays a vital role in electronics oscillator circuitry.
Sometimes mispronounced as crystal oscillator, it is rather a very important
part of the feedback network of the oscillator circuitry. A quartz crystal is the
heart of such type of resonators. Their characteristics like high quality factor
(Q), stability, small size and low cost make them superior over other resonators
like LC circuit, turning forks, ceramic resonator etc The basic phenomenon
behind working of a quartz crystal oscillator is the inverse piezo electric effect
i.e., when electric field is applied across certain materials they start producing
mechanical deformation.
POTENTIOMETER
Potentiometer (Pot) is another class of variable resistors and is used as
an adjustable voltage divider. It consists of a fixed resistance track having
connections at both ends and a sliding contact, called wiper, which moves
along this track by turning the spindle. If only one of the connections and wiper
are used, it behaves as a variable resistor or rheostat. In case wiper is not used,
it will offer fixed resistance across the two connections. They are specified by
their fixed value resistance.Potentiometer is a small sized electronic
component whose resistance can be adjusted manually. Increasing or
decreasing the value of resistance controls the amount of current flowing in a
circuit. The potentiometer is used in various electronics,
TRANSISTOR
BC547 is an NPN bi-polar junction transistor. A transistor, stands for transfer
of resistance, is commonly used to amplify current. A small current at its base
controls a larger current at collector & emitter terminals.

32
BC547 is mainly used for amplification and
switching purposes. It has a maximum current gain
of 800. Its equivalent transistors are BC548 and
BC549.
The transistor terminals require a fixed DC voltage
to operate in the desired region of its characteristic
curves. This is known as the biasing. For
amplification applications, the transistor is biased such that it is partly on for
all input conditions. The input signal at base is amplified and taken at the
emitter. BC547 is used in common emitter configuration for amplifiers. The
voltage divider is the commonly used biasing mode. For switching
applications, transistor is biased so that it remains fully on if there is a signal
at its base. In the absence of base signal, it gets completely off.

Project Model Image

33
CHAPTER VIII

SOFTWARE DESCRIPTION
EAGLE PCB Design Software
The name EAGLE is a short form, which stands for Easily Applicable
Graphical Layout Editor. This software offers user friendly and powerful
solutions for PCB design, including Schematic Capture, Board Layout and
Auto router. This software is developed by Cadsoft. EAGLE is popular among
hobbyists because of its freeware license and rich availability of component
libraries on the web. EAGLE has following 2 sections:
Schematic capture: EAGLE contains a schematic editor, for designing circuit
diagrams. Parts can be placed on many sheets and connected together through
ports.
PCB layout: The PCB layout editor allows back annotation to the schematic
and auto-routing to automatically connect traces based on the connections
defined in the schematic.
KEIL Microcontroller Programming Software
Keil has compiler designed specifically for the 8051
microcontroller. Keil provides a broad range of development tools like
IDE (Integrated Development environment), Project Manager, Simulator,
Debugger, and C Cross Compiler.
Compilers are programs used to convert a High Level Language
source code (written in assembly language or C language) into its object
code. Then a linker is used to create an absolute object module suitable
for your circuit.
8051 project development cycle: - these are the steps to develop 8051
project using keil
1. Create source files in C or assembly.
2. Compile or assemble source files.
3. Correct errors in source files.
4. Link object files from compiler and assembler.
5. Test linked application.

34
CHAPTER IX

MICROCONTROLLER PROGRAMMER
This Microcontroller Programmer we are using for our project. This simple
Microcontroller Programmer will allow you to painlessly transfer hex
programs to most ATMEL Microcontroller microcontrollers without
sacrificing your budget and time. It is more reliable than most other simple
Microcontroller programmers available out there and can be built in very short
amount of time. Microcontroller programmer consists of in-circuit serial
programmer (dongle) and small PCB with a DIP socket where you can fit your
microcontroller and have it quickly programmed.
Entire Microcontroller programmer has been build with using common parts
and fits in the case of the serial connector. The socket PCB has been created to
fit a 40-DIP Microcontroller 89s51 microcontroller, but you can build a socket
PCB for any other Microcontroller out there. This Microcontroller programmer
is compatible with popular PonyProg software that shows you a status bar of
the programming progress.

Microcontroller program

PROGRAM CODE:

LCDdatabus equ 0A0H


LCDrs equ 0A3H
LCDen equ 0A2H

Buzzer equ 0B2H

Temp_Sensor equ 0B7H

35
LCDreg equ 30h
LCDtempreg equ 34H
Reg_LCD_swap1 EQU 35h
Reg_LCD_swap2 EQU 36h

org 0000h
call LCDinit
clr Buzzer
mov dptr,#msgwelcome
call LCDdisp

start:
jb Temp_Sensor,start
setb Buzzer
mov dptr,#MsgTempdetect
call LCDdisp
call delay2sec
clr Buzzer
jmp start
;=========================================
;subroutines start from here
;=======================================
LCDinit:
call delayhalf
mov LCDtempreg,#02h
call LCDcmd
mov LCDtempreg,#28h
call LCDcmd
mov LCDtempreg,#0Ch
call LCDcmd
mov LCDtempreg,#06h
call LCDcmd
mov LCDtempreg,#01h
call LCDcmd
ret
;====================================
LCDcmd:
mov Reg_LCD_swap1,LCDtempreg

mov Reg_LCD_swap2,Reg_LCD_swap1

mov a,Reg_LCD_swap2
anl a,#0F0H
mov LCDdatabus,a

clr LCDrs
setb LCDen
nop
36
nop
clr LCDen
call LCDdelay

mov a,Reg_LCD_swap2

anl a,#0F0H
mov LCDdatabus,a

clr LCDrs
setb LCDen
nop
nop
clr LCDen
call LCDdelay

ret
;====================================
LCDdata:
mov Reg_LCD_swap1,LCDtempreg

mov Reg_LCD_swap2,Reg_LCD_swap1

mov a,Reg_LCD_swap2
anl a,#0F0H
mov LCDdatabus,a

setb LCDrs
setb LCDen
nop
nop
clr LCDen
call LCDdelay

mov a,Reg_LCD_swap
anl a,#0FH
mov LCDdatabus,a

setb LCDrs
setb LCDen
nop
nop
clr LCDen
call LCDdelay
ret
;=======================================
LCDdelay: mov 31H,#10 ;LCD
LCDdelay1: mov 32H,#250
djnz 31H,$
37
djnz 32H,LCDdelay1
ret
;=======================================
LCDdisp: mov LCDtempreg,#01h
call LCDcmd
mov LCDreg,#00h
LCDdisp2: mov a,LCDreg
movc a,@a+dptr
cjne a,#'@',LCDdisp1
mov LCDtempreg,#0c0h
call LCDcmd
inc LCDreg
jmp LCDdisp2
LCDdisp1: cjne a,#'$',LCDdisp3
ret
LCDdisp3: mov LCDtempreg,a
call LCDdata
inc LCDreg
jmp LCDdisp2
;===================================
delayhalf: mov 31H,#5
delhalf2: mov 32H,#200
delhalf1: mov 33H,#250
djnz 31H,$
djnz 32H,delhalf1
djnz 33H,delhalf2
ret
;=======================================
delay1sec: mov 31H,#10
del1sec2: mov 32H,#200
del1sec1: mov 33H,#250
djnz 31H,$
djnz 32H,del1sec1
djnz 33H,del1sec2
ret
;=======================================
delay2sec: call delay1sec
call delay1sec
ret
;=======================================
; Messages to be displayed on LCD
;=====================================
msgwelcome: DB "* TEMPERATURE *@*** DETECTOR ***$"
MsgTempdetect: DB "TEMPERATURE@INCREASED$"
;========================================
; Program ENDS here
;========================================
END

38
CHAPTER X
PCB LAYOUT
A printed circuit board, or PCB, is used to mechanically support and
electrically connect electronic components using conductive pathways, tracks
or traces etched from copper sheets laminated onto a non-conductive substrate.
It is also referred to as printed wiring board (PWB) or etched wiring board. A
PCB populated with electronic components is a printed circuit assembly
(PCA), also known as a printed circuit board assembly (PCBA).
Printed Circuit Boards play a vital role here in determining the overall
performance of the electronic equipment. A good PCB design ensures that the
noise introduced as a result of component placement and track layout is held
within limits while still providing components years of assembly maintenance
and performance reliability.Printed circuits boards are used to route electric
signals through copper track which are firmly bonded to an insulating base.
Advantages of PCB over common wiring are:

1. PCB’s are necessary for connecting a large number of electronic components


in a very small area with minimum parasitic effects.
2. PCB’s are simulated with mass production with less chance of writing error.
3. Small components are easily mounted.
Base Materials used for PCB
The base materials used for PCB’s are glass epoxy, epoxy paper, polyester etc.
Copper foil used for copper clad is manufactured by the process of electronic
deposition.
Preparation of Single Sided PCB
In single sided PCB conductor tracks are present on one side of copper
clad board. So crossing of conductors is not allowed. It is mechanically &
chemically cleansed. The photo resist is an organic solution which when
exposed to light of proper wavelength, changes their solubility in developer
but after exposure to light is not soluble.
Laminate coating of photo resist is done by: (i) Spray coating (ii) Dip coating
(iii) Roller coating.

39
The coated copper clad and laminated film negative is kept in intimate contact
with each other. The assembly is exposed to UV light and is rinsed in the
developer tank. Proper developer has to be used for a particular photo resist
and then the PCB is dyed in a tray. The dye reveals the flux to be used for a
particular photo resist. Then the PCB is dyed in a tray.
FABRICATION
The required circuit is designed and the layout of the circuit is done on the
component side as well as the copper clad side. Spaces are provided for holes
to insert the respective components. Etch resistant ink coatings are given on
the interconnecting marks.
ETCHING
The copper clad PCB is etched with ferrous chloride solution containing a
small amount of Hydro Chloric Acid for increasing activeness of Ferric
Chloride in etching. Wherever the varnish coating is there the copper remains.
Then it is washed with water and Oxalic Acid. A few PCBs are made by adding
traces to the bare substrate (or a substrate with a very thin layer of copper)
usually by a complex process of multiple electroplating steps.
DRILLING
Holes through a PCB are typically drilled with tiny drill bits made of solid
tungsten carbide. The drilling is performed by automated drilling machines
with placement controlled by a drill tape or drill file. These computer-
generated files are also called numerically controlled drill (NCD) files or
"Excellon files".The drill file describes the location and size of each drilled
hole. These holes are often filled with annular rings (hollow rivets) to create
vias. Vias allow the electrical and thermal connection of conductors on
opposite sides of the PCB.
Plating and Coating
PCBs are plated with Solder, Tin, or Gold over Nickel as a resist for etching
(removal) away the (unneeded after plating) underlying copper. Matte solder
is usually fused to provide a better bonding surface or stripped to bare
copper.Treatments, such as benzimidazolethiol, prevent surface oxidation of
bare copper. The places to which components will be mounted are typically
plated, because untreated bare copper oxidizes quickly, and therefore is not
readily solderable. Traditionally, any exposed copper was coated with solder
by hot air solder levelling (HASL). This solder was a tin-lead alloy, however
new solder compounds are now used to achieve compliance with the RoHS
directive in the EU and US, which restricts the use of lead. One of these lead-
free compounds is SN100CL, made up of 99.3% tin, 0.7% copper, 0.05%
nickel, and a nominal of 60ppm germanium.

40
SOLDERING
Soldering is the process of joining of two metals using an alloy solder
consisting of Tin and Lead (Sn-Pb). Tin determines the melting whereas the
Lead is used to reduce the cost. After the PCB fabrication is done, the various
components are arranged at proper locations on the PCB and then the soldering
is done. All liquids consist of particles which attract each other. The surface is
always trying to shrink and this is because of surface tension. The principle
behind soldering is that when liquid particles are brought in contact with the
walls of the solid surface, it may happen that the solid attracts the liquid
surface. This property is called adhesive property. Care must be taken that the
melting point of solder is below that of the metal so that its surface is melted
without melting without the metal
PCB LAYOUT
The layout can be done either by hand or by using PCB designing software
mentioned below:
• EAGLE by Cadsoft
• DipTrace by Novarm
• FreePCB by Allan Wright (open-source Win2K/XP)
• FreeRouting by Alfons Wirtz (Java, Auto router with free angle
support)
• Cadstar by Zuken
Here we have used eagle software to design PCB layout
PCB Layout of project:

41
CHAPTER XI

DEBUGGING & TESTING


We have used simulator kit of 89s51 for hardware testing and debugging. For
the software testing and debugging we have used KEIL software.
We divided our debugging and testing in different modules, which are as
follows:
a) First of all we developed assembly programming for KEIL software.
b) Then we developed programming of 89s51 to send the code of LCD,
Serial communication.
c) Then we assign different ports for corresponding peripherals.
d) After connecting different devices to their corresponding ports we burn
the 89s51 with the help of Flash-magic software.
e) Implementation of hardware is carried out by affixing the components
on the PCB and check the continuity of PCB with the help of multi meter.
f) Before implementing the IC on the respective place we use IC tester to
ensure that the IC is working properly or not.
g) The burnt 89s51 is placed in the circuit board.
h) Then we apply the power supply to our system to check whether the
given code is working properly or not, message displayed on LCD.
i) We also used Rxd and Txd pin of 89s51 for serial communication. With
the help of above given pin we connect max232 for making data in the
format of pc compatibility.
j) After completion of all the connections and all the steps, we open
HyperTerminal and check whether the message is displayed on
HyperTerminal or not, if not, we check the code burned in 89s51 or
check the connection between the systems.
Problem crop up
• Microcontroller at AT89C51 was not providing the results or was
giving errors
• The pot used in the LCD circuit for adjusting the brightness/contract
of LCD display was not giving the appropriate results.
How problems are rectified
• The microcontroller was replaced by the AT89S51 as the AT89C51
does not have In System Programmer.
• Potentiometer was adjusted to a certain level to get the required
contrast on LCD display.

42
CHAPTER XII
COMPONENT LIST

ICs
Component
Sr no Name Quantity
1 89S51 1
2 LM358 1
3 IC Base 40 Pin 1
3 IC Base 8 Pin 1
Capacitors
Component
Sr no Name Quantity
1 102 2
2 103 2
3 1000microF 1
4 100microF 2
5 10microF 1
6 33pF 2
Miscellaneous
Component
Sr no Name Quantity
Crystal 11.0592
1 MHz 1
2 1N4007 5
3 7805 1
4 7812 1
5 BC547 4
6 LCD 1
7 LED 5
8 PBT2 1
9 PBT3 1
10 Relay 1
11 Transformer 1
Resistor
Component
Sr no Name Quantity
1 100E 6
2 10k 4
3 15k 2
4 1k 2
5 27k 2
6 2k2 4
7 3k3 1
8 4k7 3
9 POT1 5k 1
10 POT2 10k 2
11 PULLUP 1
Connector
Component
Sr no Name Quantity
1 02 Pin 4
2 03 Pin 2
3 16 Pin 1
4 ISP 06Pin 1

43
CONCLUSION
With the knowledge of new techniques in ‘Electronics’ we are able to
make our life more comfortable. One such application of electronics is used in
“Microcontroller based Overheat detector using Temperature sensor with
Buzzer indication” The approach we followed and which is explained in this
project report is novel and has achieved the target of "Microcontroller based
Overheat detector using Temperature sensor with Buzzer indication" satisfying
user needs and requirements.
The development of this project has shown how much hard work goes into the
creation of a system. “Microcontroller based Overheat detector using
Temperature sensor with Buzzer indication” was a project based on
microcontroller, due to which hardware requirement is reduced. Embarking of
this project has helped us in developing a team spirit, patience and time
management necessary for today's technical professionals.
Hence we can conclude that the required goals and objectives of our project
have been achieved.
This project has built in us confidence that any problem can be solved with
sheer determination, hard work and optimism. We feel that our product serves
something good to this world and we like to present it before this prosperous
world. By doing this project, we were better able to understand the various
facets of doing an embedded system project which is emerging as one of the
most 'in demand' technologies right now.

44
Reference:
1. The Book Of C-Programming Author Dr. P.S. Tambade, V.Kdhas,
B.M Lawre
2. Electronic Design Automation For Integrated Circuits Handbook By
Louis Scheffer, Grant Marthin
3. Sensor Handbook Technology By Jon S. Wilson
4. Microcontroller Technology By Peter Spasov
5. Construction and working of LCD http://www.elprocus.com/ever-
wondered-lcd-works

45

You might also like