0% found this document useful (0 votes)
71 views

Manoj Final

This document provides an overview of a digital security code lock system using an 8-bit microcontroller. It describes the objectives of improving security and access control. The system uses a keypad to enter a password, which is checked against a password stored in memory. If the correct password is entered, a relay is activated to open the door. If an incorrect password is entered more than three times, an alarm is triggered. Block diagrams and descriptions of the system components like the microcontroller architecture, CPU, timers/counters are also provided.

Uploaded by

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

Manoj Final

This document provides an overview of a digital security code lock system using an 8-bit microcontroller. It describes the objectives of improving security and access control. The system uses a keypad to enter a password, which is checked against a password stored in memory. If the correct password is entered, a relay is activated to open the door. If an incorrect password is entered more than three times, an alarm is triggered. Block diagrams and descriptions of the system components like the microcontroller architecture, CPU, timers/counters are also provided.

Uploaded by

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

1 | P a g e

Chapter 1
Introduction

1.1 Objective
Security is a prime concern in our day-today life. Everyone wants to be as much
secure as possible. An access control for doors forms a vital link in a security chain.
The microcontroller based digital lock for Doors is an access control system that
allows only authorized persons to access a restricted area. The system is fully
controlled by the 8 bit microcontroller AT89C51 which has a 4Kbytes of ROM for the
program memory. The password is stored in the EPROM so that we can change it at
any time. 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
relay gets on and so that the door is opened. If we entered a wrong password for more
than three times then the Alarm is switched on.

2 | P a g e


1.2 What is Digital security code lock?
'Digital Security' gives individuals the freedom to embrace the digital lifestyle
confidently engage in everyday interactions across all digital devices .According to
Olivier Piou, CEO of global digital security company Gemalto,digital security has a
key role to play in the digital revolution. Yet fear of fraud, identity theft, and other
concerns are holding people back from making the most of (what the digital evolution
has to offer). They need to feel that the wealth of devices and service available are
both convenient to use and trustworthy. "Digital security affects all aspects of the
digital lifestyle, which, among others, comprises computers and the internet,
telecommunications, financial transactions, transportation, healthcare and secure
access. New approaches offer the best of both worlds by combining network DVR
capabilities with intelligent access control and alarm monitoring panel functionality
into a single IP solution. Systems now combine digital video Monitoring/recording,
access control and intrusion detection functionality in a single panel solution. With
these integrated digital video recording and access control platforms, security officers
can display live and stored video associated with alarm conditions and cardholder
activity When considering the security measures that are typically installed within
homes and properties, they often are systems that are not effective and not of much
use. With the number of contemptible acts like robberies, ransacking and vandalism,
the absence of competent security solutions is an open invitation to trouble. Digital
cameras are extremely useful devices that ensure the safety of your property when you
are away at work on or vacation. With technological advancements you can now
implement strong measures to keep trouble makers away







3 | P a g e

1.3 Need for Digital security code lock
We have seen the security personnel checking the employees
identification cards at the entrances to avoid illegal entry. The employees sign a
register at the entrance before getting in. This is still being practiced in most of the
companies.
However, the disadvantages are that, when there is a necessity of providing
control at many locations inside the company, a person at each point will not be an
economical way of implementing it.
Then came were the punch cards. Employees possess cards, which are
punched when they enter into the building. But it had disadvantages. Workers
started to practice buddy punching, for their co-workers.
Concerns about buddy punching-the practice where employees fraudulently
clock their co-workers in or out to give them credit for time that wasn't actually
worked-led Continental Airlines to implement a fingerprint ID system to augment
their automated employee time and attendance recording system. The company
expanded the system from Control Module after it saved an estimated $100,000 in
the first year. This led to the bar code readers.
It is a much common sight to see a bar code reader in the companies. These
are used to check with the employees identification. The employees swipe the
card in the provided slot. Then the access is given after checking the authenticity
of the card. This was a substitute to the security and emerged as a new technique in
access control. This acted as a starting to the automation of the access control

4 | P a g e


1.4 Basic Principle
The concept of access control is brought about using a card, a
corresponding card reader and a control panel interfaced with the server. The
card is a proximity card with a unique identification number integrated in it. The
reader reads the data and sends it to the control panel, which is the micro
controller. This controller checks the validity of the data with the server, which
bears the database. The server is loaded with the details about the employee for
that number.
The control panel checks whether he/she is allowed to enter the particular
door or not. If the employee is authentic, then he/she is allowed access in the
particular entrance.
The employees can be permitted in a given entrance as per his/her
designation. The access control is employed at this point.
In our project, the microcontroller is used to gain access through the
door. The controller used is AT89C2051.
















5 | P a g e

CHAPTER 2
BLOCK DIAGRAM & DESCRIPTION

2.1 BLOCK DIAGRAM

Figure: (a)


2.1.1 BLOCK DIAGRAM EXPLANATION

a) 8051 Architecture
The generic 8051 architecture sports a Harvard architecture, which contains two
separate buses for both program and data. So, it has two distinctive memory spaces of
64K X 8 size for both program and data. It is based on an 8 bit central processing unit
with an 8 bit Accumulator and another 8 bit B register as main processing blocks.
Other portions of the architecture include few 8 bit and 16 bit registers and 8 bit
memory locations. Each 8031 device has some amount of data RAM built in the
device for internal processing. This area is used for stack operations and temporary
storage of data. This base architecture is supported with on chip peripheral functions
like I/O ports, timers/counters, and versatile serial communication port. So it is clear
that this 8051 architecture was designed to cater many real time embedded needs.

6 | P a g e


The following list gives the features of the 8051 architecture:

ean processing capabilities.






rce / 5 vectors interrupt structure with priority levels.


Now you may be wondering about the non-mentioning of memory space meant for the
program storage, the most important part of any embedded controller. Originally this
8031 architecture was introduced with on chip, `one time programmable' version of
Program Memory of size 4K X 8. Intel delivered all these microcontrollers (8051)
with user's program fused inside the device. The memory portion was mapped at the
lower end of the Program Memory area. But, after getting devices, customers couldn't
change anything in their program code, which was already made available inside
during device fabrication. So, very soon Intel introduced the 8031 devices (8751) with
reprogrammable type of Program Memory using built in EPROM of size 4K X 8.Like
a regular EPROM, this memory can be re programmed many times. Later on Intel
started manufacturing these 8031 devices without any on chip Program Memory.

b) Central Processing Unit
The CPU is the brain of the microcontrollers reading user's programs and executing
the expected task as per instructions stored there in. Its primary elements are an 8 bit
Arithmetic Logic Unit (ALU), Accumulator (Acc), few more 8 bit registers, B register,
Stack Pointer (SP), Program Status Word (PSW) and 16 bit registers, Program Counter
(PC) and Data Pointer Register (DPTR). The ALU (Acc) performs arithmetic and
logic functions on 8 bit input variables. Arithmetic operations include basic addition,
subtraction, multiplication and division. Logical operations are AND, OR, Exclusive
OR as well as rotate, clear, complement and etc. Apart from all the above, ALU is
7 | P a g e

responsible in conditional branching decisions, and provides a temporary place in data
transfer operations within the device. B register is mainly used in multiply and divide
operations. During execution, B register either keeps one of the two inputs or then
retains a portion of the result. For other instructions, it can be used as another general
purpose register.

c) Timers/Counters
8031 has two 16 bit Timers/Counters capable of working in different modes. Each
consists of a `High' byte and a `Low' byte which can be accessed under software.
There is a mode control register and a control register to configure these
timers/counters in number of ways. These timers can be used to measure time
intervals, determine pulse widths or initiate events with one microsecond resolution up
to a maximum of 65 millisecond (corresponding to 65, 536 counts). Use software to
get longer delays. Working as counter, they can accumulate occurrences of external
events (from DC to 500 KHz) with 16 bit precision. In our project we are using 8 bit
microcontroller AT89C2051, it is the advanced 8 bit microcontroller from ATMEL,
which incorporates Flash Rom, and Timer etc.

d) Features of AT89C2051:
-51 Products




-Level Program Memory Lock
-Bit Internal RAM

-Bit Timer/Counters
12


-Chip Analog Comparator
and Power down Modes.

8 | P a g e


e) DESCRIPTION
The AT89C2051 is a low-voltage, high-performance CMOS 8-bitmicrocomputer with
2 Kbytes of Flash Programmable and erasable read only memory (PEROM). The
device is manufactured using Atmels high density non-volatile memory technology
and is compatible with the industry Standard MCS-51 instruction set and pin out. By
combining a versatile 8-bit CPU with Flash on a monolithic chip, the Atmel
AT89C2051 is a powerful microcomputer which provides a highly flexible and cost
effective solution to many embedded control applications.

2.1.2 PIN CONFIGURATIONS OF AT89C2051:

figure (b)





9 | P a g e

2.1.3 PIN DESCRIPTION:

PIN Working
VCC Supply voltage

GND Ground.

Port
1 Port 1 is an 8 -bit bidirectional I/O port. Port pins P1.2
to P1.7 provide internal pull-ups. P1.0 and P1.1 require
External pull-ups. P1.0 and P1.1also serve as the
positive input (AIN0) and the negative input (AIN1),
respectively, of the on-chip precision analog
Comparator. The Port 1output buffers can sink 20 mA
and can drive LED displays directly. When 1s are
Written to Port 1 pins, they can be used as input s. When
pins P1.2 to P1.7 are used as inputs and are externally
pulled low, they will source current (IIL) because of
the internal pull-ups. Port 1 also receives code data during
Flash programming and program verification.

Port
3 Port 3 pins P3.0 to P3.5, P3.7 are seven bidirectional I/O pins with
Internal pull-ups. P3.6 is hard-wired as an input to the output of the
onchip comparator and is not accessible as a general purpose
I/O pin. The Port 3 output buffers can sink 20 mA. When

1s are written to port 3 pins they are pulled high by the internal pull-ups and can be
used as inputs. As inputs, port 3 pins that are externally being low will source current
because of the pill-ups. Port 3 also serves the functions of various special features of
the AT89C2051 as listed below. Port 3 also receives some control signals for flash
programming and programming verification.


10 | P a g e













11 | P a g e

2.2 MAIN CIRCUIT DIAGRAM

Figure(c)



12 | P a g e

2.2.1. CIRCUIT DIAGRAM EXPLANATION
The Main Part of the above Circuit diagrams is the Microcontroller AT89C2051. The
Keypad was the input device and it was connected in a matrix format so that the
numbers of ports needed are reduced. The Microcontroller reads a four-digit password
through the Keypad. Then the Microcontroller compares the four digit password with
the number which is pre-programmed and if it is equal then the Microcontroller will
switch on the motor for the door and if we enter the wrong password for more than
three times then an alarm will be switched on until a right password was pressed
through the Keypad.
The Password was stored in the EEPROM and the password can be changed at any
time using the same keypad. To change the password dial 12345 Old password - New
Password. The power supply section is the important one. It should deliver constant
output regulated power supply for successful working of the project. A 0-12V/500 mA
transformer is used for our purpose the primary of this transformer is connected in to
main supply through on/off switch& fuse for protecting from overload and short
circuit protection. The secondary is connected to the diodes convert from 12V AC to
12V DC voltage. Which is further regulated to +5v, by using IC 7805.










13 | P a g e

2.3 POWER SUPPLY DIAGRAM
Figure (d)
Two supply voltages are required for the telephone remote system circuit. A
transformer is used for taking a 12V supply. This 12V is connected to bridge rectifier
for converting it into DC supply. The input coming from rectifier unit contains AC
voltage component. This is filtered out with the help of high capacity capacitors
connected in parallel. Here U3 and U4 are supplied with a regulated 5V from a
7805(U2) fixed voltage regulator. The unregulated voltage of approximately 12V is
required for relay and buzzer driving circuit. LEDs L1 indicate power supply status.
LED has a current limiting resister in series.








14 | P a g e

2.4 FLOWCHART

Figure (e)










15 | P a g e

2.5 ALGORITHM
1. START
2. initialiselcd , keypad
3. clearlcd
4. print Enter lock code on lcd
5. get 5 char long password using matrix key pad
6. if input = 12345 then
6.1 print Enter master code
6.2 get 10 char long password using matrix key pad
6.3 if input = masterlock then
6.3.1 change user password
6.3.2 go to step 4
6.4 else
6.4.1 print wrong code on lcd
6.4.2 go to step 4
7. else
7.1 if input = userlock or input = default lock then
7.1.1 unlock the lock
7.1.2 retry count = 3
7.1.3 print # to lock on lcd
7.1.4 accept input using matrix key pad
7.1.5 if input = # then lock
7.1.6 goto step 4
7.2 else
7.2.1 decrement retry count
16 | P a g e

7.2.2 print wrong code on lcd
7.2.3 if retry count = 0 then sound alarm on
7.2.4 go to step 4
8. STOP























17 | P a g e

CHAPTER 3
COMPONENTS DETAILS

3.1. Resistor
Resistor is a component that resists the flow of direct or alternating electric circuit.
Resistors can limit or divide the current, reduce the voltage, protect an electric circuit,
or provide large amounts of heat or light. An electric current is the movement of
charged particles called electrons from one region to another. Resistors are usually
placed in electric circuits. Physicists explain the flow of current through a material,
such as a resistor, by comparing it to water flowing through a pipe. Resistors are
designed to have a specific value of resistance. Resistors used in electric circuits are
cylindrical. They are often colour coded by three or four colour bands that indicate the
specific value of resistance. Resistors obey ohms law, which states that the current
density is directly proportional to the electric field when the temperature is constant.

3.2 Capacitor
Capacitor or electric condenser is a device for storing an electric charge. The simplest
form of capacitor consists of two metal plates separated by a non-touching layer called
the dielectric. When one plate is charged with electricity from a direct current or
electrostatic source, the other plate have induced in it a charge of the opposite sign;
that is, positive if the original charge is negative and negative if the original charge is
active. The electrical size of the capacitor is its capacitance. Capacitors are limited in
the amount of electric charge they can absorb; they can conduct direct current for only
instances but function well as conductors in alternating current circuits. Fixed capacity
and variable capacity capacitors are used in conjunction with coils as resonant circuits
in radios and other electronic equipment. Capacitors are produced in a wide variety of
forms. Air, Mica, Ceramics, Paper, Oil, and Vacuums are used as dielectrics
depending on the purpose for which the device is intended.

3.3 Transistor
Transistor is a device which transforms current flow from low resistance path to high
resistance path. It is capable of performing many functions of the vacuum tube in
electronic circuits, the transistor is the solid state device consisting of a tiny piece of
18 | P a g e

semi conducting material, usually germanium or silicon, to which three or more
electrical connections are made. A germanium or silicon crystal, containing donor
impurity atoms is called a negative or n-type semiconductor to indicate the presence of
excess negatively charged electrons. The use of an acceptor impurity produces a
positive, or p-type semiconductor so called because of the presence of positively
charged holes. When an electrical voltage is applied, the n-p junction acts as a
rectifier, permitting current to flow in only one direction. If the p-type region is
connected to the positive terminal of the battery and the n-type to the negative
terminal, a large current flows through the material across the junction.

3.4 Diode
Diode is a electronic device that allows the passage of current in only one direction.
The first such devices were vacuum-tube diodes, consisting of an evacuated glass or
steel envelope containing two electrodes a cathode and an anode. The diodes
commonly used in electronic circuits are semiconductor diodes. There are different
diodes used in electronic circuits such as Junction diode, Zener diode, Photo diodes,
and tunnel diode. The diode is a p-n junction device. Diode is the component used to
control the flow of the current in any one direction. The diode widely works in
forward bias.

Diode







APPLICATION

-wheeling, etc




19 | P a g e

3.5 Integrated circuits
Regulator IC (LM 7805):
The LM7805 monolithic 3-terminal positive voltage regulators employ internal
current-limiting, thermal shutdown and safe-area compensation, making them
essentially indestructible. If adequate heat sinking is provided, they can deliver over
1.0A output
current. They are intended as fixed voltage regulators in a wide range of applications
including local (on-card) regulation for elimination of noise and distribution problems
associated with single-point regulation. In addition to use as fixed voltage regulators,
these devices can be used with external components to obtain adjustable output
voltages and currents. Considerable effort was expended to make the entire series of
regulators easy to use and minimize the number of external components. It is not
necessary to bypass the output, although this does improve transient response. Input
bypassing is needed only if the regulator is located far from the filter capacitor of the
power supply.
Features:

tput voltage tolerances of 2% at Tj = 25



-circuit current limit
PINOUT FOR LM7805:





Figure (f)

20 | P a g e




3.6 LCD DISPLAY

This is first interfacing example for the Parallel Port. We will start with something
simple. This example doesn't use the Bi-directional feature found on newer ports, thus it
should work with most, if not all Parallel Ports. These LCD Modules are very common
these days, and are quite simple to work with, as all the logic required to run them is on
board.
The LCD panel's Enable and Register Select is connected to the Control Port. The
Control Port is an open collector / open drain output. While most Parallel Ports have
internal pull-up resistors, there is a few which don't. Therefore by incorporating the two
10K external pull up resistors, the circuit is more portable for a wider range of
computers, some of which may have no internal pull up resistors.
We make no effort to place the Data bus into reverse direction. Therefore we hard wire
the R/W line of the LCD panel, into write mode. This will cause no bus conflicts on the
data lines. As a result we cannot read back the LCD's internal Busy Flag which tells us
if the LCD has accepted and finished processing the last instruction. This problem is
overcome by inserting known delays into our program.
The 10k Potentiometer controls the contrast of the LCD panel. Nothing fancy here. As
with all the examples, I've left the power supply out. You can use a bench power
supply set to 5v or use an onboard +5 regulator. Remember a few de-coupling
capacitors, especially if you have trouble with the circuit working properly.


Figure (g)
21 | P a g e

3.7 LED

LED falls within the family of P-N junction devices. The light emitting diode (LED) is
a diode that will give off visible light when it is energized. In any forward biased P-N
junction there is, with in the structure and primarily close to the junction, a
recombination of hole and electrons. This recombination requires that the energy
possessed by the unbound free electron be transferred to another state. The process of
giving off light by applying an electrical source is called electroluminescence.


LED & LED Symbol
Figure (h)

LED is a component used for indication. All the functions being carried out are
displayed by led .The LED is diode which glows when the current is being flown
through it in forward bias condition. The LEDs are available in the round shell and
also in the flat shells. The positive leg is longer than negative leg.

3.8 CRYSTAL OSCILLATOR
Crystal oscillators are oscillators where the primary frequency determining element is
a quartz crystal. Because of the inherent characteristics of the quartz crystal the crystal
oscillator may be held to extreme accuracy of frequency stability. Temperature
compensation may be applied to crystal oscillators to improve thermal stability of the
crystal oscillator. Crystal oscillators are usually, fixed frequency oscillators where
stability and accuracy are the primary considerations. For example it is almost
impossible to design a stable and accurate LC oscillator for the upper HF and higher
frequencies without resorting to some sort of crystal control. Hence the reason for
crystal oscillators. The frequency of older FT-243 crystals can be moved upward by
crystal grinding.
22 | P a g e

3.9 RELAY
A relay is an electrically operated switch. Many relays use an electromagnet to
operate a switching mechanism mechanically, but other operating principles are also
used. Relays are used where it is necessary to control a circuit by a low-power signal
(with complete electrical isolation between control and controlled circuits), or where
several circuits must be controlled by one signal. The first relays were used in long
distance telegraph circuits, repeating the signal coming in from one circuit and re-
transmitting it to another. Relays were used extensively in telephone exchanges and
early computers to perform logical operations.
A type of relay that can handle the high power required to directly drive an electric
motor is called a contractor. Solid-state relays control power circuits with no moving
parts, instead using a semiconductor device to perform switching. Relays with
calibrated operating characteristics and sometimes multiple operating coils are used to
protect electrical circuits from overload or faults; in modern electric power systems
these functions are performed by digital instruments still called "protective relays".






Relay
Figure (i)
23 | P a g e

CHAPTER 4
PCB FABRICATION

The first step of assembling is to produce a printed circuit board. The fabrication of
the program counter plays a crucial role in the electronic field. The success of the
circuit is also dependent on the PCB. As far as the cost is concerned, more than 25%
of the total cost is for the PCB design and fabrication.
The board is designed using a personal computer. The layout is drawn using the
software Adobe PageMaker 6.5. The layout is printed in a buffer sheet using a
laser procedure. First, a negative screen of the layout is prepared with the help of a
professional screen printer. Then the copper clad sheet is kept under this screen. The
screen printing ink is poured on the screen and brushed through the top of the
screen. The printed board is kept under shade for few hours till the ink becomes dry.
The etching medium is prepared with the un-hydrous ferric chloride water. The
printed board is kept in this solution till the exposed copper dissolves in the solution
fully. After that the board is taken out and rinsed in flowing water under a tap. The
ink is removed with solder in order to prevent oxidation.
Another screen, which contains component side layout, is prepared and the same is
printed on the component side of the board. A paper epoxy laminate is used as the
board. Both the component and the track layout of the peripheral PCB is given at the
end of this report.







24 | P a g e

PCB LAYOUT

Figure (j)












25 | P a g e

CHAPTER 5
APPLICATIONS, ADVANTAGES &
DISADVANTAGES

5.1 APPLICATION
Our electronic door lock performed as expected. We were able to implement all the
functions specified in our proposal. The biggest hurdle we had to overcome with this
project was interfacing the micro controller with the hardware components. We feel
that this electronic door lock is very marketable because it is easy to use,
comparatively inexpensive due to low power consumption, and highly reliable. This
door lock is therefore particularly useful in applications such as hotel room door locks,
residential housing, and even office buildings.

Commercial buildings
Airports, civil transportation
Convention halls
Psychiatric care centres
Museums and fine art galleries
Ware houses
Technology centres
Government and military
Long term care facilities
Drug rehabilitation centres

26 | P a g e

5.2 Advantage
Use of RFID technology can increase business productivity and reduce
associated costs. To ensure that companies benefit from the advantages RFID
provides it is important to understand how to adopt this technology. By
analyzing current practices and procedures eight main areas of benefit can be
identified. These are:
Improved Productivity and Cost Avoidance.
Decreased Cycle Time and Taking Costs Out.
Reduced Rework.
Reduced Business Risk & Control of Assets.
Improved Security and Service.
Improved Utilization of Resources.
Increased Revenues.
Exception Management.

5.3 DISADVANTAGES

The disadvantages are that, when there is a necessity of providing control at many
locations inside the company, a person at each point will not be an economical way of
implementing it.
Then came were the punch cards. Employees possess cards, which are punched when
they enter into the building. But it had disadvantages. Workers started to practice
buddy punching, for their co-workers





27 | P a g e

5.4. FUTURE ENHANCEMENTS

passwords.
or further control.
Other than the speaker sounds, all the lights are made to turned on if password entered
is wrong for three times and also a hidden camera is used to record the faces who
trespassed.
We can use this system as an attendance register for the students to enter a class room
with their respective password.

5.5 CONCLUSION
This project is meant for security systems whose access is only for respected
authorities. Using a microcontroller the password entered is checked with the stored
password and then does the corresponding operations. Here we use a 5 digit password
for better secrecy.

As the program starts, string Enter Password is displayed on LCD. The keypad is
scanned for pressed digits one by one. Every time, row and column of the key pressed
is detected and the digit is displayed on LCD. If all the four digits match with set
password, LCD displays password is correct and the lock output pin goes high and
the led glows. If the security code is wrong, Wrong Password is sent to be displayed
on LCD and the buzzer rings which is connected to the microcontroller. It has wide
applications in the present world. It is mainly used for door alarms, equipment privacy
locks, cell phones, computers and in many lock systems.





28 | P a g e

REFERENCES

REFERENCE BOOKS:

Programming in ANSI C: E BALAGURUSAMY
The 8051microcontroller and embedded systems: MUHAMMAD ALI MAZIDI
JANICE GILLISPIE MAZIDI
The 8051 microcontroller: KENNETH J. AYALA

You might also like