Sei sulla pagina 1di 59

Embedded Password based Access

Control System
Security is a prime concern in our day-today life. Everyone wants to be as much secure as
possible. An access control for doors,any electrical and electronic forms a vital link in a
security chain. The Embedded Password based Access Control System that allows only
authorized persons to access a restricted area. This system is controlled by the
microcontroller. The system has a Keypad by which the password can be entered through it.
When the entered password equals with the password stored in the memory then the
doors,any electrical and electronic gets on. If we entered a wrong password the Alarm is
switched on.
1.1 OVERVIEW OF EMBEDDED SYSTEMS:
Embedded systems are electronic devices that incorporate microprocessors with in their
implementations. The main purposes of the microprocessors are to simplify the system design
and provide flexibility. Having a microprocessor in the device helps in removing the bugs,
making modifications, or adding new features are only matter of rewriting the software that
controls the device. Or in other words embedded computer systems are electronic systems
that include a microcomputer to perform a specific dedicated application. The computer is
hidden inside these products. Embedded systems are ubiquitous. Every week millions of tiny
computer chips come pouring out of factories finding their way into our everyday products.
Embedded systems are self-contained programs that are embedded within a piece of
hardware. Whereas a regular computer has many different applications and software that can
be applied to various tasks, embedded systems are usually set to a specific task that cannot be
altered without physically manipulating the circuitry. Another way to think of an embedded
system is as a computer system that is created with optimal efficiency, thereby allowing it to
complete specific functions as quickly as possible.
Embedded systems designers usually have a significant grasp of hardware technologies. They
use specific programming languages and software to develop embedded systems and
manipulate the equipment. When searching online, companies offer embedded systems
development kits and other embedded systems tools for use by engineers and businesses.
Embedded systems technologies are usually fairly expensive due to the necessary
development time and built in efficiencies, but they are also highly valued in specific
1

Dept. of ECE

Embedded Password based Access


Control System
industries. Smaller businesses may wish to hire a consultant to determine what sort of
embedded systems will add value to their organization.
1.1.1

CHARACTERISTICS:

Two major areas of differences are cost and power consumption. Since many embedded
systems are produced in tens of thousands to millions of units range, reducing cost is a major
concern. Embedded systems often use a (relatively) slow processor and small memory size to
minimize costs.
The slowness is not just clock speed. The whole architecture of the computer is often
intentionally simplified to lower costs. For example, embedded systems often use peripherals
controlled by synchronous serial interfaces, which are ten to hundreds of times slower than
comparable peripherals used in PCs. Programs on an embedded system often run with realtime constraints with limited hardware resources: often there is no disk drive, operating
system, keyboard or screen. A flash drive may replace rotating media, and a small keypad and
LCD screen may be used instead of a PC's keyboard and screen.
Firmware is the name for software that is embedded in hardware devices, e.g. in one or more
ROM/Flash memory IC chips. Embedded systems are routinely expected to maintain 100%
reliability while running continuously for long periods, sometimes measured in years.
Firmware is usually developed and tested too much harsher requirements than is generalpurpose software, which can usually be easily restarted if a problem occurs.
1.1.2

PLATFORM:

There are many different CPU architectures used in embedded designs. This in contrast to the
desktop computer market which is limited to just a few competing architectures mainly the
Intel/AMD x86 and the Apple/Motorola/IBM Power PCs which are used in the Apple
Macintosh. One common configuration for embedded systems is the system on a chip, an
application-specific integrated circuit, for which the CPU was purchased as intellectual
property to add to the IC's design.

Dept. of ECE

Embedded Password based Access


Control System
1.1.3

TOOLS:

Like a typical computer programmer, embedded system designers use compilers, assemblers
and debuggers to develop an embedded system. Those software tools can come from several
sources:
Software companies that specialize in the embedded market Ported from the GNU software
development tools. Sometimes, development tools for a personal computer can be used if the
embedded processor is a close relative to a common PC processor. Embedded system
designers also use a few software tools rarely used by typical computer programmers. Some
designers keep a utility program to turn data files into code, so that they can include any kind
of data in a program. Most designers also have utility programs to add a checksum or CRC to
a program, so it can check its program data before executing it.
1.1.4

OPERATING SYSTEM:

They often have no operating system, or a specialized embedded operating system (often a
real-time operating system), or the programmer is assigned to port one of these to the new
system.
Debugging:
Debugging is usually performed with an in-circuit emulator, or some type of debugger that
can interrupt the micro controllers internal microcode. The microcode interrupt lets the
debugger operate in hardware in which only the CPU works. The CPU-based debugger can
be used to test and debug the electronics of the computer from the viewpoint of the CPU.
Developers should insist on debugging which shows the high-level language, with
breakpoints and single stepping, because these features are widely available. Also, developers
should write and use simple logging facilities to debug sequences of real-time events. PC or
mainframe programmers first encountering this sort of programming often become confused
about design priorities and acceptable methods. Mentoring, code-reviews and ego less
programming are recommended.

1.1.5 DESIGN OF EMBEDDED SYSTEMS:


3

Dept. of ECE

Embedded Password based Access


Control System

The electronics usually uses either a microprocessor or a microcontroller. Some large or old
systems use general-purpose mainframes computers or minicomputers.
start-up:
All embedded systems have start-up code. Usually it disables interrupts, sets up the
electronics, tests the computer (RAM, CPU and software), and then starts the application
code. Many embedded systems recover from short-term power failures by restarting (without
recent self-tests). Restart times under a tenth of a second are common.
Many designers have found one of more hardware plus software-controlled LEDs useful to
indicate errors during development (and in some instances, after product release, to produce
troubleshooting diagnostics). A common scheme is to have the electronics turn off the LED(s)
at reset, whereupon the software turns it on at the first opportunity, to prove that the hardware
and start-up software have performed their job so far. After that, the software blinks the
LED(s) or sets up light patterns during normal operation, to indicate program execution
progress and/or errors. This serves to reassure most technicians/engineers and some users.
The Control Loop:
In this design, the software has a loop. The loop calls subroutines. Each subroutine manages a
part of the hardware or software. Interrupts generally set flags, or update counters that are
read by the rest of the software. A simple API disables and enables interrupts. Done right, it
handles nested calls in nested subroutines, and restores the preceding interrupt state in the
outermost enable. This is one of the simplest methods of creating an exocrine.
Typically, there's some sort of subroutine in the loop to manage a list of software timers,
using a periodic real time interrupt. When a timer expires, an associated subroutine is run, or
flag is set. Any expected hardware event should be backed-up with a software timer.
Hardware events fail about once in a trillion times.

Dept. of ECE

Embedded Password based Access


Control System
State machines may be implemented with a function-pointer per state-machine (in C++, C or
assembly, anyway). A change of state stores a different function into the pointer. The function
pointer is executed every time the loop runs.
Many designers recommend reading each IO device once per loop, and storing the result so
the logic acts on consistent values. Many designers prefer to design their state machines to
check only one or two things per state. Usually this is a hardware event, and a software timer.
Designers recommend that hierarchical state machines should run the lower-level state
machines before the higher, so the higher run with accurate information.
Complex functions like internal combustion controls are often handled with multidimensional tables. Instead of complex calculations, the code looks up the values. The
software can interpolate between entries, to keep the tables small and cheap.
One major disadvantage of this system is that it does not guarantee a time to respond to any
particular hardware event. Careful coding can easily assure that nothing disables interrupts
for long. Thus interrupt code can run at very precise timings. Another major weakness of this
system is that it can become complex to add new features. Algorithms that take a long time to
run must be carefully broken down so only a little piece gets done each time through the main
loop.
This system's strength is its simplicity, and on small pieces of software the loop is usually so
fast that nobody cares that it is not predictable. Another advantage is that this system
guarantees that the software will run. There is no mysterious operating system to blame for
bad behavior.

User Interfaces:
Interface designers at PARC, Apple Computer, Boeing and HP minimize the number of types
of user actions. For example, use two buttons (the absolute minimum) to control a menu
system (just to be clear, one button should be "next menu entry" the other button should be

Dept. of ECE

Embedded Password based Access


Control System
"select this menu entry"). A touch-screen or screen-edge buttons also minimize the types of
user actions.
Another basic trick is to minimize and simplify the type of output. Designs should consider
using a status light for each interface plug, or failure condition, to tell what failed. A cheap
variation is to have two light bars with a printed matrix of errors that they select- the user can
glue on the labels for the language that she speaks.
For example, Boeing's standard test interface is a button and some lights. When you press the
button, all the lights turn on. When you release the button, the lights with failures stay on.
The labels are in Basic English.
Designers use colors. Red defines the users can get hurt- think of blood. Yellow defines
something might be wrong. Green defines everything's OK.
Another essential trick is to make any modes absolutely clear on the user's display. If an
interface has modes, they must be reversible in an obvious way.Most designers prefer the
display to respond to the user. The display should change immediately after a user action. If
the machine is going to do anything, it should start within 7 seconds, or give progress reports.
One of the most successful general-purpose screen-based interfaces is the two menu buttons
and a line of text in the user's native language. It's used in pagers, medium-priced printers,
network switches, and other medium-priced situations that require complex behavior from
users. When there's text, there are languages. The default language should be the one most
widely understood.

Dept. of ECE

Embedded Password based Access


Control System

1.2 INTRODUCTION TO MICROCONTROLLER


Microcontrollers as the name suggests are small controllers. 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.
Micro-controllers are useful to the extent that they communicate with other devices, such as
sensors, motors, switches, keypads, displays, memory and even other micro-controllers.
Many interface methods have been developed over the years to solve the complex problem of
balancing circuit design criteria such as features, cost, size, weight, power consumption,
reliability, availability, manufacturability. Many microcontroller designs typically mix
multiple interfacing methods. In a very simplistic form, a micro-controller system can be
viewed as a system that reads from (monitors) inputs, performs processing and writes to
(controls) outputs.
Embedded system means the processor is embedded into the required application. An
embedded product uses a microprocessor or microcontroller to do one task only. In an
embedded system, there is only one application software that is typically burned into ROM.
Example: printer, keyboard, video game player
Microprocessor - A single chip that contains the CPU or most of the computer
Microcontroller - A single chip used to control other devices
Microcontroller differs from a microprocessor in many ways. First and the most important is
its functionality. In order for a microprocessor to be used, other components such as memory,
or components for receiving and sending data must be added to it. In short that means that
microprocessor is the very heart of the computer. On the other hand, microcontroller is
designed to be all of that in one. No other external components are needed for its application
because all necessary peripherals are already built into it. Thus, we save the time and space
needed to construct devices.
7

Dept. of ECE

Embedded Password based Access


Control System

1.2.1 Microprocessor Vs Microcontroller:


Microprocessor:

CPU is stand-alone, RAM, ROM, I/O, timer are separate


Designer can decide on the amount of ROM, RAM and I/O ports.
expensive
versatility general-purpose

Microcontroller:

CPU, RAM, ROM, I/O and timer are all on a single chip
fix amount of on-chip ROM, RAM, I/O ports
for applications in which cost, power and space are critical
single-purpose

1.3 ORGANIZATION OF THE REPORT:


The organization of chapters is as follows:

Chapter 2:
Deals with overview of Embedded Password based Access Control System
Chapter 3:
Deals with the discription of schematic diagram and operation
Chapter 4:
Deals with the components discription.
Chapter 5:
Deals with the description of software tools regarding keil
Chapter 6:
Provides the experimental results of Embedded Password based Access Control
System.
Chapter 7:
8

Dept. of ECE

Embedded Password based Access


Control System
Gives the conclusion and future scope of the project.
Security is prime concern in our day-to-day life. Every one wants to be as much as secure as
to be possible. An access control systems forms a vital link in a security chain. The micro
controller based digital lock presented here is an access control system that allows only
authorized persons to access a restricted area. This system is best suitable for corporate
home/offices and industry

2.1 PROJECT OVERVIEW


The project is designed for access control with the help of a password only. A keypad is
connected to the project to enter the password. For example fatal electrical accidents to the
line man are increasing day by day during the electric line repair due to lack of
communication and co-ordination between the maintenance staff and the electric substation
staff.
This proposed system provides a solution, which can ensure the safety of the maintenance
staff, e.g., line man. The control to turn on/off the line lies with the line man only. This
system has an arrangement such that a password is required to operate the circuit breaker
(ON/OFF). A line man can turn off the supply and comfortably repair it, and on return to the
substation, he can turn on the line by entering the correct password.
The system is fully controlled by a microcontroller from the 8051 family. A matrix keypad is
interfaced to the microcontroller to enter the password. The entered password is compared
with the password stored in the memory of the microcontroller. If the password entered is
correct, then only the line can be turned on/off. Activation / deactivation of the circuit breaker
are indicated by a lamp (on/off) provided in the project..

Dept. of ECE

Embedded Password based Access


Control System

2.2 BLOCK DIAGRAM

Power
supply

Keypad

16X2 LCD
display
Embedde
d
Controller

Relay
driver

Buzzer
Driver

Relay

Relay

Buzzer

2.3 SYSTEM REQUIREMENTS


a) Softwares:

1. IDE:
Keil Compiler
2. Programing Language : Embedded C
b) Hardware:

1.
2.
3.
4.
5.
6.

Power supply
Micro Controller.
LCD
4x3 KEY pad
Relay
Buzzer

10

Dept. of ECE

Embedded Password based Access


Control System

3.1. SCHEMATIC DIAGRAM

11

Dept. of ECE

Embedded Password based Access


Control System

3.2 CIRCUIT DESCRIPTION


3.2.1 Designing:
Since the main intension of this project is to design a security Door locks system. In order to
fulfill this application there are few steps that has been performed i.e.
1. Designing the power supply for the entire circuitry.
2. Selection of microcontroller that suits our application.
3. Selection Key pad.
4. Selection of relay.
5. Selection of LCD.
6. Selection of buzzer according to the requirement.
Complete studies of all the above points are useful to develop this project.

a) Power Supply Section:


In-order to work with any components basic requirement is power supply. In this section
there is a requirement of 5V power supply.

Transformers convert AC electricity from one voltage to another with little loss of power.
Transformers work only with AC and this is one of the reasons why mains electricity is AC.
Step-up transformers increase voltage, step-down transformers reduce voltage. Most power
supplies use a step-down transformer to reduce the dangerously high mains voltage (230V in
UK) to a safer low voltage.

12

Dept. of ECE

Embedded Password based Access


Control System
A Bridge Rectifier can be made using four individual diodes, but it is also available in special
packages containing the four diodes required. It is called a full-wave rectifier because it uses
all the AC wave (both positive and negative sections
By the electrolytic Capacitor connected across the DC supply to act as a reservoir, Smoothing
is performed by a large value supplying current to the output when the varying DC voltage
from the rectifier is falling

b) Regulator
Voltage regulator ICs are available with fixed (typically 5, 12 and 15V) or variable output
voltages. They are also rated by the maximum current they can pass. Negative voltage
regulators are available,mainly for use in dual supplies

13

Dept. of ECE

Embedded Password based Access


Control System
c) Selection Of Microcontroller:
As we know that there so many types of micro controller families that are available in the
market.
Those are

1) 8051 Family
2) AVR microcontroller Family
3) PIC microcontroller Family
4) ARM Family

Basic 8051 family is enough for our application; hence we are not concentrating on higher
end controller families.But still we selected AT89S52 controller because of inbuilt ISP (in
system programmer) option.

There are minimum six requirements for proper operation of microcontroller.


Those are:

1)

power supply section

2)

pull-ups for ports (it is must for PORT0)

3)

Reset circuit

4)

Crystal circuit

5)

ISP circuit (for program dumping)

6)

EA/VPP pin is connected to Vcc.

14

Dept. of ECE

Embedded Password based Access


Control System
PORT0 is open collector thats why we are using pull-up resistor which makes PORT0 as an
I/O port. Reset circuit is used to reset the microcontroller. Crystal circuit is used for the
microcontroller for timing pluses. In this project we are not using external memory thats why
EA/VPP pin in the microcontroller is connected to Vcc that indicates internal memory is used
for this application.

d) Selection Of Keypad:

In this project to enter the password I selected the 4X3 keypad. There are
many keypads available in the market but for my requirement this keypad enough.

e) selection of relay:

In my project I selected DC 5V SPDT relay. Because my hardware kit is working with


5 volts DC

f) Selection Of LCD:
A liquid crystal display (LCD) is an electronically-modulated optical device shaped into a
thin, flat panel made up of any number of color or filled monochrome pixels with liquid
crystals and arrayed in front of a light source(backlight) or reflector. In this project l LCD is
used to display the status of circuit breaker.
We can connect LCD in 8 bit mode or 4 bit mode, if use 8 bit mode more pins necessary to
interface LCD, so we can use 4 bit mode to reduce pins .In this project i used 4 bit mode and
it is connected to P0.

15

Dept. of ECE

Embedded Password based Access


Control System
3.3 CIRCUIT OPERATION:

Here after giving the power supply it will display to enter the password and instead of
displaying the password we are displaying * on the LCD. If password is matched
according to the command the circuit breaker (Relay) will ON/OFF. For ON and OFF the
circuit breaker in this project we connected 5v DPDT relay. If password not matched buzzer
will start .This process will continue .Here in this project we kept password as 160 we can
change it through program and changed program we have to dump it in to the
microcontroller.

16

Dept. of ECE

Embedded Password based Access


Control System

4.1 COMPONENT DESCRIPTION


In this section we present detailed information about the components which we have used
in our system.
4.1.1 MICROCONTROLLER 89S52
Microcontrollers as the name suggests are small controllers. 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.
4.1.1.1 FEATURES:

Compatible with MCS-51 Products

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

17

Dept. of ECE

Embedded Password based Access


Control System

4.1.1.2 DESCRIPTION:
The AT89S52 is a low-power, high-performance CMOS 8-bit microcontroller with 8K bytes
of in-system programmable Flash memory. The device is manufactured using Atmels highdensity 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 89S52 is a powerful microcontroller which provides a highly-flexible and costeffective 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
4.1.1.3 PIN CONFIGURATION 40-lead PDIP:

18

Dept. of ECE

Embedded Password based Access


Control System

4.1.1.4 ARCHITECTURE:

19

Dept. of ECE

Embedded Password based Access


Control System

4.1.1.5 PIN DESCRIPTION:


VCC: Supply voltage.

20

Dept. of ECE

Embedded Password based Access


Control System
GND: Ground.
Port 0:
Port 0 is an 8-bit open drain bidirectional I/O port. As an output port, each pin can sink eight
TTL inputs. When 1s are written to port 0 pins, the pins can be used as high-impedance
inputs. Port 0 can also be configured to be the multiplexed low-order address/data bus during
accesses to external program and data memory. In this mode, P0 has internal pull-ups.
Port 1:
Port 1 is an 8-bit bidirectional I/O port with internal pull-ups. The Port 1 output buffers can
sink/source four TTL inputs.

In addition, P1.0 and P1.1 can be configured to be the

timer/counter 2 external count input (P1.0/T2) and the timer/counter 2 trigger input
(P1.1/T2EX), respectively, as shown in the following table.
Port Pin

Alternate Functions

P1.0
P1.1
P1.5
P1.6
P1.7

T2(external count to Timer/Counter 2), clock-out


T2EX(Timer/Counter 2 capture/reload trigger and direction control)
MOSI (used for In-System Programming)
MISO(used for In-System Programming)
SCK(used for In-System Programming)

Port 2:
Port 2 is an 8-bit bidirectional I/O port with internal pull-ups. The Port 2 output buffers can
sink/source four TTL inputs. When 1s are written to Port 2 pins, they are pulled high by the
internal pull-ups and can be used as inputs. As inputs, Port 2 pins that are externally being
pulled low will source current (IIL) because of the internal pull-ups.
Port 3:

21

Dept. of ECE

Embedded Password based Access


Control System
Port 3 is an 8-bit bidirectional I/O port with internal pull-ups. The Port 3 output buffers can
sink/source four TTL inputs. Port 3 also serves the functions of various special features of
the AT89S52, as shown in the following table.

Port Pin
P3.0
P3.1
P3.2
P3.3
P3.4
P3.5
P3.6
P3.7

Alternate Functions
RXD (serial Input port)
TXD (serial output port)
INT0 bar (external Interrupt 0)
INT1 bar (external Interrupt 1)
T0 (timer 0 external Input)
T1 (timer 1 external input)
WR bar (external data memory write strobe)
RD bar (external data memory read strobe)

RST:
Reset input. A high on this pin for two machine cycles while the oscillator is running resets
the device. This pin drives high for 98 oscillator periods after the Watchdog times out. The
DISRTO bit in SFR AUXR (address 8EH) can be used to disable this feature. In the default
state of bit DISRTO, the RESET HIGH out feature is enabled.
ALE:
Address Latch Enable (ALE) is an output pulse for latching the low byte of the address
during accesses to external memory. This pin is also the program pulse input (PROG bar)
during Flash programming.
XTAL1:Input to the inverting oscillator amplifier and input to the internal clock operating
circuit.
XTAL2: Output from the inverting oscillator amplifier

4.1.2 LIQUID CRYSTAL DISPLAY (LCD)


22

Dept. of ECE

Embedded Password based Access


Control System

A liquid crystal display (LCD) is a thin, flat panel used for electronically displaying
information such as text, images, and moving pictures. Its uses include monitors for
computers, televisions, instrument panels, and other devices ranging from aircraft cockpit
displays, to every-day consumer devices such as video players, gaming devices, clocks,
watches, calculators, and telephones. Among its major features are its lightweight
construction, its portability, and its ability to be produced in much larger screen sizes than are
practical for the construction of cathode ray tube (CRT) display technology

4.1.2.1 PIN DIAGRAM:

23

Dept. of ECE

Embedded Password based Access


Control System

4.1.2.2PIN DESCRIPTION:

PIN

SYMBOL

I/O

DESCRIPTION

VSS

--

Ground

VCC

--

+5V power supply

VEE

--

Power supply to control contrast

RS

RS=0 to select command register


RS=1 to select data register

R/W

R/W=0 for write


R/W=1 for read

EN

I/O

Enable

DB0

I/O

The 8-bit data bus

DB1

I/O

The 8-bit data bus

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


24

Dept. of ECE

Embedded Password based Access


Control System
13

DB6

I/O

The 8-bit data bus

14

DB7

I/O

The 8-bit data bus

Vcc, Vss and Vee:


While VCC and VSS provide +5V and ground respectively, VEE is used for controlling LCD
contrast.

RS (REGISTER SELECT):
There are two important registers inside the LCD. 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 that is sent is a text data which should be displayed on the screen. For
example, to display the letter "T" on the screen you would set RS high.
RW (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 be low.
EN (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.

D0-D7 (DATA LINES):

25

Dept. of ECE

Embedded Password based Access


Control System
The 8-bit data pins, D0-D7 are used to send information to the LCD or read the content of
the LCDs internal registers. To display letters and numbers, we send ASCII codes for the
letters A-Z, a-z and numbers 0-9 to these pins while making RS=1. There are also instruction
command codes that can be sent to the LCD to clear the display or force the cursor to the
home position or blink the cursor.

4.1.2.3 LCD COMMAND CODES:

CODE

COMMAND TO LCD INSTRUCTION REGISTER

(HEX)
1
2
4

CLEAR DISPLAY SCREEN


RETURN HOME
DECREMENT CURSOR(SHIFT CURSOR TO

LEFT)
INCREMENT CURSOR(SHIFT CURSOR TO

5
7
8
A
C
E
F
10
14
18
1C
80
C0
38

RIGHT)
SHIFT DISPLAY RIGHT
SHIFT DISPLAY LEFT
DISPLAY OFF,CURSOR OFF
DISPLAY OFF,CURSOR ON
DISPLAY ON,CURSOR OFF
DISPLAY ON CURSOR BLINKING
DISPLAY ON CURSOR BLINKING
SHIFT CURSOR POSITION TO LEFT
SHIFT CURSOR POSITION TO RIGHT
SHIFT THE ENTIRE DISPLAY TO THE LEFT
SHIFT THE ENTIRE DISPLAY TO THE RIGHT
FORCE CURSOR TO BEGINNING OF 1ST LINE
FORCE CURSOR TO BEGINNING OF 2ND LINE
26
Dept. of ECE
2 LINES AND 5x7 MATRIX

Embedded Password based Access


Control System

4.1.2.4 ADVANTAGES:
LCD interfacing with 8051 is a real-world application. In recent years the LCD is finding
widespread use replacing LEDs (seven segment LEDs or other multi segment LEDs).
This is due to following reasons:
The declining prices of LCDs.
The ability to display numbers, characters and graphics. This is in contrast to LEDs,
which are limited to numbers and a few characters.
4.1.3 4X3 KEYPAD
A keypad is a set of buttons arranged in a block or "pad" which usually bear digits and other
symbols and usually a complete set of alphabetical letters. If it mostly contains numbers then
it can also be called a numeric keypad. Keypads are found on many alphanumeric keyboards
and on other devices such as calculators, push-button telephones, combination locks, and
digital door locks, which require mainly numeric input.
In order to detect which key is pressed from the matrix, we make row lines low one by one
and read the columns. Lets say we first make Row1 low, and then read the columns. If any
one of the key in row1 is pressed it will make the corresponding column as low i.e. if second
key is pressed in Row1, then the column2 will be low. So we come to know that key 2 of
Row1 is pressed. This is how scanning is done.

27

Dept. of ECE

Embedded Password based Access


Control System

4.1. 3.1 Interfacing The Keyboard To The Microcontroller:


At the lowest level, keyboards are organized in a matrix of rows and columns. The CPU
accesses both rows and columns through ports; therefore, with two 8-bit ports, an 8x8 matrix
of keys can be connected to a microprocessor. When a key is pressed, a row and a column
make a contact; otherwise, there is no connection between rows and columns. In IBM PC
keyboards, a single microcontroller (consisting of a microprocessor, RAM and EPROM, and
several PORTS all on a single chip) takes care of hardware and software interfacing of the
keyboard, in such systems, it is the function of programs stored in the EPROM of the
microcontroller to scan the keys continuously.
Scanning And Identifying The Key:

28

Dept. of ECE

Embedded Password based Access


Control System

Fig shows a 4x4 matrix connected to two ports.


The rows are connected to an output port and the columns are connected to an input port. If
no key has been pressed, reading the input port will yield 1s for all columns since they are all
connected to high (Vcc). If all the rows are grounded and a key is pressed, one of the columns
will have 0 since the pressed provides the path to ground. It is the function of the
microcontroller to scan the keyboard continuously to detect and identify the key pressed.
How it is done is explained next.
Grounding Rows And Reading The Columns:
To detect a pressed key, the microcontroller grounds all rows by providing 0 to the output
latch, and then it reads the columns. If the data read from the columns is D3-D0=1111, no key
has been pressed and the process continues until a key press is detected. However, if one of
the column bits has a 0, this means that a key press has occurred.

29

Dept. of ECE

Embedded Password based Access


Control System
The Process Of Scanning A Key Goes Through The Following 4 Steps:
1. To make sense that the preceding key has been released, 0s are output to all rows at
once and the columns are read and checked repeatedly until all the columns are high.
When all columns are found to be high, the program waits for a short amount of time
before it goes to the next stage of waiting for a key to be pressed.
2. To see if any key is pressed, the columns scanned over and over in an infinite loop
until one of them has a zero (0) on it. Remember that the output latches connected to
rows still have their initial zeros making them grounded. After the key press detection
it waits 20ms for bounce and then scans the columns again. This serves two functions
It ensures that the first key detection was not an erroneous one due to a spike noise
and the 20ms delay prevents the same key press from being interpreted as a multiple
key press .If after 20 ms delay the key is still pressed, it goes to the next stage to
detect which row it belongs to ;otherwise it goes back in to the loop to detect a read
key press.
3. To detect which row the key press belongs to, it grounds one row at a time reading the
column search time .If it finds that all columns are high this means that the key press
does not belongs to the row, therefore it grounds the next row and continues until it
finds the row key press belongs to, it sets up the starting address for the look up table
holding the scan codes for that row and goes to The next stage to identify the key.
4. To identify the key press, it rotates the column bits one bit at a time in to the carry flag
and check to see if it is low. Upon finding the zero, it pulls out the (ASCII code)
character for that key from the look up table. Otherwise it increments the pointer to
point to the next element of the look up table.

4.1.4 TRANSISTOR AS A SWITCH


As mentioned above, bipolar transistor has three regions of operation: the cut-off region, the
linear or active region, and the saturation region. When using the bipolar transistor as a
switch they must be either fully-OFF or fully-ON.
30

Dept. of ECE

Embedded Password based Access


Control System

When used as a switch, the bipolar transistor is operated in the cut-off region, the region
wherein the transistor is not conducting which makes the circuit open so that the applied
voltage will be same as the output to make the transistor OFF and saturation region, the
region wherein the transistor is in full conducting, thereby closing the circuit so as to get the
lowest possible VCE (i.e. nearly 0.2 volt) to make the transistor ON.
Transistors that are fully ON are said to be in their Saturation region and transistors that are
fully OFF are said to be in their Cut-off region. When using the transistor as a switch, a small
base current controls a much larger collector load current. When using transistors to switch
inductive loads such as relays and solenoids, a Flywheel Diode is used. When large currents
or voltages need to be controlled, Darlington configuration can be used. Transistor switches
can be used to switch and control lamps, relays or even motors.

NPN transistor as a switch


Here, RB resistor is used to control the current on base terminal that make transistor OFF and
ON (saturate) and RC resistor is the current limiter for the load. if the load operate with the
same voltage as the supplied power (Vcc), the resistor RC can be omitted. In the inductive
load circuit, a diode (clamp diode) is connected across the inductive load to protect the
31

Dept. of ECE

Embedded Password based Access


Control System
transistor again the EMF voltage generated by the inductor component when the transistor is
switched on and off rapidly, which is an opposing voltage to the source voltage. Here, the
diode will act as a short circuit to the high voltage generated by the inductor component. Any
diode which is capable of handling minimum 1 A of current can be used.

4.1.5 RELAYS
A relay is an electrically operated switch. These are remote control electrical switches that are
controlled by another switch, such as a horn switch or a computer as in a power train control
module, devices in industries, home based applications. Relays allow a small current pin, 4pin, 5-pin, and 6-pin, single switch or dual switches. Relays are used throughout the
automobile. Relays which come in assorted sizes, ratings, and applications, are used as
remote control switches. A typical vehicle can have 20 relays or more.

32

Dept. of ECE

Embedded Password based Access


Control System
4.1.5.1 Basics On Relay Handling

To maintain initial performance, care should be taken to avoid dropping or hitting the relay.

Under normal use, the relay is designed so that the case will not detach. To maintain initial
performance, the case should not be removed. Relay characteristics cannot be guaranteed if
the case is removed.

Use of the relay in an atmosphere at standard temperature and humidity with minimal
amounts of dust, SO 2, H 2 S, or organic gases is recommended.

Please avoid the use of silicon-based resins near the relay, because doing so may result in
contact failure. (This applies to plastic sealed type relays, too.)

Care should be taken to observe correct coil polarity (+, ) for polarized relays.

Proper usage requires that the rated voltage be impressed on the coil. Use rectangular waves
for DC coils and sine waves for AC coils.

Be sure the coil impressed voltage does not continuously exceed the maximum allowable
voltage.

Absolutely avoid using switching voltages and currents that exceed the designated values.

The rated switching power and life are given only as guides. The physical phenomena at the
contacts and contact life greatly vary depending on the type of load and the operating
conditions. Therefore, be sure to carefully check the

type of load and operating conditions before use.

Do not exceed the usable ambient temperature values listed in the catalog.

Use the flux-resistant type or sealed type if automatic soldering is to be used.

Use alcohol based cleaning solvents when cleaning is to be performed using a


sealed type relay.

Avoid ultrasonic cleaning of all types of relays.

Avoid bending terminals, because it may cause malfunction.

As a guide, use a Faston mounting pressure of 40 to 70N {4 to 7kgf}for relays with tab
terminals.

33

Dept. of ECE

Embedded Password based Access


Control System
A relay is used to isolate one electrical circuit from another. It allows a low current control
circuit to make or break an electrically isolated high current circuit path. The basic relay
consists of a coil and a set of contacts. The most common relay coil is a length of magnet
wire wrapped around a metal core. When voltage is applied to the coil, current passes through
the wire and creates a magnetic field. This magnetic field pulls the contacts together and
holds them there until the current flow in the coil has stopped. The diagram below shows the
parts of a simple relay.

Figure: Relay
4.1.5.2 Operation:
When a current flows through the coil, the resulting magnetic field attracts an armature that is
mechanically linked to a moving contact. The movement either makes or breaks a connection
with a fixed contact. When the current is switched off, the armature is usually returned by a
spring to its resting position shown in figure 6.6(b). Latching relays exist that require
operation of a second coil to reset the contact position.
By analogy with the functions of the original electromagnetic device, a solid-state relay
operates a thyristor or other solid-state switching device with a transformer or light-emitting
diode to trigger it. Pole and throw Since relays are switches the terminology applied to
switches is also applied to relays. A relay will switch one or more poles, each of whose
contacts can be thrown by energizing the coil in one of three ways:

Normally-open (NO) contacts connect the circuit when the relay is activated; the
circuit is disconnected when the relay is inactive. It is also called a Form A contact or "make"
contact.
34

Dept. of ECE

Embedded Password based Access


Control System

Normally-closed (NC) contacts disconnect the circuit when the relay is activated; the
circuit is connected when the relay is inactive. It is also called a Form B contact or "break"
contact.

Change-over (CO), or double-throw (DT), contacts control two circuits: one


normally-open contact and one normally-closed contact with a common terminal. It is also
called a Form C contact or "transfer" contact ("break before make"). If this type of contact
utilizes a "make before break" functionality, then it is called a Form D contact.
SPST Relay
SPST relay stands for Single Pole Single Throw relay. Current will only flow through the
contacts when the relay coil is energized.

Figure: SPST Relay


SPDT Relay
SPDT Relay stands for Single Pole Double Throw relay. Current will flow between the
movable contact and one fixed contact when the coil is De-energized and between the
movable contact and the alternate fixed contact when the relay coil is energized. The most
commonly used relay in car audio, the Bosch relay, is a SPDT relay.

Figure: SPDT Relay


35

Dept. of ECE

Embedded Password based Access


Control System
4.1.6

BUZZER:

A buzzer or beeper is an audio signaling device, which may be mechanical,


electromechanical, or piezoelectric. Typical uses of buzzers and beepers include alarm
devices, timers, and confirmation of user input such as a mouse click or keystroke.
4.1.6.1 Magnetic Transducer
Magnetic transducers contain a magnetic circuit consisting of a iron core with a wound coil
and a yoke plate, a permanent magnet and a vibrating diaphragm with a movable iron piece.
The diaphragm is slightly pulled towards the top of the core by the magnet's magnetic field.
When a positive AC signal is applied, the current flowing through the excitation coil
produces a fluctuating magnetic field, which causes the diaphragm to vibrate up and down,
thus vibrating air. Resonance amplifies vibration through resonator consisting of sound
hole(s) and cavity and produces a loud sound.
4.1.6.2 Magnetic Buzzer (Sounder)
Buzzers like the TMB-series are magnetic audible signal devices with built-in oscillating
circuits. The construction combines an oscillation circuit unit with a detection coil, a drive
coil and a magnetic transducer. Transistors, resistors, diodes and other small devices act as
circuit devices for driving sound generators.
With the application of voltage, current flows to the drive coil on primary side and to the
detection coil on the secondary side. The amplification circuit, including the transistor and the
feedback circuit, causes vibration. The oscillation current excites the coil and the unit
generates an AC magnetic field corresponding to an oscillation frequency. This AC magnetic
field magnetizes the yoke comprising the magnetic circuit. The oscillation from the
intermittent magnetization prompts the vibration diaphragm to vibrate up and down,
generating buzzer sounds through the resonator.

36

Dept. of ECE

Embedded Password based Access


Control System

4.1.6.2.1 Driving Circuit for Magnetic Transducer

4.1.6.2.2 SPECIFICATIONS:

Operating Temp. : Keep working well between -30 and +70.

Operating voltage: Normally, the operating voltage for a magnetic buzzer is from 1.5V to
24V.
Consumption current: According to the different voltage, the consumption current of a
magnetic buzzer is from dozens to hundreds of mill amperes.

37

Dept. of ECE

Embedded Password based Access


Control System
Driving method: the magnetic buzzer have self drive type to choose. Because of the internal
set drive circuit, the self drive buzzer can emit sound as long as connecting with the direct
current. Due to the different work principle, the magnetic buzzer need to be driven by 1/2
square waves to get better sound output.

Sound Pressure Level (SPL): Buzzer is usually tested the SPL at the distance of 10 cm, if
distance double, the SPL will decay about 6 dB; oppositely, the SPL will increase 6 dB when
the distance is shortened by one time. The SPL of the magnetic buzzer can reach to around 85
dB/ 10 cm.

5.1 SOFTWARE EXPLANATION


What is Vision3?
Vision3 is an IDE (Integrated Development Environment) that helps you write, compile,
and debug embedded programs. It encapsulates the following components:

A project manager.

A make facility.

Tool configuration.

Editor.

A powerful debugger.

To help you get started, several example programs (located in the \C51\Examples,
\C251\Examples, \C166\Examples, and \ARM\...\Examples) are provided.

HELLO is a simple program that prints the string "Hello World" using the Serial
Interface.

MEASURE is a data acquisition system for analog and digital systems.

TRAFFIC is a traffic light controller with the RTX Tiny operating system.

SIEVE is the SIEVE Benchmark.

DHRY is the Dhrystone Benchmark.

WHETS is the Single-Precision Whetstone Benchmark.


38

Dept. of ECE

Embedded Password based Access


Control System

Additional example programs not listed here are provided for each device architecture.

Building an Application in Vision2

To build (compile, assemble, and link) an application in Vision2, you must:


1.

Select Project -(forexample,166\EXAMPLES\HELLO\HELLO.UV2).

2.

Select Project - Rebuild all target files or Build target.

Vision2 compiles, assembles, and links the files in your project. Creating Your Own
Application in Vision2.

To create a new project in Vision2, you must:

1. Select Project - New Project.


2. Select a directory and enter the name of the project file.
3. Select Project - Select Device and select an 8051, 251, or C16x/ST10 device from the
Device Database.
4. Create source files to add to the project.
5. Select Project - Targets, Groups, Files. Add/Files, select Source Group1, and add the
source files to the project.
6. Select Project - Options and set the tool options. Note when you select the target
device from the Device Database all special options are set automatically. You
typically only need to configure the memory map of your target hardware. Default
memory model settings are optimal for most applications.
7. Select Project - Rebuild all target files or Build target.

5.1.3 Debugging an Application in Vision2

39

Dept. of ECE

Embedded Password based Access


Control System
To debug an application created using Vision2, you must:
1. Select Debug - Start/Stop Debug Session.
2. Use the Step toolbar buttons to single-step through your program. You may enter G,
main in the Output Window to execute to the main C function.
3. Open the Serial Window using the Serial #1 button on the toolbar.
4. Debug your program using standard options like Step, Go, Break, and so on.

Starting Vision2 and Creating a Project


Vision2 is a standard Windows application and started by clicking on the program icon. To
create a new project file select from the Vision2 menu Project New Project. This opens
a standard Windows dialog that asks you for the new project file name.
We suggest that you use a separate folder for each project. You can simply use
the icon Create New Folder in this dialog to get a new empty folder. Then select this folder
and enter the file name for the new project, i.e. Project1. Vision2 creates a new project file
with the name PROJECT1.UV2 which contains a default target and file group name. You can
see these names in the Project
Window Files.
Now use from the menu Project Select Device for Target and select a CPU
for your project. The Select Device dialog box shows the Vision2 device
database. Just select the micro controller you use. We are using for our examples the Philips
80C51RD+ CPU. This selection sets necessary tool options for the 80C51RD+ device and
simplifies in this way the tool Configuration
Building Projects and Creating a HEX Files
40

Dept. of ECE

Embedded Password based Access


Control System

Typical, the tool settings under Options Target are all you need to start a new application.
You may translate all source files and line the application with a click on the Build Target
toolbar icon. When you build an application with syntax errors, Vision2 will display errors
and warning messages in the Output Window Build page. A double click on a message line
opens the source file on the correct location in a Vision2 editor window. Once you have
successfully generated your application you can start debugging.
After you have tested your application, it is required to create an Intel HEX file to download
the software into an EPROM programmer or simulator. Vision2 creates HEX files with each
build process when Create HEX files under Options for Target Output is enabled. You may
start your PROM programming utility after the make process when you specify the program
under the option Run User Program #1.
CPU Simulation
Vision2 simulates up to 16 Mbytes of memory from which areas can be mapped for read,
write, or code execution access. The Vision2 simulator traps and reports illegal memory
accesses. In addition to memory mapping, the simulator also provides support for the
integrated peripherals of the various 8051 derivatives. The on-chip peripherals of the CPU
you have selected are configured from the Device
Database selection
you have made when you create your project target. Refer to page 58 for more
Information about selecting a device. You may select and display the on-chip peripheral
components using the Debug menu. You can also change the aspects of each peripheral using
the controls in the dialog boxes.
Start Debugging
You start the debug mode of Vision2 with the Debug Start/Stop Debug Session command.
Depending on the Options for Target Debug Configuration, Vision2 will load the
41

Dept. of ECE

Embedded Password based Access


Control System
application program and run the startup code Vision2 saves the editor screen layout and
restores the screen layout of the last debug session. If the program execution stops, Vision2
opens an editor window with the source text or shows CPU instructions in the disassembly
window. The next executable statement is marked with a yellow arrow. During debugging,
most editor features are still available.
For example, you can use the find command or correct program errors. Program source text
of your application is shown in the same windows. The Vision2 debug mode differs from
the edit mode in the following aspects:
The Debug Menu and Debug Commands described on page 28 areAvailable. The
additional debug windows are discussed in the following.The project structure or tool
parameters cannot be modified. All build Commands are disabled.
Disassembly Window
The Disassembly window shows your target program as mixed source and assembly program
or just assembly code. A trace history of previously executed instructions may be displayed
with Debug View Trace Records. To enable the trace history, set Debug Enable/Disable
Trace Recording.
If you select the Disassembly Window as the active window all program step commands
work on CPU instruction level rather than program source lines. You can select a text line and
set or modify code breakpoints using toolbar buttons or the context menu commands.
You may use the dialog Debug Inline Assembly to modify the CPU instructions. That
allows you to correct mistakes or to make temporary changes to the target program you are
debugging.
Installing the Keil software on a Windows PC

Insert the CD-ROM in your computers CD drive

42

Dept. of ECE

Embedded Password based Access


Control System

On most computers, the CD will auto run, and you will see the Keil installation menu.
If the menu does not appear, manually double click on the Setup icon, in the root

directory: you will then see the Keil menu.


On the Keil menu, please select Install Evaluation Software. (You will not require a

license number to install this software).


Follow the installation instructions as they appear.

Loading the Projects


The example projects for this book are NOT loaded automatically when you install the Keil
compiler.These files are stored on the CD in a directory /Pont. The files are arranged by
chapter: for example, the project discussed in Chapter 3 is in the directory /Pont/Ch03_00Hello.Rather than using the projects on the CD (where changes cannot be saved), please
copy the files from CD onto an appropriate directory on your hard disk.
Note: you will need to change the file properties after copying: file transferred from the CD
will be read only.Configuring the Simulator.Open the Keil Vision2 go to Project Open
Project and browse for Hello in Ch03_00 in Pont and open it.

5.2 KEIL SOFTWARE TOOL (STEPS)


1. Click on the Keil uVision Icon on DeskTop
2. The following fig will appear

43

Dept. of ECE

Embedded Password based Access


Control System
1.

Click on the Project menu from the title bar

2.

Then Click on New Project

3.

Save the Project by typing suitable project name with no extension in u r own
folder sited in either C:\ or D:\

4.

Then Click on Save button above.

5.

Select the component for u r project. i.e. Atmel.

6.

Click on the + Symbol beside of Atmel

44

Dept. of ECE

Embedded Password based Access


Control System

7.

Select AT89C52 as shown below

8.

Then Click on OK

9.

The Following fig will appear

45

Dept. of ECE

Embedded Password based Access


Control System

10.

Then Click either YES or NOmostly NO

11.

Now your project is ready to USE

12.

Now double click on the Target1, you would get another option Source group 1
as shown in next page.

13.

Click on the file option from menu bar and select new

46

Dept. of ECE

Embedded Password based Access


Control System

14.

The next screen will be as shown in next page, and just maximize it by double
clicking on its blue boarder.

15.

Now start writing program in either in C or ASM

16.

For a program written in Assembly, then save it with extension . asm and for
C based program save it with extension .C

47

Dept. of ECE

Embedded Password based Access


Control System

17.

Now right click on Source group 1 and click on Add files to Group Source

48

Dept. of ECE

Embedded Password based Access


Control System
18.

Now you will get another window, on which by default C files will appear.

19.

Now select as per your file extension given while saving the file

20.

Click only one time on option ADD

21.

Now Press function key F7 to compile. Any error will appear if so happen.

49

Dept. of ECE

Embedded Password based Access


Control System
22.

If the file contains no error, then press Control+F5 simultaneously.

23.

The new window is as follows

24.

Then Click OK

25.

Now Click on the Peripherals from menu bar, and check your required port as
shown in fig below

26.

Drag the port a side and click in the program file.

50

Dept. of ECE

Embedded Password based Access


Control System

27.

Now keep Pressing function key F11 slowly and observe.

28. You are running your program successfully


5.3 CODING
/*HEADER FILES*/
#include<reg52.h>
#include<string.h>
/*LCD PIN CONNECTIONS*/
#define lcd P0
sbit rs=P0^1;
sbit en=P0^3;
/*LCD FUNCTIONS DECLARATIONS*/
void init_lcd(void);
void cmd_lcd(unsigned char);
void data_lcd(unsigned char);
void str_lcd(unsigned char *);
void Delay_ms(unsigned int);
/*KEYPAD PIN CONNECTIONS*/
sbit row0=P2^3;
51

Dept. of ECE

Embedded Password based Access


Control System
sbit row1=P2^5;
sbit row2=P2^6;
sbit row3=P2^0;
sbit col0=P2^4;
sbit col1=P2^2;
sbit col2=P2^1;
/*RELAY PIN CONNECTIONS*/
sbit R1=P1^0;
/*BUZZER PIN CONNECTION*/
sbit BUZZER=P1^2;
/*VARIABLES DECLARATION*/
unsigned char i,j;
unsigned char colval,rowval,pwdchange;
unsigned char pwd[15],str1[]="12345", str2[]="12346
unsigned char keypad[4][3]={'1','2','3','4','5','6','7','8','9','*','0','#',};
/*PASSWORD FUNCTION DECLARATION*/
void password(void);
/*KEYPAD FUNCTION DECLARATION*/
unsigned char key(void);
/*MAIN FUNCTION*/
main()
{
unsigned char k=0;
BUZZER=0;
R1= 0;

//BUZZER OFF
//Relay OFF

init_lcd();

//LCD INITIALIZATION FUNCTION CALLING

str_lcd("ENTER PASSWORD:");

//DISPLAY STRING ON LCD

while(1)
{
cmd_lcd(0xc0);

//2ND LINE DISPLAY

password();

//PASSWORD FUNCTION CALLING

if(pwdchange)
{
52

Dept. of ECE

Embedded Password based Access


Control System
pwdchange=0;
continue;
}
if(!strcmp(str1,pwd))//COMPARING WITH 1ST PASSWORD
{
BUZZER=0;

//BUZZER OFF

cmd_lcd(0xc0);
str_lcd("CIRCUIT BREAKER ON ");
R1=1;

//RELAY ON

}
else If (!strcmp(str1,pwd))

//COMPARING WITH 2nd PASSWORD

{
BUZZER=0;

//BUZZER OFF

cmd_lcd(0xc0);
str_lcd("CIRCUIT BREAKER OFF ");
R1=0;

//RELAY OFF

}
else
{
strcpy(temp,pwd);
cmd_lcd(0x01);
str_lcd("Confirm Password");
cmd_lcd(0xc0);
password();
if(!strcmp(temp,pwd))
{
strcpy(str1,temp);
cmd_lcd(0x01);
str_lcd("Password
}
53

Dept. of ECE

Embedded Password based Access


Control System
Changed");
Delay_ms(1000);
cmd_lcd(0x01);
str_lcd("Enter Password");
cmd_lcd(0xc0);
pwdchange=1;
return;
}
else
{
cmd_lcd(0x01);
str_lcd("Password Error");
Delay_ms(1000);
cmd_lcd(0x01);
str_lcd("Enter Password");
cmd_lcd(0xc0);
pwdchange=1;
return;
}
}
else
{
cmd_lcd(0x01);
str_lcd("Password Error");
Delay_ms(1000);
cmd_lcd(0x01);
str_lcd("Enter Password");
cmd_lcd(0xc0);
pwdchange=1;
return;
}
}
else goto label;
54

Dept. of ECE

Embedded Password based Access


Control System
}
else goto label;

}
else
{
label:pwd[i++]=j;
data_lcd('*');
}
}
pwd[i]='\0';
}

6.1 RESULT
The result is a scalable, implementable technology that we have tested and validated
numerically and in the field. By using this key pad, we can find ON and OFF the circuit
bracker. If we enter wront password tha buzzer will ON automatically.

55

Dept. of ECE

Embedded Password based Access


Control System

6.2 Applications:
Used in Banks lockers
Home access security.
Office access security.
Garage automation access.
56

Dept. of ECE

Embedded Password based Access


Control System
Home automation access.

6.3 Advantages

No keys to be lost, stolen or occupied.


Can be ON/OFF using keypad.
Totally cost efficient.
Simple installation.
Provide ease and automation.
Keyless system, hence no more worry of losing of keys.
Since, it is the system having password facility, provide security as well.

7.1 FUTURE SCOPE

We can send this data to a remote location using mobile or internet.

We can add fingerprint sensor so entry will be allowed for the authorized person using
their fingerprints.

57

Dept. of ECE

Embedded Password based Access


Control System

We can add fire, wind and LPG sensors so that in case of accident, the doors will
automatically open.

7.2 CONCLUSION

Embedded Password based Access Control System is used in the places where we need
more security. It can also used to secure lockers and other protective doors. The system
comprises a number keypad and the keypads are connected to the 8 bit microcontroller
AT89S52. The microcontroller continuously monitor the keypad and if somebody enters the
password it will check the entered password with the password which was stored in the
memory and if it they are same then the microcontroller will switch on the corresponding
device. The system will allow the person who knows the password and it will not allow who
dont know the password.

REFERENCES

www.electronicsforyou.com
www.encyclopedia.com
www.wikipedia.com
www.atmel.com
www.electronicshub.org
58

Dept. of ECE

Embedded Password based Access


Control System
www.keil.com
http://www.edgefxkits.com/remote-password-operated-load-control-by-android-applications
http://www.edgefxkits.com/password-based-circuit-breaker
http://www.sparkfun.com/datasheets/Components/DS1307.pdf
http://www.engineersgarage.com
http://www.zntu.edu.ua/base/lection/rpf/lib/zh03/8051_tutorial.pdf
http://electricly.com/at89s52-microcontroller

59

Dept. of ECE

Potrebbero piacerti anche