ArdLock – Build An Arduino Door Lock

This a door lock built as fun project. It is quite easy to build and a fun way to learn and improve your knowledge of Arduino. I tried to add a 16*2 display but there weren’t enough GPIO pins on Arduino Uno. If You are interested in adding a display you would need an Arduino Mega.

ArdLock – Arduino Door Lock

Items Needed

Arduino UNO

Jumper wires

Servo(or any other component to open a door lock like a linear actuator)

Keypad(I used a 4*3 keypad)


Resistor(1k or 2k)


Get your Code

Get your code from-

Tip-You can use a 4*4 keypad too just by not using the last column.

Installing the library

Copy the keypad folder to Library folder under Arduino folder(under>program files>Arduino) .

Step 1: Connecting the Keypad to Arduino

At first you would like to connect a keypad and test if it is working flawlessly and to check your connections.

Connect your keypad through keypad pins to Arduino pins 3 to 9(row pins to 3-6)(column pins to 7-9).You can verify your connections by seeing the color code of wires used.

Seeing the output

Use the Hello_keypad.ino code from the library to test for proper connections.(file>examples>Keypad(scrolldown)>hello_keypad)This code gives the button pressed on the serial monitor.

First you open the code in Arduino IDE and then upload it onto your Arduino, then open the serial Monitor(button on the upper right corner).Then test by pressing a button and then observing the input on the serial monitor.

Tips for the main code

In the main code the previous character is deleted by pressing the * key.

Step 2: Building the Button

Do not remove the connections to the keypad while testing the button.

Our doorlock has a button to open or close a door from the inside. I built it using a pushbutton. As Arduino reads voltages form a closed circuit we create a Circuit with a resistor.

The code to test if the button works is given in this segment.

Test the code before going forward.

Read more: ArdLock – Build An Arduino Door Lock


About The Author

Ibrar Ayyub

I am an experienced technical writer holding a Master's degree in computer science from BZU Multan, Pakistan University. With a background spanning various industries, particularly in home automation and engineering, I have honed my skills in crafting clear and concise content. Proficient in leveraging infographics and diagrams, I strive to simplify complex concepts for readers. My strength lies in thorough research and presenting information in a structured and logical format.

Follow Us:

Leave a Comment

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

Scroll to Top