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

[amazon_link asins=’B00YJ67SYW,B014YUY3RC,B00MTFFAE0,B075GDCYS1,B074J4VTBM|B01LZF1ZSZ,B01AR7YJ3O,B071KJV7DD,B015M1CEIC,B004V40IUS’ template=’ProductGrid’ store=’yogepal-21|yogendrapal-20′ marketplace=’IN|US’ link_id=’55de229f-37cb-11e8-9c49-576111ed658d’]


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

  2. #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 {

Leave a Comment

Your email address will not be published. Required fields are marked *

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

Scroll to Top