Password Based Door Locking System Using Arduino UNO in Proteus Simulation

Password Based Door Locking System Using Arduino UNO in Proteus Simulation

In this article we will learn how to make password based door locking system using arduino UNO in proteus.
In the last post we will learn how to interfacing arduino UNO with 7 segment 4 digit display in proteus. You can visit our website,
I hope you appreciate my work, let’s discuss about today’s project.

Diagram of this project is below:

Password Based Door Locking System Using Arduino UNO in Proteus Simulation
Password Based Door Locking System Using Arduino UNO in Proteus Simulation

Components which we use in this project are listed below:

  1. Keypad-phone
  2. LMO 16L
  3. Servo motor (PWM)
  4. Arduino UNO

Construction of password based door locking system using arduino UNO in proteus:

  • Connect the point 0 of arduino to the pin A of keypad
  • Connect the point 1 of arduino to the pin B of keypad
  • Connect the point 2 of arduino to the pin C of keypad
  • Connect the point 3 of arduino to the pin D of keypad
  • Connect the point 4 of arduino to the pin 1 of keypad
  • Connect the point 5 of arduino to the pin 2 of keypad
  • Connect the point 6 of arduino to the pin 3 of keypad
  • Connect the point 9 of arduino to the signal pin of servo motor
  • Connect the negative pin of servo motor to GND
  • Connect the positive pin of servo motor to +ve point
  • Connect A0 point of arduino to the point D7 of LCD display
  • Connect A1 point of arduino to the point D6 of LCD display
  • Connect A2 point of arduino to the point D5 of LCD display
  • Connect A3 point of arduino to the point D4 of LCD display
  • Connect A4 point of arduino to the point RS of LCD display
  • Connect A5 point of arduino to the point E of LCD display
  • Connect RW & VSS both points of LCD display to GND
  • Connect VDD point of LCD display to +ve

Working of password based door locking system using arduino UNO in proteus:

A password-based door locking system using arduino UNO involves combining hardware components with programming to create a secure control mechanism.

Applications of password based door locking system using arduino UNO in proteus:

  1. Home security
  2. Office access control
  3. Hotel room access
  4. Apartment buildings
  5. Gated communities

Advantages of password based door locking system using arduino UNO in proteus:

  1. Enhanced security
  2. No physical keys
  3. Flexibility
  4. Remote management
  5. Cost-effective

Program code:

#include <LiquidCrystal.h>

#include <Servo.h>

#include <Keypad.h>

Servo myservo;

int pos=0; // position of servo motor

LiquidCrystal lcd(A4, A5, A3, A2, A1, A0);

const byte rows=4;

const byte cols=3;

 

char key[rows][cols]={

{‘1′,’2′,’3’},

{‘4′,’5′,’6’},

{‘7′,’8′,’9’},

{‘*’,’0′,’#’}

};

byte rowPins[rows]={0,1,2,3};

byte colPins[cols]={4,5,6};

Keypad keypad= Keypad(makeKeymap(key),rowPins,colPins,rows,cols);

char* password=”0123″;

int currentposition=0;

 

 

 

void setup()

{

 

displayscreen();

//Serial.begin(9600);

myservo.attach(9); //Servo motor connection

 

lcd.begin(16,2);

 

}

 

void loop()

{

if( currentposition==0)

{

displayscreen();

 

}

int l ;

char code=keypad.getKey();

if(code!=NO_KEY)

{

lcd.clear();

lcd.setCursor(0,0);

lcd.print(“PASSWORD:”);

lcd.setCursor(7,1);

lcd.print(” “);

lcd.setCursor(7,1);

for(l=0;l<=currentposition;++l)

{

 

lcd.print(“*”);

//keypress();

}

 

if (code==password[currentposition])

{

++currentposition;

if(currentposition==4)

{

 

unlockdoor();

currentposition=0;

 

}

 

}

 

 

else

{

incorrect();

currentposition=0;

 

}

}

}

 

//—————— Function 1- OPEN THE DOOR————–//

 

void unlockdoor()

{

delay(900);

 

lcd.setCursor(0,0);

lcd.println(” “);

lcd.setCursor(1,0);

lcd.print(“Access Granted”);

lcd.setCursor(4,1);

lcd.println(“WELCOME!!”);

lcd.setCursor(15,1);

lcd.println(” “);

lcd.setCursor(16,1);

lcd.println(” “);

lcd.setCursor(14,1);

lcd.println(” “);

lcd.setCursor(13,1);

lcd.println(” “);

 

for(pos = 180; pos>=0; pos-=5) // open the door

{

myservo.write(pos);

delay(5);

}

delay(2000);

 

 

 

delay(1000);

counterbeep();

 

delay(1000);

 

for(pos = 0; pos <= 180; pos +=5) // close the door

{ // in steps of 1 degree

myservo.write(pos);

delay(15);

 

 

currentposition=0;

 

lcd.clear();

displayscreen();

 

}

}

 

//——————–Function 2- Wrong code————–//

 

void incorrect()

{

delay(500);

lcd.clear();

lcd.setCursor(1,0);

lcd.print(“CODE”);

lcd.setCursor(6,0);

lcd.print(“INCORRECT”);

lcd.setCursor(15,1);

lcd.println(” “);

lcd.setCursor(4,1);

lcd.println(“GET AWAY!!!”);

 

lcd.setCursor(13,1);

lcd.println(” “);

Serial.println(“CODE INCORRECT YOU ARE UNAUTHORIZED”);

delay(3000);

lcd.clear();

displayscreen();

}

//——-Function 3 – CLEAR THE SCREEN——————–/

void clearscreen()

{

lcd.setCursor(0,0);

lcd.println(” “);

lcd.setCursor(0,1);

lcd.println(” “);

lcd.setCursor(0,2);

lcd.println(” “);

lcd.setCursor(0,3);

lcd.println(” “);

}

 

//————Function 4 – DISPLAY FUNCTION——————–//

void displayscreen()

{

 

lcd.setCursor(0,0);

lcd.println(“ENTER THE CODE”);

lcd.setCursor(1 ,1);

 

lcd.println(“TO OPEN DOOR!!”);

}

 

 

 

//————–Function 5 – Count down——————//

void counterbeep()

{

delay(1200);

 

 

lcd.clear();

 

lcd.setCursor(2,15);

lcd.println(” “);

lcd.setCursor(2,14);

lcd.println(” “);

lcd.setCursor(2,0);

delay(200);

lcd.println(“GET IN WITHIN:::”);

 

lcd.setCursor(4,1);

lcd.print(“5”);

delay(200);

lcd.clear();

lcd.setCursor(2,0);

lcd.println(“GET IN WITHIN:”);

delay(1000);

lcd.setCursor(2,0);

lcd.println(“GET IN WITHIN:”);

lcd.setCursor(4,1); //2

lcd.print(“4”);

delay(100);

lcd.clear();

lcd.setCursor(2,0);

lcd.println(“GET IN WITHIN:”);

delay(1000);

 

lcd.setCursor(2,0);

lcd.println(“GET IN WITHIN:”);

lcd.setCursor(4,1);

lcd.print(“3”);

delay(100);

lcd.clear();

lcd.setCursor(2,0);

lcd.println(“GET IN WITHIN:”);

delay(1000);

 

lcd.setCursor(2,0);

lcd.println(“GET IN WITHIN:”);

lcd.setCursor(4,1);

lcd.print(“2”);

delay(100);

lcd.clear();

lcd.setCursor(2,0);

lcd.println(“GET IN WITHIN:”);

delay(1000);

 

lcd.setCursor(4,1);

lcd.print(“1”);

delay(100);

lcd.clear();

lcd.setCursor(2,0);

lcd.println(“GET IN WITHIN::”);

 

delay(1000);

delay(40);

lcd.clear();

lcd.setCursor(2,0);

lcd.print(“RE-LOCKING”);

delay(500);

lcd.setCursor(12,0);

lcd.print(“.”);

delay(500);

lcd.setCursor(13,0);

lcd.print(“.”);

delay(500);

lcd.setCursor(14,0);

lcd.print(“.”);

delay(400);

lcd.clear();

lcd.setCursor(4,0);

lcd.print(“LOCKED!”);

delay(440);

}