+21622886281
ESP32 Industry Keypad 4x4 Project

Door security system controlled by ESP32

Purpose of this project:

In today’s life everything becomes simple and advanced, previously to lock something we used to have padlocks, combination locks. But due to the increase in theft and technology, new types of locks such as electronic locks, smart locks have been invented and people are widely using them to protect their property.

In this project, we will build a password-based door lock system by interfacing the ESP32 board with a 4×4 keypad to enter the password.

We use a sliding door opening or closing by horizontal translation thanks to a 5V DC motor.

With this project, we can build a security system that works with a password. We must enter a code to close or open the door.

Description of how the door security system works

Necessary components:

  • ESP32 card
  • 4×4 keypad
  • L298N motor board

  • 5V DC motor

  • connecting wires

Assembly of the ESP32 board with the SSD1306 display and the 4×4 keyboard:

We connect the 8 outputs of the keyboard to the 8 pins of the ESP32 card following this order: D2, D4, D5, D18, D19, D16, D15 and D23.

For the SSD1306 display we connect:

  • the SDA pin to the D21 pin of the ESP32 board

  • the SCL pin to the D22 pin of the ESP32 board

  • the GND pin to the GND pin of the ESP32 board

  • the VCC pin to the 5V pin of the ESP32 board

Assembly of the ESP32 board with the L298N board and the motor:

  • Connect pin 17 of the ESP32 board to the ENA pin of the L298N module.

  • Connect pin 3 of the ESP32 board to pin IN1 of the L298N module.

  • Connect pin 1 of the ESP32 board to pin IN2 of the L298N module.

  • Connect the GND pin of the ESP32 board to the GND pin of the L298N module.

  • Connect the GND pin of the ESP32 board to the (-) terminal of the 9V battery

  • Connect the 12V pin of the L298N module to the (+) terminal of the 9V battery

  • Connect the two motor terminals to the two pins OUT1 and OUT2 of the L298N module

Micropython Program

Here is the micropython program which allows to open or close the door by the ESP32 card.

Note: the following two libraries must be imported: ssd1306 and dcmotor

esp32-door.py:




1 commentaire

Ricardo 09-06-2222

It's in reality a nice and useful piece of info. I am happy that you shared this helpful information with us.


Leave a comment

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

Scroll to Top