Door opening controlled by Arduino and 4×3 matrix keypad

Arduino UNO 30-04-25
16 0

Tutorial plan

1- Secure access system using digital keypad

2- How open a door using Arduino and 4x3 matrix keypad ?

3- Required Components

4- Circuit Connections of system

5- Arduino program of system

 

 

Secure access system using digital keypad

A secure access system using a digital keypad is an electronic security solution designed to restrict entry to a building, room, device, or system. Users must enter a correct numeric or alphanumeric password using a keypad to gain access. If the code entered is correct, the system unlocks a door, enables a device, or performs a predefined secure action. If the code is wrong, the system may deny access, sound an alarm, or lock the system temporarily.

The main goal of a secure access system is to control and monitor access to restricted areas, ensuring only authorized individuals can enter or use the system. These systems are commonly found in homes, office buildings, laboratories, server rooms, ATMs, and safes.

Working Principle

1- Input: The user enters a code via the keypad.

2- Processing:

The microcontroller reads the input.

It compares the entered code to a stored (preset) password.

3- Decision:

If the code matches: it activates a relay/servo motor to unlock a door or enable a system.

If the code is incorrect:

It may allow retrying a limited number of times.

It may activate a buzzer or alarm.

It may enter a lockout mode after repeated failures.

4- Feedback: The system provides real-time feedback through a display, buzzer, or LEDs.

Applications

- Home and office door locks

- School and university labs

- Lockers and safes

- Industrial machinery controls

- ATMs and banking terminals

- Hotel room access systems

 

How open a door using Arduino and 4x3 matrix keypad ?

To build a secure access system that opens a door using a servo motor when a correct password is entered via a 4x3 matrix keypad. An LCD display provides visual feedback (e.g., password input, access granted or denied).

Working Principle:

1- User enters a password using the 4x3 keypad.

2- The Arduino compares the entered password with a predefined password stored in the code.

3- If the password is correct:

- LCD displays “Access Granted”

- Servo motor rotates to unlock position (e.g., 20°)

4- If we press the button 0 of keypad , it returns to the lock position (85°)

5- If the password is incorrect:

- LCD displays “Access Denied”

- System resets for a new attempt

 

Required Components

1. Arduino UNO

Arduino Uno

Type: Microcontroller board based on the ATmega328P.

Function: Acts as the brain of the project. It reads the keypad input, processes the password, controls the servo motor, and updates the LCD.

2. 4x3 Matrix Keypad

Type: 12-button membrane keypad arranged in 4 rows and 3 columns.

Function: Used for password input. Each key press is sent as a character (e.g., '1', '2', '#') to the Arduino.

3. 16x2 LCD Display (with I2C module)

Pinouts of 1602 LCD display with I2C

Type: Character LCD with 2 lines and 16 characters per line.

Function: Displays system status such as “Enter Password”, “Access Granted”, or “Access Denied”.

4. Servo Motor (e.g., SG90)

Type: Small 180° rotation hobby servo

Function: Simulates a door lock mechanism:

Rotates to 20° when access is granted (unlock)

Returns to 85° to close the door

5. Breadboard 

Breadboard

Breadboard is used for building a non-permanent circuit without soldering.

6. Jumper Wires

Jumper wires

Jumper wires (male-to-male or male-to-female) are used to connect components to the Micro:bit.

7. Wooden house prototype

A miniature wooden house represents a real-world structure.

The door mechanism is attached to a servo motor, which rotates to open or close it.

The wooden prototype provides a stable frame for installing components like the IR sensor and LCD screen.

Circuit Connections of system

Connection of LCD I2C display to Arduino

LCD I2C Display Pin

Arduino Pin

GND

GND

VCC

5V

SDA

A4

SCL

A5

Connection of servo motor to Arduino

Servo motor

Arduino UNO

Brown wire (-)

GND

Red wire (+)

5V

Yellow wire (Signal)

D2

Connection of keypad to Arduino

4x3 Matrix Keypad

Arduino

Pin 1 (right)

Pin 3

Pin 2

Pin 4

Pin 3

Pin 5

Pin 4

Pin 6

Pin 5

Pin 7

Pin 6

Pin 8

Pin 7

Pin 9

 

Arduino program of system

Here is a complete Arduino sketch for your Door Access Control System using keypad, I2C LCD, and Servo motor, with clear comments for each section:

This code uses the MFRC522 library for RFID communication and the LiquidCrystal_I2C library for the LCD display.

1- Open Arduino IDE.

2- Go to Sketch → Include Library → Manage Libraries.

3- Search for keypad and install it.

4- Search for LiquidCrystal_I2C and install it

0 comment

Leave a comment

Veuillez noter s'il vous plaît*

Votre adresse e-mail ne sera pas publiée. Les champs obligatoires sont indiqués avec *

Purpose of this website

Educational robotics refers to the use of robots and robotics technology to promote learning in educational settings. It involves the integration of technology, engineering, and computer science into the classroom, allowing students to engage in hands-on, project-based learning experiences.
In this context, our website represents an excellent resource for parents, teachers and children who wish to discover robotics.

Contact details

Zaouiet Kontech-Jemmel-Monastir-Tunisia

+216 92 886 231

medaliprof@gmail.com

Pictures of the articles

Robotic site created by MedAli-Teacher info