0% found this document useful (0 votes)
16 views15 pages

CSE331 Lab Report

The project report presents a Password Based Door Lock System using an 8051 microcontroller, aimed at enhancing security and convenience by allowing authorized access through a password. The system integrates a microcontroller, LCD, keypad, and motor driver to operate a locking mechanism, with the code written in C and compiled using Kiel µVision software. The design emphasizes the transition from traditional locks to electronic systems, providing a reliable solution for residential and organizational security.

Uploaded by

Dinesh Ch
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)
16 views15 pages

CSE331 Lab Report

The project report presents a Password Based Door Lock System using an 8051 microcontroller, aimed at enhancing security and convenience by allowing authorized access through a password. The system integrates a microcontroller, LCD, keypad, and motor driver to operate a locking mechanism, with the code written in C and compiled using Kiel µVision software. The design emphasizes the transition from traditional locks to electronic systems, providing a reliable solution for residential and organizational security.

Uploaded by

Dinesh Ch
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/ 15

North South University

Department of Electrical & Computer Engineering


PROJECT REPORT
Course Code : CSE 331.
Course Title: Microprocessor Interfacing and Embedded System.
Supervisor Name: Rishad Arfin (Rsf).
Project Name:

Password based door lock system using 8051/PIC


microcontroller.

Date of Submission: 18-05-2021.


Section: 04.
Instructor Name: M.A. Muhiminul Islam.
Group Members:

Md. Farhad Gazi

Id:1621760642.
Password based door lock system using 8051/PIC microcontroller.
Objective:
A microcontroller based door locker is an access control system that allows only authorized
persons to access a restricted area. 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.

Objective:
Many times we forgot to carry the key of our home. Or sometimes we come out of our home and
door latch closes by mistake. In these cases it is really difficult to get inside the house. This
project is designed to solve this purpose also. This 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
to loads through password.

Working procedures:
At first I did some research about the door locking process using 8051. Then in proteus I used
a 8051 microcontroller, LCD, keypad, motor, motor driver IC and wired them then set the motor
driver Ic at 12v then the microcontroller 12 mhz .

Once the circuit is designed and drawn on a piece of paper, the next step is to write and compile
the code. Here we select the Kiel µVision software to write the program in C language. Prior to
writing the code, general steps needs to be followed like creating a new project and selecting
the target device or the required microcontroller. Once the code is written, we saved it with .c
extension and then added it to the source file group under the target folder. The code is then
compiled by pressing F7 key. Once the code is compiled, a hex file is created. In the next step,
we use Proteus software to draw the circuit. The code is dumped into the microcontroller by
right clicking on the IC and then adding the hex file.

Then simulate and checked the input and output operation of the circuit.
Images of Schematic circuit:

Fig1:Proteus simulation.
Fig2:keil C program.

Code:
#include<reg51.h>

#include<string.h>

sbit RS = P3^0;

sbit EN = P3^1;

sbit IN1 =P3^2;

sbit IN2 = P3^3;

void delay(int a)

int i,j;

for(i=0;i<a;i++)
for(j=0;j<255;j++);

void cmd(char cm)

P2 = cm;

RS = 0;

EN = 1;

delay(1);

EN = 0;

void dat(char dt)

P2 = dt;

RS = 1;

EN = 1;

delay(1);

EN = 0;

void display(char *lcd)

while(*lcd != '\0')

dat(*lcd);

lcd++;

}
}

void lcdint()

cmd(0x01);

cmd(0x38);

cmd(0x0E);

cmd(0x80);

void main()

char pass[5] = "1234";

char pass2[5];

int i=0;

char *ptr;

ptr = pass2;

lcdint();

display("Password-");

pass2[4]='\0';

while(1)

while(i<4)

P1=0xFE;
if(P1==0xEE)

*(ptr+i)='7';

dat('7');

delay(200);

cmd(0x06);

i++;

else if(P1==0xDE)

*(ptr+i)='8';

dat('8');

delay(200);

cmd(0x06);

i++;

else if(P1==0xBE)

*(ptr+i)='9';

dat('9');

delay(200);

cmd(0x06);
i++;

else if(P1==0x7E)

*(ptr+i)='/';

dat('/');

delay(200);

cmd(0x06);

i++;

P1=0xFD;

if(P1==0xED)

*(ptr+i)='4';

dat('4');

delay(200);

cmd(0x06);

i++;

else if(P1==0xDD)

{
*(ptr+i)='5';

dat('5');

delay(200);

cmd(0x06);

i++;

else if(P1==0xBD)

*(ptr+i)='6';

dat('6');

delay(200);

cmd(0x06);

i++;

else if (P1==0x7D)

*(ptr+i)='*';

dat('*');

delay(200);

cmd(0x06);

i++;

}
P1=0xFB;

if(P1==0xEB)

*(ptr+i)='1';

dat('1');

delay(200);

cmd(0x06);

i++;

else if(P1==0xDB)

*(ptr+i)='2';

dat('2');

delay(200);

cmd(0x06);

i++;

else if(P1==0xBB)

*(ptr+i)='3';

dat('3');

delay(200);

cmd(0x06);
i++;

else if(P1==0x7B)

*(ptr+i)='-';

dat('-');

delay(200);

cmd(0x06);

i++;

P1=0xF7;

if(P1==0xE7)

*(ptr+i)='C';

dat('C');

delay(200);

cmd(0x06);

i++;

}
else if(P1==0xD7)

*(ptr+i)='0';

dat('0');

delay(200);

cmd(0x06);

i++;

else if(P1==0xB7)

*(ptr+i)='=';

dat('=');

delay(200);

cmd(0x06);

i++;

else if(P1==0x77)

*(ptr+i)='+';

dat('+');

delay(200);

cmd(0x06);

i++;
}

while(i==4)

if ((strcmp(pass, pass2)) == 0)

cmd(0xC0);

display("Correct");

IN1 = 1;

IN2 = 0;

delay(100);

else

cmd(0xC0);

display("Incorrect");

IN1 = 0;

IN2 = 0;

delay(100);

}
Discussion:
Password Based Door Locking System design uses five major components – a Microcontroller,
an L293D Motor Driver, a DC motor, a 4×4 matrix keypad and an LCD. Here AT89C52
Microcontroller is used and it is an 8-bit controller.

Microcontroller : This is the CPU (central processing unit) of our project. We are going to use a
Microcontroller of 8051 family. The various functions of microcontroller are like:

 Reading the digital input from Keypad.

 Sending this data to LCD so that the person

operating this project should read the password.

 Sensing the password using keypad and to check wheather it is a correct password or a
wrong password and rotate the stepper motor if the password entered is a correct password.

LCD : We are going to use 16x2 alphanumeric Liquid Crystal Display (LCD) which means it can
display Alphabets along with numbers on 2 lines each are containing 16 characters.

KEYPAD : User will enter the password using the keypad. In our project we are using 4*4
matrix to provide the input .

MOTOR DRIVER IC(L293D) : The Actuator's are those devices which actually gives the
movement or to do a task like motor's. In the real world there are various types of motors
available which works on different voltages. So we need motor driver for running them through
the controller. To get interface between motor and microcontroller [4]. We use L293D motor
driver IC in our circuit. The Device is a monolithic integrated high volt- age, high current four
channel driver designed to accept standard DTL or TTL logic levels and drive inductive loads
(such as relays solenoids, DC and stepping motors) and switching power transistors. To simplify
use as two bridges each pair of channels is equipped with an enable input

Once the circuit is designed and drawn on a piece of paper, the next step is to write and compile
the code. Here we select the Kiel µVision software to write the program in C language. Prior to
writing the code, general steps needs to be followed like creating a new project and selecting
the target device or the required microcontroller. Once the code is written, we saved it with .c
extension and then added it to the source file group under the target folder. The code is then
compiled by pressing F7 key. Once the code is compiled, a hex file is created. In the next step,
we use Proteus software to draw the circuit. The code is dumped into the microcontroller by
right clicking on the IC and then adding the hex file.

The total functioning of the―CODE LOCK SYSTEM is based on the software program which is
burn inside the microcontroller IC 8051.The at89c51 IC is heart of the given circuitry because
this IC is programmable 40pin dip IC in which we burn the program in rom. This IC has a 32
input lines through which we take the output pin no 9 is used for reset the microcontroller

The operating frequency of the controller is set by the internal oscillator of crystal oscillator of
crystal having frequency of 12MHZ. to the controller during the supply is turning on and off. The
keypad used to give input signal is been interfaced with microcontroller are port0 (p0.1-
p0.7).The controller fetches the hex code according to the instruction. The LCD is used for
display device it is a 16 slots device usually used to show output status from the microcontroller .
The output signal which be fetched by relay status followed by on/off status of electronic lock..

Contribution:
Md Farhad Gazi

Id:1621760642.

CSE 331

Sec:04

You might also like