Department of Electronics and Communication Engineering Faculty of Engineering and Technology, SRM University

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 11

DEPARTMENT OF

ELECTRONICS AND COMMUNICATION ENGINEERING


Faculty of Engineering and Technology, SRM University.
MINI PROJECT REPORT
ODD Semester, 2016-17
Lab code & Name

EC1019A- Processor Lab

Year & Semester

III Year, V sem

Project Title

PASSWORD BASED DOOR LOCKING SYSTEM

Lab Supervisor

Mr.A.SRIRAM
Assistant professor
Electronics and Communication Department

Team Members

V.PHANEENDHRA
K.S.SAI VINEETH
B.ASWIN
B.L.SAIEESHA

Reg. No
Mark split up

RA1411004010
521

RA1411004010
522

RA141100401
0540

RA1411004010521
RA1411004010522
RA1411004010547
RA1411004010540
RA1411004010
547

Novelty
in
the
project work
(2 marks)
Level
of
understanding of the
design formula
(4 marks)
Contribution to the
project
(2 Marks)
Report writing (2
Marks)
Total (10 Marks)

Date:
Signature of Lab Supervisor
1

PASSWORD BASED DOOR LOCKING SYSTEM


OBJECTIVE:
The objective is to unlock the door in digital process by assigning a password.
ABSTRACT:
This project comes with a user defined password and LCD display. The user will be
prompted to set a password at installation. This password inputted at installation will
continue to serve the lock until it is changed. The user can change the current password
with a single key press. The program will check for current password and allows the user
to change password only if the current password is entered correctly. The door is
unlocked , when password is entered correctly
INTRODUCTION:
ARDUINO Uno is a microcontroller board based on the ATmega328P (datasheet). It has
14 digital input/output pins (of which 6 can be used as PWM outputs), 6 analog inputs, a
16 MHz quartz crystal, a USB connection, a power jack, an ICSP header and a reset
button. It contains everything needed to support the microcontroller; simply connect it to a
computer with a USB cable or power it with a AC-to-DC adapter or battery. The arduino
board is connected to a Bluetooth module , which in turn is connected to a smartphone and
the necessary program instructions are flashed to the microcontroller(atmega) of the
arduino using arduino software by connecting it to a personal computer.
HARDWARE REQUIREMENT/DESCRIPTION:

ARDUINO UNO
Servo motor
Keypad
Lcd Display
Potentiometer - 10k

CIRCUIT/COMPONENT SPECIFICATIONS:
Supply voltage (VCC)

5V

Output current (maximum)

200 mA

Power consumption (minimum operating)

30 mW@5V

Operating temperature

0 to 70 C

CIRCUIT DIAGRAM:

PROGRAM :
#include <Servo.h>
#include<LiquidCrystal.h>
LiquidCrystal lcd(7,6,5,4,3,2);
Servo myservo;
int row[]={A1,A0,8,9};// Defining row pins of keypad connected to Arduino pins
int col[]={10,11,12,13};//Defining column pins of keypad connected to Arduino
int i,j,lcd_count,count=1,key_id=0,flag,entry=0;// See About the Program
int col_scan;// Variable to identify a key press
char temp_press; // Variable to hold value of key press
int out=A2;
char check[6],pass[6]; // See About the Program
void setup()
{
lcd.begin(16,2);
pinMode(out,OUTPUT);
myservo.attach(A2);
myservo.write(90);
for(i=0;i<=3;i++)
{
pinMode(row[i],OUTPUT);
pinMode(col[i],INPUT);
digitalWrite(col[i],HIGH);
}
lcd.print("SET 5 Digit PASS");
}
/* Main Program Begins */
void loop()
{
while(entry<=4)// Password Setting Loop begins
{
SetPassword();
3

}
// Password Setting Loop Ends
key_id=0;
keyscan(); // Scan for a Key Press
/* Actions on Key Press begins */
if(key_id==1) // Condition to Check Key is Pressed
{
check[count]=temp_press;
count++;
/* Condition to Unlock Begins*/
if(temp_press=='A')
{
checkPassword();
if(flag==0)
{
lcd.setCursor(0,0);
lcd.print("UNLOCKED");
digitalWrite(out,HIGH);
myservo.write(180);
delay(5000);
myservo.write(90);
}else{
lcd.setCursor(0,0);
lcd.print("WRONG PASSWORD");
delay(200);
lcd.clear();
lcd.print("LOCKED");
}
count=1; // Resetting the counter variable
}
/* Condition to Unlock Ends*/
/* Condition to Change Password Begins */
else if(temp_press=='C')
{
checkPassword();
4

if(flag==0)
{
lcd.setCursor(0,0);
lcd.print("ENTER NEW PASS");
key_id=0;
entry=0;
}else{
lcd.setCursor(0,0);
lcd.print("WRONG PASSWORD");
}
count=1; // Resetting the counter variable
}
/* Condition to Change Password Ends */
/* Condition to LOCK Begins*/
else if(temp_press=='B')
{
lcd.setCursor(0,0);
lcd.print("LOCKED");
count=1; // Resetting the counter variable
}
/* Condition to LOCK Ends*/
}
/* Actions on Key Press Ends*/
}
/* Main Program Ends */
void SetPassword() // Subroutine to SET User Defined Password
{
keyscan();
if(key_id==1)
{
if(temp_press=='A'||temp_press=='C'||temp_press=='B') // Condition to Check for an
Invalid Keypress
{
lcd.setCursor(0,0);
lcd.print("INVALID KEYS");
entry=0;
}
else
{
pass[entry]=temp_press;
5

}
}
key_id=0;
if(entry==5)
{
lcd.clear();
lcd.setCursor(0,0);
lcd.print("PASSWORD SET & LOCKED");
}} // Subroutine to SET Password ENDS
char keyscan()// Subroutine to Scan Keypad for a Keypress
{
for(i=0; i<=3; i++)
{
digitalWrite(row[0],HIGH);
digitalWrite(row[1],HIGH);
digitalWrite(row[2],HIGH);
digitalWrite(row[3],HIGH);
digitalWrite(row[i],LOW);
for(j=0; j<=3; j++)
{
col_scan=digitalRead(col[j]);
if(col_scan==LOW)
{
key_id=1;
entry++;
temp_press=keypress(i,j);
lcd.setCursor(lcd_count++,1);
lcd.print(temp_press);
if(temp_press=='A'||temp_press=='C'||temp_press=='B')
{
lcd_count=0;
lcd.clear();
}
delay(300);
break;
}}
}}// Subroutine to Scan Keypress Ends
char keypress(int i, int j) // Subroutine to Identify the value of Key pressed
{
if(i==0&&j==0)
{
6

return('1');
}
if(i==0&&j==1)
{
return('2');
}
if(i==0&&j==2)
{
return('3');
}
if(i==0&&j==3)
{
return('A');
}
if(i==1&&j==0)
{
return('4');
}
if(i==1&&j==1)
{
return('5');
}
if(i==1&&j==2)
{
return('6');
}
if(i==1&&j==3)
{
return('B');
}
if(i==2&&j==0)
{
return('7');
}
if(i==2&&j==1)
{
return('8');
}
if(i==2&&j==2)
{
return('9');
}
if(i==2&&j==3)
{
7

return('C');
}
if(i==3&&j==0)
{
return('*');
}
if(i==3&&j==1)
{
return('0');
}
if(i==3&&j==2)
{
return('#');
}
if(i==3&&j==3)
{
return('D');
}
} // Subroutine to identify Keypress Ends
void checkPassword() // Subroutine to Check User Input Data with SET Password
{
flag=0;
for(i=1;i<=5&&flag==0;i++)
{
if(check[i]==pass[i])
{
flag=0;
}
else
{flag=1;
}}} // Subroutine to check password ends
DESIGN ISSUES:

Maximum voltage to arduino should not exceed 5v.


The keypad should be connected based on the configuration specified.

APPROACH/METHODOLOGY:
Installation You will be asked to input 5 digits as password at the initial boot/reset of the device. The
first 5 digits you input at installation will be saved as your SET PASSWORD. The device will go
LOCKED after setting PASSWORD.
Key A for unlocking the device. Input correct password and press A for Unlocking.
Key B for locking any time. Just press B and you will see the LOCKED message.
Key C for changing the password. Input the correct password and Press C. You will see message
asking to ENTER NEW PASSWORD. Enter 5 digits as password. The first 5 digits you enter will be
SAVED as NEW PASSWORD.

CONCLUSIONS:
Thus the digital password for the door has been set and it can be unlocked by entering the
required password.
REFERENCES:
http://www.circuitstoday.com/advanced-digital-code-lock-using-arduino

APPENDIX:
ARDUINO UNO BOARD :

Arduino board is a microcontroller(ATMEGA ) based development board. It is used for


building digital and interactive objects that can sense and control physical devices.
LCD:

LCD (liquid crystal display) is the technology used for displays in notebook and other
smaller computers. LCDs allow displays to be much thinner than cathode ray tube (CRT)
technology.

SERVO:

A servomotor is a rotary actuator or linear actuator that allows for precise control of
angular or linear position, velocity and acceleration. It consists of a suitable motor coupled
to a sensor for position feedback.
4*4 KEYPAD :

Matrix keypad offers more input to the microcontroller with lesser I/O pins compared to
the buttons and only 8 I/O pins are needed for interfacing.

10

PASSWORD BASED DOOR LOCKING SYSTEM


V.PHANE
ENDHRA
K.S.SAI VINEETH
B.ASWIN
B.L.SAIEESHA

RA1411004010521
RA1411004010522
RA1411004010547
RA1411004010540

11

You might also like