+21622886281
ESP32 Industry Keypad 4x4 Project

Door security system controlled by ESP32

A door security system is a device or system that is used to secure a door and prevent unauthorized access. There are several different types of door security systems, including keyless entry systems, keypad entry systems, and biometric systems.

Here are some examples of how a door security system might be used:

  1. Securing a home or office: A door security system can be used to secure the doors of a home or office and prevent unauthorized access.
  2. Controlling access to a building or facility: A door security system can be used to control access to a building or facility by allowing only authorized personnel to enter.
  3. Monitoring access to a restricted area: A door security system can be used to monitor access to a restricted area and record when people enter or leave.
  4. Sending alerts: A door security system can be configured to send alerts if the door is opened unexpectedly or if an unauthorized person attempts to enter.

By using a door security system, you can secure your doors and control access to your home, office, or other building. You can also monitor access to restricted areas and receive alerts if there is unusual activity.

The ESP32 is a microcontroller that can be used to control and monitor various devices and systems, including a door security system. By using the ESP32, you can create a door security system that can detect when a door is opened or closed and take appropriate actions based on the status of the door.

Purpose of this project:

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

An ESP32 card is a physical device that includes an ESP32 microcontroller and associated components, such as memory and input/output (I/O) pins. These cards are typically designed to be easily integrated into a project or prototype, and can be plugged into a breadboard or other prototyping platform.

ESP32 cards are often used in Internet of Things (IoT) projects, as the ESP32 microcontroller has built-in WiFi and Bluetooth capabilities, making it well suited for connecting to the internet and communicating with other devices wirelessly. These cards may also include additional features such as sensors, OLED displays, or other components that can be used in a project.

4×4 keypad

A 4×4 keypad is a device that consists of a grid of 4 rows and 4 columns of buttons, for a total of 16 buttons. It is commonly used as an input device for electronic projects and can be used to enter numbers, characters, or commands.

To use a 4×4 keypad, you will need to connect it to your project using wires. Each button on the keypad is connected to a row and a column on the keypad matrix. To determine which button has been pressed, you can scan the rows and columns of the matrix and look for a low voltage.

Display SSD1306

The SSD1306 is a monochrome OLED (organic light-emitting diode) display controller, which is used to control small OLED displays. These displays are often used in small, portable electronic devices, such as smartphones, smartwatches, and other wearables. They are known for their high contrast, wide viewing angles, and low power consumption, making them a popular choice for display applications.

The SSD1306 controller is used to communicate with the OLED display and to control the display’s contents. It is a small, low-power device that is typically driven by an external microcontroller, such as ESP32. The controller receives data from the microcontroller and sends it to the OLED display, which then displays the data as an image or text.

L298N motor board

The L298N is a dual H-bridge motor driver IC that is commonly used to control the speed and direction of small DC motors, as well as to drive stepper motors. It can also be used to control the speed and direction of larger motors, such as those found in electric vehicles, by using external power MOSFETs.

The L298N has a number of input and output pins that can be used to control the motors and monitor their status. It can be driven by a microcontroller, such as an Arduino, or by other digital logic devices. The L298N can be used to drive motors in both forward and reverse directions, and the speed of the motors can be controlled by adjusting the duty cycle of the control signals.

5V DC motor

A 5V DC motor is a type of electric motor that operates on direct current (DC) voltage. It is a small motor that typically runs on 5V of power, although the voltage may vary slightly depending on the specific motor and the load it is driving. These motors are often used in small electronic devices, such as portable fans, toys, and robotic applications. They are generally very reliable, efficient, and simple to control, making them a popular choice for many different types of projects and applications.

test plate

A test plate is a type of device used in robotics to test the functionality and performance of various components or systems. It is typically a physical platform or structure that is designed to hold and support various test items or devices, such as sensors, actuators, motors, or other types of mechanical or electrical components. Test plates can be used to simulate different environments or conditions, such as temperature, humidity, vibration, or other factors, in order to evaluate the performance of the components or systems being tested. They can also be used to perform a variety of diagnostic or diagnostic tests, such as stress testing, endurance testing, or other types of evaluations.

connecting wires

Wires are used to transmit electrical signals and power to various components such as motors, sensors, and microcontrollers. It’s important to properly route and secure the wires to prevent tangles and damage. There are several methods for doing this, including using cable ties, clamps, and wire looms. It’s also a good idea to use different colors or labeling to identify the different wires and their functions. When connecting wires in a robot, it’s important to follow proper safety procedures, such as using the correct wire stripper and connectors, and wearing protective equipment such as gloves and safety glasses.

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:




2 commentaires

Ashly 04-07-2222

Having read this I thought it was extremely enlightening. I appreciate you finding the time and energy to put this content together. I once again find myself spending a significant amount of time both reading and posting comments. But so what, it was still worth it!

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