Mini Project Report Digital Door Lock System: Submitted by

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 36

MINI PROJECT REPORT

ON

DIGITAL DOOR LOCK SYSTEM

Submitted by:
FAZIL T A (13180031)
GOKULNAND C K (13180032)
H VISHNUDAS (13180033)
HANA ABDUL RASHEED (13180034)
ISHIKA SINGH (13180035)

In partial fulfillment of requirement for the award of the degree of

BACHELOR OF TECHNOLOGY
In
ELECTRONICS AND COMMUNICATION
DIVISION OF ELECTRONICS ENIGINEERING
SCHOOL OF ENGINEERING
COCHIN UNIVERSITY OF SCIENCE AND TECHNOLOGY

KOCHI-22
NOVEMBER 2019
1
DIVISION OF ELECTRONICS ENGINEERING
SCHOOL OF ENGINEERING
COCHIN UNIVERSITY OF SCIENCE AND TECHNOLOGY
KOCHI-22

CERTIFICATE
Certified that the MINI PROJECT report entitled DIGITAL DOOR LOCK
SYSTEM is a bonafide report of work by FAZIL T A, GOKULNAND C K, H
VISHNUDAS, HANA ABDUL RASHEED and ISHIKA SINGH towards the
partial fulfillment of the award of the degree of B.Tech in ELECTRONICS
AND COMMUNICATION of Cochin University of Science And Technology,
Kochi-22

Co-ordinators Head of Division


Mr. Manu Krishna Dr. Shahana T K
Mr. Unni A M
2
ACKNOWLEDGEMENT

We express our sincere thanks to Dr. Shahana T.K, Head of the


Division of Electronics Engineering, for her kind cooperation,
encouragement and help.

We express our gratitude to our


Coordinators Mr. Manu krishna and Mr.Unni A M , Associate
Professors, Division of Electronics Engineering for the expert
guidance and advice in presenting the Mini Project.

FAZIL T A
GOKULNAND C K
H VISHNUDAS
HANA ABDUL RASHEED
ISHIKA SINGH

3
ABSTRACT

This report is based on implementation of ‘DIGITAL DOOR


LOCK’. This password-based door lock system using 8051
Microcontroller is a simple project where a secure password
will act as a door unlocking system. Traditional lock systems
using mechanical lock and key mechanisms are being replaced
by new advanced techniques of locking system. These
techniques are an integration of mechanical and electronic
devices and are highly intelligent. One of the prominent
features of these innovative lock systems is their simplicity and
high efficiency.
Such a automatic lock system consists of electronic
control assembly, which controls the output load through a
password. This output load can be a motor or a lamp or any
other mechanical/electrical load.
This system demonstrates a Password based
lock system using 8051 Microcontroller, wherein once the
correct code or password is entered, the door is opened and
the concerned person is allowed access to the secured area.
Again, if another person arrives, it will ask to enter the
password. If the password is wrong, then door would remain
closed, denying access to that person.

4
CONTENTS

1 INTRODUCTION 7
2 OBJECTIVES 8
3 BLOCK DIAGRAM 9
4 PASSWORD BASED LOCK 10
SYSTEM ALGORITHM
5 CIRCUIT DIAGRAM 11
6 PCB LAYOUT DIAGRAM 12
7 CIRCUIT DESCRIPTION 13
8 PROGRAM 14
9 COMPONENTS 20
Microcontroller
LCD Module
Motor
Keypad
Crystal Oscillator

10 ADVANTAGES OF PASSWORD 31
BASED LOCK SYSTEM
11 APPLICATIONS OF PASSWORD 32
BASED LOCK SYSTEM
12 CONCLUSION AND SCOPE 33
OF THE PROJECT
13 REFERENCE 34
5
14 BILL OF MATERIALS 35

LIST OF FIGURES

1 BLOCK DIAGRAM 9
2 CIRCUIT DIAGRAM 11
3 PCB LAYOUT 12
4 MICROCONTROLLER: 20
AT89S51
5 AT89S51 :
PIN CONFIGURATION 21
6 LCD MODULE 25
7 DC MOTOR 28
8 KEYPAD 29
9 KEYPAD INTERNAL 29
DIAGRAM
10 CRYSTAL OSCILLATOR 30

6
INTRODUCTION
.

This Password based door lock system uses five major components – a
Microcontroller, a DC Motor, a 4×3 Matrix Keypad and a 16×2 LCD.
Here, an AT89S51 Microcontroller is used and it is an 8-bit controller.
This controller requires a supply voltage of +5V DC. In order to provide
regulated 5V DC voltage, we can use 9V DC battery or 12V, 1A adaptor
as a power source.
Once the circuit is powered ON, microcontroller sends commands to
the LCD to display “enter password” on LCD. Now we need to enter
the password using the keypad. Once password is entered, it displays
10 stars on LCD to indicate that controller read password successfully.
Now the controller compares the entered password with predefined
password. If the password is matched, the door motor rotates in
forward direction to open the door. After a delay of 10seconds, the
door motor rotates in reverse direction to close the door. If the
password is not matched, then the door motor is stationary so that
door remains closed.

7
OBJECTIVE

The objective of this project is to implement a low cost, easy to install


security solution for buildings that require a reliable means of access
control but where the allocation of keys or cards is unpractical due to the
volume of people entering and exiting the building

They also provide a keyless way to enter business premises, homes &
schools without the need for always having to carry a set of keys. This
password can also be changed instantly as per our requirement.

8
BLOCK DIAGRAM

power supply
16x2 LCD
Module:

Microcontroller

4×3 keypad

9
PASSWORD BASED DOOR LOCK SYSTEM ALORITHM:

• Initially, declare the PORT2 to LCD data pins and control pins (RS, RW
and E) to P3.0, P3.1, P3.2. Also declare PORT0 to Keypad. Also use P3.3
and P3.4 for motor.
• Then display the message “Enter Password” on LCD
• Now read the 10-digit password from the user
• Compare the entered password with the stored password
• If the password is correct, then make P3.3 high and P3.4 low to open
the door.
• After some time delay, make P3.3 low and P3.4 high to close the door.
• If the password is wrong, then display the message “Access Denied” on
LCD.
• After some delay, ask again to enter password

10
CIRCUIT DIAGRAM

11
PCB LAYOUT

12
CIRCUIT DESCRIPTION

The core of the circuit is AT89S51 Microcontroller. An 11.0592MHz


crystal oscillator is used to provide external clock signal to the
microcontroller. To ensure smooth operation, we need to connect two
ceramic capacitors in the range of 30pF to 40pF. This crystal oscillator is
connected between pin 18 and 19 of the microcontroller. Here, we used
two 33pF capacitors. Port 1 of Microcontroller is connected to a 4×3
keypad through 10K pull up resistors. The reset pin of the
microcontroller is kept active till the power supply is in the specified
range and a minimum oscillation level is maintained. A 10KΩ
Potentiometer is connected to the LCD Display’s Contrast Adjust Pin (Pin
3). RS, RW and E of LCD are connected to P3.0, P3.1 and P3.2 pins
respectively. The eight data lines of the LCD are connected to PORT 2.
Door Motor is connected to P3.3 and P3.4. The four ROW pins of keypad
are connected to P1.0 to P1.3 and three COLUMN pins of keypad is
connected to P1.4 to P1.6.

13
THE PROGRAM

Here, we used the Keil µVision software to write the program in C


language.

#include<reg51.h>
sbit r1=P1^0;
sbit r2=P1^1;
sbit r3=P1^2;
sbit r4=P1^3;
sbit c1=P1^4;
sbit c2=P1^5;
sbit c3=P1^6;

sbit rs=P3^0;
sbit rw=P3^1;
sbit en=P3^2;

sbit motp=P3^3;
sbit motn=P3^4;

void lcdcmd(unsigned char);


void lcddat(unsigned char);
void lcddis(unsigned char *,unsigned char);
void delay();
void check();
unsigned char pwd[10],x;
void main()
{
lcdcmd(0x38);
lcdcmd(0x01);
lcdcmd(0x10);
lcdcmd(0x0c);
lcdcmd(0x80);
14
lcddis("PSWD SECURITY",13);
lcdcmd(0xc0);
lcddis("SYSTEM",7);
lcdcmd(0x01);
lcddis("ENTER PASSWORD",14);
lcdcmd(0xc0);
while(1)
{
r1=0;
if(c1==0)
{
pwd[x]='1';
delay();delay();delay();delay();delay();delay();
lcddat('*');
x=x+1;
}
if(c2==0)
{
pwd[x]='2';
delay();delay();delay();delay();delay();delay();
lcddat('*');
x=x+1;
}
if(c3==0)
{
pwd[x]='3';
delay();delay();delay();delay();delay();delay();
lcddat('*');
x=x+1;
}
r2=0;r1=1;
if(c1==0)
{
pwd[x]='4';
delay();delay();delay();delay();delay();delay();
lcddat('*');
15
x=x+1;
}
if(c2==0)
{
pwd[x]='5';
delay();delay();delay();delay();delay();delay();
lcddat('*');
x=x+1;
}
if(c3==0)
{
pwd[x]='6';
delay();delay();delay();delay();delay();delay();
lcddat('*');
x=x+1;
}
r3=0;r2=1;
if(c1==0)
{
pwd[x]='7';
delay();delay();delay();delay();delay();delay();
lcddat('*');
x=x+1;
}
if(c2==0)
{
pwd[x]='8';
delay();delay();delay();delay();delay();delay();
lcddat('*');
x=x+1;
}
if(c3==0)
{
pwd[x]='9';
delay();delay();delay();delay();delay();delay();
lcddat('*');
16
x=x+1;
}
r4=0;r3=1;
if(c1==0)
{
pwd[x]=('*');
delay();delay();delay();delay();delay();delay();
lcddat('*');
x=x+1;
}
if(c2==0)
{
pwd[x]=('0');
delay();delay();delay();delay();delay();delay();
lcddat('*');
x=x+1;
}
if(c3==0)
{
check();
delay();
delay();
}

r4=1;
}

}
void check()
{
if(pwd[0]=='7'&&pwd[1]=='0'&&pwd[2]=='0'&&pwd[3]=='4'&&pw
d[4]=='6'&&pwd[5]=='2'&&pwd[6]=='8'&&pwd[7]=='3'&&pwd[8]=='8'&&
pwd[9]=='7')
{
motp=1;
17
motn=0;
lcdcmd(0x01);
lcddis("PASSWORD MATCHED",16);
delay();
}
else
{
lcdcmd(0x01);
lcddis("PASSWORD WRONG",14);
delay();

}
}

void lcdcmd(unsigned char val)


{
P2=val;
rs=0;
rw=0;
en=1;
delay();
en=0;
}

void lcddat(unsigned char dat)


{
P2=dat;
rs=1;
rw=0;
en=1;
delay();
en=0;
}
void lcddis(unsigned char *s,unsigned char r)
{
unsigned char w;
18
for(w=0;w<r;w++)
{
lcddat(s[w]);
delay();
}
}
void delay()
{
unsigned int i,j;
for(i=0;i<4000;i++);
for(j=0;j<3000;j++);
}

19
COMPONENTS

MICROCONTROLLER: AT89S51

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


microcontroller with 4K bytes of In-System Programmable Flash
memory. The device is manufactured using Atmel’s high-density non-
volatile memory technology and is compatible with the industry-
standard 80C51 instruction set and pinout. 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
AT89S51 is a powerful microcontroller which provides a highly-flexible
and cost-effective solution to many embedded control applications. The
AT89S51 provides the following standard features: 4K bytes of Flash, 128
bytes of RAM, 32 I/O lines, Watchdog timer, two data pointers, two 16-
bit timer/counters, a five-vector two-level interrupt architecture, a full
duplex serial port, on-chip oscillator, and clock circuitry. In addition, the
AT89S51 is designed with static logic for operation down to zero
20
frequency and supports two software selectable power saving modes.
The Idle Mode stops the CPU while allowing the RAM, timer/counters,
serial port, and interrupt system to continue functioning. The Power-
down mode saves the RAM contents but freezes the oscillator, disabling
all other chip functions until the next external interrupt or hardware
reset.
PIN CONFIGURATION:

PIN DESCRIPTION:

21
Pin Pin Name Description
Number

1 P1.0 Timer/Counter or 0th GPIO pin of PORT 1

2 P1.1 Timer/Counter/External Counter or 1st GPIO pin of PORT 1

3 P1.2 2nd GPIO pin of PORT 1

4 P1.3 3rd GPIO pin of PORT 1

5 P1.4 4th GPIO pin of PORT 1

6 P1.5 (MOSI) MOSI for in System Programming or 5th GPIO pin of PORT 1

7 P1.6 (MISO) MISO for in System Programming or 6th GPIO pin of PORT 1

8 P1.7 (SCK) SCK for in System Programming or 7th GPIO pin of PORT 1

9 RST Making this pin high will reset the Microcontroller

10 P3.0 (RXD) RXD Serial Input or 0th GPIO pin of PORT 3

11 P3.1 (TXD) TXD Serial Output or 1st GPIO pin of PORT 3

12 P3.2 (INT0’) External Interrupt 0 or 2nd GPIO pin of PORT 3

13 P3.3 (INT1’) External Interrupt 1 or 3rd GPIO pin of PORT 3

14 P3.4 (T0) Timer 0 or 4th GPIO pin of PORT 3

15 P3.5 (T1) Timer 1 or 5th GPIO pin of PORT 3

16 P3.6 (WR’) Memory Write or 6th GPIO pin of PORT 3

22
17 P3.7 (RD’) Memory Read or 7th GPIO pin of PORT 3

18 XTAL2 External Oscillator Output

19 XTAL1 External Oscillator Input

20 GND Ground pin of MCU

21 P2.0(A8) 0th GPIO pin of PORT 2

22 P2.1 (A9) 1st GPIO pin of PORT 2

23 P2.2 (A10) 2nd GPIO pin of PORT 2

24 P2.3 (A11) 3rd GPIO pin of PORT 2

25 P2.4 (A12) 4th GPIO pin of PORT 2

26 P2.5 (A13) 5th GPIO pin of PORT 2

27 P2.6 (A14) 6th GPIO pin of PORT 2

28 P2.7 (A15) 7th GPIO pin of PORT 2

29 PSEN’ Program store Enable used to read external program memory

30 ALE / PROG’ Address Latch Enable / Program Pulse Input

31 EA’ / VPP External Access Enable / Programming enable Voltage

32 P0.7 (AD7) Address / Data pin 7 or 7th GPIO pin of PORT 0

33 P0.6 (AD6) Address / Data pin 6 or 6th GPIO pin of PORT 0

23
34 P0.5 (AD5) Address / Data pin 5 or 5th GPIO pin of PORT 0

35 P0.4 (AD4) Address / Data pin 4 or 4th GPIO pin of PORT 0

36 P0.3 (AD3) Address / Data pin 3 or 3rd GPIO pin of PORT 0

37 P0.2 (AD2) Address / Data pin 2 or 2nd GPIO pin of PORT 0

38 P0.1 (AD1) Address / Data pin 1 or 1st GPIO pin of PORT 0

39 P0.0 (AD0) Address / Data pin 0 or 0th GPIO pin of PORT 0

40 VCC Positive pin of MCU (+5V)

24
16x2 LCD Module:

LCD modules are very commonly used in most embedded projects, the
reason being its cheap price, availability and programmer friendly. Most
of us would have come across these displays in our day to day life, either
at PCO’s or calculators. The appearance and the pinouts have already
been visualized above now let us get a bit technical.
16×2 LCD is named so because; it has 16 Columns and 2 Rows. There are
a lot of combinations available like, 8×1, 8×2, 10×2, 16×1, etc. but the
most used one is the 16×2 LCD. So, it will have (16×2=32) 32 characters in
total and each character will be made of 5×8 Pixel Dots. A Single character
with all its Pixels is shown in the below picture.

25
PIN DESCRIPTION:

Pin Pin Name: Description


No:

1 Vss Ground pin connected to system ground


(Ground)

2 Vdd (+5 Powers the LCD with +5V (4.7V – 5.3V)


Volt)

3 VE Decides the contrast level of display. Grounded to get maximum


(Contrast contrast.
V)

4 Register Connected to Microcontroller to shift between command/data


Select register

5 Read/Write Used to read or write data. Normally grounded to write data to LCD

6 Enable Connected to Microcontroller Pin and toggled between 1 and 0 for


data acknowledgement

7 Data Pin 0

Data pins 0 to 7 forms a 8-bit data line. They can be connected to


Microcontroller to send 8-bit data.
These LCD’s can also operate on 4-bit mode in such case Data pin
4,5,6 and 7 will be left free.

8 Data Pin 1

26
9 Data Pin 2

10 Data Pin 3

11 Data Pin 4

12 Data Pin 5

13 Data Pin 6

14 Data Pin 7

15 LED Backlight LED pin positive terminal


Positive

16 LED Backlight LED pin negative terminal


Negative

Features of 16×2 LCD module

• Operating Voltage is 4.7V to 5.3V


• Current consumption is 1mA without backlight
• Alphanumeric LCD display module, meaning can display alphabets and
numbers
• Consists of two rows and each row can print 16 characters.
• Each character is built by a 5×8-pixel box
• Can work on both 8-bit and 4-bit mode
• It can also display any custom generated characters
• Available in Green and Blue Backlight

27
DC MOTOR:
A DC motor is an electric motor that runs on
direct current power. In any electric motor,
operation is dependent upon simple
electromagnetism. A current carrying
conductor generates a magnetic field, when
this is then placed in an external magnetic
field, it will encounter a force proportional
to the current in the conductor and to the
strength of the external magnetic field. It is a device which converts
electrical energy to mechanical energy. It works on the fact that a current
carrying conductor placed in a magnetic field experiences a force which
causes it to rotate with respect to its original position.
Practical DC Motor consists of field windings to provide the magnetic flux
and armature which acts as the conductor.

28
4×3 KEYPAD:
Most of the applications of embedded systems require keypads to take
the user inputs, especially in case where an application requires more
number of keys. With simple architecture and easy interfacing
procedure, matrix keypads are replacing normal push-buttons by
offering more inputs to the user with the lesser I/O pins

A Matrix keypad is the most commonly used input device in many of the
application areas like digital circuits, telephone communications,
calculators, ATMs, and so on. A matrix keypad consists of a set of push
button or switches which are arranged in a matrix format of rows and
columns. These keypads are available in configurations like 4×3 and 4×4
based on the application it is implemented for. Internal diagram of this
matrix keypad is shown in the below figure.

Internal Diagram

29
CRYSTAL OSCILLATOR:
A crystal oscillator is an electronic oscillator circuit that uses the
mechanical resonance of a vibrating crystal of piezoelectric material to
create an electrical signal with a precise frequency. This frequency is
often used to keep track of time, as in quartz wristwatches, to provide a
stable clock-signal for digital integrated circuits, and to stabilize
frequencies for radio transmitters and receivers. The most common type
of piezoelectric resonator used is
the quartz crystal, so oscillator
circuits incorporating them
became known as crystal
oscillators,[1] but other
piezoelectric materials including
polycrystalline ceramics are used
in similar circuits.
A crystal oscillator, particularly
one using a quartz crystal, works by distorting the crystal with an electric
field, when voltage is applied to an electrode near or on the crystal. This
property is known as electrostriction or inverse piezoelectricity. When
the field is removed, the quartz - which oscillates in a precise frequency -
generates an electric field as it returns to its previous shape, and this can
generate a voltage. The result is that a quartz crystal behaves like an RLC
circuit, but with a much higher Q.

30
ADVANTAGES OF PASSWORD BASED DOOR LOCK SYSTEM:

• This project provides security.


• Power consumption is sufficiently less.
• The components used in this project is commonly available
components.
• Project is simple, reliable and very easy to fabricate.

31
APPLICATIONS OF PASSWORD BASED DOOR LOCK SYSTEM:

• The simple circuit can be used at residential places to ensure better


safety.
• It can be used at organizations to ensure authorized access to highly
secured places.
• With a slight modification, this project can be used to control the
switching of loads through password.

32
CONCLUSION AND SCOPE OF THE PROJECT:

It gives me immense pleasure that I have completed my project successfully. This


project helps me to enhance my skill. By selecting this project, I have understood the
applications of the microcontroller. I understood how the microcontroller reduces the
circuit and performs the function accurately. It was my great opportunity to work on
this project “PASSWORD BASED DIGITAL DOOR LOCK”. By this project I have learnt
the P.C.B designing, layout preparation, burning of the microcontroller. It gives me
immense pleasure that I have learnt something new from the project which helps me in
my life.

33
REFERENCE:

• www.firmcodes.com/
• www.circuitstoday.com
• www.electronicshub.org

BOOKS

1. The 8051 Microcontroller and Embedded systems by Muhammed


Ali Mazidi and Janice Gillispie Mazidi
2. Rajkamal ,Microcontrollers-Architecture,programming,interfacing
and System design , Pearson educations

34
BILL OF MATERIALS:
1. Microcontroller 55/-
2. DC Motor 25/-
3. 4*3 Keypad 80/-
4. LCD Module 60/-
5. Wires 10/-
6. PCB Layout 700/-
7. Crystal Oscillator 12/-
8. Resistors, capacitors 10/-
and Potentiometer

35
36

You might also like