Door Lock System
Door Lock System
Door Lock System
PASSWORD
DOOR LOCK SYSTEM
Project report
ENC {5TH SEM}
SUBMITTED BY :
19001015011 DEEPIKA
19001015019 ISHMEET KAUR
19001015054 SAROJ
SUBMITTED TO :
KUSUM ARORA MAAM
DOOR LOCK SYSTEM
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 mechanism 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.
COMPONENTS REQUIRED:
8051 Microcontroller(AT89C51)
4×4 Matrix Keypad
16×2 LCD(LM0162)
L293D Motor Driver Board
DC Motor
10KΩ Potentiometer
Crystal Oscillator
Connecting wires
Capacitors(store charge) -2(22pF)
Power Supply(+5V)
Resistor 1k Ohm - 1
SOFTWARE REQUIREMENTS
Keil µVision IDE
Proteus (for circuit diagram and simulation)
INTRODUCTION:
Here, an AT89C52 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 to the controller we
need to use 7805 power supply circuit. We can use 9V DC battery or 12V, 1A adaptor as a
power source.
3. Motor Driver IC L293D is used for controlling DC motor of 12V rating. It is interfaced with
Port 3 of micro controller 8051.
4. RS (Register Select) and EN (Enable) Pins of LCD are connected to Port 3 and RW(Read-
Write) pin is grounded only for writing purpose on LCD.
Concept:-
1. Password is set 4444 by using programming.
2. If user entered correct password by means of keyboard then LCD will indicate SUCCESS and
Motor will Rotate to open door.
3. If user entered incorrect password then LCD will display "FAILURE" and motor will not
rotate, eventually door will not open.
SIMULATION VIDEO:
CIRCUIT DIAGRAM
SIMULATION:
IF PASSWORD ENTERED IS CORRECT(4444):
IF PASSWORD ENTERED IS INCORRECT:
CODE:-
ORG 0000H
CLR P3.0
CLR P3.1
CLR P3.2
CLR P3.3
CLR P2.2
CLR P2.3
MOV R4,#4
MOV DPTR,#0550H
Z: MOV A,#0
MOVC A,@A+DPTR
MOV @R1,A
INC R1
INC DPTR
DJNZ R4,Z
MOV A,#38H
ACALL CMD
MOV A,#0EH
ACALL CMD
MOV A,#01H
ACALL CMD
MOV A,#080H
ACALL CMD
ACALL DEL
SJMP PRT
CLR P2.0
SETB P2.1 ;The SETB instruction sets the bit operand to a value of 1
ACALL DEL2 ;The ACALL instruction calls a subroutine located at the specified address.
CLR P2.1
RET
DAT: MOV P1,A ;DAT FUNCTION Sending data to 16×2 lcd.
SETB P2.0
SETB P2.1
ACALL DEL2
CLR P2.1
RET
DJNZ R1,D2
RET
DJNZ R1,D2A
RET
DJNZ R2,D3B
DJNZ R1,D2B
RET
PRT:MOV R4,#11
MOV DPTR,#0500H
MOVC A,@A+DPTR
ACALL DAT
INC DPTR
DJNZ R4,TH
MOV A,#0C0H
ACALL CMD
MOV R4,#4
SJMP M
M: ACALL DEL
JNB P3.4,C1
JNB P3.5,C2
JNB P3.6,C3
JNB P3.7,C4S
CJNE R4,#0,M
JMP CHE
C4S:JMP C4
INC R0
SETB P3.0
JB P3.4,SEVEN
SETB P3.1
JB P3.4,FOUR
SETB P3.2
JB P3.4,ONE
SETB P3.3
JB P3.4,STAR
INC R0
SETB P3.0
JB P3.5,EIGHT
SETB P3.1
JB P3.5,FIVE
SETB P3.2
JB P3.5,TWO
SETB P3.3
JB P3.5,ZERO
ACALL DAT
ACALL DEL
MOV @R0,#'7'
JMP H
ACALL DAT
ACALL DEL
MOV @R0,#'4'
JMP H
ACALL DAT
ACALL DEL
MOV @R0,#'1'
JMP H
ACALL DAT
ACALL DEL
MOV @R0,#'*'
JMP H
ACALL DAT
ACALL DEL
MOV @R0,#'8'
JMP H
ACALL DAT
ACALL DEL
MOV @R0,#'5'
SJMP H
TWO: MOV A,#'2'
ACALL DAT
ACALL DEL
MOV @R0,#'2'
SJMP H
ACALL DAT
ACALL DEL
MOV @R0,#'0'
SJMP H
INC R0
SETB P3.0
JB P3.7,AA
SETB P3.1
JB P3.7,BB
SETB P3.2
JB P3.7,CC
SETB P3.3
JB P3.7,DD
ACALL DAT
ACALL DEL
MOV @R0,#'9'
SJMP H
SIX: MOV A,#'6'
ACALL DAT
ACALL DEL
MOV @R0,#'6'
SJMP H
ACALL DAT
ACALL DEL
MOV @R0,#'3'
SJMP H
ACALL DAT
ACALL DEL
MOV @R0,#'#'
SJMP H
ACALL DAT
ACALL DEL
MOV @R0,#'A'
SJMP H
ACALL DAT
ACALL DEL
MOV @R0,#'B'
SJMP H
ACALL DAT
ACALL DEL
MOV @R0,#'C'
SJMP H
ACALL DAT
ACALL DEL
MOV @R0,#'D'
SJMP H
H: CLR P3.0
CLR P3.1
CLR P3.2
CLR P3.3
JMP M
CHE:MOV A,#01H
ACALL CMD
MOV A,#080H
ACALL CMD
ACALL DEL
MOV R0,#02FH
MOV R1,#03FH
MOV R4,#4
CH: INC R0
INC R1
MOV A,@R0
MOV B,@R1
CJNE A,B,FA ;(compare and jump if not equal) The CJNE instruction compares two operands, and jumps if they
are not equal.
MOV R4,#7
MOV DPTR,#0600H
TH2:MOV A,#0
MOVC A,@A+DPTR ; The Data Pointer (DPTR) is the 8051's only user-accessible 16-bit (2-byte) register. The
Accumulator, R0–R7 registers and B register are 1-byte value registers.
INC DPTR ;DPTR is meant for pointing to data. It is used by the 8051 to access external memory using the
address indicated by DPTR.
ACALL DAT
DJNZ R4,TH2
H2:CLR P2.2
SETB P2.3
ACALL DEL3
CLR P2.3
CLR P2.3
ACALL DEL3
SETB P2.2
CLR P2.3
ACALL DEL3
JMP S
MOV DPTR,#0650H
TH3:MOV A,#0
MOVC A,@A+DPTR
ACALL DAT
INC DPTR
DJNZ R4,TH3
MOV R4,#10
DJNZ R4,WA
JMP S
ORG 0500H
DB "ENTER CODE:"
ORG 0550H
DB "4444"
ORG 0600H
DB "SUCCESS"
ORG 0650H
DB "FAILURE"
END