Back to School with STEM-Limited-Time Event(Aug 6-Sep 5)

user-img

Dharani Creations

+ Follow

Arduino Keypad Door Lock System

This project demonstrates a basic electronic security system using an Arduino Uno, a 4x4 keypad, and a relay-controlled electric lock. When a predefined PIN code is entered correctly on the keypad, the Arduino activates a relay that unlocks the door for a short duration, then automatically locks it again. If an incorrect code is entered, access is denied. This system can be expanded with features like an LCD display, buzzer alerts, multiple user PINs, and tamper detection.

Arduino Keypad Door Lock System
 
  • thumbnail-img
  • thumbnail-img
  • thumbnail-img
 

Hardware Components

  • Arduino UNO R3

    X 1
  • Electromagnetic Lock

    X 1 fenxiang
  • 4 by 4 Keypad

    YTF
    X 1 fenxiang
  • 12v Relay Module 10a

    X 1
  • Power Supply SMPS 5V 12V 24V AC-DC 220V TO 12V 24V 5V 1A 1.5A 2A

    X 1 fenxiang
  • Jumper Wires

    X 1

Tools, APP Software Used etc.

  • Arduino IDE

    Arduino IDE

    Arduino
  • Fritzing

Story

 

 

Project Title: Arduino-Based Keypad Door Lock System

Overview:
This project demonstrates a basic electronic security system using an Arduino Uno, a 4x4 keypad, and a relay-controlled electric lock. When a predefined PIN code is entered correctly on the keypad, the Arduino activates a relay that unlocks the door for a short duration, then automatically locks it again. If an incorrect code is entered, access is denied. This system can be expanded with features like an LCD display, buzzer alerts, multiple user PINs, and tamper detection.

Key Project Components & Functionality

Component Purpose
Keypad Captures user input of numeric code
Arduino Uno Processes input, compares against stored PIN, and activates relay
Relay Module Safely switches high-current for electric lock
Electric Lock Locks/unlocks door via electric signal powered through relay
LCD & Buzzer (Optional) Displays prompts, confirms or denies access via sound and visual feedback
Power Supply Typically 5 V for Arduino; 12 V for many electric locks

Workflow:

  1. Arduino reads each keypress from the keypad.

  2. Entered code is stored in memory.

  3. Once confirmed (e.g. by pressing ‘#’ key), Arduino verifies the PIN.

  4. If correct: activate relay to unlock for ~X seconds (configurable).

  5. If incorrect: deny access, optionally trigger buzzer.


Implementation Steps (as shown in the video)

  1. Wiring setup

    • Connect keypad rows/columns to Arduino digital pins.

    • Hook relay IN pin to Arduino output, relay’s NO/NC lines to lock supply.

    • (Optional) Attach LCD and buzzer for user interface.

  2. Arduino Code Structure

    • Libraries: <Keypad.h>, optionally <LiquidCrystal.h>

    • Define keypad layout, PIN code, and timing for unlock.

    • Loop logic:

      • Scan keypad input

      • Build code string

      • Upon entry complete, perform PIN check

      • Trigger relay if correct, else deny

  3. Testing & Adjustment

    • Power supply management: ensure lock and Arduino have correct voltage levels.

    • Test with correct and incorrect codes.

    • Fine‑tune unlock duration and error handling.

  4. Safety Enhancements (optional)

    • Add a mechanical override or backup power.

    • Store PIN securely; avoid hardcoding in plaintext.

    • Add tamper or failed‑attempt alert.


Optional Enhancements & Ideas

  • Multiple user PINs with different access levels

  • Tamper lockout after multiple wrong attempts

  • Wireless control via Bluetooth/Wi‑Fi (e.g. ESP8266 module)

  • Logging events to SD card or server for audit trail

  • App-based control, using mobile interface or RFID/NFC integration


What You’ll Learn

 

  • Interfacing numeric keypad with Arduino

  • Interfacing relay module to control high‑power devices

  • Basic code structure for PIN authentication

  • Relay timing and safety considerations

  • Optional feedback with LCD and buzzer

Working Principle:

  1. User inputs a numeric password via the keypad.

  2. Arduino compares it with a predefined PIN.

  3. If correct → relay is triggered → door unlocks.

  4. If incorrect → system denies access.

  5. After a set time, the system re-locks the door.

Applications:

  • Home or office door automation

  • Basic IoT security projects

  • School/college mini-projects

Skills Demonstrated:

  • Embedded programming (Arduino)

  • Use of digital I/O, keypad matrix scanning

  • Relay and electric lock control

  • Basic security logic design

Code
  • CODE

    https://github.com/DharaniCreations/Arduino-Keypad-Door-Lock-System/blob/main/Arduino_keypad_lock.ino
    View
Schematic and Layout
  • DIAGRAM

    https://github.com/DharaniCreations/Arduino-Keypad-Door-Lock-System/blob/main/Graphic1.JPG
    View

Arduino Keypad Door Lock System

This project demonstrates a basic electronic security system using an Arduino Uno, a 4x4 keypad, and a relay-controlled electric lock. When a predefined PIN code is entered correctly on the keypad, the Arduino activates a relay that unlocks the door for a short duration, then automatically locks it again. If an incorrect code is entered, access is denied. This system can be expanded with features like an LCD display, buzzer alerts, multiple user PINs, and tamper detection.

85
 
8
0
0

Share your project on social media to expand its influence! Get more people to support it.

  • Comments( 0 )
  • Like( 8 )
/1000
Upload a photo:
You can only upload 1 files in total. Each file cannot exceed 2MB. Supports JPG, JPEG, GIF, PNG, BMP

You May Also Like

View All
Add to cart
Board Type : GerberFile :
Layer : Dimensions :
PCB Qty :
Different PCB Design
PCB Thickness : PCB Color :
Surface Finish : Castellated Hole :
Copper Weight : 1 oz Production Time :
Total: US $
As a sharing platform, our community will not bear responsibility for any issues with this design and parameters.

PCB Assembly

PCBA Qty: BomFile:
NO. OF UNIQUE PARTS: NO. of Components:
Country: Shipping Way:
Assembly Cost: US $
As a sharing platform, our community will not bear responsibility for any issues with this design and parameters.
Add to cart
3dPrintingFile : Size :
Unit : Volumn :
3D Printing Qty : Material :
Total: US $12.99
As a sharing platform, our community will not bear responsibility for any issues with this design and parameters.
Add to cart
Acrylic Type : AcrylicFile :
Dimensions: Engrave:
Acrylic Qty :
Acrylic Thickness:
Acrylic Color:
Total: US $12.99
As a sharing platform, our community will not bear responsibility for any issues with this design and parameters.
Add to cart
CNC Milling File : Size:
Unit: Volumn:
CNC Milling Qty : Material:
Type of Aluminum: Surface Finish:
Tolerance:
Surface Roughness:
Total: US $12.99
As a sharing platform, our community will not bear responsibility for any issues with this design and parameters.
Add to cart
Item Price Qty Subtotal Delete
Total: US $0.00
Certified Product | Supported Purchase: Full After-sales Protection