Smart Parking Sistem
A parking sistem that use infrared sensors, ultrasound sensors and Raspberry Pi Pico 2W
Author: Gabriel Constantin
GitHub Project Link: https://github.com/UPB-PMRust-Students/proiect-pachirishu
Description
The parking sistem use ultrasound sensors that detect when a car wants to enter and a servomotor will activate as a barrier. Inside there are 3 parking slots that use led rgb modules to generate the use for each spot and infrared sensors that check the availability. At the entrance there is a lcd module that will tell the number of available spots and the closest one to the entrance. The parking also use wifi connection, so the driver can see online how many spots are left.
Motivation
I chose this project because it addresses a real-world problem related to the organization and management of parking spaces, especially in small or private areas such as driveways, company lots, or residential complexes. The proposed system offers an automated, cost-effective, and scalable solution for access control and parking availability display, without relying on expensive equipment like cameras or commercial barriers.
Architecture
The Raspberry Pi Pico 2W acts as the central controller, managing all data exchange and operations between input and output modules. The ultrasonic sensors detect vehicle presence near the entry and exit, triggering barrier actions. The micro servomotors lift or lower the entry and exit barriers based on sensor data. The infrared sensors detect car presence in each parking spot. The RGB LED modules indicate the occupancy status: green for available, red for occupied. The LCD 1602 displays the number of available parking spaces in real time. The built-in Wi-Fi module allows the Pico to transmit parking status data to a remote server, enabling remote monitoring. The PC is used for programming and optional debugging, while the battery supplies power to the entire system.
Log
Week 5 - 11 May
Acquired the development boards and the necessary peripherals.
Set up the Rust Embassy development environment on my laptop.
Created the project webpage.
Week 12 - 18 May
Tested the functionality of the peripherals and replaced the ones that were not working.
Designed the schematic in KiCad.
Connected the components on the breadboards.
Week 19 - 25 May
Wrote the code for the peripherals (encountered issues with delay timing between them, so I created separate tasks for each to run them in parallel)
Built the parking prototype and mounted the peripherals on it
Painted the parking prototype to be more aesthetic
Purchased replacement sensors after some of the original ones stopped working, as well as longer cables
Hardware
Schematics
Photos
Before assembly
Pico in the box
Front face
Side
LCD
Bill of materials
Device | Usage | Price |
---|---|---|
Rapspberry Pi Pico 2W | Microcontroller | 39.66 RON |
Rapspberry Pi Pico | Debugger | 22.49 RON |
Modul Led RGB | Led RGB | 4.99 RON |
Micro Servomotor SG90 180° | Micro Servomotor | 11.99 RON |
Male to male jumper wires 10cm | Wires | 4.99 RON |
Male to female jumper wires 20cm | Wires | 7.99 RON |
Male to female jumper wires 40cm | Wires | 22.99 RON |
Infrared Sensor | Infrared Sensor | 3.49 RON |
Ultrasonic Sensor | Ultrasonic Sensor | 6.49 RON |
LCD 1602 | LCD | 14.99 RON |
Breadboards | Breadboard | 4.56 RON |
Software
Library | Description | Usage |
---|---|---|
embassy-rp | Peripheral access crate for the RP2040 chip used in Raspberry Pi Pico | Used to interact with the microcontroller's hardware |
embassy-executor | Asynchronous task executor for embedded systems | Enables non-blocking async execution |
embassy-time | Time management library | Used for implementing delays and measuring durations |
log | Logging facade for embedded Rust | Used to add structured logging |
embassy-net | Asynchronous embedded networking stack built on smoltcp | Used for network connection |
embassy-net-driver | Network interface drivers for embassy-net | Used to connect embassy-net with hardware like the CYW43 Wi-Fi chip on the Raspberry Pi Pico 2W |
embedded-hal-async | Async traits for embedded hardware | Needed for async I2C communication (used by LCD) |
lcd1602-diver | LCD driver over I2C | Used to control the LCD1602 screen using Embassy I2C |
heapless | Fixed-capacity data structures | Used for memory-safe strings in no_std environments |
The software uses asynchronous tasks to independently monitor ultrasonic and infrared sensors, managing entrance and exit barriers while tracking parking spot availability. Sensor data updates an atomic counter for free spots, and the LCD displays the current status. Using Embassy’s async executor on a Raspberry Pi Pico, the design ensures responsive, non-blocking handling of all inputs and outputs in a safe, efficient manner.