Skip to main content

Automated Parking System

A parking system utilizing infrared sensors, RFID, and Raspberry Pi Pico W for enhanced security and efficiency.

info

Author: El-Ghoul Layla
GitHub Project Link: https://github.com/UPB-FILS-MA/project-Scarletwtc

Description

The project revolves around a multi-storey parking lot. At the entrance, an infrared sensor will detect the presence of vehicles. After the detection of a vehicle a servomotor barrier will allow its entry. Infrared sensors will be implanted at each parking lot to monitor occupation.There will be green leds indicating available parking spaces, and red ones indicating occupancy.The second floor will be designated for authorized vehicles only.To make this happen, an RFID system will be utilized. In case an unauthorized vehicle tries to access, a buzzer will be activated alerting security personnel. When an authorized vehicle is detected, an LED light will turn on. The exit will also implement an infrared sensor and a servomotor barrier. A flame sensor will indicate the presence of fire, in case of fire a buzzer will be activated to enable evacuation procedures.

Motivation

These days, cars have become a necessity rather than a luxury. People rely on them for their everyday activities, whether it's going to work, running errands, or simply enjoying some leisure time. One major concern for them is finding a place to park wherever they go. Whether it's for work, fun, or shopping, having a convenient and safe parking space is crucial for their comfort and peace of mind. I picked this project because it addresses this concern. My project focuses on making parking lots safer, ensuring a better parking experience for everyone.

Architecture

A prototype of architecture Architecture Scheme

This project utilizes a Raspberry Pi Pico W to create a smart parking system, housed within a cardboard box. The system features two floors, with various sensors and components managing the parking spaces.

Components Overview

First Floor

  • Parking Areas:

    • 3 parking spaces, each equipped with:
    • Green LED: Indicates the space is available.
    • Red LED: Indicates the space is occupied.
    • Infrared Sensor: Detects presence of cars.
  • Gates:

    • Entrance Gate: Controlled by Servomotor 1 (connected to GPIO pin 19).
    • Exit Gate: Controlled by Servomotor 2 (connected to GPIO pin 20).
  • Sensors:

    • Infrared Sensors: 5 sensors (PIR 1 to PIR 5) monitoring vehicle movements, connected to GPIO pins 6-10. 3 senzors indicate if a car is parked in a parking space, while 2 of them are used to indicate cars for gates (servomotors) to open.
    • IR Flame Sensor: Detects fire and triggers a buzzer, connected to GPIO pin 3.

Second Floor

  • Authorized Parking Area:
    • RFID RC522: Controls access to the area, communicates with the Pico W via SPI:
    • SCK: GPIO 2
    • MISO: GPIO 4
    • MOSI: GPIO 3
    • CS: GPIO 1
    • RST: GPIO 0
    • LED Light: Indicates access status.
    • -Buzzer: Indicates unauthorised access.

Connectivity

  • Infrared Sensors: Connected to the Raspberry Pi Pico W's GPIO pins, sending signals about vehicle presence.
  • Servo Motors: Controlled by pins on the Pico W.
  • LEDs: Indicate parking space and authorization status.
  • Fire Sensor: Activates a buzzer when triggered.
  • RFID: Communicates via SPI with the Pico W, controlling access and indicating status with an LED.
  • Active buzzer: the buzzer that gets activated in case of a fire.

Physical Layout

  • Cardboard Box: Houses the system, with cutouts for each component:
    • First Floor: 3 parking spaces, entrance, and exit.
    • Second Floor: Authorized parking area.
  • Breadboard: Hidden inside, connecting all components to the Pico W.

Log

Week 6 - 12 May

I searched for a suitably sized cardboard box that could fit all my components. I purchased cars that could be detected by the infrared sensors and ordered the missing components.

After preparing the cardboard, I made all the necessary cutouts and painted it blue. I then developed and tested code for each component individually to ensure proper functionality. The infrared sensors, flame sensor, buzzers, and LEDs worked as intended. However, I still needed to code the servo and the RFID, and select the appropriate GPIO pins.

I also drew the initial KiCad schematics, ensuring each component was accurately represented and connected according to my design.

Week 7 - 19 May

I assembled all the components, secured them in their positions within the cardboard structure, and wrote the code for the remaining components, the servo, and the RFID. After that, I combined the code to ensure everything worked together, using asynchronous functions to achieve this.

Additionally, I updated the original KiCad design by adding a few more components and modifying some pin connections. Initially, I tried to get the RFID to work using SPI without a driver. Later, at the laboratory, I received help to get the RFID functioning correctly and using the driver, then I coded it to recognize specific UIDs. The only component that still needs work is the servo. I also need to decorate the cardboard further, as it is currently just plain blue.

Week 20 - 26 May

I've completed the decoration of the cardboard. With guidance from our laboratory assistant and course instructor, I finally understood how servomotors operate. I was able to configure the servos to function as intended. Moreover, I have uploaded the software to GitHub.

Hardware

  • Infrared Flame sensor: I used this to detect any nearby fires.
  • Active buzzer module: This buzzer is activated when the flame sensor detects fire, or when rfid detects unauthorised car.
  • Servomotor: Used as a barrier.
  • Infrared sensor: Two of them are used with the servomotors, they indicate nearby cars so that the servo barrier opens. Three of them are used to detect if parking spaces are occupied or not.
  • Rfid module: I used it to differ between authorised and unauthorised cars. Authorised have a recognised card attached to it, the unauthorised ones will have a different card attached.
  • Green leds: used to indicate free parking spots.
  • Red leds: used to indicate occupied parking spots. -Orange led: used to indicate the presence of authorised car

This is what the wiring looks like: This is what the wiring looks like

This picture shows what the wires look like inside the cardboard behind the "wall" i will be adding: This picture shows what the wires look like inside the cardboard behind the "wall" i will be adding

This is the final product as of yet: This is the final product as of yet

Schematics

Kicad schematic This is the kicad schematic.

Bill of Materials

DeviceUsagePrice
Rapspberry Pi Pico WThe microcontroller35 RON
Led 5mmRed Led light0.26 RON
Led 5mmGreen Led light0.26 RON
Micro Servomotor SG90 90°The micro servomotor14 RON
Modul cu Buzzer activActive buzzer2,49 RON
Male to male jumper wiresWires6.98 RON
Male to male jumper wiresWires6.98 RON
Infrared Sensor infrared sensor8,78 RON
ServoMotorMicro Servomotor SG90 90°13,99 RON
Infrared Flame Sensor flame sensor2,49 RON
Modul RFID RC522 Rfid RC5222,49 RON

Software

LibraryDescriptionUsage
embassy-executorAsynchronous executor for Rust embedded systemsUsed for task scheduling and asynchronous programming
embassy-timeTime management libraryUsed for time-based operations such as delays
embassy-rpPeripheral access libraryUsed for initializing and interacting with peripherals
logLogging facadeUsed for logging messages
embassy-usb-loggerUSB logger implementation for embassyUsed for logging messages over USB
gpioGPIO manipulationUsed for interacting with GPIO pins
pwmPulse-width modulationUsed for controlling the buzzer's sound intensity
Mfrc522Mfrc rfid readerUsed for initialization or rfid522 and for reading cards/UIDs
  1. PM projects 2023
  2. Car Parking System