0% found this document useful (0 votes)
112 views

Door Lock System Using ARDUINO: Name: Anjali Deore Div: C Roll:39

An Arduino-based door lock system is implemented using a servo motor, keypad, and Arduino UNO. The system opens the door lock when the correct 3-digit password is entered on the keypad by turning the servo motor. Initially the servo motor is closed. When the correct password is typed, the servo motor opens and the door is unlocked.

Uploaded by

ANJALI DEORE
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
112 views

Door Lock System Using ARDUINO: Name: Anjali Deore Div: C Roll:39

An Arduino-based door lock system is implemented using a servo motor, keypad, and Arduino UNO. The system opens the door lock when the correct 3-digit password is entered on the keypad by turning the servo motor. Initially the servo motor is closed. When the correct password is typed, the servo motor opens and the door is unlocked.

Uploaded by

ANJALI DEORE
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 6

Name: Anjali Deore

Div: c
Roll:39

Door lock system Using ARDUINO


//Implementation on tinkercad//
Components used:
Arduino UNO
Servo motor
Keypad
Jumper wires
Screenshot of the implementation.
Working description:
Typing correct password will open the door lock.
Initially servo motor is closed
As soon as we type the correct password, the servo
motor gets opened

Program :
#include <Servo.h>
#include <Keypad.h>
Servo ServoMotor;
char* password ="888";
int position=0;
const byte ROWS=4;
const byte COLS=4;
char keys[ROWS][COLS]={
{'1','2','3','A'},
{'4','5','6','B'},
{'7','8','9','C'},
{'*','0','#','D'},
};
byte rowPins[ROWS]={8,7,6,9};
byte colPins[COLS]={5,4,3,2};
Keypad keypad=Keypad(makeKeymap(keys),
rowPins,colPins,ROWS,COLS);
int RedpinLock =12;
int GreenpinUnlock=13;

void setup()
{
ServoMotor.attach(11);
LockedPosition(true);

void loop()
{
char key =keypad.getKey();
if(key =='*'||key =='#')
{
position=0;
LockedPosition(true);

}
if(key ==password[position])
{
position++;
}
if(position==3)
{
LockedPosition(false);
}
delay(100);
}
void LockedPosition(int locked)
{
if(locked)
{
digitalWrite(RedpinLock,HIGH);
digitalWrite(GreenpinUnlock,LOW);
ServoMotor.write(11);
}
else{
digitalWrite(RedpinLock,LOW);
digitalWrite(GreenpinUnlock,HIGH);
ServoMotor.write(90);
}
}

You might also like