Skip to main content
Version: FILS English

Smart Parking Lot

A smart system to monitor parking spaces and manage parking time for billing purposes.

info

Author: Zeinalabdin ISSA
GitHub Project Link: https://github.com/UPB-PMRust-Students/project-zein409

Description

The Smart Parking Lot project automates parking spot allocation using sensors and tracks the time a car is parked for billing. The system provides real-time parking availability and uses a web interface for monitoring.

Motivation

I chose this project to address the need for efficient parking management in crowded urban environments. The goal is to optimize parking space usage and provide real-time data to drivers.

Architecture

Schematic Diagram

Architecture Diagram

The architecture of the Smart Parking Lot system includes the following main components:

  • Parking Sensors: Detect free parking spaces.
  • Microcontroller (Raspberry Pi Pico W): Collects data from sensors and processes the information.
  • Web Interface: Displays real-time parking availability and billing info.
  • Database: Stores parking data such as time parked and billing information.

How they connect:

  • The Raspberry Pi Pico W communicates with the parking sensors to detect free or occupied spots.
  • The microcontroller sends the data to the web interface, allowing users to view available spots.
  • The system tracks parking time and calculates the bill based on the time spent.

Log

Week 5 - 11 May

  • Started the project and gathered the necessary components.

Week 12 - 18 May

  • I started making the hardware work and figuring out how to put all parts together to make them work perfectly with each other. and made the Kicad schematics for the project.

Week 19 - 25 May

  • Initialized the software repository and structured the codebase.
  • Implemented asynchronous tasks using Embassy for sensor and servo control.
  • Integrated LCD display using the hd44780-driver over I2C.
  • Added logic for tracking parking duration and calculating billing.
  • Tested individual components: ultrasonic sensors, servos, LEDs, and LCD.
  • I started working on the software part of the project on VScode. and when i was done with it, i started working on the project appearance.

Hardware

The Raspberry Pi Pico controls the smart parking lot system using Ultrasonic sensors to detect cars, two servo motors to open and close the gates, and LEDs to indicate slot status. An I2C 1602 LCD displays messages such as time and availability. All components communicate through GPIO pins, with shared power and ground connections.

Here is the actual setup:

front view

side view1

side view2

Schematics

KiSchematic Diagram

Bill of Materials

DeviceUsagePrice
Raspberry Pi Pico 2WThe microcontroller2 x 39 RON
Ultrasonic SensorsUsed for cars detection2 x 6.45 RON
ServoMotorOpens the gate for the cars2 x 11.99 RON
LEDsLights up on detection4 x 0.39 RON
LCD 1602Shows results on screen1 x 16.34 RON
Wiresconnections2 x 7.99 RON
Resistors 330ohmUsed to limit the current4 x 0.10 RON
Bread BoardUsed to connect part together2 x 8.99 RON

Software

Libraries

LibraryDescriptionUsage
embassyAsync embedded framework for RustCore async runtime for the project
embassy-rpRP2040 support crate in EmbassyAccess to GPIO, PWM, I2C, etc. on Raspberry Pi Pico
embassy-timeTimer and delay utilities for EmbassyUsed for non-blocking delays and time tracking
embassy-executorAsync task executor for EmbassyManages async tasks and scheduling
embassy-rp-pwmPWM peripheral driver for RP2040Controls servo motors for entry/exit gates
embassy-rp-gpioGPIO peripheral driver for RP2040Reads ultrasonic sensors and controls LEDs
embassy-rp-i2cI2C peripheral driver for RP2040Communicates with the 1602 LCD display
hd44780-driverDriver for HD44780 LCDs (I2C support)Displays parking information on the 1602 LCD
heaplessFixed-size, no_std data structuresUsed for String formatting on the LCD
defmtLogging framework for embedded RustDebugging and logging system events
panic-probeMinimal panic handler for embedded RustHandles panics and outputs debug info
fixedFixed-point arithmetic libraryUsed for accurate PWM timing and calculations
coreRust core library for no_std environmentsProvides essential types and traits