Skip to main content
Version: ACS CC

Smart Parking Sistem

A parking sistem that use infrared sensors, ultrasound sensors and Raspberry Pi Pico 2W

info

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

alt text

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

alt text

Photos

Before assembly alt text

Pico in the box alt text

Front face alt text

Side alt text

LCD alt text

Bill of materials

DeviceUsagePrice
Rapspberry Pi Pico 2WMicrocontroller39.66 RON
Rapspberry Pi PicoDebugger22.49 RON
Modul Led RGBLed RGB4.99 RON
Micro Servomotor SG90 180°Micro Servomotor11.99 RON
Male to male jumper wires 10cmWires4.99 RON
Male to female jumper wires 20cmWires7.99 RON
Male to female jumper wires 40cmWires22.99 RON
Infrared Sensor Infrared Sensor3.49 RON
Ultrasonic Sensor Ultrasonic Sensor6.49 RON
LCD 1602 LCD14.99 RON
Breadboards Breadboard4.56 RON

Software

LibraryDescriptionUsage
embassy-rpPeripheral access crate for the RP2040 chip used in Raspberry Pi PicoUsed to interact with the microcontroller's hardware
embassy-executorAsynchronous task executor for embedded systemsEnables non-blocking async execution
embassy-timeTime management libraryUsed for implementing delays and measuring durations
logLogging facade for embedded RustUsed to add structured logging
embassy-netAsynchronous embedded networking stack built on smoltcpUsed for network connection
embassy-net-driverNetwork interface drivers for embassy-netUsed to connect embassy-net with hardware like the CYW43 Wi-Fi chip on the Raspberry Pi Pico 2W
embedded-hal-asyncAsync traits for embedded hardwareNeeded for async I2C communication (used by LCD)
lcd1602-diverLCD driver over I2CUsed to control the LCD1602 screen using Embassy I2C
heaplessFixed-capacity data structuresUsed 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.

Functional Diagram

alt text

  1. I2C LCD 1602 with Raspberry Pi Pico
  2. IR Sensor on Raspberry Pi Pico
  3. For Wi-Fi