+21622886281
ESP32 HC-SR04 Project Servo motor

Realization of an automatic parking barrier with ESP32

Presentation of automatic parking barrier

An automatic parking barrier is a type of gate that is used to control access to a parking lot or garage. It typically consists of a barrier arm that is raised and lowered using an electric motor or hydraulic actuator, and is controlled by a computer or microcontroller.

An automatic parking barrier system can be activated by various means such as a remote control, a keypad, a card reader, or a mobile application. It can also be integrated with other systems such as access control systems, cameras, or license plate recognition systems.

The system can be designed to automatically raise the barrier arm when a vehicle approaches, and lower it again once the vehicle has passed through. The system can also be set up to only allow access to authorized vehicles, such as those with a valid parking permit or those that have paid for parking.

Automatic parking barriers can be used in a wide variety of settings, such as parking lots, garages, gated communities, and commercial or industrial properties. They can also be used to control access to restricted areas, such as loading docks or service entrances.

When using an automatic parking barrier, it’s important to ensure that the system is properly installed, configured, and maintained to ensure proper operation and to prevent accidents. Additionally, it’s important to ensure that the system is compliant with local laws and regulations, and that it meets safety standards.

Automatic parking barrier controlled by ESP32

An automatic parking barrier system can be controlled by an ESP32 microcontroller, which can be programmed to activate the barrier arm when a vehicle approaches, lower it again once the vehicle has passed through, and control the access by various means. The ESP32 can be connected to various sensors, such as ultrasonic or infrared sensors, to detect the presence of a vehicle and trigger the barrier arm to open or close.

To control the barrier arm, the ESP32 can be connected to an electric motor or a hydraulic actuator using a motor driver or an H-bridge. The ESP32 can be programmed to control the speed and direction of the motor, and to monitor the position of the barrier arm.

The system can be configured to be activated by various means such as a RFID reader, a barcode scanner, a keypad, or a mobile application. The ESP32 can be programmed to read the data from these devices and determine whether the vehicle is authorized to enter the parking lot or not.

Additionally, the system can be configured to work with other systems such as an access control system, cameras, or license plate recognition systems. The ESP32 can communicate with these systems using various protocols such as HTTP, MQTT, or Bluetooth.

When using an ESP32 to control an automatic parking barrier, it’s important to ensure that the system is properly programmed, configured, and maintained to ensure proper operation and to prevent accidents. Additionally, it’s important to ensure that the system is compliant with local laws and regulations, and that it meets safety standards.

Objective of this project:

In this project we will simulate an automated parking barrier with the ESP32 card. This model shows the general operation of the automated systems that allow access to public parks found in stations, airports, cinemas, supermarkets, etc.

Our barrier opens using a servomotor when the HC-SR04 sensor detects a vehicle and closes automatically otherwise.

Necessary components

ESP32

The ESP32 is a low-cost, low-power microcontroller with built-in Wi-Fi and Bluetooth capabilities. It is a popular choice for IoT projects and is commonly used for a variety of applications such as home automation, wireless control, and sensor data logging. The ESP32 features a dual-core processor, a rich set of peripherals, and support for a wide range of protocols. It can be programmed using the Arduino IDE and various other programming languages such as C, C++, and MicroPython.

Additionally, the ESP32 has a wide range of features including:

  • A high-performance processor with a clock speed of up to 240 MHz
  • Support for various types of wireless connectivity such as Wi-Fi, Bluetooth, and Bluetooth Low Energy (BLE)
  • Multiple communication interfaces such as I2C, SPI, UART, and I2S
  • A large number of GPIO pins to connect to external devices and sensors
  • A built-in security module for secure communication

The ESP32 is often used in projects where a low-cost, low-power device with Wi-Fi and Bluetooth capabilities is needed, and it is commonly used with other sensors and devices to build IoT projects, home automation systems, wireless control systems, and data logging systems.

HC-SR04 sensor

The HC-SR04 sensor is an ultrasonic sensor that can be used in an automatic parking barrier system to detect the presence of a vehicle. This sensor works by emitting a high-frequency sound wave and measuring the time it takes for the sound wave to bounce back. By measuring the time it takes for the sound wave to return, the sensor can determine the distance to an object.

When used in an automatic parking barrier system, the HC-SR04 sensor can be positioned to detect a vehicle as it approaches the barrier. The sensor can be connected to the ESP32 microcontroller and programmed to trigger the barrier arm to open when a vehicle is detected and to close again when the vehicle has passed through.

Servomotor

A servomotor can be used in an automatic parking barrier system to control the movement of the barrier arm. A servomotor is a type of motor that can be controlled to rotate to a specific position, making it well suited for precise control of the barrier arm.

When used in an automatic parking barrier system, the servomotor can be connected to the ESP32 microcontroller and programmed to rotate to a specific position to open or close the barrier arm. The ESP32 can be programmed to control the speed and position of the servomotor, and to monitor the position of the barrier arm.

Barrier in the form of a pen

Connecting wires

Connecting wires refers to the process of physically connecting wires or cables to a device or circuit in order to establish an electrical connection. This can be done by using various connectors such as plugs, sockets, or terminal blocks. The wires are typically color-coded to indicate their function, such as red for power, black for ground, and yellow for signals.

Test plate 

A test plate is a type of circuit board that is used to test electronic components. It typically consists of a flat board made of a non-conductive material, such as plastic or fiberglass, with a number of holes or pads that are used to connect electronic components. The test plate allows you to connect electronic components and test them easily.

Mounting of Parking

To perform the assembly, you can connect

For HC-SR04 sensor:

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

  • the Trig pin to pin D5 of the ESP32 board

  • the ECHO pin to pin D18 of the ESP32 board

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

For servo motor:

  • red wire: power supply wire to be connected to the (+) terminal of a 9V battery

  • brown wire: wire to be connected to the GND terminal of the ESP32 board

  • Yellow wire: Positioning signal wire connected to pin D4 of the ESP32 board

Micropython program

Here is the program for the automated parking system controlled by the ESP32 card:




0 commentaire


Leave a comment

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

Scroll to Top