Creatjet3D-Labsmunazirali4793
Published © GPL3+

Keyless Door Locking System Using Arduino and 4x4 KeyPad

In this project, we're going to make a keyless door lock system that uses a 4X4 keypad to enter the keys and a servo motor to open or close.

IntermediateFull instructions provided660
Keyless Door Locking System Using Arduino and 4x4 KeyPad

Things used in this project

Hardware components

Arduino UNO & Genuino UNO
Arduino UNO & Genuino UNO
×1
Servos (Tower Pro MG996R)
×1
Jumper wires (generic)
Jumper wires (generic)
×1
Breadboard (generic)
Breadboard (generic)
×1
5 mm LED: Red
5 mm LED: Red
×1
5 mm LED: Yellow
5 mm LED: Yellow
×1
Buzzer
Buzzer
×1
Standard LCD - 16x2 White on Blue
Adafruit Standard LCD - 16x2 White on Blue
×1

Software apps and online services

Blynk
Blynk

Story

Read more

Code

Source code

C/C++
#include<LiquidCrystal.h>

LiquidCrystal lcd(2,3,4,5,6,7);

int i=0;
int ok,cancel,up,down;
char  count[4];
char  count1[4];
char buffer1[20];
void setup() {
  // put your setup code here, to run once:
lcd.begin(16,2);
lcd.setCursor(0,0);
lcd.print("   Login pswd   ");

pinMode(A0,INPUT_PULLUP);
pinMode(A1,INPUT_PULLUP);
pinMode(A2,INPUT_PULLUP);
pinMode(A3,INPUT_PULLUP);

count[0]='0';
count[1]='0';
count[2]='0';
count[3]='0';

}

void loop() {
  // put your main code here, to run repeatedly:
while(1)
{  
ok=digitalRead(A0);
cancel=digitalRead(A1);
up=digitalRead(A2);
down=digitalRead(A3);
if (ok==LOW)
{ 
  while(digitalRead(A0)==LOW);
  count1[i]=count[i];
  count[i]='*';
  i++;
  
  if (i>=4)
  break;
  
  }
if (cancel==LOW)
{ 
  while(digitalRead(A1)==LOW);
  break;

  }
if (up==LOW)
{ 
  while(digitalRead(A2)==LOW);
  count[i]++;
  if(count[i]>'9')
  count[i]='0';

  }
if (down==LOW)
{ 
  while(digitalRead(A3)==LOW);
  count[i]--;
  if(count[i]<'0')
  count[i]='9';

  }
sprintf(buffer1,"      %c%c%c%c      ",count[0],count[1],count[2],count[3]);  
lcd.setCursor(0,1);
lcd.print(buffer1);
}

if((count1[0]=='1')&&(count1[1]=='2')&&(count1[2]=='3')&&(count1[3]=='4'))
{
lcd.setCursor(0,0);  
lcd.clear();
lcd.print("Successfully done ");
  }
  else
  {
lcd.clear();
lcd.print("faild ");
    }
while(1);

}

Credits

Creatjet3D-Labs

Creatjet3D-Labs

0 projects • 6 followers
munazirali4793

munazirali4793

0 projects • 4 followers

Comments

Add projectSign up / Login