Door opening controlled by ESP32 and 4×3 matrix keypad

ESP32 06-05-25
288 0

Tutorial plan

1- Secure access system using digital keypad

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

3- Required Components

4- Circuit Connections of system

5- Micropython program of system

 

Secure access system using digital keypad

A Secure Access System using a Digital Keypad is an electronic security mechanism designed to restrict entry to authorized individuals by requiring them to input a specific code through a digital keypad. This system is commonly used in homes, offices, laboratories, and other restricted areas. Below is a detailed description of such a system from a general perspective:

The Secure Access System using Digital Keypad is an authentication-based system where access is granted only if the correct passcode is entered on the keypad. The system typically involves a microcontroller (like Arduino, ESP32, or Micro:bit), a keypad (usually 4x4 or 4x3), a display (LCD/OLED), and an actuator (such as a servo motor, magnetic lock, or relay) to physically unlock the door or gate.

Working Principle

1- Initialization

System boots up and displays a prompt (e.g., “Enter Password”).

2- Code Entry

User enters a pre-set code using the keypad.

Each keypress is registered by the microcontroller and optionally displayed as * for security.

3- Code Verification

The entered code is compared with a stored password.

The password can be hard-coded or stored in EEPROM or an external memory module.

4- Access Decision

- If the code matches:

The actuator (e.g., servo motor) is triggered to unlock the door.

A message like “Access Granted” is shown.

- If the code is incorrect:

A warning is shown (e.g., “Access Denied”), and optionally a buzzer sounds.

5- Security Features (optional)

- Limited number of attempts before lockout.

- Delay between failed attempts.

- Alarm trigger after several wrong entries.

- Logging access attempts to memory or cloud.

Advantages

- Simple and effective: Easy to implement and use.

- No keys needed: Eliminates the need for physical keys.

- Customizable: Codes can be changed easily without replacing hardware.

- Secure: With proper safeguards like limited attempts, it offers decent protection.

 

How open a door using ESP32 board and 4x3 matrix keypad ?

To design a secure electronic door lock system that allows access only when the correct password is entered through a 4x3 matrix keypad. The ESP32 microcontroller processes the input, and if the password is correct, it activates a servo motor to unlock the door. A 16x2 I2C LCD display provides real-time feedback to the user.

Working Principle

1- Startup:

- The system initializes all components.

- The LCD displays: “Enter Password”.

2- User Input:

- User enters a numeric password using the keypad.

- The LCD displays * for each digit to hide the input.

3- Password Verification:

- After entering the password and pressing a specific key (e.g., #), the ESP32 compares the input with the stored password.

4- Door Control:

- Correct password: The servo motor rotates to unlock position (e.g., 90°), LCD shows “Access Granted”, then after a few seconds returns to locked position (0°).

- Wrong password: LCD displays “Access Denied”, and servo remains locked.

 

Required Components

1. ESP32 Development Board

Function: Acts as the brain of the system. It processes keypad inputs, controls the servo motor, and communicates with the LCD.

2. 4x3 Matrix Keypad

Function: Used by the user to enter a numeric password.

Working: When a key is pressed, it connects a specific row and column, which the ESP32 detects via GPIO scanning.

3. LCD Display (with I2C Module)

Pinouts of 1602 LCD display with I2C

Function: Displays messages like "Enter Password", "Access Granted", or "Access Denied".

4. SG90 Servo Motor

Function: Acts as the physical door lock actuator. Rotates to unlock and lock 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 I2C LCD display

LCD I2C Pin

ESP32 pin

VCC

5 volt

GND

GND

SDA

GPIO 21

SCL

GPIO 22

Connection of servo motor

Servo motor

ESP32

Brown wire (-)

GND

Red wire (+)

5V

Yellow wire (Signal)

GPIO 23

Connection of matrix keypad

4x3 Matrix Keypad

ESP32 board

Pin 1 (located on the left)

GPIO 19

Pin 2

GPIO 18

Pin 3

GPIO 5

Pin 4

GPIO 17

Pin 5

GPIO 16

Pin 6

GPIO 4

Pin 7

GPIO 2

 

Micropython program of system

Before running the code, install the necessary libraries:

- DIYables_MicroPython_Keypad (for matrix keypad)

- i2c_lcd and lcd_api (for I2C LCD screen)

- Servo (for servo motor)

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