Skip to main content

Bank Security Digital Door Lock System Using Arduino

In this tutorial, Bank Security Digital Door Lock System using Arduino is discussed with its components and is explained. There are many types of security systems present but out of all the solutions, the best low-cost one is to use a pin-based system or a password. 

Now in the project, I have built an Arduino Keypad Lock System which is used to mount on any of the existing bank doors to secure them with the digital password. 

WHAT IS A BANK SECURITY DIGITAL DOOR LOCK SYSTEM?

Simply it's a Digital Door Lock System that helps in the security of the door lock with the use of a digital keypad and by using the Arduino Uno Board. This idea helps in the security of the locker’s in the bank

LIST OF THE COMPONENTS REQUIRED FOR THE PROJECT

  • Arduino UNO
  • 16*2 Liquid Crystal Display
  • Servo Motor
  • 4*3 or 4*4 matrix keypad for the Arduino
  • 3D printed door locker or customized door lock system
  • 4” / 6” plastics boxes, jumper wires, nuts bolts, and plastics casing etc.
  • Additional components for power supply of 1 Amp 5 Volt mobile charger.


DESCRIPTION OF THE PROJECT

Firstly, the brain of the project is the Arduino UNO board. The Arduino UNO board is connected to the LCD along with a servo motor. 

Here, the servo motor is used to lock or unlock the latch on the door. 

The 16x2 LCD (16 columns and 2 rows) is used to display the message with the help of Arduino. 

The servo motor used is a 5V Towerpro SG90. This servo motor is the basic level servo motor and that works fine with the Arduino without any external module. 

A 4*4 matrix keypad is used in this project (but as a 4*4 keypad part was not available I used a 4*3 keypad in the above graphical representation), but it’s not a problem as the 4*3 matrix keypad works fine with the code I used.

We also need a keypad for the password input and for manually locking our customized door locker. The keypad consists of 16 keys totally. Out of all the keys, 4 keys in Rows (R1, R2, R3, R4) and 4 keys in Columns (C1, C2, C3, C4).

Whenever a key is pressed, a connection will be established between the corresponding rows and columns.

 

CIRCUIT DIAGRAM:

The pin configuration of the circuit is explained and shown below:

Home_Security_System_using_Arduino_6ecea1575e223985f0eef593b57dc5a83d1118fb.jpg

  • GND of LCD – GND of Arduino
  • VCC of LCD – VCC of Arduino and VCC of Servo motor
  • Vo (display contrast pin) of LCD – 
  • RS pin (register select) of LCD – A0 pin of Arduino
  • R/W pin (read/ write) of LCD - VCC pin of Arduino
  • E (Enable) pin of LCD – GND of Arduino
  • DB4 pin of LCD – A2 pin of Arduino
  • DB5 pin of LCD – A3 pin of Arduino
  • DB6 pin of LCD – A4 pin of Arduino
  • DB7 pin of LCD – A5 pin of Arduino
  • GND pin of Servo Motor – GND of LCD and Arduino
  • VCC pin of Servo Motor – VCC of LCD and 5V of Arduino
  • PWM pin of Servo Motor – Digital pin 9 of Arduino
  • R1 pin of Matrix Keypad – Digital pin 1 of Arduino
  • R2 pin of Matrix Keypad – Digital pin 2 of Arduino
  • R3 pin of Matrix Keypad – Digital pin 3 of Arduino
  • R4 pin of Matrix Keypad – Digital pin 4 of Arduino
  • C1 pin of Matrix Keypad – Digital pin 5 of Arduino
  • C2 pin of Matrix Keypad – Digital pin 6 of Arduino
  • C3 pin of Matrix Keypad – Digital pin 7 of Arduino
  • Circuit Design of the Project

CODE:

#include <Keypad.h>

#include <LiquidCrystal.h>

#include <Servo.h>

Servo myservo;

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

#define Password_Lenght 7 // Give enough room for six chars + NULL char

int pos = 0;    // variable to store the servo position

char Data[Password_Lenght]; // 6 is the number of chars it can hold + the null char = 7

char Master[Password_Lenght] = "123456";

byte data_count = 0, master_count = 0;

bool Pass_is_good;

char customKey;

const byte ROWS = 4;

const byte COLS = 3;

char keys[ROWS][COLS] = {

  {'1', '2', '3'},

  {'4', '5', '6'},

  {'7', '8', '9'},

  {'*', '0', '#'}

};

bool door = true;

byte rowPins[ROWS] = {1, 2, 3, 4}; //connect to the row pinouts of the keypad

byte colPins[COLS] = {5, 6, 7}; //connect to the column pinouts of the keypad

Keypad customKeypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS); //initialize an instance of class NewKeypad

void setup()

{

  myservo.attach(9);

  ServoClose();

  lcd.begin(16, 2);

  lcd.print(" Arduino Door");

  lcd.setCursor(0, 1);

  lcd.print("--Look project--");

  delay(3000);

  lcd.clear();

}

void loop()

{

  if (door == 0)

  {

    customKey = customKeypad.getKey();

    if (customKey == '#')

    {

      lcd.clear();

      ServoClose();

      lcd.print("  Door is close");

      delay(3000);

      door = 1;

    }

  }

  else Open();

}

void clearData()

{

  while (data_count != 0)

  { // This can be used for any array size,

    Data[data_count--] = 0; //clear array for new data

  }

  return;

}

void ServoOpen()

{

  for (pos = 180; pos >= 0; pos -= 5) { // goes from 0 degrees to 180 degrees

    // in steps of 1 degree

    myservo.write(pos);              // tell servo to go to position in variable 'pos'

    delay(15);                       // waits 15ms for the servo to reach the position

  }

}

void ServoClose()

{

  for (pos = 0; pos <= 180; pos += 5) { // goes from 180 degrees to 0 degrees

    myservo.write(pos);              // tell servo to go to position in variable 'pos'

    delay(15);                       // waits 15ms for the servo to reach the position

  }

  }

}

void Open()

{

  lcd.setCursor(0, 0);

  lcd.print(" Enter Password");

  customKey = customKeypad.getKey();

  if (customKey) // makes sure a key is actually pressed, equal to (customKey != NO_KEY)

  {

    Data[data_count] = customKey; // store char into data array

    lcd.setCursor(data_count, 1); // move cursor to show each new char

    lcd.print(Data[data_count]); // print char at said cursor

    data_count++; // increment data array by 1 to store new char, also keep track of the number of chars entered

  }

  if (data_count == Password_Lenght - 1) // if the array index is equal to the number of expected chars, compare data to master

  {

    if (!strcmp(Data, Master)) // equal to (strcmp(Data, Master) == 0)

    {

      lcd.clear();

      ServoOpen();

      lcd.print("  Door is Open");

      door = 0;

    }

      lcd.clear();

      lcd.print("  Wrong Password");

      delay(1000);

      door = 1;

    }

    clearData();

  }

    Else

{}

 

So, that was all for today. In the next post, I will provide a detailed explanation of this code, as this post has already gone too long. Will see you guys in the next tutorial. Take care !!!

DesignSpark Electrical Logolinkedin