Arduino Keypad Door Lock

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:

Required Material to make it yourself

 

admin

This is about me.

This Post Has 8 Comments

  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. Can i get the source code plz

  3. did u get the code

  4. Can i get the source code please ?

  5. Where’s the code?
    Please

  6. #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);
    }
    }

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Close Menu
×

Cart

Skip to toolbar