Microcontroller Project 1
Microcontroller Project 1
“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
Guide
Prof. P.S.Kand
Dept.of physics
Prof. Ramkrishna More
College,Akurdi,Pune.
1
Roll No - 441401 Exam Seat No-
CERTIFICATE
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.
M.Sc II
3
ACKNOWLEDGEMENT
Place: Pune
Date: - -2022
M.Sc.Il
4
INDEX:
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
Software description
12. Chapter IX 36
PCB layout
14. Chapter XI 43
Component List
16. Conclusion and Reference 45-46
5
Chapter I
INTRODUCTION
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.
6
CHAPTER II
BLOCK DIAGRAM
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:-
5) Buzzer:
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
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:
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
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
19
CHAPTER VI
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.
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.
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)
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.
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:
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.
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.
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
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.
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:
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:
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
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