Skip to main content
Version: ACS CC

Barrier Parking Spot

Automated parking barrier with distance display for tall vehicles

info

Author: Stefan Talpos
GitHub Project Link: https://github.com/UPB-PMRust-Students/proiect-stefantlp

Description

The project consists of a miniature automated parking system designed for tall vehicles. It uses a barrier that opens when a vehicle approaches and displays the distance to the rear wall on a screen. Once the vehicle is close enough to the wall, the barrier closes automatically. The system is controlled by a microcontroller and uses sensors to detect vehicle presence and distance.

Motivation

I chose this project because I wanted to experiment with multiple hardware components such as sensors and a display, and I’m particularly interested in automation systems. This idea gave me the opportunity to integrate different devices into a functional setup and better understand how microcontrollers interact with various peripherals in real-time scenarios.

Architecture

Architecture Diagrama

Main components used in Barrier Parking Spot project:

  1. Ultrasonic Sensor - This sensor is used to detect the presence and distance of the approaching vehicle. It sends distance data to the Raspberry Pi Pico in real time.

  2. Raspberry Pi Pico - The central microcontroller of the system, responsible for processing the distance data from the ultrasonic sensor and controlling both the motorized barrier and the display accordingly.

  3. Display - A visual interface (e.g., LCD or OLED screen) that shows the distance between the vehicle and the wall, helping the driver park safely.

  4. Motor with Barrier - This component represents the physical gate mechanism. It receives commands from the Raspberry Pi Pico to open or close the barrier depending on the vehicle’s position.

Log

Week 5 - 11 May

Purchased all components: Raspberry Pi Pico W, ultrasonic sensor, OLED display, stepper motor with driver, power module, and battery holder. Set up the Pico W and ultrasonic sensor with working distance detection code. Attempted but failed to connect the OLED display.

Week 12 - 18 May

Successfully set up the OLED display and displayed live distance data. Installed and configured the stepper motor with driver. Wrote, tested and uploaded the final code that integrates all components. The project is now fully functional.

Week 19 - 25 May

Updated README file and uploaded SCH and SVG files to the project repository.

Hardware

This project is built around the Raspberry Pi Pico W, which reads distance data from an HC-SR04 ultrasonic sensor and controls a 28BYJ-48 stepper motor via a ULN2003 driver to raise or lower a barrier. A 0.96'' OLED display provides visual feedback to the user.

The components are connected using jumper wires on a 400-point breadboard. Power is supplied through a 2x18650 battery holder regulated by a DC-DC Step-Down MP1584EN module, with a micro USB cable used for programming and optional power input.

This setup ensures a compact, low-cost prototype suitable for quick testing and deployment.

Microprocessors Motor, Driver and Stepdown Baterries and Stepdown Display Sensor Whole Setup

Schematics

Schema Kicad

Bill of Materials

DeviceUsagePrice
Set de cabluri pentru breadboardConnecting components on the breadboard8 RON
Fire Colorate Mama-Tata (10p) 10 cmConnecting modules to the microcontroller3 RON
Senzor ultrasonic HC-SR04Measuring distance to the vehicle7 RON
Display OLED 0.96''Displaying distance information50 RON
Raspberry Pi Pico 2WMain microcontroller unit40 RON
Breadboard HQ (400 Points)Prototyping circuit connections5 RON
Cablu Negru Micro USB 1 mPowering the Raspberry Pi Pico4 RON
Suport baterii 4 x R6 PatratProviding portable power supply5 RON
Modul DC-DC Step-Down MP1584ENRegulating voltage to suitable levels7 RON
Set Motor Pas cu Pas 28BYJ-48 5V și Driver ULN2003 AlbastruControlling the barrier mechanism17 RON
Header de Pini Tată de 1.27 mm 40pConnecting modules to the breadboard2 RON

Software

LibraryDescriptionUsage
gpio (embedded-hal)General Purpose Input/OutputUsed to interface with sensors, motor, and other components
i2c (embedded-hal)I2C communication protocolUsed for communicating with the OLED display
embassy-timeManaging timeUsed for implementing delays and scheduling tasks
embassy-rpPeripheral access libraryUsed for accessing Raspberry Pi Pico 2W hardware features
uln2003Stepper motor driverUsed to control the 28BYJ-48 stepper motor
ssd1306OLED display driverUsed to show distance measurements or status messages
hc-sr04Ultrasonic sensor driverUsed for distance measurement
defmtLogging frameworkUsed for debugging over serial connection
panic-probePanic handler for embedded RustUsed for logging panic messages via USB serial
  1. Youtube Similar Project
  2. Last Year Similar Project