learnbywatch
Play Video

Arduino Keypad Door Lock

After watching this video you will be able to:

No data was found

You can Open or Close a lock using keypad with the help of  Arduino. All you need is an Arduino, servo motor and Keypad. In this video, we are going to show you how to make an arduino project for home automation to open or close door using a password. Write a program to take input from keypad and open or close the door based on the password received from smartphone. Let’s look at the required components:

What is your goal?

No data was found

16 thoughts on “Arduino Keypad Door Lock”

  1. please give us the source code.
    u did’nt shared the source code and without it your project will go in vain.
    which one you shared in Youtube is not working (uploading error).
    please give me the modified one which one is workable .
    mail me at shakhawat.eu@gmail.com
    thanks

  2. #include
    #include
    #include
    Servo servo1;
    Password password = Password( “3262” );
    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] = {3, 2, A1, A2 };
    byte colPins [COLS] = {7, 6, 5, 4};
    Keypad keypad = Keypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS);
    void setup() {
    Serial.begin(9600);
    servo1.attach(9);
    keypad.addEventListener (keypadEvent);
    }
    void loop() {
    keypad.getKey();
    }
    void keypadEvent (KeypadEvent eKey) {
    switch (keypad.getState()){
    case PRESSED:
    switch (eKey) {
    case ‘*’: checkPassword(); break;
    case ‘1’: password.reset();servo1.write(90);break;
    default: password.append(eKey);
    }
    }
    }
    void checkPassword(){
    if (password.evaluate()){
    servo1.write(180);
    } else {
    servo1.write(90);
    }
    }

  3. code don´t work error message at line ” case ‘1’: password.reset();servo1.write(90);break;”
    stray 342 in program

Comments are closed.

Micro Courses using this Video

No data was found
Scroll to Top
Scroll to Top