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



This is about me.

This Post Has 16 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

  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?

  6. #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() {
    keypad.addEventListener (keypadEvent);
    void loop() {
    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()){
    } else {

  7. I copied the code, and pasted it as you wrote above. but get the error message stray\342 in program

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

  9. what are the different types libraries required for this?

  10. Password library please

Leave a Reply

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

Close Menu


Close Panel
Skip to toolbar