Barrier Parking Spot
Automated parking barrier with distance display for tall vehicles
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
Main components used in Barrier Parking Spot project:
-
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.
-
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.
-
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.
-
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.
Schematics
Bill of Materials
Device | Usage | Price |
---|---|---|
Set de cabluri pentru breadboard | Connecting components on the breadboard | 8 RON |
Fire Colorate Mama-Tata (10p) 10 cm | Connecting modules to the microcontroller | 3 RON |
Senzor ultrasonic HC-SR04 | Measuring distance to the vehicle | 7 RON |
Display OLED 0.96'' | Displaying distance information | 50 RON |
Raspberry Pi Pico 2W | Main microcontroller unit | 40 RON |
Breadboard HQ (400 Points) | Prototyping circuit connections | 5 RON |
Cablu Negru Micro USB 1 m | Powering the Raspberry Pi Pico | 4 RON |
Suport baterii 4 x R6 Patrat | Providing portable power supply | 5 RON |
Modul DC-DC Step-Down MP1584EN | Regulating voltage to suitable levels | 7 RON |
Set Motor Pas cu Pas 28BYJ-48 5V și Driver ULN2003 Albastru | Controlling the barrier mechanism | 17 RON |
Header de Pini Tată de 1.27 mm 40p | Connecting modules to the breadboard | 2 RON |
Software
Library | Description | Usage |
---|---|---|
gpio (embedded-hal) | General Purpose Input/Output | Used to interface with sensors, motor, and other components |
i2c (embedded-hal) | I2C communication protocol | Used for communicating with the OLED display |
embassy-time | Managing time | Used for implementing delays and scheduling tasks |
embassy-rp | Peripheral access library | Used for accessing Raspberry Pi Pico 2W hardware features |
uln2003 | Stepper motor driver | Used to control the 28BYJ-48 stepper motor |
ssd1306 | OLED display driver | Used to show distance measurements or status messages |
hc-sr04 | Ultrasonic sensor driver | Used for distance measurement |
defmt | Logging framework | Used for debugging over serial connection |
panic-probe | Panic handler for embedded Rust | Used for logging panic messages via USB serial |