Control Room Omar
Menu

Case Study

Automated Parking System

An integrated mechatronics solution featuring YOLOv11-based license plate recognition, automated gate control, and real-time occupancy mapping.

2025-11-12 Robotics & Automation University
Cover for Automated Parking System

My Role

Lead Mechanical Design Engineer responsible for the structural CAD modeling, hardware integration of ESP32-CAM modules, and mechanical assembly of the gate and rotation systems.

Outcome

Developed a fully functional prototype capable of autonomous license plate recognition, automated entry/exit control, and real-time occupancy mapping.

Tools

ESP32 Python YOLOv11 OpenCV MQTT FastAPI Streamlit CAD

TL;DR

The Automated Parking System is a comprehensive mechatronics solution designed to mitigate urban congestion and eliminate manual oversight in parking facilities. By integrating ESP32-powered hardware, YOLOv11-driven computer vision, and a multi-functional web dashboard, the system automates the entire vehicle lifecycle: from entry detection and license plate recognition (LPR) to dynamic LED-guided navigation and automated fee calculation.

Problem

Urban infrastructure faces significant challenges in managing limited parking capacity, often resulting in traffic congestion and inefficient land utilization. Traditional management systems frequently suffer from:

  • Manual Supervision: High labor costs and the potential for human error in gate operation.
  • Processing Latency: Delays in identifying vehicle status and available spots.
  • Fragmented Integration: Disconnected systems for payment processing, location tracking, and entry control.

The objective was to engineer a unified, cost-effective architecture that replaces manual intervention with automated logic, leveraging high-speed vision processing and real-time IoT communication.

Solution

The proposed solution is a fully automated parking management system that integrates:

  • Servo-Actuated Gates: Controlled via MQTT to manage entry and exit based on verified vehicle status.
  • LED Navigation Array: Dynamically guides drivers to the nearest available parking slot, reducing search time and congestion.
  • Management Dashboard: A web-based interface for administrators and users to monitor occupancy, manage subscriptions, and process payments in real-time.
  • Clients Dashboard: A user-facing portal that allows drivers to view their parking history, manage subscriptions, and locate their vehicles using license plate recognition.

Design Iterations

A critical phase of the engineering process involved refining physical enclosures and mechanical mountings to accommodate structural tolerances and electrical wiring requirements.

1. ESP32-CAM Housing

The initial 3D-printed enclosure failed to lock the camera PCB securely, leading to module vibration and misaligned camera perspectives. The second iteration introduced a snap-fit locking front cover and enlarged wire notches to reduce physical strain on power and serial connection lines.

Enlarged visualization

2. Servo Mounting Horns

Standard mounting horns presented fitment tolerance issues when coupling the SG90 servo shaft to the rotating camera base. Redesigning the horn geometry and expanding the inner coupling diameter by 0.2 mm compensated for 3D printer material shrinkage, securing a precision fit for smooth 180-degree scanning.

Enlarged visualization

Software & Hardware Architecture

The system operates across three interconnected layers: physical hardware execution, wireless communication protocols, and central software logic.

  • Main ESP32 Controller: Acts as the local execution hub, driving the SG90 servo motors for gate barriers and managing pin outputs for the 12-LED navigation strip.

  • Vision Nodes: Two ESP32-CAM modules are deployed: one is fixed at the entry/exit point to capture license plates; the other is mounted on a rotating servo to scan the entire lot, effectively reducing the number of required static cameras. The worst part of using the ESP32-CAM is that it required flashing the firmware using a serial adapter, which was a tedious process. However, once flashed, the modules performed reliably for real-time image capture and streaming.

Enlarged visualization
  • Communication Protocols:
    • MQTT: Handles low-latency messaging between the main ESP32 controller and backend server across four main topics: esp32/entry, esp32/exit, esp32/LED, and esp32/main.
    • HTTP: Streams snapshot feeds from both ESP32-CAM IP addresses directly to the host processing server.

Backend & Image Processing

1. Automated Parking & Guidance Logic

When a vehicle approaches the entry lane, the system checks database availability. If valid, the backend publishes an OPEN signal to esp32/entry. Concurrently, a pathfinding function calculates the physical distance from the entry gate to the target vacant slot and issues a command to esp32/LED to illuminate the corresponding number of LEDs along the track.

Logic flowchart for slot allocation, path calculation, and LED guidance sequence generation.

2. YOLOv11 License Plate Recognition

Initial OCR iterations struggled to accurately parse bilingual Egyptian license plates. The vision pipeline was upgraded to a fine-tuned YOLOv11 model (ACLPR) capable of detecting plate bounding boxes and performing character recognition on Arabic and English alpha-numerics simultaneously.

Real-time YOLOv11 inference identifying license plate coordinates and performing character extraction.

3. OpenCV Occupancy Detection

The scanning camera divides incoming video frames into pre-mapped bounding boxes corresponding to physical parking slots. An OpenCV image classification routine checks each slotโ€™s region of interest (ROI) to classify state as occupied or vacant, dynamically updating the database.

OpenCV slot occupancy mapping overlaying bounding boxes to determine slot status in real time.

4. Database Schema & Web Dashboards

The system uses a relational SQLite database organized into six interconnected tables:

  1. CARS: Stores unique plate strings and subscription flags.
  2. PARKING_SLOTS: Stores slot IDs, vacancy states, and gate distance metrics.
  3. IN_PARKING: Tracks active vehicles and entrance timestamps.
  4. PARKED: Maps vehicles to their assigned slot IDs.
  5. SUBSCRIPTIONS: Manages member plans, start dates, and expiry dates.
  6. TRANSACTIONS: Logs billing records, hourly rates, duration, and revenue.
Relational database schema linking vehicle records, slot occupancy, subscriptions, and financial transactions.

Management Portal

Provides managers with live facility capacity metrics, revenue breakdowns, slot map visualization, and manual vehicle lookup tools.

Enlarged visualization

Customer Portal

Allows drivers to locate their vehicle by typing their plate number, review accrued parking fees based on duration, and purchase monthly/yearly membership subscriptions.

Enlarged visualization

Technical Challenges & Troubleshooting

  • Power & Line Resistance: Long wire runs from the main breadboard to the entry camera caused voltage drops, dropping the camera offline. Re-routing power rails and utilizing dedicated supply buses resolved signal instability.
  • Network Isolation: University Wi-Fi client isolation blocked direct MQTT communication between the ESP32 microcontrollers and the FastAPI local server. The deployment of a dedicated local router re-established internal MQTT/HTTP traffic.

Final Prototype

The completed prototype features a custom MDF physical base plate (100ย cmร—75ย cm100\text{ cm} \times 75\text{ cm}) supporting entry/exit gate towers, ground-embedded LEDs, central wire routing underneath the board, and a rotating camera module monitoring 10 numbered parking slots.

Enlarged visualization
Frameworks & Tooling