Skip to content

G1:Autonomous Parking Car

FaridaRagheb05 edited this page May 2, 2026 · 7 revisions

Autonomous Parking Car

Name GitHub
Freddy Amgad FreddyAmgad
Farida Ragheb FaridaRagheb05
Habiba Seif HabibaSeif

Github Repo: https://github.com/FaridaRagheb05/Autonomous-Parking

1. The Proposal

Abstract / Elevator Pitch:

The system is built around an STM32 Nucleo microcontroller running a Real-Time Operating System (FreeRTOS), ensuring that timing-critical tasks such as sensor polling and motor control are handled with deterministic precision. The car enters "Autonomous Parking Mode" via a physical push-button interrupt. Once activated, the system utilizes distance sensors to navigate and detect parking boundaries and obstacles. If the car gets too close to an obstacle, it triggers a warning LED and a buzzer. Upon successfully parking, the system automatically disables the parking mode and halts the vehicle.

Project Objectives & Scope:

  • RTOS Integration: Deploy FreeRTOS with clearly separated tasks for sensor reading, motor control, obstacle alerting (LED/buzzer), and state management.
  • Mode Switching (GPIO/Interrupts): Implement an external interrupt via a push button to safely toggle the car in and out of autonomous parking mode.
  • Distance Sensing: Continuously poll distance sensors (e.g., ultrasonic) to measure proximity to obstacles and parking spot boundaries in real time.
  • Proximity Alerts (GPIO): Illuminate a warning LED and trigger a buzzer if the vehicle breaches a predefined minimum safe distance from an obstacle, preventing collisions.
  • Autonomous Motor Control: Control DC motors via a motor driver to execute the parking maneuver, automatically stopping all movement once the parking sequence is successfully completed.

Stretch Goals:

  • Parallel & Perpendicular Modes: Add a secondary button or switch to let the user choose between parallel and perpendicular parking algorithms.
  • Companion Mobile Interface: Develop a minimal Bluetooth-enabled app (or serial terminal UI) to monitor the car's telemetry (current distance readings, mode status) and allow for a wireless emergency stop.

2. System Architecture

2.1 High-Level Block Diagram:

Arch

Subsystem Breakdown:

  • Input Subsystem: The push button triggers a hardware interrupt to start the sequence. Distance sensors continuously feed proximity data to the microcontroller.
  • Processing Subsystem: The STM32 Nucleo board runs FreeRTOS. A centralized control task evaluates sensor data, determines the vehicle's position relative to obstacles, and calculates the necessary steering and drive commands.
  • Output Subsystem: The Nucleo outputs PWM signals to a motor driver to physically move the car. Simultaneously, GPIO pins drive the warning LED and buzzer based on the proximity threshold logic.

3. Hardware Design

Component Selection:

  • STM32 Nucleo Board
  • Distance Sensors (e.g., HC-SR04 Ultrasonic)
  • Motor Driver (e.g., L298N) and DC Motors
  • Push Button
  • LEDs and Active Buzzer
  • Chassis and Power Supply (Batteries)

4. Software Implementation

4.1 Software Architecture:

The firmware is built on FreeRTOS to manage concurrent operations. Dedicated tasks handle reading sensor data, updating motor PWM outputs, and managing the state machine (Idle vs. Parking Mode).

4.2 Flowcharts & State Machines:

(Visual diagrams mapping out the parking algorithm, state transitions (Idle -> Parking -> Parked), and the button ISR to be added here)

4.3 Key Algorithms:

The core logic relies on a parking state machine that calculates trajectories based on sensor feedback. A threshold-checking algorithm continuously compares the distance sensor arrays against a safety margin to trigger the LED/buzzer interrupts.

4.4 Development Environment:

Keil MDK / STM32CubeMX for hardware configuration, HAL library integration, and FreeRTOS deployment.

5. Testing, Validation & Debugging

5.1 Unit Testing:

Validating that the distance sensors return accurate measurements at known distances, and ensuring the motor driver correctly interprets PWM signals for forward/reverse and turning.

5.2 Integration Testing:

Testing the transition into parking mode via the button, and verifying that the LED/buzzer trigger accurately when an obstacle is introduced during motion.

5.3 Challenges & Solutions:

(A log of major bugs, hardware failures, or design flaws encountered, and the engineering steps taken to solve them to be added here)

6. Results & Demonstration

6.1 Final Prototype:

(High-quality photos of the completed build to be added here)

6.2 Video Demonstration:

(A link to a short video showing the car successfully navigating into a parking spot and stopping)

6.3 Performance Metrics:

(Data showing how well the project met its initial objectives, e.g., "Car successfully parked within 5cm of the target boundary in 9/10 trials")

7. Project Management

7.1 Division of Labor

Team Member Primary Responsibilities
Freddy RTOS architecture, FreeRTOS task design, motor control logic, and parking state machine
Habiba Distance sensor integration, threshold algorithm for the LED/buzzer proximity alerts, telemetry over UART
Farida Hardware design, chassis assembly, motor driver wiring, integration testing and debugging

7.2 Timeline

A Gantt chart or milestone list showing the planned schedule versus the actual completion dates.

Milestone Deliverable Planned Date Owner(s)
M1: Team Formation Team formation sheet submitted Apr 14, 2026 All
M2: Proposal Presentation 5–7 min in-class proposal presentation + wiki Sections 1, 2.1, 7 live Apr 15, 2026 All
Checkpoint A: Wiki Setup Full proposal material on wiki (problem, solution, block diagram, requirements, BOM draft) Apr 20, 2026 All
M3: Progress Presentation & Demo At least one major working subsystem demoed live — target: Sensor polling + LED/Buzzer alerts running Apr 29, 2026 ALL
Checkpoint B: Integration Update Wiki updated with integration status, testing evidence, remaining bugs May 6, 2026 All
M4: Final Demo & Presentation Full system demo, polished 10–12 min presentation, complete wiki, clean code repo May 13, 2026 All

Milestone-by-Milestone Breakdown:

M2 -> Checkpoint A (Apr 15 – 20)

  • Freddy: Define FreeRTOS task structure, set up Keil environment for Nucleo.
  • Habiba: Write driver code for distance sensors and test basic proximity thresholds.
  • Farida: Assemble car chassis, source power supply, create block diagram and schematic.

M3 -> Checkpoint A (Apr 20 – 29)

  • Freddy: Implement motor control tasks and PWM generation.
  • Habiba: Integrate LED and buzzer triggers based on sensor readings.
  • Farida: Wire up motor driver and sensors to the Nucleo board.

M3 -> Checkpoint B (Apr 29 – May 6)

  • Freddy: Develop the main parking algorithm/state machine.
  • Habiba: Integrate the push button interrupt to toggle parking mode.
  • Farida: Conduct physical track testing and calibrate sensor angles.

M4 -> Checkpoint B (May 6 – 13)

  • All: System-wide integration testing, tuning the parking accuracy, bug fixes, final demo prep, wiki completion.

8. Appendices & References

8.1 Source Code Repository:

Link to your GitHub/GitLab repo.

8.2 References:

Links to datasheets (e.g., L298N, HC-SR04), Nucleo pinouts, tutorials, and course materials used during development.

Clone this wiki locally