Batch2 MPMC
Batch2 MPMC
PROJECT REPORT
COURSE CODE / TITLE BECE204L – Microprocessors and Microcontrollers
22BEC1072 AKAASH R P
COURSE HANDLER’S
DR.N.SUBHASHINI
NAME
REMARKS
This project aims to design a digital code lock system using assembly language for a
microcontroller. The purpose of this project is to create a secure access that allows users
to enter a predefined password to gain access. If the correct password is entered, access is
granted; otherwise, access is denied and after three unsuccessful attempts, the system
prompts the user for a security key, providing an extra layer of security. Upon successful
entry of the security key, the system prompts the user to reset the primary access code.
The user enters the new code twice for confirmation, replacing the old one for future
access.
The methods used involve storing the main password and security key in the
microcontroller's memory. Upon user input, the system compares the entered values with
the stored ones to determine access.
The digital code lock system we developed is really effective at keeping things secure. It
makes sure only the right people can get in by asking for a password. If someone tries the
wrong password too many times, it locks them out to stop any tricks. Plus, there's an extra
step with a special security key for even more protection. It's easy for users too, with clear
instructions on the screen. And if someone needs to change their password, they can do it
easily, with a double-check to make sure they got it right. Overall, it's a smart and user-
friendly system that's great for keeping things safe.
The digital code lock system we've developed isn't just about security—it's about practical
solutions for real-world needs. By creating a user-friendly interface and incorporating
robust security measures like password protection and security keys, our system can be
applied in various settings where access control is crucial.
KEYWORDS:
The motivation to embark on this project stems from the recognition of the pervasive
importance of security in modern society. With the proliferation of digital technologies and
interconnected systems, the threat landscape has evolved, necessitating advanced measures to
protect assets and ensure privacy. Traditional lock and key mechanisms, while effective to
some extent, often fall short in addressing the dynamic security requirements of today's world.
Consequently, there arises a need for smarter, more adaptable solutions capable of Keeping out
determined intruders while offering convenience and ease of use to authorized users.
The primary access relies on a pre-programmed code, typically 5 digits long. However, to
prevent brute-force attacks, a lockout mechanism triggers after a set number of incorrect
attempts. To regain access after a lockout, a secondary 6-digit security key is required. This
two-tiered approach significantly enhances security and user convenience. Even if the primary
code is compromised, the additional security key prevents unauthorized entry. Additionally,
the ability to reset the primary code allows users to regain access if forgotten.
The overarching aim of our project is to design, implement, and evaluate a digital code lock
system that offers robust security features while prioritizing user-friendliness and efficiency.
Our primary goal is to develop a reliable and effective access control solution that addresses
the evolving security challenges of modern society. By leveraging assembly language
programming on a microcontroller platform, we aim to create a versatile system capable of
safeguarding assets, protecting privacy, and enhancing overall security.
OBJECTIVE:
Secure Access Control: Our first objective is to develop a secure access control mechanism that
allows only authorized users to gain entry. This involves implementing a digital code lock
system that prompts users to enter a predefined password for authentication. Upon successful
verification, access will be granted, while unauthorized attempts will be denied.
Lockout/Reset Functionality: The code needs to implement a lockout mechanism that disables
further access attempts after exceeding the limit. Additionally, upon successful entry of the
security key, the system should allow resetting the primary access code. This involves
prompting the user for a new code and securely storing it in memory.
NOVELTY:
In a world increasingly reliant on digital security measures, the innovation of the 8051
microcontroller-based digital code lock system offers a unique blend of robustness and user-
friendliness. Unlike conventional systems, this project introduces a multi-layered security
approach that not only safeguards against unauthorized access but also ensures seamless
usability.
One standout feature is the implementation of a limited number of attempts to input the
correct password, adding an extra layer of protection against brute force attacks. However,
where this project truly shines is its incorporation of a fail-safe mechanism – the requirement
to input a security key after exceeding the allotted attempts. This not only enhances security
but also prevents lockout scenarios, a common frustration in similar systems.
Moreover, the ability to reset the password adds a dynamic element to the system's
functionality. The iterative process of re-entering the reset password until correct ensures that
inadvertent changes are minimized, thereby reducing the risk of accidental lockouts. This
thoughtful design consideration showcases a commitment to user experience rarely seen in
comparable projects.
COMPONENTS/ SOFTWARE REQUIRED:
S.NO COMPONENTS
3. 4X4 KEYPAD
4. 16X2 LCD
6. BUZZER/LED
7. JUMPER WIRES
BLOCK DIAGRAM:
SCHEMATIC USED IN PROTEUS SIMULATION:
HARDWARE IMPLEMENTATION:
When user enters wrong password: The system displays an error message indicating an
incorrect password entry. Users are prompted to try again, ensuring security while
maintaining accessibility.
When user enters wrong security key: Following unsuccessful attempts, users are prompted
to enter a security key for verification. Incorrect entries trigger an error message,
safeguarding against unauthorized access.
When user enters correct security key: Upon entering the correct security key, the system
grants access to the password reset functionality, ensuring seamless navigation through
security protocols.
When user resets the password: Users initiate the password reset process, entering a new
password for enhanced security. Clear prompts guide them through the procedure,
enhancing usability.
When user enters wrong re-enter password: After resetting the password, users are
prompted to re-enter it for confirmation. Incorrect entries trigger a prompt toretry ,
preventing accidental changes.
When user enters correct re-enter password: Upon correctly confirming the new password,
users receive a confirmation message, indicating successful password reset and ensuring
accuracy.
When user enters correct password: Successful entry of the correct password grants access to
the secured system, providing users with the desired functionality and ensuring a seamless
user experience.
ASSEMBLY LANGUAGE PROGRAM:
ORG 0000H
RS EQU P3.7 // Row Select for keypad
RW EQU P3.6 // Row Write for keypad
E EQU P3.5 // Enable for LCD
SEL EQU 50H //Data Instruction Select for LCD
//DEFAULT PASSWORD
MOV 60H,#1D
MOV 61H,#2D
MOV 62H,#3D
MOV 63H,#4D
MOV 64H,#5D
//SECURITY KEY
MOV 40H,#1D
MOV 41H,#1D
MOV 42H,#2D
MOV 43H,#2D
MOV 44H,#3D
MOV 45H,#3D
ACALL LCD_INIT
ACALL LINE1
MOV DPTR,#TEXT1
ACALL LCD_OUT
ACALL LINE2
MOV DPTR,#TEXT2
ACALL LCD_OUT
MOV R2, #3D // NO OF ATTEMPTS
MAIN:
ACALL DELAY // Introduce a delay
MOV R0, #5D // Number of digits in password (5)
MOV R1, #70H //Data memory location for entered password
ACALL READ_KEYPRESS //Read entered password from keypad (explained later)
ACALL CLRSCR //Clear LCD screen
ACALL LINE1 // Move cursor to first line
MOV DPTR, #CHKMSG // Set data pointer to message
ACALL LCD_OUT //Display message on LCD
ACALL DELAY //Introduce a delay
ACALL CHECK_PASSWORD //Check entered password (explained later)
BACK: SJMP BACK //Infinite loop (waiting for correct password)
LCD_INIT:
MOV DPTR, #INIT_COMMANDS //Set data pointer to initialization commands
SETB SEL //Set data/instruction select for command
ACALL LCD_OUT //Send commands to LCD
CLR SEL //Clear data/instruction select
RET //Return from function
LCD_OUT:
CLR A // Clear accumulator
MOVC A, @A+DPTR //Move data byte from data memory to accumulator
JZ EXIT // If zero byte encountered, exit
INC DPTR //Increment data pointer
JB SEL, CMD // If data/instruction select bit is low, jump to command write
ACALL DATAWRT //Call function to write data byte
SJMP LCD_OUT //Jump back to LCD_OUT loop
CMD: ACALL COMNWRT // Call function to write command byte
SJMP LCD_OUT //Jump back to LCD_OUT loop
EXIT: RET //Return from function
LINE2:
MOV A, #0C0H //Set command byte for second line
ACALL COMNWRT //Call function to write command byte
RET //Return from function
LINE1:
MOV A, #80H // Set command byte for first line
ACALL COMNWRT // Call function to write command byte
RET //Return from function
CLRSCR:
MOV A, #01H //Set command byte for clear screen
ACALL COMNWRT // Call function to write command byte
RET // Return from function
COMNWRT:
MOV P2, A //Move command byte to port P2
CLR P3.7 //Clear row select for LCD
CLR P3.6 //Clear row write for LCD
SETB P3.5 //Enable LCD
ACALL DELAY //Introduce a short delay
CLR P3.5 // Disable LCD
RET // Return from function
READ_KEYPRESS:
ACALL CLRSCR // Clear LCD screen
ACALL LINE1 // Move cursor to first line
MOV DPTR, #IPMSG // Set data pointer to "ENTER PASSWORD" message
ACALL LCD_OUT //Display message on LCD
ACALL LINE2 //Move cursor to second line
ROTATE:
ACALL KEY_SCAN // Call function to scan keypad for pressed key
MOV @R1, A //Store scanned key code in memory pointed to by R1
MOV A, #'*' //Set accumulator with asterisk character
ACALL DATAWRT //Display '*' on LCD (might be visual feedback)
ACALL DELAY // Introduce a delay
INC R1 //Increment pointer to next memory location for storing key
DJNZ R0, ROTATE //Decrement digit counter, loop until all digits entered
RET //Return from function
CHECK_PASSWORD:
MOV R3, #5D // Number of digits in password (5)
MOV R0, #60H // Data memory location for stored password (default)
MOV R1, #70H //Data memory location for entered password
RPT: MOV A, @R0 //Move stored password digit to accumulator
MOV B, @R1 // Move entered password digit to B register
XRL A, B // Perform XOR operation (check if digits match)
JNZ FAIL //If digits don't match, jump to FAIL
INC R0 //Increment pointers to next digits
INC R1
DJNZ R3, RPT // Decrement digit counter, loop until all digits checked
GOBACK: RET // Return from function (reached after successful password check)
GOMAIN: LJMP MAIN //Long jump to MAIN loop (reached after failed attempt with attempts remaining)
ORG 800H
Home Security: The system can be installed on doors, safes, or cabinets within homes to restrict
access to unauthorized individuals. It provides an additional layer of security beyond traditional
locks and keys, allowing homeowners to protect valuable belongings and ensure the safety of
their family members.
Office Access Control: In office buildings, the digital code lock system can be deployed to control
access to restricted areas such as server rooms, executive offices, or storage facilities. Authorized
personnel can easily enter the designated areas by inputting the correct password and security
key, while unauthorized access attempts are promptly denied.
Industrial Facilities: Manufacturing plants, warehouses, and industrial facilities can benefit from
the enhanced security provided by the digital code lock system. It can be integrated into
machinery, equipment, and storage units to prevent unauthorized access and safeguard critical
assets from theft or tampering.
Hotel Room Security: Hotels and hospitality establishments can utilize the digital code lock
system to enhance guest room security. Guests are provided with a unique code upon check-in,
allowing them to access their rooms securely without the need for physical keys. This improves
convenience for guests while minimizing the risk of unauthorized room entry.
Data Centres and Server Rooms: Data centres and server rooms house critical infrastructure and
sensitive information that require stringent access control measures. The digital code lock
system can be deployed to restrict access to authorized personnel only, helping prevent
unauthorized data breaches and ensuring the integrity and security of IT infrastructure.
CONCLUSION:
Future Work:
• Hardware Integration: Interfacing the code with a physical keypad and lock
mechanism for a complete real-world application.
By incorporating these advancements, the digital code lock can become even more
secure, versatile, and user-friendly.
REFERENCES:
• https://www.circuitstoday.com/digital-door-lock-password-based-security-8051
• https://github.com/Sayed-Noman/NSU-CSE331-Password-Based-Door-Lock-Using-
8051-Microcontroller
• https://www.electronicshub.org/password-based-door-lock-system-using-8051-
microcontroller/
https://drive.google.com/file/d/1LFfh5IS3PtpLKAijueG1msulNKkYK5FS/view?usp=drive_
link