You are on page 1of 53

ACKNOWLEDGMENT

We cant achieve worthwhile in the field of the technical


education without testing the theoretical knowledge acquired in
classroom as it is effectively linked to the practical approach. We
all experienced the same, while working for the project.
We would like to express a deep sense of gratitude and thanks
profusely to . (Head of department, E.C.E.) for allowing
us to carry out the project named Advance Energy Meter and for
providing us the excellent facilities and atmosphere under his
leadership, during the entire duration of work.
Our very special thanks to .. for being our project
guide, whose excellent guidance, constant encouragement
and motivation has inspired us a lot at all phases of our
work, without whom we would not be able to complete our
project.
We are also extremely thankful to our lab technicians for guiding
and helping us during the entire course of our project.
Finally, we also express our gratitude to other faculty members of
E.C.E department for their intellectual support throughout the
course of work.

It has been a wonderful experience and we are deeply indebted to


all those who made it possible.
BLIND STICK

Introduction

Many people with visual impairments can travel independently, using a wide
range of tools and techniques. Blind people are faced with many problems
such as independent and graceful travel.

In this we are using tracking system in which we are using GSM and GPS
system for detecting the person GPS whenever an accident happens or the
person needs help it sends the alert message to the predefined number with
location of the person received from the GPS.

At the same time we will implement the ultrasonic to detect the obstacles.
Whenever an object comes closer to the specific range then it generates a
sound.

A LDR sensor is used to detect the day and night condition in night it
automatically turns on the indicator.

A RF remote is used to find the stick if lost by the person whenever we press
the switch on the remote. Stick starts to beep, so we can hear their voice
and find out in which direction stick is.
GSM Overview:-

Global System for Mobile Communications or GSM (originally from Grouped


Special Mobile), is the world's most popular standard for mobile telephone
systems. The GSM Association estimates that 80% of the global mobile
market uses the standard. GSM is used by over 1.5 billion people across
more than 212 countries and territories. This ubiquity means that subscribers
can use their phones throughout the world, enabled by international roaming
arrangements between mobile network operators. GSM differs from its
predecessor technologies in that both signalling and speech channels are
digital, and thus GSM is considered a second generation (2G) mobile phone
system. The GSM standard has been an advantage to both consumers, who
may benefit from the ability to roam and switch carriers without replacing
phones, and also to network operators, who can choose equipment from
many GSM equipment vendors.

GPS Overview:-

The Global Positioning System (GPS) is a space-based global navigation


satellite system (GNSS) that provides reliable location and time information
in all weather and at all times and anywhere on or near the Earth when and
where there is an unobstructed line of sight to four or more GPS satellites. It
is maintained by the United States government and is freely accessible by
anyone with a GPS receiver. The GPS project was started in 1973 to
overcome the limitations of previous navigation systems, integrating ideas
from several predecessors, including a number of classified engineering
design studies from the 1960s. GPS was created and realized by the U.S.
Department of Defense (USDOD) and was originally run with 24 satellites. It
became fully operational in 1994.
Block Diagram
Schematic Diagrams
+5V

VCC
VCC

TX
TX

GPS Receiver
U1
19 39 C1
XTAL1 P0.0/AD0
38
P0.1/AD1 GND

GND
37
P0.2/AD2
18 36 10uF
XTAL2 P0.3/AD3
35
P0.4/AD4
34 1 3 U2
P0.5/AD5
33
P0.6/AD6
9 32
RST P0.7/AD7 C1+ C1- +5V
21 11 14
P2.0/A8
22 12
T1IN T1OUT
13 C3
P2.1/A9 R1OUT R1IN
23 10 7
P2.2/A10 T2IN T2OUT
29 24 9 8
PSEN P2.3/A11 R2OUT R2IN
30 25 10uF
ALE P2.4/A12
31 26 2
EA P2.5/A13 VS+
27 6
P2.6/A14
28
VS- C4
P2.7/A15
C2+ C2-
1 10

VCC
P1.0/T2 P3.0/RXD
2 11 10uF
P1.1/T2EX P3.1/TXD
3 12 4 5 MAX232
4
P1.2 P3.2/INT0
13 C2
P1.3 P3.3/INT1
5 14
P1.4 P3.4/T0
6 15
P1.5 P3.5/T1 RX
7 16 10uF
P1.6 P3.6/WR
8
P1.7 P3.7/RD
17
GSM Module
AT89C52
GND

Material Used:-
1. Diodes (IN4007)
2. Capacitor (470uF,1000uf,22pf)
3. Voltage Regulator (7805 )
4. Resistors
5. LED
6. Microcontroller
7. Crystal
8. LDR
9. LM358
10. Ultrasonic Sensor
11. GSM Modem
12. GPS
13. Switches
14. Wooden body
15. IC bases
16. Ribbon wire
17. Jumper wire
18. Soldering Iron
19. Soldering Wire

WORKING

Power Supply: -

Power supply is the essential part of any device or project. We are using
relays, microcontroller and LCD. These components needs +5V DC supply.
So we need a power supply circuit of +5V DC. Power supply circuit includes
step down transformer, rectifier circuit, filter circuit and regulator circuit. A
indicating component is also attached with the power supply to indicate the
power ON condition of power supply unit.
Microcontroller: -

A microcontroller is a intelligent device, which take actions according to


their programming. We are using AT89S52 microcontroller. Microcontroller
works on +5V DC power supply. Its a 40 pin microcontroller. This
microcontroller has 4 input/output ports. Each port is of 8 bit. Means we can
connect up to 32 devices to this microcontroller. LCD and IR sensors are
coupled with the microcontroller. Microcontroller continuously read the
status of IR sensors. Microcontroller includes reset and crystal circuit for its
own functioning.

Ultrasonic Sensor:-

Ultrasonic sensor comes in the pair. One is transmitter and second is


receiver. These are used to identify the distance.

RF MODULE

RF module comes in the transmitter and receiver pair. Varity of RF modules


are available in the market. These RF modules operate at some particular
frequency like 433 MHz and 315 MHz HT 12 D and HT 12 E ICs are used with
the RF modules to encode and decode the data and channels.

Working of Project

It is a very useful and simple project for the blind peoples in all over the
world; in this project firstly we are using UDM sensors to measure the
distance between the person and any type of object in front. If it detects any
object in the front it alerts the person with buzzer, in secondly condition we
are using GSM and GPS system in which if something happens with the
person he just has to press an button on the stick it will automatically reads
the location co-ordinates of the person and send these locations to the
predefined mobile no. After pressing the button controllers starts to read the
location from the GPS module after receiving it send this with the help of
GSM Modem.

Next we are using RF remote with which if a person lost his stick he can try
to find it by the remote when he presses the button on the remote it sends
the commands to the stick and stick starts to beep.

Next we are using LDR sensor which turns on the Indicators in night
automatically.

Components Description
RESISTORS
The flow of charge (or current) through any material, encounters an opposing

force similar in many respect to mechanical friction. This opposing force is

called resistance of the material. It is measured in ohms. In some electric

circuits resistance is deliberately introduced in the form of the resistor.

Resistors are of following types:

1. Wire wound resistors.


2. Carbon resistors.
3. Metal film resistors.

Wire Wound Resistors:

Wire wound resistors are made from a long (usually Ni-Chromium) wound on

a ceramic core. Longer the length of the wire, higher is the resistance. So

depending on the value of resistor required in a circuit, the wire is cut and

wound on a ceramic core. This entire assembly is coated with a ceramic

metal. Such resistors are generally available in power of 2 watts to several

hundred watts and resistance values from 1ohm to 100k ohms. Thus wire

wound resistors are used for high currents.

Carbon Resistors:
Carbon resistors are divided into three types:

a. Carbon composition resistors are made by mixing carbon grains with


binding material (glue) and moduled in the form of rods. Wire leads are
inserted at the two ends. After this an insulating material seals the
resistor. Resistors are available in power ratings of 1/10, 1/8, 1/4 , 1/2 , 1.2
watts and values from 1 ohm to 20 ohms.
b. Carbon film resistors are made by deposition carbon film on a ceramic
rod. They are cheaper than carbon composition resistors.
c. Cement film resistors are made of thin carbon coating fired onto a
solid ceramic substrate. The main purpose is to have more precise
resistance values and greater stability with heat. They are made in a
small square with leads.

Metal Film Resistors:

They are also called thin film resistors. They are made of a thin metal

coating deposited on a cylindrical insulating support. The high resistance

values are not precise in value; however, such resistors are free of

inductance effect that is common in wire wound resistors at high frequency.

Variable Resistors:
Potentiometer is a resistor where values can be set depending on the

requirement. Potentiometer is widely used in electronics systems. Examples

are volume control, tons control, brightness and contrast control of radio or

T.V. sets.

RESISTOR COLOR CODE

1st 2nd 3rd band 4th band Temp.


Color
band band (multiplier) (tolerance) Coefficient

Black 0 0 100

Brown 1 1 101 1% (F) 100 ppm

Red 2 2 102 2% (G) 50 ppm

Orang
3 3 103 15 ppm
e

Yellow 4 4 104 25 ppm

Green 5 5 105 0.5% (D)

Blue 6 6 106 0.25% (C)

Violet 7 7 107 0.1% (B)

Gray 8 8 108 0.05% (A)

White 9 9 109

Gold 101 5% (J)

Silver 102 10% (K)

None 20% (M)

Example: 1k or 1000 ohms


Band1

Band 2

Band 3

Band 4

CAPACITORS

A capacitor can store charge, and its capacity to store charge is called

capacitance. Capacitors consist of two conducting plates, separated by an

insulating material (known as dielectric). The two plates are joined with two
leads. The dielectric could be air, mica, paper, ceramic, polyester,

polystyrene, etc. This dielectric gives name to the capacitor. Like paper

capacitor, mica capacitor etc.

Types of Capacitors:- Capacitors are of two Types Fixed and variable

capacitor.

Fixed types of capacitor are further of two types:-

Polar Capacitor:- Those capacitor have polarity are known as polar capacitor.

Electrolytic capacitor are the example of polar capacitors.

Non Polar Capacitor:- Those capacitor have no polarity are known as NON-

polar capacitor. Ceramic capacitor are the example of non polar capacitors

Electrolytic Capacitor: Electrolytic capacitors have an electrolyte as a

dielectric. When such an electrolyte is charged, chemical changes takes

place in the electrolyte. If its one plate is charged positively, same plate

must be charged positively in future. We call such capacitors as polarized.

Normally we see electrolytic capacitor as polarized capacitors and the leads


are marked with positive or negative on the can. Non-electrolyte capacitors

have dielectric material such as paper, mica or ceramic. Therefore,

depending upon the dielectric, these capacitors are classified.

Ceramic Capacitor: Such capacitors have disc or hollow tabular shaped

dielectric made of ceramic material such as titanium dioxide and barium

titanate. Thin coating of silver compounds is deposited on both sides of

dielectric disc, which acts as capacitor plates. Leads are attached to each

sides of the dielectric disc and whole unit is encapsulated in a moisture

proof coating. Disc type capacitors have very high value up to 0.001uf. Their

working voltages range from 3V to 60000V. These capacitors have very low

leakage current. Breakdown voltage is very high.


Diode:-

Diodes are semiconductor devices which might be described as passing

current in one direction only. Diodes have two terminal, an anode and a

cathode. The cathode is always identified by a dot, ring or some other mark.

Diode is a unidirectional device. In this current flows in only one direction.

Diodes can be used as voltage regulators, tuning devices in rf tuned circuits,


frequency multiplying devices in rf circuits, mixing devices in rf circuits,
switching applications or can be used to make logic decisions in digital
circuits. There are also diodes which emit "light", of course these are known
as light-emitting-diodes or LED's.

a rectifying diode of the 1N4001-07 ( 1A) type or even one of the high power,
high current stud mounting types. You will notice the straight bar end has the
letter "k", this denotes the "cathode" while the "a" denotes anode. Current
can only flow from anode to cathode and not in the reverse direction, hence
the "arrow" appearance. This is one very important property of diodes.

The principal early application of diodes was in rectifying 50 / 60 Hz AC


mains to raw DC which was later smoothed by choke transformers and / or
capacitors. This procedure is still carried out today and a number of
rectifying schemes for diodes have evolved, half wave, full wave and bridge,
full wave and bridge rectifiers.

As examples in these applications the half wave rectifier passes only the
positive half of successive cycles to the output filter through D1. During the
negative part of the cycle D1 does not conduct and no current flows to the
load. In the full wave application it essentially is two half wave rectifiers
combined and because the transformer secondary is centre tapped, D1
conducts on the positive half of the cycle while D2 conducts on the negative
part of the cycle. Both add together. This is more efficient. The full wave
bridge rectifier operates essentially the same as the full wave rectifier but
does not require a cetre tapped transformer. Further discussion may be seen
on the topic power supplies
1N400X series Diode:-

Features

Diffused Junction

High Current Capability and Low Forward Voltage Drop

Low Reverse Leakage Current

Lead Free Finish

1N4148 Diode

The 1N4148 and 1N4448 are high-speed switching diodes fabricated in


planar technology, and encapsulated in hermetically sealed leaded glass
SOD27 (DO-35) packages.
FEATURES

Hermetically sealed leaded glass SOD27 (DO-35) package

High switching speed: max. 4 ns

General application

Continuous reverse voltage: max. 100 V

Repetitive peak reverse voltage: max. 100 V

Repetitive peak forward current: max. 450 mA.


APPLICATIONS

High-speed switching

IC

IC (Integrated Circuit) means that all the components of the circuit are
fabricated on same chip. Digital ICs are a collection of resistors, diodes, and
transistors fabricated on a single piece of semiconductor, usually silicon
called a substrate, which is commonly referred to as wafer. The chip is
enclosed in a protective plastic or ceramic package from which pins extend
out connecting the IC to other device. Suffix N or P stands for dual-in-line
(plastic package (DIP) while suffix J or I stands for dual-in-lime ceramic
package. Also the suffix for W stands for flat ceramic package.

The pins are numbered counter clockwise when viewed from the top of the
package with respect to an identity notch or dot at one end of the chip.The
manufacturers name can usually be guessed from its logo that is printed on
the IC. The IC type number also indicates the manufacturers code. For e.g.
DM 408 N SN 7404 indicates National Semiconductor and Texas Instruments.

Other examples are:

Fair Child : UA, UAF

National Semiconductor : DM, LM, LH, LF, and TA.

Motorola : MC, MFC.

Sprague : UKN, ULS, ULX.

Signetic : N/s, NE/SE, and SU.

Burr-Brown : BB.

Texas Instruments : SN.


The middle portion i.e. the IC type number tells about the IC function and
also the family, which the particular IC belongs to.ICs that belongs to
standard TTL series have an identification number that starts with 74; for e.g.
7402, 74LS04, 74S04 etc. ICs that belongs to standard CMOS family their
number starts with 4, like 4000, 451B, 4724B, 1400. The 74C, 74HC, 74AC &
74ACT series are newer CMOS series.

Various series with TTL logic family are:-

Standard TTL 74.

Schottky TTL 74s.

Low power Schottky 74LS.

Advance Schottky 74AS.

Advanced Low Power Schottky 74ALs.

Also there are various series with CMOS logic family as metal state CMOS 40
or 140.

Transistor:-

The schematic representation of a transistor is shown. Note the arrow


pointing down towards the emitter. This signifies it's an NPN transistor A
transistor is basically a current amplifier. Say we let 1mA flow into the base.
We may get 100mA flowing into the collector. Note: The currents flowing into
the base and collector exit through the emitter (sum off all currents entering
or leaving a node must equal zero). The gain of the transistor will be listed in

the datasheet as either or H . The gain won't be identical even in


DC fe
transistors with the same part number. The gain also varies with the collector
current and temperature.
Signals from switches
When a switch is used to provide an input to a circuit, pressing the switch
usually generates a voltage signal. It is the voltage signal which triggers the
circuit into action. What do you need to get the switch to generate a voltage
signal? . . . You need a voltage divider. The circuit can be built in either of two
ways:

The pull down resistor in the first circuit forces Vout to become LOW except
when the push button switch is operated. This circuit delivers a HIGH voltage
when the switch is pressed. A resistor value of 10 is often used.

In the second circuit, the pull up resistor forces Vout to become HIGH except
when the switch is operated. Pressing the switch connects Vout directly to 0 V.
In other words, this circuit delivers a LOW voltage when the switch is
pressed.

In circuits which process logic signals, a LOW voltage is called 'logic 0' or just
'0', while a HIGH voltage is called 'logic1' or '1'. These voltage divider circuits
are perfect for providing input signals for logic systems.

What kinds of switches could you use. One variety of push button switch is
called a miniature tactile switch. These are small switches which work
well with prototype board:

LED:- LED means light emitting diode. Its function is similar to the diode.
But these are not made up from silicon or germanium. These are generally
used as a indicating device. There are variety of LEDs are available in market
depending upon their size and colour.

Polarity of LED:- LED have polarity. We can judge its polarity by watching
flags in its structure. Bigger flag is known as cathode and smaller flag is
known as anode as shown below.

Voltage Regulator The LM78XX 3-terminal positive voltage regulators


employ internal current-limiting, thermal shutdown and safe-area
compensation, making them essentially indestructible. Heat sinking is
provided; they can deliver over 1.0A output current. They are intended as
fixed voltage regulators in a wide range of applications including local (on-
card) regulation for elimination of noise and distribution problems associated
with single-point regulation. In addition to use as fixed voltage regulators.

Features

Output current up to 1 A

Output voltages of 5; 6; 8; 9; 12; 15; 18; 24 V

Thermal overload protection

Short circuit protection

Crystal: - Its a 2 terminal component. This component has no polarity. Its


basic function to generate a Square Wave of some fixes frequency. Its value
is measure in MHz.
RF MODULE

RF module comes in the transmitter and receiver pair. Varity of RF modules


are available in the market. These RF modules operate at some particular
frequency like 433 MHz and 315 MHz. HT 12 D and HT 12 E ICs are used with
the RF modules to encode and decode the data and channels. RF modules
send data serially by air as shown below:-
HT 12 E is an encoder IC which is used to encode the channel and data. Its a
18 pin IC. 4 pins are used for the data and 8 pins are used for addressing.
17th pin is the output pin, which is further connected to the RF module of
some particular frequency. Pin diagram and circuit is shown below : -
HT 12 D is an decoder IC which is used to decode the channel and data. Its a
18 pin IC. 4 pins are used for the data and 8 pins are used for addressing.
14th pin is the input pin, which is connected to the RF receiver. Pin diagram
and circuit is shown below : -
An isolator device to electrically insulate and isolate a separate component
in a circuit board arrangement to allow for relatively fast and convenient
diagnostic inspection of a circuit to locate failed components

In electronics, an opto-isolator, also called an optocoupler, photocoupler, or


optical isolator, is "an electronic device designed to transfer electrical signals
by utilizing light waves to provide coupling with electrical isolation between
its input and output. The main purpose of an opto-isolator is "to prevent high
voltages or rapidly changing voltages on one side of the circuit from
damaging components or distorting transmissions on the other side

An opto-isolator contains a source (emitter) of light, almost always a near


infrared light-emitting diode (LED), that converts electrical input signal into
light, a closed optical channel (also called dielectrical channel [5]), and a
photosensor, which detects incoming light and either generates electric
energy directly, or modulates electric current flowing from an external power
supply. The sensor can be a photoresistor, a photodiode, a phototransistor.
Pin diagram of PC 817 is shown below.
PC 817 is a 4 pin opto coupler as shown above. A series resistance of
470 ohm is used to limit the voltage across the diode. +5V power supply is
connected to the first pin of IC, which is the anode pin diode. 2 nd pin is
connected to the port of microcontroller. When the second pin is low then we
get low output, when the input to 2 nd pin high we get high voltage the
output. Thus we isolate the voltage having the same logic level.

Power supply: - Power supply is the essential part of any device or project.
We are using microcontroller and LED. These components needs +5V DC
supply. So we need a power supply circuit of +5V DC. Power supply circuit
includes step down transformer, rectifier circuit, filter circuit and regulator
circuit. An indicating component is also attached with the power supply to
indicate the power ON condition of power supply unit.
A step down transformer of 12-0-12 V and 750 mA is used to step down the
AC power supply. This transformer can provide current up to 750 mA. Our
circuit load is below 750 mA. So there will not be any loading effect on
transformer. Output of transformer is given to the rectifier circuit. We are
using a central tapped full wave rectifier. In this rectifier we are using
1N4007 pn diode to rectify AC voltage. Output of this rectifier is not purely
DC. Output of rectifier is rippled DC. So we need some filtering section to
rectify this ripples. Output voltage of rectifier can be calculated by :-

Vout = (Vin * 2)- (Forward voltage drop of diode)

1N4007 is a silicon semiconductor material based diode. So in this case


forward Voltage drop is .7 V. Final output of this rectifier be:-

Vout= (12*2)- .7

Vout= 16.1 V

Rectifier circuit is build of capacitor. A capacitor of 1000uF,25V is used to


filter the ripples. Output of capacitor is almost pure DC. But its voltage is 16V
and we need +5V DC. So we are using a voltage regulator to get the desired
+5V DC. A 7805 voltage regulator is a suitable component for this purpose.
Output of 7805 regulator is +5V DC. A capacitor of 470uf, 10V is used to
further filter out the critical ripples. A LED is used as an indicating device.
Most of LED operates at 1.5 to 2.5V voltage range with 8-10 mA. LED used
here is of 5mm size. We consider that LED operating at 1.6V with 8mA
current. We can calculate the value of resistor using the KVC law.

Total Voltage= Voltage across resistor+ Voltage across LED

LED and resistor are connected in series so same current will flow.
Means 8mA current will flow through the resistor.
Now Total Voltage is =5V
Voltage across resistor is =1.6v
Current is = 8mV
So our equation will be
5V= (10mA * resistance) + 1.6V
3.4V=10mA * resistance
Resistance =3.4/10mA
= 450 ohm

Thus we can calculate the any series resistor for any input voltage and LED.

MICROCONTROLLERS (MCU)

Figure shows the block diagram of a typical microcontroller, which is a


true computer on a chip. The design incorporates all of the features found
in micro-processor CPU, ALU, PC, SP, and registers. It also added the other
features needed to make a complete computer: ROM, RAM, I/O,timer &
counters,and clock circuit.
Structure of microprocessor and microcontroller

DIFFERENCE BETWEEN MICROCONTROLLER & MICROPROCESSOR

It is very clear from figure that in microprocessor we have to interface


additional

circuitry for providing the function of memory and ports, for example we
have to

interface external RAM for data storage, ROM for program storage,
programmable

peripheral interface (PPI) 8255 for the Input Output ports, 8253 for timers,
USART

for serial port. While in the microcontroller RAM, ROM, I/O ports, timers and

serial communication ports are in built. Because of this it is called as system


on

chip. So in micro-controller there is no necessity of additional circuitry which


is
interfaced in the microprocessor because memory and input output ports are
inbuilt

in the microcontroller. Microcontroller gives the satisfactory performance for

small applications. But for large applications the memory requirement is


limited

because only 64 KB memory is available for program storage. So for large

applications we prefer microprocessor than microcontroller due to its high

processing speed.

4.1 8051 MICROCONTROLLER

Description:-

The AT89S52 is a low-power, high-performance CMOS 8-bit microcontroller


with 8Kbytes of in-system programmable Flash memory. The device is
manufactured using Atmels high-density non-volatile memory technology
and is compatible with the industry-standard 80C51 instruction set and pin
out. The on-chip Flash allows the program memory to be reprogrammed in-
system or by a conventional non-volatile memory programmer. By combining
a versatile 8-bit CPU with in-system programmable Flash on a monolithic
chip, the Atmel AT89S52 is a powerful microcontroller which provides a
highly-flexible and cost-effective solution to many embedded control
applications. The AT89S52 provides the following standard features: 8K bytes
of Flash, 256 bytes of RAM, 32 I/O lines, Watchdog timer, two data pointers,
three 16-bit timer/counters, a six-vector two-level interrupt architecture, a
full duplex serial port, on-chip oscillator, and clock circuitry. In addition, the
AT89S52 is designed with static logic for operation down to zero frequency
and supports two software selectable power saving modes. The Idle Mode
stops the CPU while allowing the RAM, timer/counters, serial port, and
interrupt system to continue functioning. The Power-down mode saves the
RAM contents but freezes the oscillator, disabling all other chip functions
until the next interrupt
or hardware reset.

Features:-
8K Bytes of In-System Programmable (ISP) Flash Memory
Endurance: 1000 Write/Erase Cycles
4.0V to 5.5V Operating Range
Fully Static Operation: 0 Hz to 33 MHz
Three-level Program Memory Lock
256 x 8-bit Internal RAM
32 Programmable I/O Lines
Three 16-bit Timer/Counters
Eight Interrupt Sources
Full Duplex UART Serial Channel
Low-power Idle and Power-down Modes
Interrupt Recovery from Power-down Mode
Watchdog Timer
Dual Data Pointer
Power-off Flag
Fast Programming Time
Flexible ISP Programming (Byte and Page Mode)
PIN CONFIGURATION OF 8051 MICROCONTROLLER

Although 8051 family members come in different packages such


DIP(dual in line package),QFP(Quad flat package), and LLC(leadless chi0p
carrier),they all have 40 pins that are dedicated to various functions such as
I/O,RD,WR, address, data and interrupts.

VCC:

Pin 40 provides supply voltage to the chip. The voltage source is +5 Volts.

GND:
Pin 20 is the ground.

FIG 28: PIN DIAGRAM OF THE P89C51

XTAL1 and XTAL2:

The 8051 has an on chip oscillator but requires an external clock to run
it. Most often a quartz crystal oscillator is connected to inputs XTAL1 (pin 19)
and XTAL2 (pin 18). The quartz crystal oscillator connected to XTAL1 and
XTAL2 also needs two capacitors of 27 pf value. One side of each capacitor is
connected to the ground. Speed refers to the maximum oscillator frequency
connected to XTAL .When the 8051 is connected to a crystal oscillator is
powered up we can observe the frequency on the XTAL2 pin using the
oscilloscope.
RST:

Pin 9 is the RESET pin. It is an input and is active high. Upon applying a
high pulse to this pin the microcontroller well reset and terminate all
activities. This is often referred to as a power on reset .Activating a power on
reset will cause all values the registers to be lost. It will set program counter
to all 0s.

In order for the RESET input to be effective it must have a minimum duration
of two machine cycles. In other words the high pulse must be high for a
minimum of two machine cycles before it is allowed to go low.
EA:

The 8051 family members such as the 8751/52, 89C51/52 or


DS89C4*0 all come with on chip ROM to store programs. In such cases the
EA pin is connected to Vcc. For family members such as the 8031 and 8032
in which there is no on chip ROM, code is stored on an external ROM and is
fetched by 8031/32. Therefore for the 8031 the EA pin must be connected to
GND to indicate that the code is stored externally. EA which stands for
external access is pin number 31 in the DIP packages. It is an input pin and
must be connected to either Vcc or GND. In other words it can not be
unconnected.

PSEN:

This is an output pin. PSEN stands for program store enable. In an


8031 based system in which an external ROM holds the program code, this
pin is connected to the OE pin of the ROM.
ALE: ALE stands for address latch enable. It is an output pin and is active
high. When connecting an 8031 to external memory, port 0 provides both
address and data. In other words the 8031 multiplexes address and data
through port 0 to save pins. The ALE pin is used for de-multiplexing the
address and data by connecting to G pin of the 74LS373 chip.

PORTS 0,1,2,3:

All the ports upon RESET are configured as input, since P0-P3 have
value FFH on them. The following is a summary of features of P0-P3.

PORT 0:

Port 0 is also designated as AD0-AD7 allowing it to be used for both


address and data. When connecting an 8051/31 to an external memory, port
0 provides both address and data. The 8051 multiplexes address and data
through port 0 to save pins. ALE indicates if p0 has address A0-A7.in the
8051 based systems where there is no external memory connection the pins
of P0 must be connected externally to 10k-ohm pull-up resistor. This is due to
the fact that P0 is an open drain, unlike P1, P2 and P3. Open drain is a term
used for MOS chips in the same way that open collector is used for TTL chips.
In many systems using the 8751, 89c51 or DS89c4*0 chips we normally
connect P0 to pull up resistors.

PORT 1, PORT 2:

In 8051 based systems with no external memory connection both P1


and P2 are used as simple I/O. however in 8031/51 based systems with
external memory connections P2 must be used along with P0 to provide the
16-bit address for the external memory. P2 is also designated as A8-A15
indicating its dual function. Since an 8031/51 is capable of accessing 64k
bytes of external memory it needs a path for the 16 bits of address. While P0
provides the lower 8 bits via A0-a7 it is the job P2 to provide bits A8-A15 of
the address. In other words when the 8031/51 is connected to external
memory P2 is used for the upper 8 bits of the 16 bit address and it cannot be
used for I/O.

PORT 3:

Port 3 occupies a total of 8 pins 10 through 17. It can be used as input


or output. P3 does not need any pull-up resistors the same as P1 and P2 did
not. Although port 3 is configured as input port upon reset this is not the way
it is most commonly used. Port 3 has the additional function of providing
some extremely important signals such as interrupts.

Port 3 Alternate functions:

P3 Bit Function Pin

P3.0 RxD 10

P3.1 TxD 11

P3.2 INT0 12

P3.3 INT1 13

P3.4 T0 14

P3.5 T1 15

P3.6 WR 16

P3.7 RD 17

Table 1: Alternate functions of Port 3

Difference between RAM and ROM

RAM is used for data storage while ROM is used for program storage.

Data of RAM can be changed during processing while data of ROM cant

be changed during processing.

We can take an example of calculator. If we want to perform addition of


two numbers then we type the two numbers in calculator, this is saved in

the RAM, but the Algorithms by which the calculation is performed is saved

in the ROM. Data which is given by us to calculator can be changed but the

algorithm or program by which calculation is performed cant be changed.

PROGRAMMING MODEL

In programming model of 8051 we have different types of registers are


available and te4hse registers are used to store temporarily data is then the
information could be a byte of data to be processed or an address pointing to
the data to be fetched the majority of registers is 8051 are 8-bikt registers.

a) ACCUMULATOR (REGISTER A):

Accumulator is a mathematical register where all the arithmetic and logical


operations are done is this register and after execution of instructions the
outpour data is stored in the register is bit addressable near. We can access
any of the single bit of this register.

b) B REGISTER:

B register is same as that of accumulator of. It is also an 8 bit register and


every bit of this is accessible. This is also a mathematical register B which is
used mostly for multiplication and division.

c) PSW (PROGRAM STATUS WORD) Register:

Program status word register is an 8 bit register. It is also referred to as the


flag register. Although the PSW register is 8 bits wide, only 6 bits of it are
used by the 8051. The unused bits are user-definable flags. Four of the flags
are called conditional flags, meaning that they indicate some conditions that
result after an instruction is executed. These four are CY (carry), AC (auxiliary
carry), P (parity) and OV (overflow).

CY PSW.7 Carry Flag


AC PSW.6 Auxiliary
Carry Flag

F0 PSW.5 Available
to the user
for
General
Purpose

RS1 PSW.4 Register


Bank
Selector
Bit 1

RS0 PSW.3 Register


Bank
Selector
Bit 0

OV PSW.2 Overflow
Flag

-- PSW.1 User
Definable
Bit

P PSW.0 Parity
Flag.

c) SP (STACK POINTER, ADDRESS 81H):

This is the stack pointer of the microcontroller. This SFR indicates


where the next value to be taken from the stack will be read from in Internal
RAM. If you push a value onto the stack, the value will be written to the
address of SP + 1. That is to say, if SP holds the value 07h, a PUSH
instruction will push the value onto the stack at address 08h. This SFR is
modified by all instructions, which modify
The stack, such as PUSH, POP, LCALL, RET, RETI, and whenever interrupts are
provoked by the microcontroller.

d) DPL/DPH (DATA POINTER LOW/HIGH, ADDRESSES 82H/83H):

The SFRs DPL and DPH work together to represent a 16-bit value called
the Data Pointer. The data pointer is used in operations regarding external
RAM and some instructions involving code memory. Since it is an unsigned
two-byte integer value, it can represent values from 0000h to FFFFh (0
through 65,535 decimal).

Two instructions which are used to start and terminate program.

ORG this instruction indicate the origin of program ORG 3000H

means program starts from 3000H loc

this instruction hasnt take any memory space. It is used to show the

starting address of program.

END this instruction show the END of program or it is used to terminate

the program.

LIQUID CRYSTAL DISPLAY

A liquid crystal display (LCD) is a thin, flat electronic visual display that
uses the light modulating properties of liquid crystals (LCs). LCs does not
emit light directly. LCDs therefore need a light source and are classified as
"passive" displays. Some types can use ambient light such as sunlight or
room lighting. There are many types of LCDs that are designed for both
special and general uses.

LCDs are more energy efficient, and offer safer disposal, than CRTs. Its low
electrical power consumption enables it to be used in battery-powered
electronic equipment.
The LCD Module can easily be used with an 8051 microcontroller such as the
162A. The LCD Module comes with a 16 pin connector. This can be plugged
into connector 16 pin.

Most common LCDs connected to the 8051 are 16x2 and 20x2 displays. This
means 16 characters per line by 2 lines and 20 characters per line by 2 lines,
respectively.

LCD Character 2 x 16 Module

Character LCDs use a standard 14-pin interface and those with backlights
have 16 pins.

Pin configuration
PIN Name Function

1 VSS Ground voltage

2 VCC +5V

3 VEE Contrast voltage

Register Select
4 RS 0 = Instruction Register
1 = Data Register

Read/ Write, to choose write or read mode


5 R/W 0 = write mode
1 = read mode

Enable
6 E 0 = start to latch data to LCD character
1= disable

7 DB0 LSB

8 DB1 -

9 DB2 -

10 DB3 -

11 DB4 -

12 DB5 -

13 DB6 -

14 DB7 MSB

15 BPL Back Plane Light

16 GND Ground voltage


The user may select whether the LCD is to operate with a 4-bit data bus or
an 8-bit data bus. If a 4-bit data bus is used, the LCD The 44780 standard
requires 3 control lines as well as either 4 or 8 I/O lines for the data bus. The
user may select whether the LCD is to operate with a 4-bit data bus or an 8-
bit data bus. If a 4-bit data bus is used, the LCD will require a total of 7 data
lines (3 control lines plus the 4 lines for the data bus). If an 8-bit data bus is
used, the LCD will require a total of 11 data lines (3 control lines plus the 8
lines for the data bus).

The three control lines are referred to as EN, RS, and RW.

Enable:-The EN line is called "Enable." This control line is used to tell the
LCD that you are sending it data. To send data to the LCD, your program
should first set this line high (1) and then set the other two control lines
and/or put data on the data bus. When the other lines are completely ready,
bring EN low (0) again. The 1-0 transition tells the 44780 to take the data
currently found on the other control lines and on the data bus and to treat it
as a command.

Register Select:-The RS line is the "Register Select" line. When RS is low


(0), the data is to be treated as a command or special instruction (such as
clear screen, position cursor, etc.). When RS is high (1), the data being sent
is text data which should be displayed on the screen. For example, to display
the letter "T" on the screen you would set RS high.

Read Write:-The RW line is the "Read/Write" control line. When RW is low


(0), the information on the data bus is being written to the LCD. When RW is
high (1), the program is effectively querying (or reading) the LCD. Only one
instruction ("Get LCD status") is a read command. All others are write
commands--so RW will almost always be low.
Finally, the data bus consists of 4 or 8 lines (depending on the mode of
operation selected by the user). In the case of an 8-bit data bus, the lines are
referred to as DB0, DB1, DB2, DB3, DB4, DB5, DB6, and DB7.

MAX-232:

The MAX232 is an integrated circuit that converts signals from an RS-


232 serial port to signals suitable for use in TTL compatible digital logic
circuits. The MAX232 is a dual driver/receiver and typically converts the RX,
TX, CTS and RTS signals.

The drivers provide RS-232 voltage level outputs from a single + 5 V supply
via on-chip charge pumps and external capacitors. This makes it useful for
implementing RS-232 in devices that otherwise do not need any voltages
outside the 0 V to + 5 V range, as power supply design does not need to be
made more complicated just for driving the RS-232 in this case.

When a MAX232 IC receives a TTL level to convert, it changes a TTL Logic 0


to between +3 and +15 V, and changes TTL Logic 1 to between -3 to -15 V,
and vice versa for converting from RS232 to TTL.

The MAX232 is a dual driver/receiver that includes a capacitive voltage


generator to supply EIA-232 voltage levels from a single 5-V supply.
RS232 Line Type & Logic RS232 TTL Voltage to/from
Level Voltage MAX232

Data Transmission (Rx/Tx) +3 V to


0V
Logic 0 +15 V

Data Transmission (Rx/Tx)


-3 V to -15 V 5V
Logic 1

Max-232(operating circuit)

Ultrasonic Module

Ultrasonic module provides 2cm - 400cm non-contact measurement function,


these modules includes ultrasonic transmitters, receiver and control circuit.
The basic principle of work:
(1) Using IO trigger for at least 10us high level signal,
(2) The Module automatically sends eight 40 kHz and detect whether there is
a pulse signal back.
(3) IF the signal back, through high level, time of high output IO duration is
the time from sending ultrasonic to returning.
Test distance = (high level time velocity of sound (340M/S) / 2,
Wire connecting direct as following:
5V Supply
Trigger Pulse Input
Echo Pulse Output
0V Ground
LDR

LDR stands for Light Dependent Resistors . Light Dependent Resistor, an


electronic component, also known as Photo-Resistor. An LDR will have a
resistance that varies according to the amount of visible light that falls on it.
A close up of an LDR is shown below
An LDR (light-dependent resistor) is a particular type of semiconductor (A
material with a conduction rating in between that of a conductor and an
insulator i.e. electricity flows through a semiconductor slower than through a
conductor, but quicker than through an insulator)
The light falling on the brown zigzag lines on the sensor causes the
resistance of the device to fall. This is known as a negative co-efficient.
There are some LDRs that work in the opposite way i.e. their resistance
increases with light (called positive co-efficient)

LDR Circuit
Working

LDR is a very common and easy to use sensor. In this a ldr is placed between
the collector and base terminal of a transistor. Both the transistors are used
as a switch. When LDR is placed in light then the resistance of LDR goes low
and hence sufficient current flow through the base of transistor, which switch
on the transistor and output goes low. When a LDR is placed in the dark then
resistance of LDR is very high hence no current will flow through the base of
transistor which results in high output. A variable resistor of 1M is used to
change the switching light density.

Software Used:-
1. UMPS / KEIL
2. Orcad
3. ISPPROG

You might also like