Remote-Controlled Door System with ESP32

ESP32 15-04-25
95 0

Tutorial plan

1- Remotely control the opening of a door

2- Remotely Controlling the door with ESP32

3- Required Components

4- Circuit Connections of system

5- Micropython program to control the system

 

 

Remotely control the opening of a door

Remotely controlling the opening of a door using a remote control refers to the ability to unlock or open a door wirelessly using a handheld transmitter device. The remote sends signals to a receiver connected to a door-opening mechanism, such as a servo motor, solenoid lock, or relay-controlled motor.

This system is widely used in home automation, garage doors, electronic gates, smart locks, and secure access control systems.

To implement a remote-controlled door-opening system, the following components are required:

1- Remote Control (Transmitter)

Sends a signal when a button is pressed.

Can use infrared (IR), radio frequency (RF), Bluetooth, Wi-Fi, or Zigbee.

Example: Car key fob, TV remote, RF keychain remote.

2- Receiver Module

Installed near the door.

Receives the signal from the remote and processes it.

Example: IR receiver module (VS1838B), RF receiver (433MHz MX-05V), Bluetooth module (HC-05), Wi-Fi module (ESP32/ESP8266).

3- Microcontroller (if needed for processing signals)

Processes the received signal and activates the motor or lock.

Example: Arduino, ESP32, ESP8266, Micro:bit.

4- Door Opening Mechanism

Servo Motor – Rotates a latch or handle.

Electromagnetic Lock (Solenoid) – Unlocks the door.

Relay-Controlled Motor – Drives an electric motor to open the door.

Remotely Controlling the door with ESP32

This project showcases a smart door control system that allows users to remotely open and close a door using an infrared (IR) remote control. The system is built using an ESP32 microcontroller, which serves as the brain of the operation, coordinating inputs from the KY-032 IR sensor module (used here to detect IR signals from a remote) and controlling a servo motor to physically open or close the door.

An I2C LCD screen is included in the system to provide real-time visual feedback, such as displaying the current state of the door (e.g., "Door Open", "Door Closed", or "Waiting for Command"), as well as any error messages or confirmation prompts.

How It Works ?

1. System Initialization:

The ESP32 initializes all components.

The LCD displays a welcome message like "Remote Door Control Ready..."

2. Listening for IR Remote Commands:

The KY-032 IR sensor continuously listens for incoming IR signals from the remote.

When a valid signal is received (e.g., a specific button press), the ESP32 decodes it using an IR decoding library.

3. Command Processing:

If the command corresponds to "Open Door", the ESP32 sends a PWM signal to rotate the servo motor, opening the door.

If the command is "Close Door", it rotates the servo in the opposite direction to close the door.

Invalid or unrecognized signals are ignored or flagged with a message on the LCD.

4. Status Display:

The LCD I2C screen updates the status in real-time, showing messages like: "Opening Door" or "Door Closed"

 

Required Components

ESP32 card

THE ESP32 card is the main controller, offering Wi-Fi and Bluetooth, but used here primarily for GPIO and control logic.

KY-032 IR Sensor

Capteur infrarouge KY-032

The KY-032 is repurposed to act as an IR receiver that detects signals from an IR remote control.

IR Remote Control

Télécommande infrarouge

The IR Remote Control sends encoded signals (e.g., NEC protocol) to the sensor, which are interpreted by the ESP32.

Servo Motor (e.g., SG90)

The Servo Motor moves the door open or closed based on remote commands.

LCD Display (16x2 or 20x4 with I2C module)

Pinouts of 1602 LCD display with I2C

The LCD display shows the system status and messages.

6. Jumper wires

Fils de connexion

The Jumper wires connect components on a breadboard or directly to the ESP32.

7. Breadboard

Breadboard

The breadboard allows prototyping and easy connection of components without soldering.

8. 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 KY-032 sensor

KY-032

ESP32

GND

GND

(+)

3.3V

OUT

GPIO19

 

Micropython program to control the system

Before running the code, install the necessary libraries:

- Servo (for servo motor)

- i2c_lcd and lcd_api for I2C LCD screen

- ir_rx → for KY-032 sensor

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