Skip to main content

Digital Keypad Security Door Lock

Digital Keypad Security Door Lock using Arduino

Hi everyone, welcome to another blog tutorial,in this tutorial I will teach you how tomake this password enabled entry.


Components:

  • 4X4 matrix keypad
  • membrane keypad
  • 16X2 LCD
  • Arduino
  • Servo Motor
  • Connecting Wires
  • Potentiometer

Circuit Diagram:


Description:

I'm using as an improvised enclosure and this is the door, this is a 4X4 matrix keypad, membrane keypad, this is a 16X2 LCD.So, what this system does is this, like I said it’s a password enabled entry, so, I programmed the system with Arduino, so,when you enter the wrong password using this 4 by 4 matrix keypad the door will not open and the password you entered will be displayed on this LCD, but once you enter the right password, the door will open, then it will remain open for 5 and then close. So, the components or for the parts I usedin the design you can see here I have a motor driver this is a motor driver to drive the motor that opens and closes the door, this is a potentiometer to vary the brightness of the LCD. Here I have an Arduino Uno and I have an I2 CLCD module, I2C module, and here I have a DVD tray, so this tray is serving as the electronic door, it has a motor DC motor, It’s already closed, so, when it is working, this tray will move in this direction and open and when it is to be closed, it will go back to its previous position. I have the 4 by 4 matrix membrane keypad and a liquid crystal display. I have connected it; everything is fine all need to do now is to upload the Arduino code and we will test how the system works so to keep Reading. Alright, I have uploaded the code to the Arduino board and it's good to go, so all I will do now is to enter the password.
Now I programmed it with the password 3142,3142, so, once I enter the right password, I expect this door to open and once I enterthe wrong password, I don't expect it to open. So, let me start by entering the right password first 3-1-4-2, open, you can see it’s open, access granted and then after 5 seconds it closes then, if I enter it again, 3-1-4-2, open,access granted, and then it closes, but if I enter the wrong password, let’s say3-2-5-4 access denied, enter password, 1-4-7-8, access denied, A-B-C-D, access denied, #-*-0-*,access denied, 3-6-9-8, access denied, 4-5-2-1, access denied, 7-8-0-8, anything you entered that is not that right password it will not open, but once you enter the right password,which is 3-1-4-2, Access granted So, it is working perfectly.

Code:

#include <Wire.h> 
#include <LiquidCrystal_I2C.h>
#include <Keypad.h>
#define Password_Length 5 
int signalPin1 = 10;
int signalPin2= 11; 

char Data[Password_Length]; 
char Master[Password_Length] = "3142"; 
byte data_count = 0, master_count = 0;
bool Pass_is_good;
char customKey;

const byte ROWS = 4;
const byte COLS = 4;

char hexaKeys[ROWS][COLS] = {
  {'1', '2', '3', 'A'},
  {'4', '5', '6', 'B'},
  {'7', '8', '9', 'C'},
  {'*', '0', '#', 'D'}
};
byte rowPins[ROWS] = {9, 8, 7, 6};
byte colPins[COLS] = {5, 4, 3, 2};
Keypad customKeypad = Keypad(makeKeymap(hexaKeys), rowPins, colPins, ROWS, COLS);
LiquidCrystal_I2C lcd(0x27, 16, 2);  
void setup(){
  lcd.init(); 
  lcd.backlight();
  pinMode(signalPin1, OUTPUT);
  pinMode (signalPin2, OUTPUT);
}
void loop(){
  lcd.setCursor(0,0);
  lcd.print("Enter Password:");
   customKey = customKeypad.getKey();
  if (customKey){
    Data[data_count] = customKey; 
    lcd.setCursor(data_count,1); 
    lcd.print(Data[data_count]); 
    data_count++; 
    }
   if(data_count == Password_Length-1){
    lcd.clear();

    if(!strcmp(Data, Master)){
      lcd.print("Access Granted");
      digitalWrite(signalPin1,  LOW);
      digitalWrite(signalPin2,HIGH); 
      delay(5000);
      digitalWrite(signalPin1, HIGH);
      digitalWrite(signalPin2,LOW); 
      }
    else{
      lcd.print("Access Denied");
      delay(1000);
      }
    
    lcd.clear();
    clearData();  
  }
}
void clearData(){
  while(data_count !=0){
    Data[data_count--] = 0; 
  }
  return;
}
Now this is to tell you that it is very easy to deign this project, this gives you a basic understanding of how all those smart doors work, all those smart doors that use password enabled entry technology, this is basically how they work. I can scale up this design to control a normal door or a safe box, or anything I want to enable with a password I can do that withthis setup. So, this is how the system works, everythingis fine,the code is given below, visit our website you will find other projects we’ve designed that are Very Wonderful and are very educating .Someone who saw when I was designing the project asked me to incorporate a sensor here so that the sensor will monitor when there is an obstructionas the door is closing, because the door opens very fast and closes fast as well, so, if someone is caught at this end when the door is closing it might be a problem, so, the person asked me to incorporate a sensor that will monitor if there is an obstruction on the way as door is closing , and then if such is the case, then the Arduino should pick the information and tell the door to go back and then wait for another 5 seconds and then closes again, so, I’m thinking of incorporating that very part to this design, so, if you like this project share it with your friends and leave a comment. Thanks for watching and see you in the next tutorial. 

Stay Home Stay Safe!!!

Comments

Post a Comment

If you have any doubts ,Please let me know.

amazon banner

Popular posts from this blog

Motion Detector Camera

Motion Detector With Photo Capture Camera   Hello friends!! Welcome to This Blog. In this Blog, we will make a motion sensor detector with photo capture using ESP32CAM and the PIR module. The logic behind is when the PIR sensor detects any motion, the ESP32CAM will start taking the pictures. So you can use this project as a security camera. In thisblog, I will share the circuitdiagram, Arduino sketch, and the component list, so after reading the complete article you can easily make this project. Now ESP32 CAM is a small camera module that has ESP32S chip on the back and some GPIO pins to connect peripherals and it also has a micro-SD card slot, where you can insert the micro-SD card and store the pictures. Now before going to the circuit diagram and Arduino sketch, let me give you a quick overview of this project.  Components Required ESP32-CAM  PIR Motion Sensor Module BC547 NPN Transistor 220ohm, 1k, 10k Resistor. LED 5-mm FTDI 232 USB to Serial Interface board 5 v...

Automatic Water Tap Control

Automatic Water Tap Control System Using Arduino Hello, viewers welcome to our new project demonstration.The project title is automatic basin tap control system using Arduino with IR obstacle sensor. The project have another part which is detect the motion and control the light automatically.  Let's see how it is made.  Components list: * Arduino Nano * 16*2 LCD display * Water Tap * IR Sensor * 10k potentiometer * PIR Motion Sensor * 5v LED light * 12v Dc water pump * 12v transformer * BC547 Transistor * 4*2 Battery * On/OFF Switch * 10k Resistor * 100ohm resistor * Veroboard * Some Jumper wire For making this project single Arduino nano-board, 16*2 LCD Display. This is a PIR motion sensor and 5v LED light.The power switch for the circuit. This is another PIR motion sensor and 5v LED light. Here we supply the power using two 4V batteries. This is the rectifier circuit with 12V Auto Dc Transformer. Here we connect the 12V dc water pump motor. This IR obstacle sensor and water ...

Wireless Weather Station

Wireless weather station u sing Arduino   Dear friends welcome back! Today we are going to build a wireless weather station project using Arduino.Without any further delay, let’s get started!  A Wireless Weather Station with a big 3.2” Color TFT display. The project is up and running,and it displays the current date and time, the indoor temperature and humidity, and the outdoor temperature and humidity. The readings of the outdoor sensor are updated every second in order to demonstrate that we have a reliable communication link established with the transmitter which is outside at a distance of 5m. The readings of the indoor sensor are updated once every minute. The heart of the project is the fast Arduino Due, there is no flickering of the screen when the values are updated. Let’s now see the transmitter.  The transmitter is much simpler. It consists of an Arduino Nano, a DHT22 sensor and the NRF24L01 wireless transceiver module. The transmitter reads the temperature and ...