COE/ELE 70AB Capstone | Milestones Compliance Report I | Weeks 4 and 5

Automatic Parking Lot Gate Closure and Smart Space Monitoring System

Project manager this period
Mohamed Abouzaid
Team
Student B: Ashwini Erambalur Student C: Julian Vila Student D: Ezz Alzokm
Faculty supervisor
Meranda Salem

Tasks outlined for this period

The tasks for weeks 4 and 5, as set in the milestones submitted to the FLC in week 3.

Group
  • Finalize scope, requirements, architecture, interfaces, and responsibilities. Confirm the added modules: computer vision, website, routing, and digital twin.
  • Select technologies and build first subsystem proof-of-concepts. Agree on the common data format shared by CV, backend, gate, and digital twin.
Student AMohamed Abouzaid
  • Lead overall system design and architecture. Define the backend, API, database, website, routing, and digital-twin architecture.
  • Create the backend/database skeleton, website wireframe, and integration interface specification.
Student BAshwini Erambalur
  • Define camera coverage, parking-space mapping, CV model and toolchain, and detection requirements.
  • Bring up the camera feed, detect vehicles, and define parking-space polygons (ROIs).
Student CJulian Vila
  • Define gate hardware, entry/exit sensors, actuator, safety, and control approach.
  • Bench-test the gate actuator and vehicle-passing sensor sequence.
Student DEzz Alzokm
  • Define display, logging, validation metrics, and test-plan requirements.
  • Prototype the AVAILABLE/FULL display and basic event logging.

Progress made

What each member completed during weeks 4 and 5, mapped to the tasks above.

Group

Not yet reported.

Student AMohamed Abouzaid

Architecture overview

Swipe sideways to see the full diagram.

The system is organized into three layers: the parking buildings, the cloud, and the user-facing clients. In each building, space sensors (supported by computer vision) report whether each space is occupied or empty, an NFC reader handles stored-value cards, and a gate motor with a local LCD and LEDs controls entry and exit. These devices connect to a local gateway, such as a Raspberry Pi, that runs the gate logic on its own, keeps working if the internet drops, and buffers events to replay once the connection returns. The first building is real hardware, and the additional buildings are simulated to show that the design scales.

The gateway communicates with the cloud through an MQTT broker. MQTT is a lightweight publish/subscribe messaging protocol designed for constrained devices and unreliable networks (Banks & Gupta, 2014). Devices publish small messages to named topics, and any subscriber to a topic receives them through a central broker. A single backend server, split into clear modules, consumes those messages. The modules cover device communication, live occupancy, space assignment and routing, accounts and wallet billing, logging and analytics, and admin functions such as roles and manual gate override.

The backend stores users, cards, ledgers, sessions, events and buildings in a PostgreSQL database, and keeps the 3D models and floor maps in file storage. It exposes a REST API for actions (Fielding, 2000) and a WebSocket for live updates. The public website with its interactive 3D viewer, the iOS app with CarPlay support, and the admin dashboard all use that same API, so every client sees the same live data.

Development approach

We will use the Agile methodology to build the website and to manage the project (Beck et al., 2001). Work is split into short sprints, each delivering a small working piece, such as live availability, then the 3D viewer, then accounts and the wallet. A prioritized backlog is reviewed at the end of every sprint, so feedback and changing requirements can be handled early instead of at the end.

Cloud server

The cloud layer runs on a dedicated VPS. Each parking building's gateway connects to it to report occupancy and gate events, and the same server hosts the public website and the REST API used by the iOS and desktop applications. The website is available at www.parkflow.tech.

Student BAshwini Erambalur

Camera

  • Defined a fixed, high-angle camera position so one camera covers multiple parking spots.
  • Candidate camera: Arducam 8MP IMX219 USB. It is compatible with Windows, Linux and Raspberry Pi, inexpensive, and easy to mount.

Space mapping and detection

  • Parking spaces are mapped in OpenCV, with each spot defined manually as a polygon.
  • The polygons work together with YOLO vehicle detection, which uses fast, real-time capable pretrained CNN models.
  • A vehicle detected inside a spot marks that polygon as occupied.

Tracking and state changes

  • ByteTrack (real-time performance) or DeepSORT (object tracking and identity) will change a spot's state between free and occupied only once a threshold of n consecutive frames is met.
Student CJulian Vila

Gate actuator

Proposed a small servo motor driving a lightweight barrier arm for the model entrance gate. A servo suits a small prototype because the controller can command open and closed positions directly.

Control states

IDLE› APPROACH› OPEN› PASSING› CLOSE FULL / BLOCKED

The gate should permit entry only when spaces are available and the entry request is authorized.

Sensors

Proposed infrared break-beam sensors in a two-stage sequence at both lanes: entrance sensors (E1, E2) detect approach and passage, and exit sensors (X1, X2) confirm a vehicle leaving.

Bench-test plan

  • Verify servo travel.
  • Confirm the order of sensor triggers as a model car passes.
  • Check that the gate stays closed when the lot is FULL.

These tests remain to be carried out and documented during the proof-of-concept stage.

Student DEzz Alzokm

Display logic

Defined the AVAILABLE/FULL display logic and the parking status data it needs. The sign shows AVAILABLE if at least one space is free, and FULL if all spaces are occupied.

Green LED: space available Red LED: space occupied

Event log format

FieldPurpose
TimestampWhen a car enters and leaves the lot, used for automatic payment
Parking space IDThe lot number associated with each space
Space countAvailable spaces left in the lot
State changeA space changing from available to occupied

Test scenarios

Created test scenarios for empty, partially occupied, and full parking lots to check display accuracy and update response time.

Difficulties encountered

Issues found during the period and how we plan to address them.

Group

Our main challenge as a group was finalizing the scope after adding new modules (computer vision, website, routing and digital twin), since each one affected the others' requirements. Choosing between many hardware and software options, such as camera types, detection models, display types and gate sensors, took more research time than expected, and agreeing on one common data format for the CV, backend, gate and digital twin required several rounds of discussion. We also revised the overall architecture from a peer-to-peer design to a centralized cloud server after identifying consistency, security and management problems.

To keep progress on track, we split the research by subsystem and will hold regular integration checkpoints in the next period so each subsystem stays aligned with the shared architecture.

Student AMohamed Abouzaid

In the first two weeks, I planned to design the system as a peer-to-peer (P2P) network, where each parking building (or even each parking space) would act as a peer and communicate directly with the others to share availability. As I worked through the design, I found that this approach creates several serious problems for a system like ours (Androutsellis-Theotokis & Spinellis, 2004; Lua et al., 2005):

  • Inconsistent data: without one source of truth, peers can hold conflicting views of the same space or the same card balance. Two buildings could assign the same space, or a stored-value card could be charged twice, because no node has the final say.
  • No single point for clients: the website, iOS app and desktop apps would need to locate and query many peers to build a complete picture, instead of calling one API.
  • Security and trust: payments, card authorization and admin overrides need a trusted authority. In a P2P network every peer must be trusted, and a compromised node can spread false data.
  • Peers going offline: when a building's node goes offline, its data becomes unavailable to the rest of the network unless it is replicated across peers, which adds complexity.
  • Growing connection count: in a fully connected network the number of links grows as n(n−1)/2, so every new building adds connections to all the others.
  • Hard to manage: software updates, logging and analytics would have to be handled across every node instead of in one place.

Solution: I changed the design to a centralized client-server architecture. Each building runs a local gateway that keeps the gate working offline and buffers events. All gateways report to one cloud server through an MQTT broker. The cloud server is the single source of truth for occupancy, accounts and billing, and serves one API to all clients.

Student BAshwini Erambalur

Comparing the options in depth for hardware (camera angle, camera type) and software (vehicle detection with CNN or transformer models).

Solution: thorough research and comparison charts across the options, rating each on cost-effectiveness, implementation difficulty, accuracy and reliability, scalability, and overall system compatibility.

Student CJulian Vila

The main design challenge is telling a vehicle that passes through the gate apart from one that approaches and reverses, stops in the sensor beam, or triggers the sensors more than once.

Possible solution: use the ordered E1 to E2 and X1 to X2 sensor sequences, require a valid state transition before counting a vehicle, and add a short re-trigger lockout or event confirmation to prevent duplicate counts.

A sensor obstruction or failure could leave the gate in an unsafe or indeterminate state.

Possible solution: add timeout and fault states. When passage is uncertain, keep the gate from closing onto the vehicle and require recovery or manual intervention.

Student DEzz Alzokm

Researched the differences in cost and quality between LCD, OLED and LED displays. LEDs were the most efficient and cost-effective option for our need, which is simply showing two colours for parking state.

Tasks for the next period

Matches the week 3 milestones. Project manager for the next period: to be confirmed.

Group
  • Implement reliable occupancy detection and initial gate logic. Test live space status through the central application.
  • Integrate computer vision with the physical parking prototype. Show the live available-space count on the website.
Student AMohamed Abouzaid
  • Create the occupancy API, live availability data model, and database connection.
  • Connect CV occupancy to the backend, database and website, and coordinate the integration checkpoint.
Student BAshwini Erambalur
  • Implement vehicle detection, ROI overlap, and multi-frame confirmation.
  • Calibrate cameras and ROIs, and handle shadows, brief occlusion, and vehicles passing spaces.
Student CJulian Vila
  • Implement the gate state machine: IDLE, APPROACH, OPEN, PASSING, CLOSE, FULL/BLOCKED.
  • Connect the gate decision to central availability and verify the open/close sequence.
Student DEzz Alzokm
  • Create test cases for occupancy, count and display accuracy, and response time.
  • Integrate the physical status display and record the first performance measurements.