SlideShare a Scribd company logo
Submitted By :-
Anjali Rai EC4873
Archna Dhiman EC4881
Jyoti Thakur EC 4894
Monika Chauhan EC4904
Neha Verma EC4907
 Acknowledgment
 Preface
 Company profiles
 Embedded system
Introduction
Applications of embedded system
 Microcontroller
Introduction
Definition of microcontroller
Block diagram
 Microprocessor
Introduction
Definition of microprocessor
Block diagram
Difference between microcontroller and microprocessor
TABLE OF CONTENT
TOPIC
 Various microcontrollers
8031
8051
AT89C51
 8051 microcontroller architecture
Block diagram
Pin diagram
Pin description
 Microcontroller memory organization
Program memory
Data memory
 Software used
Various steps to use compiler
How to debug the program
 Interfacing with various devices
LED Interfacing
DC Motor
Relay
Stepper Motor
Seven Segment
LCD Interfacing
 Project description
Introduction to project
Circuit diagram of Home Security Prototype
Project methodology
Procedure
Description in detail
Application and advantages
Future development
 Reference and Bibliography
COMPANY PROFILES
 EEAST is a complete R & D organization dedicated to provide electronics and
Advanced Software Products and Solutions to its clients. Achieving the needs of
our costumer and converting their ideas to real models is our motto.
 We are working in the field of Embedded systems, Automation and advanced
system design for the last five years with the vision of becoming a center of
Excellence to provide Solutions, Services and Training in various fields of
technologies.
 EEAST is an organization providing advanced projects, complete electronics
solutions in development systems like microprocessor, micro-controllers,
wireless communications, optical-fiber communications, real time operating
systems, digital signal processing,
 Embedded systems and Micro-sensors including software solution, solution in
C, C++, Java, Net, Visual basic, embedded C and embedded LINUX.
INTRODUCTION TO EMBEDDED
SYSTEMS
 An Embedded System employs a combination of hardware & software (a
“ computational engine”) to perform a specific function; is part of a
larger system that may not be a “computer works in a reactive and time-
constrained environment. Software is used for providing features and
flexibility. Hardware ={Processors, ASICs, Memory...} is used
for performance (& sometimes security )
 An embedded system is a special purpose system in which the computer
is completely encapsulated by the device it controls.
 Unlike a general purpose computer, such as a PC, an embedded system
performs predefined task’s usually with very specific tasks design
engineers can optimize it reducing the size and cost of the product.
Embedded systems are often mass produced, so the cost savings may be
multiplied by millions of items.
 The core of any embedded system is formed by one
or several microprocessor or micro controller
programmed to perform a small number of tasks.
In contrast to a general purpose computer, which
can run any software application, the user chooses,
the software on an embedded system is semi-
permanent, so it is often called firmware.
APPLICATIONS OF EMBEDDED
SYSTEM
 Automated tiller machines (ATMS).
 Avionic, such as inertial guidance systems, flight control hardware /software
and letter integrated system in aircraft and missile.
 Cellular telephones and telephonic switches.
 Computer network equipment, including routers timeservers and firewalls
 Computer printers, Copiers
 .Disk drives (floppy disk drive and hard disk drive)
 Engine controllers and antilock brake controllers for automobiles.
 Home automation products like thermostat, air conditioners sprinkles and
security monitoring system.
 House hold appliances including microwave ovens, washing machines, TV sets
DVD players/recorders.
 Medical equipment
 Stationary video game controllers.
 Wearable computers.
 Measurement equipment such as digital storage oscilloscopes, logic analyzers
and spectrum analyzers.
 Multimedia appliances: internet radio receivers, TV set top boxes.
MICROPROCESSOR (MPU)
 A microprocessor is a general-purpose digital
computer central processing unit (CPU). Although
popularly known as a “computer on a chip”
is in no sense a complete digital computer. The
block diagram of a microprocessor CPU is shown,
which contains an arithmetic and logical unit (ALU),
program counter (PC), a stack pointer (SP),some
working registers, a clock timing circuit, and interrupt
circuits.
BLOCK DIAGRAM OF MICROPROCESSOR
 The prime use of microprocessor is to read data, perform
extensive calculations on that data and store them in the
mass storage device or display it. The prime functions of
microcontroller is to read data, perform limited
calculations on it, control its environment based on these
data.
 Thus the microprocessor is said to be general-purpose
digital computers whereas the microcontroller are intend
to be special purpose digital controller.
 Microprocessor need many opcodes for moving data from
the external memory to the CPU, microcontroller may
require just one or two, also microprocessor may have one
or two types of bit handling instructions whereas
microcontrollers have many.
 Lastly, the microprocessor design accomplishes the
goal of flexibility in the hardware configuration by
enabling large amounts of memory and I/O that could
be connected to the address and data pins on the IC
package. The microcontroller design uses much more
limited set of single and double byte instructions to
move code and data from internal
Microcontroller
 Microcontroller, as the name suggests, are small contro
llers. They are like single chip computers that are often
embedded into other systems to function as
processing/controlling unit. For example, the remote
control you are using probably has microcontrollers
inside that do decoding and other controlling
functions. They are also used in automobiles, washing
machines, microwave ovens, toys ... etc, where
automation is needed
The key features of
microcontrollers include:
 High Integration of Functionality
 Microcontrollers sometimes are called single-chip
computers because they have on-chip memory and
I/O circuitry and other circuitries that enable them to
function as small stand alone computers without other
supporting circuitry.
 Field Programmability, Flexibility
 Microcontrollers often use EEPROM or EPROM as
their storage device to allow field programmability so
they are flexible to use. Once the program is tested to
be correct then large quantities of microcontrollers
can be programmed to be used in embedded systems
 A Timer module to allow the microcontroller to
perform tasks for certain time periods.
 A serial I/O port to allow data to flow between the
microcontroller and other devices such as a PC or
another microcontroller.
 An ADC to allow the microcontroller to accept
analogue input data for processing
The design
incorporates all of the features found in microprocessor CPU:
ALU, PC, SP, and registers. It also added the other features
needed to make a complete computer: ROM, RAM, parallel I/O,
serial I/O, counters, and clock circuit
DIFFERENCE BETWEEM MICROPROCESSOR AND
MICROCONTROLLER
MICROPROCESSORS MICROCONTROLLERS
1.
Microprocessors contain no 1.
Microcontrollers have an internal RAM or
ROM. RAM and a ROM
2.
Microprocessor don’t have any I/O 2.Microcontrollers have I/O
ports.
Ports.
3.
Advantage of versatility. 3. Advantage of less power
consumption.
4.
Expensive. 4. Cheaper in comparison.
5.
With the addition of external RAM 5. Occupies less space.
And ROM, the system is more bulky.
VARIOUS MICROCONTROLLERS
 First microcontroller is ‘8031’
 FEATURES
1. It is Intel’s product. Neither a microprocessor nor a
microcontroller.
2. It is 8-bit controller.
3. Internally no RAM is provided i.e. code is outside the chip.
 Second microcontroller is ‘8051’
 FEATURES
1. It is first complete 8-bit microcontroller.
2. It is a name of a family. In which the instruction set, pin
configuration, architecture are same, only memory storage
capacity is different.
3. Internally PROM (programmable read only memory) is
provided so it called one time programmable (OTP)
 Third microcontroller is ‘AT89C51’
 FEATURES
1. It is similar to 8051 microcontroller i.e. having same
instruction set, pin configuration, architecture.
2. It is also 8-bit microcontroller. It’s cost is only Rs 10 more
than 8051.
3. It uses EPROM (erasable programmable read only
memory) or FLASH memory.
4. It is multiple time programmable (MTP) i.e. 1000 times.
So it is better than 8051.
ATMEL 89C51
 It is a lower-power, high-performance CMOS 8-bit
microcomputer with 4K bytes of Flash programmable and
erasable read only memory (PEROM).
 The device is manufactured using Atmel’s high-density
nonvolatile memory technology and is compatible with the
industry-standard MCS-51 instruction set and pin out. The
on chip Flash allows the program memory to be
reprogrammed in system or by a conventional nonvolatile
memory programmer.
 By combining a versatile 8-bit CPU with Flash on a
monolithic chip, the Atmel AT89C51 is a powerful
microcontroller, which provides a highly flexible and cost-
effective solution to many embedded control applications.
THE 8051
MICROCONTROLLER
The 8051 provides the following standard features:
• 4k bytes of ROM, 128 bytes of RAM, 32 I/O lines, two 16-
bit timer/counters, and five vector two-level interrupt
architecture, a full duplex serial port, on- chip oscillator
and clock circuitry
• In addition, the 8051 is designed with static logic for
operation down to zero frequency and supports two
software selectable power saving modes.
ON-CHIP
ROM for
program
code
EXTERNAL
INTERRUPTS
ON-CHIP
RAM
ETC.
TIMER 0
CPU
OSC
BUS
CONTROL
4 I/O
PORTS
SERIAL
PORT
TXD RXD
BLOCK DIAGRAM OF MICROCONTROLLER
THE 8051 MICROCONTROLLER’S
ARCHITECTURE
 Eight bit CPU with registers A (the accumulator) & B.
 Sixteen bit program counter (PC) and data pointer (DPTR).
 Eight bit program status word (PSW).
 Eight bit stack pointer (SP).
 Internal ROM or EPROM.
 Internal RAM of 128 bytes
Four register banks, each containing eight registers.
Sixteen bytes, which may be addressed at the bit level.
Eight bytes of general-purpose data memory.
 Thirty two I/O pins arranged as four-bit ports P0-P3.
 Two 16-bit timer/counters T0 and T1.
 Full duplex serial data received/transmitter.
 Two external and three internal interrupt sources.
Project  report on embedded system using 8051 microcontroller
PIN DESCRIPTION
 Vcc
Pin 40 provides supply voltage to the chip. The voltage source is +5 V.
 GND
Pin 20 is the ground.
 X1 and X2
The 8051 have an on-chip oscillator but requires external clock to run it. Most
often a quartz crystal oscillator is connected to input X1 (pin 19) and X2 (pin
18).
 RESET
Pin 9 is the reset pin. It is an input and is active high (normally low).
 EA
EA, which stands for “external access,” is pin number 31 in the DIP
packages. It is input pin and must be connected to either Vcc or GND. In
other words, it cannot be left unconnected.
 PSEN
This is an output pin. PSEN stands for “program store enable.” It is
the read strobe to external program memory
 ALE
ALE (Address latch enable) is an output pin and is active high
 I/O port pins
The four ports P0, P1, P2, and P3 each use 8 pins, making them 8-bit
ports. All the ports upon RESET are configured as output, ready to be
used as output ports. To use any of these as input port, it must be
programmed.
Software Used
 The Keil 8051 Development Tools are designed to
solve the complex problems facing embedded
software developers.
 When starting a new project, simply select the
microcontroller you use from the Device Database and
the µVision IDE sets all compiler, assembler, linker,
and memory options for you.
INTERFACING WITH VARIOUS DEVICES:
LED INTERFACING
 CIRCUIT DIAGRAM
D3
LED
C?
CAP NP
D7
LED
D4
LED
D5
LED
D8
LED
U?
AT89C52
9
18
19 29
30
31
1
2
3
4
5
6
7
8
21
22
23
24
25
26
27
28
10
11
12
13
14
15
16
17
39
38
37
36
35
34
33
32
RST
XTAL2
XTAL1 PSEN
ALE/PROG
EA/VPP
P1.0/T2
P1.1/T2-EX
P1.2
P1.3
P1.4
P1.5
P1.6
P1.7
P2.0/A8
P2.1/A9
P2.2/A10
P2.3/A11
P2.4/A12
P2.5/A13
P2.6/A14
P2.7/A15
P3.0/RXD
P3.1/TXD
P3.2/INTO
P3.3/INT1
P3.4/TO
P3.5/T1
P3.6/WR
P3.7/RD
P0.0/AD0
P0.1/AD1
P0.2/AD2
P0.3/AD3
P0.4/AD4
P0.5/AD5
P0.6/AD6
P0.7/AD7
D1
LED
R1
R
40
D2
LED
Y?
CRYSTAL
VCC
D6
LED
20
 Like a normal diode, an LED consists of a chip of semiconducting
material impregnated, or doped, with impurities to create a p-n
junction.
 LEDs are usually built on an n-type substrate, with an electrode
attached to the p-type layer deposited on its surface. P-type substrates,
while less common, occur as well.
 Many commercial LEDs, especially GaN/InGaN, also use sapphire
substrate. Substrates that are transparent to the emitted wavelength,
and backed by a reflective layer, increase the LED efficiency.
 The refractive index of most LED semiconductors is quite high, so in
almost all cases the LED is coupled into a much lower-index medium.
 The large index difference makes the reflection quite substantial (per
the Fresnel coefficients), and this is usually one of the dominant causes
of LED inefficiency.
 Often more than half of the emitted light is reflected back at the LED-
package and package-air interfaces impurities to create a p-n junction.
There are two methods of LED interfacing:
 Common Anode Method
 Common Cathode Method
Here we have employed Common Anode Method
FOUR ON FOUR OFF PATTERN
#include<reg51.h> // this file contains the Ports and SFR address of 8051
#include<delay.h> // this file is used to produce seconds and milliseconds delay
#define led P1 // 'P1' is given the another name as ‘led’, u can use 'led' Or
directly 'P1'
//for programming
Void main () // main program starts from here
{
while (1) // Repeat forever
{
led=0xf0; // light on lower 4 leds '0'-> ON (11110000)
secdelay (1); // 1 secdelay
led=0x0f; // light on upper 4 leds '1'-> OFF (00001111)
secdelay (1);
}
}
DC MOTOR INTERFACING
Circuit Diagram
1 2
VCC
Y1
GROUND
10UF
U1
8051
31
19
18
9
12
13
14
15
1
2
3
4
5
6
7
8
39
38
37
36
35
34
33
32
21
22
23
24
25
26
27
28
17
16
29
3011
10
40
20
EA/VP
X1
X2
RESET
INT0
INT1
T0
T1
P1.0
P1.1
P1.2
P1.3
P1.4
P1.5
P1.6
P1.7
P0.0
P0.1
P0.2
P0.3
P0.4
P0.5
P0.6
P0.7
P2.0
P2.1
P2.2
P2.3
P2.4
P2.5
P2.6
P2.7
RD
WR
PSEN
ALE/PTXD
RXD
VCC
VSS
SW1
RESETS/W
12
VCC
C2
1 2
S3
10K
S1 1 2
S2
MG2
MOTOR DC
12
U5
UL2003
1
2
3
4
5
6
7
8 9
10
11
12
13
14
15
16
IN1
IN2
IN3
IN4
IN5
IN6
IN7
GRD VCC
OUT7
OUT6
OUT5
OUT4
OUT3
OUT2
OUT1
DEVICE
K1
RELAY SPDT
3
5
4
1
2
C3
C
R2
RESISTOR SIP 10
12
3
4
5
6
7
8
9
10
33PF
CRYSTAL33PF
VCC
C1
R1
Working Principle
The principle upon which the d.c. motor works is very
simple. If a current carrying conductor is placed in a
magnetic field, mechanical force is experienced on the
conductor, the direction of which is given by the Fleming's
left hand rule and hence the conductor moves in the
direction of force. The magnitude of the mechanical force
experienced on the conductor is given by:
F = B Ic Lc newton
where B is the field strength in teslas,
Ic is the current flowing through the conductor in amperes
and Lc is the length of the conductor in metres.
ON -OFF DC MOTOR
#include<reg51.h>
#include<delay.h>
/* define the motor using sbit as dc motor */
sbit dc_motor=P0^5;
#define ON 1
#define OFF 0
void main()
{
while(1)
{
dc motor=ON; // switch on the Dc motor
secdelay(3);
dc_motor=OFF; // switch OFF the Dc motor
secdelay(2);
}
}
RELAY INTERFACING
ELECTROMAGNETIC solenoid valve
 The electromagnetic relay consists of a multi-turn coil,
wound on an iron core, to form an electromagnet.
 When the coil is energised, by passing current through it,
the core becomes temporarily magnetised. The magnetised
core attracts the iron armature. The armature is pivoted
which causes it to operate one or more sets of contacts.
 When the coil is de-energised the armature and contacts
are released. The coil can be energised from a low power
source such as a transistor while the contacts can switch
high powers such as the mains supply.
 The relay can also be situated remotely from the control
source. Relays can generate a very high voltage across the
coil when switched off. This can damage other components
in the circuit.
 To prevent this a diode is connected across the coil.
As there are always some chances of high voltage
spikes back from the switching circuit i.e. heater so
an up to coupler/isolator MCT2e is used.
It provides and electrical isolation between the
microcontroller and the heater
CIRCUIT DIAGRAM
1 2
VCC
Y1
GROUND
10UF
U1
8051
31
19
18
9
12
13
14
15
1
2
3
4
5
6
7
8
39
38
37
36
35
34
33
32
21
22
23
24
25
26
27
28
17
16
29
3011
10
40
20
EA/VP
X1
X2
RESET
INT0
INT1
T0
T1
P1.0
P1.1
P1.2
P1.3
P1.4
P1.5
P1.6
P1.7
P0.0
P0.1
P0.2
P0.3
P0.4
P0.5
P0.6
P0.7
P2.0
P2.1
P2.2
P2.3
P2.4
P2.5
P2.6
P2.7
RD
WR
PSEN
ALE/PTXD
RXD
VCC
VSS
SW1
RESETS/W
12
VCC
C2
1 2
S3
10K
S1 1 2
S2
MG2
MOTOR DC
12
U5
UL2003
1
2
3
4
5
6
7
8 9
10
11
12
13
14
15
16
IN1
IN2
IN3
IN4
IN5
IN6
IN7
GRD VCC
OUT7
OUT6
OUT5
OUT4
OUT3
OUT2
OUT1
DEVICE
K1
RELAY SPDT
3
5
4
1
2
C3
C
R2
RESISTOR SIP 10
12
3
4
5
6
7
8
9
10
33PF
CRYSTAL33PF
VCC
C1
R1
SIMPLE RELAY CONTROL
#include<reg51.h>
#include<delay.h>
sbit dev=P0^6; // define the 220v device using sbit as dev
#define ON 1
#define OFF 0
void main()
{
while(1)
{
dev=ON;
secdelay(5);
dev=OFF;
secdelay(3);
}
}
STEPPER MOTOR
 A stepper motor is an electromechanical device which converts
electrical pulses into discrete mechanical movements. Stepper
motor is a form of ac. motor .
 The shaft or spindle of a stepper motor rotates in discrete step
increments when electrical command pulses are applied to it in
the proper sequence.
 The motors rotation has several direct relationships to these
applied input pulses.
 The sequence of the applied pulses is directly related to the
direction of motor shafts rotation.
 The speed of the motor shafts rotation is directly related to the
frequency of the input pulses and the length of rotation is
directly related to the number of input pulses applied
 For every input pulse, the motor shaft turns through a
specified number of degrees, called a step.
 Its working principle is one step rotation for one
input pulse. The range of step size may vary from
0.72 degree to 90 degree.
A stepper motor differs from a conventional motor (CM)
as under:
 Input to SM is in the form of electric pulses whereas
input to a CM is invariably from a constant voltage
source.
 A CM has a free running shaft whereas shaft of SM
moves through angular steps.
 In control system applications, no feedback loop is
required when SM is used but a feedback loop is
required when CM is used.
 A SM is a digital electromechanical device whereas a
CM is an analog electromechanical device .
CIRCUIT DIAGRAM
R1
VCC
10K
Y1
33PF
VCC
S1 1 2
1 2
C1
U1
8051
31
19
18
9
12
13
14
15
1
2
3
4
5
6
7
8
39
38
37
36
35
34
33
32
21
22
23
24
25
26
27
28
17
16
29
3011
10
40
20
EA/VP
X1
X2
RESET
INT0
INT1
T0
T1
P1.0
P1.1
P1.2
P1.3
P1.4
P1.5
P1.6
P1.7
P0.0
P0.1
P0.2
P0.3
P0.4
P0.5
P0.6
P0.7
P2.0
P2.1
P2.2
P2.3
P2.4
P2.5
P2.6
P2.7
RD
WR
PSEN
ALE/PTXD
RXD
VCC
VSS
CRYSTAL
S2
C2
VCC
33PF
MG1
MOTOR STEPPER
1
2
3
4
5
6
1 2
C3
10UF
GROUND
S3
U5
UL2003
1
2
3
4
5
6
7
8 9
10
11
12
13
14
15
16
IN1
IN2
IN3
IN4
IN5
IN6
IN7
GRD VCC
OUT7
OUT6
OUT5
OUT4
OUT3
OUT2
OUT1
C
R2
RESISTOR SIP 10
12
3
4
5
6
7
8
9
10
SW1
RESETS/W
12
DIRECTION CONTROL
#include<reg51.h>
#include<delay.h>
sbit m1=P0^0; // define the four windings of stepper motor using sbit m1,m2,m3,m4
sbit m2=P0^1;
sbit m3=P0^2;
sbit m4=P0^3;
void mov_clk()
{
m1=1;m2=0;m3=0;m4=0; //give high pulse to m1 motor moves one step angle in
// clockwise
ms_delay(200);
m1=0;m2=1;m3=0;m4=0; //give high pulse to m2 motor moves two step angle in
// clockwise
ms_delay(200);
m1=0;m2=0;m3=1;m4=0; //give high pulse to m3 motor moves three step angle in
// clockwise
ms_delay(200);
m1=0;m2=0;m3=0;m4=1; //give high pulse to m4 motor moves four step angle in
// clockwise
ms_delay(200);
}
void mov_anticlk()
{
m1=0;m2=0;m3=0;m4=1; //give high pulse to m4 motor moves
one step angle in
// anti clockwise
ms_delay(200);
m1=0;m2=0;m3=1;m4=0;
ms_delay(200);
m1=0;m2=1;m3=0;m4=0;
ms_delay(200);
m1=1;m2=0;m3=0;m4=0;
ms_delay(200);
}
void motor_stop()
{
m1=0;m2=0;m3=0;m4=0;
}
void main()
{
while(1)
{
mov clk(); // motor moves in clock
wise direction
motor stop(); // motor stops
secdelay(2);
mov anticlk(); // motor moves in
anticlock wise direction
motor stop(); // motor stops
secdelay(2);
}
}
SEVEN SEGMENT INTERFACING
 The seven-segment LED display has four individual
digits, each with a decimal point.

 Each of the seven segments (and the decimal point) in
a given digit contains an individual LED.
 When a suitable voltage is applied to a given segment
LED, current flows through and illuminates that
segment LED. By choosing which segments to
illuminate, any of the nine digits can be shown
Project  report on embedded system using 8051 microcontroller
Seven segment displays come in two varieties -
common anode (CA) and common cathode (CC).
 In a CA display, the anodes for the seven segments and
the decimal point are joined into a single circuit node.
 To illuminate a segment in a CA display, the voltage on
a cathode must be at a suitably lower voltage (about
.7V) than the anode.
 In a CC display, the cathodes are joined together, and
the segments are illuminated by bringing the anode
voltage higher than the cathode node (again, by about
.7V).
 The Digilab board uses CA displays.
Circuit diagram
VCC
U2
7-segm ent
5
4
3
2
110
9
8
7
6
g
f
vcc
a
bh
c
vcc
d
e
10UF
LED 3
SW1
RESETS/W
12
1 2
LED 7
LED 4
C2
LED 2
10K
1 2
U1
8051
31
19
18
9
12
13
14
15
1
2
3
4
5
6
7
8
39
38
37
36
35
34
33
32
21
22
23
24
25
26
27
28
17
16
29
3011
10
40
20
EA/VP
X1
X2
RESET
INT0
INT1
T0
T1
P1.0
P1.1
P1.2
P1.3
P1.4
P1.5
P1.6
P1.7
P0.0
P0.1
P0.2
P0.3
P0.4
P0.5
P0.6
P0.7
P2.0
P2.1
P2.2
P2.3
P2.4
P2.5
P2.6
P2.7
RD
WR
PSEN
ALE/PTXD
RXD
VCC
VSS
S1
1 2
VCC
GR O UN D
CR YSTAL33PF
LED 1
33PF
Y1
R2
470 E
S2
LED 5
S3
VCC(5 V)
C3
LED 8
R1
C1
LED 6
UP COUNTER
#include<reg51.h>
#include<delay.h>
#define seg_port P2 //define segment port
// array is used to store the value of data to be sent on the port to display
// any digit on seven segment as below
unsigned char seg_array[10]={0xc0,0xf9,0xa4,0xb0,0x99,0x92,0x82,0xf8,0x80,0x90};
void main()
{
unsigned char count;
while(1)
{
for(count=0;count<10;count++)
{
seg_port=seg_array[count]; // put array digit value from array to the port
secdelay(1);
}
}
}
LCD
LCD Display
 Liquid crystal displays (LCD) are widely used in recent
years as compares to LEDs. This is due to the declining
prices of LCD, the ability to display numbers,
characters and graphics, incorporation of a refreshing
controller into the LCD, their by relieving the CPU of
the task of refreshing the LCD and also the ease of
programming for characters and graphics. HD 44780
based LCDs are most commonly used.
LCD pin description
Vcc
16
15
14
13
12
11
10
9
8
6
5
4
3
2
1
7
16
15
14
13
12
11
10
9
8
6
5
4
3
2
1
7
D7
E
Vcc
D4
Contrast
RS
Gnd
R/W
Gnd
D0
D3
D6
D5
13
2
D2
D1
Pin Symbol I/O Description
1 VSS - Ground
2 VCC - +5V power supply
3 VEE - Power supply to
control contrast
4 RS I RS=0 to select
command register,
RS=1 to select data
register.
5 R/W I R/W=0 for write,
R/W=1 for read
6 E I/O Enable
LCD pin
description
Pin Symbol I/O Description
7 PB0 I/O The 8 bit data bus
8 PB1 I/O The 8 bit data bus
9 DB2 I/O The 8 bit data bus
10 DB3 I/O The 8 bit data bus
11 DB4 I/O The 8 bit data bus
12 DB5 I/O The 8 bit data bus
13 DB6 I/O The 8 bit data bus
14 DB7 I/O The 8 bit data bus
 Circuit diagram
LCD FUNCTION
#include<reg51.h>
#include<delay.h>
#define DATA P1 // define DATA and Control Pins of LCD
sbit RS=P3^5;
sbit RW=P3^6;
sbit E=P3^7;
void lcd_cmd(unsigned char data x) // function to write command at lcd port
{
ms_delay(20);
DATA=data x;
RS=0; //clear RS (i.e. RS=0) to write command
RW=0; // write operation
E=1; // send H-L pulse at E pin
ms_delay(5);
E=0;
}
void lcd_data (unsigned char datax) // function to write data at lcd port
{
ms_delay(20);
DATA=datax;
RS=1; // set RS=1 to write DATA
RW=0; // write operation
E=1; // send H-L pulse at E pin
ms_delay (5);
E=0;
}
void lcd_init() // function to initialize the LCD at power on time
{
lcd_cmd(0x38); // 2x16 display select
ms_delay(3);
lcd_cmd (0x38); // 2x16 display select
ms_delay(3);
lcd_cmd (0x0c); // display on cursor off command
ms_delay(3);
lcd_cmd (0x06); // automatic cursor movement to right
ms_delay(3);
lcd_cmd (0x01); // lcd clear command
ms_delay(3);
lcd_cmd (0x80); // first row first column select command
ms_delay(3);
}
void lcd_puts(unsigned char *str) // function to display string to lcd
{
while(*str!='0')
{
lcd_data(*str);
str++;
}
}
void displaypval(unsigned int datax) // function to display 3 digit decimal value to lcd
{
unsigned int temp,temparr[3];
for(temp=3;temp>0;temp--)
{
temparr[temp-1]=datax%10;
datax=datax/10;
}
for(temp=0;temp<3;temp++)
{
lcd_data(temparr[temp]+48);
}
}
void main()
{
lcd_init();
while(1)
{
lcd_cmd(0x80);
lcd_puts("Value");
lcd_cmd(0xc0);
displaypval(123);
}
}
HOME SECURITY
SYSTEM
Project  report on embedded system using 8051 microcontroller
INTRODUCTION
 THE NEED
 Our doors serve as entrances to our homes and offices.
They may also provide access to strangers, criminals and
offenders. So how do we secure our doors and prevent
intrusions by these people? This is the sole of purpose of
door locks. They keep us and our properties safe and
protected
 The method of lock picking involves opening the door lock
with a locking tool kit. A basic kit contains a screwdriver or
other types of tension wrench and a lock pin, which is a
long and thin piece of metal that is curved at one end. In
cases of emergencies, a hairpin may substitute for the lock
pin.
 A professional kit, on the other hand, contains several
types of tension wrenches in varying in sizes and shapes
and lock pins with different dimensions. It may also
contain a pick gun which is an instrument that vibrates and
push several lock pins at the same time.
 The main goal of this project is develop an embedded
password security door lock system using
microcontroller. In this project we are going to use 4x4
keypad to enter the security lock. Here
microcontroller place major role which is nothing but
decision of door opening. Here predefined password
is stored in microcontroller. We have to write a code
such that whenever password is entered from keypad
if that password is matches door has to open.
Otherwise buzzer has to on.
PROJECT METHODOLOGY
Component Name Quantity
1.Power supply section
Plug with wire 1
Step down transformer 1
1N4007 diodes 4
LM7805 1
100µF capacitor 1
ON/OFF switch 1
1K Resistor 1
2. Microcontroller section
Microcontroller IC (AT89C51) with base 1
Crystal oscillator 1
Capacitor 2
Resistor 1
LCD connector 1
3.Buzzer 1
4.LCD 1
5. Stepper motor 1
6.ON/OFF switch 3
Software Used
Keil µ Version3.
Equipment used
1. Soldering iron
2. Solder
3. Flux
PROCEDURE
Step 1
Circuit diagram of the proposed system is designed and finalized.(Refer to Figure6.1 )
Step 2
All the components and software platform to be used are selected which are also mentioned
above.
Step 3
All the hardware components are soldered on their respective printed circuit board with the help
of soldering iron, solder and flux according to the hardware schematic shown in the Figure
Step 4
Code/program of the proposed system is developed using assembly language with the help of
software platform (Keil u vision3).The coding could be seen in section
Step 5
The hex code of the program being created by the software platform is burnt into thef lash code
memory of our microcontroller IC 89C51.
Step 6
Testing is done at various levels to finalize the appropriate program for the most proper working
of the system.
 DESCRIPTION IN DETAIL
 It mainly consists of following blocks:
 1. Microcontroller: This is the CPU (central processing unit) of our
project. We are going to use a microcontroller of 8051 family. The
various functions of microcontroller are like:
I. Reading the digital input from Keypad
II. Sending this data to LCD so that the person operating this
project should read the password
III. Sensing the password using keypad and to check whether it is a
correct password or a wrong password and rotate the stepper motor if
the password entered is a correct password.
 2. LCD: We are going to use 16×2 alphanumeric Liquid Crystal Display
(LCD) which means it can display alphabets along with numbers on 2
lines each containing 16 characters.
 3. Keypad: User will enter the password using the keypad. Various keys
of keypad are as following,
I. Increment (1 to 9)
II. Decrement
III. Enter
Applications and Advantages:
1. This project can be used in offices, companies also at
home. It will provide keyless entry.
2. This can be used in Banks for safety lock.
3. User don’t have to carry keys along with him.
Future Development:
1. We can monitor parameters like fire, overheat
2. We can provide voice feedback system
3. We can interface GSM modem which will send sms if
invalid attempt is made to open the lock.

More Related Content

What's hot (20)

DOCX
Embedded System
Sonali Parab
 
PDF
Serial Communication Interfaces
anishgoel
 
PPTX
Ppt on six month training on embedded system & IOT
preetigill309
 
DOC
Unit 1 embedded systems and applications
Dr.YNM
 
PPT
Introduction to stm32-part1
Amr Ali (ISTQB CTAL Full, CSM, ITIL Foundation)
 
PPT
Embedded System Basics
Dr M Muruganandam Masilamani
 
PDF
ARM CORTEX M3 PPT
Gaurav Verma
 
PPTX
Interfacing external memory in 8051
ssuser3a47cb
 
PPTX
Introduction to AVR Microcontroller
Mahmoud Sadat
 
PPTX
Difference Between Microprocessors and Microcontrollers
elprocus
 
PDF
Device drivers and interrupt service mechanism
Vijay Kumar
 
PPTX
Embedded system.ppt
Radhika Puttewar
 
PPTX
Design challenges in embedded systems
mahalakshmimalini
 
PDF
8051 Microcontroller I/O ports
anishgoel
 
PPT
Microprocessor & microcontroller
Nitesh Kumar
 
PDF
Introduction to embedded system design
Mukesh Bansal
 
PPTX
Embedded system seminar
Sukhendra Chaudhary
 
PDF
Vlsi design
Iftikar Alam
 
PPTX
Introduction to arm processor
RAMPRAKASHT1
 
PDF
Characteristics and Quality Attributes of Embedded System
anand hd
 
Embedded System
Sonali Parab
 
Serial Communication Interfaces
anishgoel
 
Ppt on six month training on embedded system & IOT
preetigill309
 
Unit 1 embedded systems and applications
Dr.YNM
 
Embedded System Basics
Dr M Muruganandam Masilamani
 
ARM CORTEX M3 PPT
Gaurav Verma
 
Interfacing external memory in 8051
ssuser3a47cb
 
Introduction to AVR Microcontroller
Mahmoud Sadat
 
Difference Between Microprocessors and Microcontrollers
elprocus
 
Device drivers and interrupt service mechanism
Vijay Kumar
 
Embedded system.ppt
Radhika Puttewar
 
Design challenges in embedded systems
mahalakshmimalini
 
8051 Microcontroller I/O ports
anishgoel
 
Microprocessor & microcontroller
Nitesh Kumar
 
Introduction to embedded system design
Mukesh Bansal
 
Embedded system seminar
Sukhendra Chaudhary
 
Vlsi design
Iftikar Alam
 
Introduction to arm processor
RAMPRAKASHT1
 
Characteristics and Quality Attributes of Embedded System
anand hd
 

Viewers also liked (20)

DOCX
Project Report On Micro-controller Embedded System
Rkrishna Mishra
 
PDF
Training Report on Embedded System
Roshan Mani
 
DOC
8051 Microcontroller Notes
Dr.YNM
 
PPTX
Using 8051 microcontroller based washing machine control ppt
Sangeeth Sb
 
PPT
8051 MICROCONTROLLER
THANDAIAH PRABU
 
PPTX
ppt on embedded system
manish katara
 
DOC
02 2012-11 ieee embedded system project titles, ncct ieee 2012-11 project list
ncctstudentprojects
 
PPT
Microcontroller 8051
Mukesh Kashyap
 
PPTX
Automatic water level controller
Geetha Smiley
 
PDF
PC Based Industrial Automation With AVR Atmega 16 - Project Report
Robo India
 
PPTX
automation of waterpump using 8051 microcontroller
Parth Joshi
 
PPTX
Embedded system 8051 Microcontroller
ankitsharmaj
 
PDF
List of microcontroller 8051 projects
Sushil Mishra
 
PPTX
RTC Interfacing and Programming
Devashish Raval
 
PPTX
Microprocessor in washing machine
Sandeep Kamath
 
PPT
Microcontroller 8051
Rashmi
 
PPT
Interfacing LCD with 8051 Microcontroller
Pantech ProLabs India Pvt Ltd
 
PDF
Question paper with solution the 8051 microcontroller based embedded systems...
manishpatel_79
 
PPT
Project Report Format
Vikram Thadeshvar
 
PDF
Embedded C programming based on 8051 microcontroller
Gaurav Verma
 
Project Report On Micro-controller Embedded System
Rkrishna Mishra
 
Training Report on Embedded System
Roshan Mani
 
8051 Microcontroller Notes
Dr.YNM
 
Using 8051 microcontroller based washing machine control ppt
Sangeeth Sb
 
8051 MICROCONTROLLER
THANDAIAH PRABU
 
ppt on embedded system
manish katara
 
02 2012-11 ieee embedded system project titles, ncct ieee 2012-11 project list
ncctstudentprojects
 
Microcontroller 8051
Mukesh Kashyap
 
Automatic water level controller
Geetha Smiley
 
PC Based Industrial Automation With AVR Atmega 16 - Project Report
Robo India
 
automation of waterpump using 8051 microcontroller
Parth Joshi
 
Embedded system 8051 Microcontroller
ankitsharmaj
 
List of microcontroller 8051 projects
Sushil Mishra
 
RTC Interfacing and Programming
Devashish Raval
 
Microprocessor in washing machine
Sandeep Kamath
 
Microcontroller 8051
Rashmi
 
Interfacing LCD with 8051 Microcontroller
Pantech ProLabs India Pvt Ltd
 
Question paper with solution the 8051 microcontroller based embedded systems...
manishpatel_79
 
Project Report Format
Vikram Thadeshvar
 
Embedded C programming based on 8051 microcontroller
Gaurav Verma
 
Ad

Similar to Project report on embedded system using 8051 microcontroller (20)

PPT
Ppt embedded
karan bansal
 
PPTX
Microcontoller and Embedded System
Karan Thakkar
 
PPT
Embeddedsystem
anshul parmar
 
PPT
Embedded system
Anmol Bagga
 
PPT
Embeded system by Mitesh Kumar
Mitesh Kumar
 
PPT
ritesh (3)
Ritesh Maheshwari
 
PDF
Robotics & Embedded IoT System Design [Day-3]
Deepam Dubey
 
PPTX
Embedded Systems - Training ppt
Nishant Kayal
 
PDF
Embedded notes.iet.trichy
SankaraVinayagam
 
PDF
Embedded notes.iet.trichy
SankaraVinayagam
 
PPTX
Embedded systems - UNIT-1 - Mtech
sangeetha rakhi
 
PPT
Microprocessor Based Systems.ppt
TALHARIAZ46
 
PPTX
Vinod ppt on es31 08 15
Govt. Engg. Collage Ajmer
 
PDF
Lecture 5-Embedde.pdf
BlackHunter13
 
PDF
Architecture and Programmingpart1_Microcontroller
ssuser1bfdb5
 
DOCX
Project Report on Embedded Systems
Suhani Singh
 
PPTX
Embedded System basic and classifications
rajkciitr
 
PPTX
8051 Architecture
ShinuMMAEI
 
PPTX
microcontroller 8051 hfdsdsyghydfhdsgukhdfsdgjkghu
suchitra72aw
 
Ppt embedded
karan bansal
 
Microcontoller and Embedded System
Karan Thakkar
 
Embeddedsystem
anshul parmar
 
Embedded system
Anmol Bagga
 
Embeded system by Mitesh Kumar
Mitesh Kumar
 
ritesh (3)
Ritesh Maheshwari
 
Robotics & Embedded IoT System Design [Day-3]
Deepam Dubey
 
Embedded Systems - Training ppt
Nishant Kayal
 
Embedded notes.iet.trichy
SankaraVinayagam
 
Embedded notes.iet.trichy
SankaraVinayagam
 
Embedded systems - UNIT-1 - Mtech
sangeetha rakhi
 
Microprocessor Based Systems.ppt
TALHARIAZ46
 
Vinod ppt on es31 08 15
Govt. Engg. Collage Ajmer
 
Lecture 5-Embedde.pdf
BlackHunter13
 
Architecture and Programmingpart1_Microcontroller
ssuser1bfdb5
 
Project Report on Embedded Systems
Suhani Singh
 
Embedded System basic and classifications
rajkciitr
 
8051 Architecture
ShinuMMAEI
 
microcontroller 8051 hfdsdsyghydfhdsgukhdfsdgjkghu
suchitra72aw
 
Ad

Project report on embedded system using 8051 microcontroller

  • 1. Submitted By :- Anjali Rai EC4873 Archna Dhiman EC4881 Jyoti Thakur EC 4894 Monika Chauhan EC4904 Neha Verma EC4907
  • 2.  Acknowledgment  Preface  Company profiles  Embedded system Introduction Applications of embedded system  Microcontroller Introduction Definition of microcontroller Block diagram  Microprocessor Introduction Definition of microprocessor Block diagram Difference between microcontroller and microprocessor TABLE OF CONTENT TOPIC
  • 3.  Various microcontrollers 8031 8051 AT89C51  8051 microcontroller architecture Block diagram Pin diagram Pin description  Microcontroller memory organization Program memory Data memory  Software used Various steps to use compiler How to debug the program
  • 4.  Interfacing with various devices LED Interfacing DC Motor Relay Stepper Motor Seven Segment LCD Interfacing  Project description Introduction to project Circuit diagram of Home Security Prototype Project methodology Procedure Description in detail Application and advantages Future development  Reference and Bibliography
  • 5. COMPANY PROFILES  EEAST is a complete R & D organization dedicated to provide electronics and Advanced Software Products and Solutions to its clients. Achieving the needs of our costumer and converting their ideas to real models is our motto.  We are working in the field of Embedded systems, Automation and advanced system design for the last five years with the vision of becoming a center of Excellence to provide Solutions, Services and Training in various fields of technologies.  EEAST is an organization providing advanced projects, complete electronics solutions in development systems like microprocessor, micro-controllers, wireless communications, optical-fiber communications, real time operating systems, digital signal processing,  Embedded systems and Micro-sensors including software solution, solution in C, C++, Java, Net, Visual basic, embedded C and embedded LINUX.
  • 6. INTRODUCTION TO EMBEDDED SYSTEMS  An Embedded System employs a combination of hardware & software (a “ computational engine”) to perform a specific function; is part of a larger system that may not be a “computer works in a reactive and time- constrained environment. Software is used for providing features and flexibility. Hardware ={Processors, ASICs, Memory...} is used for performance (& sometimes security )  An embedded system is a special purpose system in which the computer is completely encapsulated by the device it controls.  Unlike a general purpose computer, such as a PC, an embedded system performs predefined task’s usually with very specific tasks design engineers can optimize it reducing the size and cost of the product. Embedded systems are often mass produced, so the cost savings may be multiplied by millions of items.
  • 7.  The core of any embedded system is formed by one or several microprocessor or micro controller programmed to perform a small number of tasks. In contrast to a general purpose computer, which can run any software application, the user chooses, the software on an embedded system is semi- permanent, so it is often called firmware.
  • 8. APPLICATIONS OF EMBEDDED SYSTEM  Automated tiller machines (ATMS).  Avionic, such as inertial guidance systems, flight control hardware /software and letter integrated system in aircraft and missile.  Cellular telephones and telephonic switches.  Computer network equipment, including routers timeservers and firewalls  Computer printers, Copiers  .Disk drives (floppy disk drive and hard disk drive)  Engine controllers and antilock brake controllers for automobiles.  Home automation products like thermostat, air conditioners sprinkles and security monitoring system.  House hold appliances including microwave ovens, washing machines, TV sets DVD players/recorders.  Medical equipment  Stationary video game controllers.  Wearable computers.  Measurement equipment such as digital storage oscilloscopes, logic analyzers and spectrum analyzers.  Multimedia appliances: internet radio receivers, TV set top boxes.
  • 9. MICROPROCESSOR (MPU)  A microprocessor is a general-purpose digital computer central processing unit (CPU). Although popularly known as a “computer on a chip” is in no sense a complete digital computer. The block diagram of a microprocessor CPU is shown, which contains an arithmetic and logical unit (ALU), program counter (PC), a stack pointer (SP),some working registers, a clock timing circuit, and interrupt circuits.
  • 10. BLOCK DIAGRAM OF MICROPROCESSOR
  • 11.  The prime use of microprocessor is to read data, perform extensive calculations on that data and store them in the mass storage device or display it. The prime functions of microcontroller is to read data, perform limited calculations on it, control its environment based on these data.  Thus the microprocessor is said to be general-purpose digital computers whereas the microcontroller are intend to be special purpose digital controller.  Microprocessor need many opcodes for moving data from the external memory to the CPU, microcontroller may require just one or two, also microprocessor may have one or two types of bit handling instructions whereas microcontrollers have many.
  • 12.  Lastly, the microprocessor design accomplishes the goal of flexibility in the hardware configuration by enabling large amounts of memory and I/O that could be connected to the address and data pins on the IC package. The microcontroller design uses much more limited set of single and double byte instructions to move code and data from internal
  • 13. Microcontroller  Microcontroller, as the name suggests, are small contro llers. They are like single chip computers that are often embedded into other systems to function as processing/controlling unit. For example, the remote control you are using probably has microcontrollers inside that do decoding and other controlling functions. They are also used in automobiles, washing machines, microwave ovens, toys ... etc, where automation is needed
  • 14. The key features of microcontrollers include:  High Integration of Functionality  Microcontrollers sometimes are called single-chip computers because they have on-chip memory and I/O circuitry and other circuitries that enable them to function as small stand alone computers without other supporting circuitry.  Field Programmability, Flexibility  Microcontrollers often use EEPROM or EPROM as their storage device to allow field programmability so they are flexible to use. Once the program is tested to be correct then large quantities of microcontrollers can be programmed to be used in embedded systems
  • 15.  A Timer module to allow the microcontroller to perform tasks for certain time periods.  A serial I/O port to allow data to flow between the microcontroller and other devices such as a PC or another microcontroller.  An ADC to allow the microcontroller to accept analogue input data for processing
  • 16. The design incorporates all of the features found in microprocessor CPU: ALU, PC, SP, and registers. It also added the other features needed to make a complete computer: ROM, RAM, parallel I/O, serial I/O, counters, and clock circuit
  • 17. DIFFERENCE BETWEEM MICROPROCESSOR AND MICROCONTROLLER MICROPROCESSORS MICROCONTROLLERS 1. Microprocessors contain no 1. Microcontrollers have an internal RAM or ROM. RAM and a ROM 2. Microprocessor don’t have any I/O 2.Microcontrollers have I/O ports. Ports. 3. Advantage of versatility. 3. Advantage of less power consumption. 4. Expensive. 4. Cheaper in comparison. 5. With the addition of external RAM 5. Occupies less space. And ROM, the system is more bulky.
  • 18. VARIOUS MICROCONTROLLERS  First microcontroller is ‘8031’  FEATURES 1. It is Intel’s product. Neither a microprocessor nor a microcontroller. 2. It is 8-bit controller. 3. Internally no RAM is provided i.e. code is outside the chip.  Second microcontroller is ‘8051’  FEATURES 1. It is first complete 8-bit microcontroller. 2. It is a name of a family. In which the instruction set, pin configuration, architecture are same, only memory storage capacity is different. 3. Internally PROM (programmable read only memory) is provided so it called one time programmable (OTP)
  • 19.  Third microcontroller is ‘AT89C51’  FEATURES 1. It is similar to 8051 microcontroller i.e. having same instruction set, pin configuration, architecture. 2. It is also 8-bit microcontroller. It’s cost is only Rs 10 more than 8051. 3. It uses EPROM (erasable programmable read only memory) or FLASH memory. 4. It is multiple time programmable (MTP) i.e. 1000 times. So it is better than 8051.
  • 20. ATMEL 89C51  It is a lower-power, high-performance CMOS 8-bit microcomputer with 4K bytes of Flash programmable and erasable read only memory (PEROM).  The device is manufactured using Atmel’s high-density nonvolatile memory technology and is compatible with the industry-standard MCS-51 instruction set and pin out. The on chip Flash allows the program memory to be reprogrammed in system or by a conventional nonvolatile memory programmer.  By combining a versatile 8-bit CPU with Flash on a monolithic chip, the Atmel AT89C51 is a powerful microcontroller, which provides a highly flexible and cost- effective solution to many embedded control applications.
  • 21. THE 8051 MICROCONTROLLER The 8051 provides the following standard features: • 4k bytes of ROM, 128 bytes of RAM, 32 I/O lines, two 16- bit timer/counters, and five vector two-level interrupt architecture, a full duplex serial port, on- chip oscillator and clock circuitry • In addition, the 8051 is designed with static logic for operation down to zero frequency and supports two software selectable power saving modes.
  • 22. ON-CHIP ROM for program code EXTERNAL INTERRUPTS ON-CHIP RAM ETC. TIMER 0 CPU OSC BUS CONTROL 4 I/O PORTS SERIAL PORT TXD RXD BLOCK DIAGRAM OF MICROCONTROLLER
  • 23. THE 8051 MICROCONTROLLER’S ARCHITECTURE  Eight bit CPU with registers A (the accumulator) & B.  Sixteen bit program counter (PC) and data pointer (DPTR).  Eight bit program status word (PSW).  Eight bit stack pointer (SP).  Internal ROM or EPROM.  Internal RAM of 128 bytes Four register banks, each containing eight registers. Sixteen bytes, which may be addressed at the bit level. Eight bytes of general-purpose data memory.  Thirty two I/O pins arranged as four-bit ports P0-P3.  Two 16-bit timer/counters T0 and T1.  Full duplex serial data received/transmitter.  Two external and three internal interrupt sources.
  • 25. PIN DESCRIPTION  Vcc Pin 40 provides supply voltage to the chip. The voltage source is +5 V.  GND Pin 20 is the ground.  X1 and X2 The 8051 have an on-chip oscillator but requires external clock to run it. Most often a quartz crystal oscillator is connected to input X1 (pin 19) and X2 (pin 18).  RESET Pin 9 is the reset pin. It is an input and is active high (normally low).  EA EA, which stands for “external access,” is pin number 31 in the DIP packages. It is input pin and must be connected to either Vcc or GND. In other words, it cannot be left unconnected.
  • 26.  PSEN This is an output pin. PSEN stands for “program store enable.” It is the read strobe to external program memory  ALE ALE (Address latch enable) is an output pin and is active high  I/O port pins The four ports P0, P1, P2, and P3 each use 8 pins, making them 8-bit ports. All the ports upon RESET are configured as output, ready to be used as output ports. To use any of these as input port, it must be programmed.
  • 27. Software Used  The Keil 8051 Development Tools are designed to solve the complex problems facing embedded software developers.  When starting a new project, simply select the microcontroller you use from the Device Database and the µVision IDE sets all compiler, assembler, linker, and memory options for you.
  • 28. INTERFACING WITH VARIOUS DEVICES: LED INTERFACING  CIRCUIT DIAGRAM D3 LED C? CAP NP D7 LED D4 LED D5 LED D8 LED U? AT89C52 9 18 19 29 30 31 1 2 3 4 5 6 7 8 21 22 23 24 25 26 27 28 10 11 12 13 14 15 16 17 39 38 37 36 35 34 33 32 RST XTAL2 XTAL1 PSEN ALE/PROG EA/VPP P1.0/T2 P1.1/T2-EX P1.2 P1.3 P1.4 P1.5 P1.6 P1.7 P2.0/A8 P2.1/A9 P2.2/A10 P2.3/A11 P2.4/A12 P2.5/A13 P2.6/A14 P2.7/A15 P3.0/RXD P3.1/TXD P3.2/INTO P3.3/INT1 P3.4/TO P3.5/T1 P3.6/WR P3.7/RD P0.0/AD0 P0.1/AD1 P0.2/AD2 P0.3/AD3 P0.4/AD4 P0.5/AD5 P0.6/AD6 P0.7/AD7 D1 LED R1 R 40 D2 LED Y? CRYSTAL VCC D6 LED 20
  • 29.  Like a normal diode, an LED consists of a chip of semiconducting material impregnated, or doped, with impurities to create a p-n junction.  LEDs are usually built on an n-type substrate, with an electrode attached to the p-type layer deposited on its surface. P-type substrates, while less common, occur as well.  Many commercial LEDs, especially GaN/InGaN, also use sapphire substrate. Substrates that are transparent to the emitted wavelength, and backed by a reflective layer, increase the LED efficiency.  The refractive index of most LED semiconductors is quite high, so in almost all cases the LED is coupled into a much lower-index medium.  The large index difference makes the reflection quite substantial (per the Fresnel coefficients), and this is usually one of the dominant causes of LED inefficiency.  Often more than half of the emitted light is reflected back at the LED- package and package-air interfaces impurities to create a p-n junction.
  • 30. There are two methods of LED interfacing:  Common Anode Method  Common Cathode Method Here we have employed Common Anode Method
  • 31. FOUR ON FOUR OFF PATTERN #include<reg51.h> // this file contains the Ports and SFR address of 8051 #include<delay.h> // this file is used to produce seconds and milliseconds delay #define led P1 // 'P1' is given the another name as ‘led’, u can use 'led' Or directly 'P1' //for programming Void main () // main program starts from here { while (1) // Repeat forever { led=0xf0; // light on lower 4 leds '0'-> ON (11110000) secdelay (1); // 1 secdelay led=0x0f; // light on upper 4 leds '1'-> OFF (00001111) secdelay (1); } }
  • 32. DC MOTOR INTERFACING Circuit Diagram 1 2 VCC Y1 GROUND 10UF U1 8051 31 19 18 9 12 13 14 15 1 2 3 4 5 6 7 8 39 38 37 36 35 34 33 32 21 22 23 24 25 26 27 28 17 16 29 3011 10 40 20 EA/VP X1 X2 RESET INT0 INT1 T0 T1 P1.0 P1.1 P1.2 P1.3 P1.4 P1.5 P1.6 P1.7 P0.0 P0.1 P0.2 P0.3 P0.4 P0.5 P0.6 P0.7 P2.0 P2.1 P2.2 P2.3 P2.4 P2.5 P2.6 P2.7 RD WR PSEN ALE/PTXD RXD VCC VSS SW1 RESETS/W 12 VCC C2 1 2 S3 10K S1 1 2 S2 MG2 MOTOR DC 12 U5 UL2003 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 IN1 IN2 IN3 IN4 IN5 IN6 IN7 GRD VCC OUT7 OUT6 OUT5 OUT4 OUT3 OUT2 OUT1 DEVICE K1 RELAY SPDT 3 5 4 1 2 C3 C R2 RESISTOR SIP 10 12 3 4 5 6 7 8 9 10 33PF CRYSTAL33PF VCC C1 R1
  • 33. Working Principle The principle upon which the d.c. motor works is very simple. If a current carrying conductor is placed in a magnetic field, mechanical force is experienced on the conductor, the direction of which is given by the Fleming's left hand rule and hence the conductor moves in the direction of force. The magnitude of the mechanical force experienced on the conductor is given by: F = B Ic Lc newton where B is the field strength in teslas, Ic is the current flowing through the conductor in amperes and Lc is the length of the conductor in metres.
  • 34. ON -OFF DC MOTOR #include<reg51.h> #include<delay.h> /* define the motor using sbit as dc motor */ sbit dc_motor=P0^5; #define ON 1 #define OFF 0 void main() { while(1) { dc motor=ON; // switch on the Dc motor secdelay(3); dc_motor=OFF; // switch OFF the Dc motor secdelay(2); } }
  • 36.  The electromagnetic relay consists of a multi-turn coil, wound on an iron core, to form an electromagnet.  When the coil is energised, by passing current through it, the core becomes temporarily magnetised. The magnetised core attracts the iron armature. The armature is pivoted which causes it to operate one or more sets of contacts.  When the coil is de-energised the armature and contacts are released. The coil can be energised from a low power source such as a transistor while the contacts can switch high powers such as the mains supply.  The relay can also be situated remotely from the control source. Relays can generate a very high voltage across the coil when switched off. This can damage other components in the circuit.  To prevent this a diode is connected across the coil.
  • 37. As there are always some chances of high voltage spikes back from the switching circuit i.e. heater so an up to coupler/isolator MCT2e is used. It provides and electrical isolation between the microcontroller and the heater
  • 38. CIRCUIT DIAGRAM 1 2 VCC Y1 GROUND 10UF U1 8051 31 19 18 9 12 13 14 15 1 2 3 4 5 6 7 8 39 38 37 36 35 34 33 32 21 22 23 24 25 26 27 28 17 16 29 3011 10 40 20 EA/VP X1 X2 RESET INT0 INT1 T0 T1 P1.0 P1.1 P1.2 P1.3 P1.4 P1.5 P1.6 P1.7 P0.0 P0.1 P0.2 P0.3 P0.4 P0.5 P0.6 P0.7 P2.0 P2.1 P2.2 P2.3 P2.4 P2.5 P2.6 P2.7 RD WR PSEN ALE/PTXD RXD VCC VSS SW1 RESETS/W 12 VCC C2 1 2 S3 10K S1 1 2 S2 MG2 MOTOR DC 12 U5 UL2003 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 IN1 IN2 IN3 IN4 IN5 IN6 IN7 GRD VCC OUT7 OUT6 OUT5 OUT4 OUT3 OUT2 OUT1 DEVICE K1 RELAY SPDT 3 5 4 1 2 C3 C R2 RESISTOR SIP 10 12 3 4 5 6 7 8 9 10 33PF CRYSTAL33PF VCC C1 R1
  • 39. SIMPLE RELAY CONTROL #include<reg51.h> #include<delay.h> sbit dev=P0^6; // define the 220v device using sbit as dev #define ON 1 #define OFF 0 void main() { while(1) { dev=ON; secdelay(5); dev=OFF; secdelay(3); } }
  • 40. STEPPER MOTOR  A stepper motor is an electromechanical device which converts electrical pulses into discrete mechanical movements. Stepper motor is a form of ac. motor .  The shaft or spindle of a stepper motor rotates in discrete step increments when electrical command pulses are applied to it in the proper sequence.  The motors rotation has several direct relationships to these applied input pulses.  The sequence of the applied pulses is directly related to the direction of motor shafts rotation.  The speed of the motor shafts rotation is directly related to the frequency of the input pulses and the length of rotation is directly related to the number of input pulses applied
  • 41.  For every input pulse, the motor shaft turns through a specified number of degrees, called a step.  Its working principle is one step rotation for one input pulse. The range of step size may vary from 0.72 degree to 90 degree.
  • 42. A stepper motor differs from a conventional motor (CM) as under:  Input to SM is in the form of electric pulses whereas input to a CM is invariably from a constant voltage source.  A CM has a free running shaft whereas shaft of SM moves through angular steps.  In control system applications, no feedback loop is required when SM is used but a feedback loop is required when CM is used.  A SM is a digital electromechanical device whereas a CM is an analog electromechanical device .
  • 43. CIRCUIT DIAGRAM R1 VCC 10K Y1 33PF VCC S1 1 2 1 2 C1 U1 8051 31 19 18 9 12 13 14 15 1 2 3 4 5 6 7 8 39 38 37 36 35 34 33 32 21 22 23 24 25 26 27 28 17 16 29 3011 10 40 20 EA/VP X1 X2 RESET INT0 INT1 T0 T1 P1.0 P1.1 P1.2 P1.3 P1.4 P1.5 P1.6 P1.7 P0.0 P0.1 P0.2 P0.3 P0.4 P0.5 P0.6 P0.7 P2.0 P2.1 P2.2 P2.3 P2.4 P2.5 P2.6 P2.7 RD WR PSEN ALE/PTXD RXD VCC VSS CRYSTAL S2 C2 VCC 33PF MG1 MOTOR STEPPER 1 2 3 4 5 6 1 2 C3 10UF GROUND S3 U5 UL2003 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 IN1 IN2 IN3 IN4 IN5 IN6 IN7 GRD VCC OUT7 OUT6 OUT5 OUT4 OUT3 OUT2 OUT1 C R2 RESISTOR SIP 10 12 3 4 5 6 7 8 9 10 SW1 RESETS/W 12
  • 44. DIRECTION CONTROL #include<reg51.h> #include<delay.h> sbit m1=P0^0; // define the four windings of stepper motor using sbit m1,m2,m3,m4 sbit m2=P0^1; sbit m3=P0^2; sbit m4=P0^3; void mov_clk() { m1=1;m2=0;m3=0;m4=0; //give high pulse to m1 motor moves one step angle in // clockwise ms_delay(200); m1=0;m2=1;m3=0;m4=0; //give high pulse to m2 motor moves two step angle in // clockwise ms_delay(200); m1=0;m2=0;m3=1;m4=0; //give high pulse to m3 motor moves three step angle in // clockwise ms_delay(200); m1=0;m2=0;m3=0;m4=1; //give high pulse to m4 motor moves four step angle in // clockwise ms_delay(200); }
  • 45. void mov_anticlk() { m1=0;m2=0;m3=0;m4=1; //give high pulse to m4 motor moves one step angle in // anti clockwise ms_delay(200); m1=0;m2=0;m3=1;m4=0; ms_delay(200); m1=0;m2=1;m3=0;m4=0; ms_delay(200); m1=1;m2=0;m3=0;m4=0; ms_delay(200); } void motor_stop() { m1=0;m2=0;m3=0;m4=0; }
  • 46. void main() { while(1) { mov clk(); // motor moves in clock wise direction motor stop(); // motor stops secdelay(2); mov anticlk(); // motor moves in anticlock wise direction motor stop(); // motor stops secdelay(2); } }
  • 47. SEVEN SEGMENT INTERFACING  The seven-segment LED display has four individual digits, each with a decimal point.   Each of the seven segments (and the decimal point) in a given digit contains an individual LED.  When a suitable voltage is applied to a given segment LED, current flows through and illuminates that segment LED. By choosing which segments to illuminate, any of the nine digits can be shown
  • 49. Seven segment displays come in two varieties - common anode (CA) and common cathode (CC).  In a CA display, the anodes for the seven segments and the decimal point are joined into a single circuit node.  To illuminate a segment in a CA display, the voltage on a cathode must be at a suitably lower voltage (about .7V) than the anode.  In a CC display, the cathodes are joined together, and the segments are illuminated by bringing the anode voltage higher than the cathode node (again, by about .7V).  The Digilab board uses CA displays.
  • 50. Circuit diagram VCC U2 7-segm ent 5 4 3 2 110 9 8 7 6 g f vcc a bh c vcc d e 10UF LED 3 SW1 RESETS/W 12 1 2 LED 7 LED 4 C2 LED 2 10K 1 2 U1 8051 31 19 18 9 12 13 14 15 1 2 3 4 5 6 7 8 39 38 37 36 35 34 33 32 21 22 23 24 25 26 27 28 17 16 29 3011 10 40 20 EA/VP X1 X2 RESET INT0 INT1 T0 T1 P1.0 P1.1 P1.2 P1.3 P1.4 P1.5 P1.6 P1.7 P0.0 P0.1 P0.2 P0.3 P0.4 P0.5 P0.6 P0.7 P2.0 P2.1 P2.2 P2.3 P2.4 P2.5 P2.6 P2.7 RD WR PSEN ALE/PTXD RXD VCC VSS S1 1 2 VCC GR O UN D CR YSTAL33PF LED 1 33PF Y1 R2 470 E S2 LED 5 S3 VCC(5 V) C3 LED 8 R1 C1 LED 6
  • 51. UP COUNTER #include<reg51.h> #include<delay.h> #define seg_port P2 //define segment port // array is used to store the value of data to be sent on the port to display // any digit on seven segment as below unsigned char seg_array[10]={0xc0,0xf9,0xa4,0xb0,0x99,0x92,0x82,0xf8,0x80,0x90}; void main() { unsigned char count; while(1) { for(count=0;count<10;count++) { seg_port=seg_array[count]; // put array digit value from array to the port secdelay(1); } } }
  • 52. LCD LCD Display  Liquid crystal displays (LCD) are widely used in recent years as compares to LEDs. This is due to the declining prices of LCD, the ability to display numbers, characters and graphics, incorporation of a refreshing controller into the LCD, their by relieving the CPU of the task of refreshing the LCD and also the ease of programming for characters and graphics. HD 44780 based LCDs are most commonly used.
  • 54. Pin Symbol I/O Description 1 VSS - Ground 2 VCC - +5V power supply 3 VEE - Power supply to control contrast 4 RS I RS=0 to select command register, RS=1 to select data register. 5 R/W I R/W=0 for write, R/W=1 for read 6 E I/O Enable LCD pin description
  • 55. Pin Symbol I/O Description 7 PB0 I/O The 8 bit data bus 8 PB1 I/O The 8 bit data bus 9 DB2 I/O The 8 bit data bus 10 DB3 I/O The 8 bit data bus 11 DB4 I/O The 8 bit data bus 12 DB5 I/O The 8 bit data bus 13 DB6 I/O The 8 bit data bus 14 DB7 I/O The 8 bit data bus
  • 57. LCD FUNCTION #include<reg51.h> #include<delay.h> #define DATA P1 // define DATA and Control Pins of LCD sbit RS=P3^5; sbit RW=P3^6; sbit E=P3^7; void lcd_cmd(unsigned char data x) // function to write command at lcd port { ms_delay(20); DATA=data x; RS=0; //clear RS (i.e. RS=0) to write command RW=0; // write operation E=1; // send H-L pulse at E pin ms_delay(5); E=0; }
  • 58. void lcd_data (unsigned char datax) // function to write data at lcd port { ms_delay(20); DATA=datax; RS=1; // set RS=1 to write DATA RW=0; // write operation E=1; // send H-L pulse at E pin ms_delay (5); E=0; } void lcd_init() // function to initialize the LCD at power on time { lcd_cmd(0x38); // 2x16 display select ms_delay(3); lcd_cmd (0x38); // 2x16 display select ms_delay(3); lcd_cmd (0x0c); // display on cursor off command ms_delay(3); lcd_cmd (0x06); // automatic cursor movement to right ms_delay(3); lcd_cmd (0x01); // lcd clear command ms_delay(3); lcd_cmd (0x80); // first row first column select command ms_delay(3); }
  • 59. void lcd_puts(unsigned char *str) // function to display string to lcd { while(*str!='0') { lcd_data(*str); str++; } } void displaypval(unsigned int datax) // function to display 3 digit decimal value to lcd { unsigned int temp,temparr[3]; for(temp=3;temp>0;temp--) { temparr[temp-1]=datax%10; datax=datax/10; } for(temp=0;temp<3;temp++) { lcd_data(temparr[temp]+48); } }
  • 63. INTRODUCTION  THE NEED  Our doors serve as entrances to our homes and offices. They may also provide access to strangers, criminals and offenders. So how do we secure our doors and prevent intrusions by these people? This is the sole of purpose of door locks. They keep us and our properties safe and protected  The method of lock picking involves opening the door lock with a locking tool kit. A basic kit contains a screwdriver or other types of tension wrench and a lock pin, which is a long and thin piece of metal that is curved at one end. In cases of emergencies, a hairpin may substitute for the lock pin.
  • 64.  A professional kit, on the other hand, contains several types of tension wrenches in varying in sizes and shapes and lock pins with different dimensions. It may also contain a pick gun which is an instrument that vibrates and push several lock pins at the same time.  The main goal of this project is develop an embedded password security door lock system using microcontroller. In this project we are going to use 4x4 keypad to enter the security lock. Here microcontroller place major role which is nothing but decision of door opening. Here predefined password is stored in microcontroller. We have to write a code such that whenever password is entered from keypad if that password is matches door has to open. Otherwise buzzer has to on.
  • 65. PROJECT METHODOLOGY Component Name Quantity 1.Power supply section Plug with wire 1 Step down transformer 1 1N4007 diodes 4 LM7805 1 100µF capacitor 1 ON/OFF switch 1 1K Resistor 1 2. Microcontroller section Microcontroller IC (AT89C51) with base 1 Crystal oscillator 1 Capacitor 2 Resistor 1 LCD connector 1 3.Buzzer 1 4.LCD 1 5. Stepper motor 1 6.ON/OFF switch 3
  • 66. Software Used Keil µ Version3. Equipment used 1. Soldering iron 2. Solder 3. Flux PROCEDURE Step 1 Circuit diagram of the proposed system is designed and finalized.(Refer to Figure6.1 ) Step 2 All the components and software platform to be used are selected which are also mentioned above. Step 3 All the hardware components are soldered on their respective printed circuit board with the help of soldering iron, solder and flux according to the hardware schematic shown in the Figure Step 4 Code/program of the proposed system is developed using assembly language with the help of software platform (Keil u vision3).The coding could be seen in section Step 5 The hex code of the program being created by the software platform is burnt into thef lash code memory of our microcontroller IC 89C51. Step 6 Testing is done at various levels to finalize the appropriate program for the most proper working of the system.
  • 67.  DESCRIPTION IN DETAIL  It mainly consists of following blocks:  1. Microcontroller: This is the CPU (central processing unit) of our project. We are going to use a microcontroller of 8051 family. The various functions of microcontroller are like: I. Reading the digital input from Keypad II. Sending this data to LCD so that the person operating this project should read the password III. Sensing the password using keypad and to check whether it is a correct password or a wrong password and rotate the stepper motor if the password entered is a correct password.  2. LCD: We are going to use 16×2 alphanumeric Liquid Crystal Display (LCD) which means it can display alphabets along with numbers on 2 lines each containing 16 characters.  3. Keypad: User will enter the password using the keypad. Various keys of keypad are as following, I. Increment (1 to 9) II. Decrement III. Enter
  • 68. Applications and Advantages: 1. This project can be used in offices, companies also at home. It will provide keyless entry. 2. This can be used in Banks for safety lock. 3. User don’t have to carry keys along with him. Future Development: 1. We can monitor parameters like fire, overheat 2. We can provide voice feedback system 3. We can interface GSM modem which will send sms if invalid attempt is made to open the lock.