Post

Microprocessor Architecture Project

Documentation for my 2nd year Microprocessor Architecture class project

Parking Simulator

Small scale parking lot simulation

Author: Cristian Branet
GitHub Project Link: https://github.com/UPB-PMRust-Students/project-cristibtz

Description

The project consists of a small scale simulation of a parking lot, that has a barrier, motion sensor and a display.

It was built using three boards, each having a separate role.

  • Raspberry Pi Pico 2 W (main board)
  • 2 x Raspberry Pi Pico W (secondary boards)

Besides these boards, I have also used a servo motor, motion sensors, a display and WIFI connectivity for inter-boards communications.

The idea of this project is that tasks are delegated and each board does something useful: one board receives IR commands from a remote and sends them via WIFI to the main board which opens the parking lot barrier. After the car parks, motion sensors controlled by the main board detect the event and send the information, also via WIFI, to the other secondary board which will display the parking lot space status on a display. When a car leaves, the display reflects the parking lot space changes accordingly.

Having delegated tasks and the boards working in a detachable manner, it makes the process of handling one board’s failure easier and the functionality of the whole assembly doesn’t stop working 100%.

Motivation

I built this project with the idea of simulating something that is common in real life and creating a parking lot simulation was the idea that I was sure I can bring to life. I created it because it was very practical and by researching about this topic, learning how to design the project and how components are interconnected with each other at this scale, it helped me understand how more complex systems are created. Another reason is that I like the idea of multiple components actively communicating with each other, thus the use of three boards and WIFI

Architecture

Architecture

There are 3 important components in this project.

RP Pico 2 W:

  • Receives data from the IR sensor regarding the desired state of the barrier, either closed or opened.
  • Based on received data, it moves the servo motor.
  • Receives data from one or more motion sensors, if a parking space is occupied.
  • Sends motion sensor’s data to the board controlling the display.
  • Modifies LEDs based on the barrier’s and sensor’s state.

RP Pico W no. 1:

  • Receives IR signals from the remote.
  • Processes the signal and sends command corresponding to the signal to the main Pico 2.

RP Pico W no. 2:

  • Receives data from the main board.
  • Updates displayed details based on received data.

LEDs:

  • Controlled by the main board.
  • They are turned on or off based on the state of the components associated with them (ex: opened barrier - light green LED or sensor that detected motion - light red LED)

Display:

  • Displays data about the state of the parking lot, more exactly when a place is freed or how many spaces are available.

IR remote and receiver:

  • Classic IR remote which sends IR signals.
  • The IR sensor receives the signals and sends them to the IR receiving board via wire.

Note:
All the boards communicate with each other using WIFI. Each one connects to a designated network via WIFI. The boards have a TCP server setup on them to listen for incoming connections. In this way, if a certain part stops working as it should, necessary data can be sent manually to keep the functionality working (ex: barrier can be opened by sending the proper code to the main board without IR). All other components are wired between each other and programmed to communicate accordingly in the software part.

Log

Week 5 - 11 May

Uploaded a part of the documentation for the project. Started working on each individual component’s functionality and very soon planning to integrate them together. Also, still testing some functionalities, like infrared and display related stuff.

Week 12 - 18 May

Having acquired all the necessary hardware, I continued working on creating IR receiver functionality in Rust, having previously used MicroPython, and succeeded (implementing more exactly, the NEC 8 bit protocol), I continued testing the main board’s servo motor and motion detection sensors for proper functioning, then moved on to setting up the display.

Having finished all the individual functionalities of the boards, I moved on to integrating them together and making sure they communicate properly via WIFI. I also defined the format for data that is transmitted and what every board expects to receive. Will continue testing and deciding on the components’ arrangements on the breadboard and on the cardboard parking lot replica.

Week 19 - 25 May

Finished all software related stuff and tested the project to make sure it works properly. I have also created some kind of cardboard parking and assembled the components for better presentation.

Hardware

  1. Infrared Sensor VS1838B
    IR receiver module that decodes signals from remote controls.
    Connected to a secondary board to receive parking commands.
    Cheap, simple, and ideal for remote input tasks.

  2. Infrared Remote
    Standard remote control that emits IR signals to communicate commands.
    Used to simulate a user requesting to open or lock the barrier.
    Paired with the VS1838B sensor for command input.

  3. SG90 Servo Motor
    Miniature 180° servo motor for basic actuation tasks.
    Used to physically open and close the parking barrier.
    Controlled via PWM signals from the main board.

  4. Display SSD1306
    0.96” OLED display module with I2C interface.
    Used to show real-time parking lot status (free/occupied spots).
    Compact and energy-efficient visual output component.

  5. Infrared Obstacle Sensor
    Detects the presence of objects (e.g., parked cars) using reflected IR light.
    Notifies the main board when a spot is occupied.
    Essential for automatic status updates of parking spaces.

  6. LEDs
    Standard 5mm LEDs used for visual feedback.
    Indicate system status like barrier state or space availability.
    Color-coded for easy understanding of events.

  7. USB Hub
    Used to supply current to the boards.
    Very useful to handle multiple USB connections to a Laptop while debugging the project.
    Cheap and reliable.

2 minutes demo of the current version: Demo

Below, there are some images taken during the development process:

Main board
main

Infrared receiver board
ir

Display board
display

Photos when the components are integrated together:
p1

Left - main board and motion sensor, Center - IR receiver board, Right - Display board

p2

p3

Schematics

Kicad

Bill of Materials

DeviceUsagePrice
2 x Raspberry Pi Pico WHThe secondary boards2 x 56 RON
Raspberry Pi Pico 2 WThe main board40 RON
Infrared Sensor VS1838BReceive IR signals1.77 RON
Infrared RemoteSend IR signals10 RON
SG90 Servo MotorUsed to move the barrier12 RON
Display SSD1306Display parking space info34 RON
Infrared Obstacle SensorDetects a parked car3.5 RON
LEDsUsed to signal certain events0.30 RON
ResistancesFundamental in every circuit0.10 RON

Software

LibraryDescriptionUsage
cyw43Rust driver for the CYW43439 WiFi+Bluetooth chipUsed for WiFi communications between the boards.
embassy-rpAccess to the Raspberry Pi Pico W peripheralsUsed for GPIO, PWM, and other peripheral interactions.
embassy-netNetworking stack for embedded systemsUsed for TCP socket communication and network stack initialization.
embassy-timeTime management for embedded systemsUsed for delays and timers in tasks.
defmtLogging framework for embedded systemsUsed for logging events and debugging information.
fixedProvides fixed-point arithmetic supportUsed for configuring PWM with precise timing values.
heaplessProvides heapless data structuresUsed for creating fixed-size strings for sensor state messages.
static_cellProvides statically allocated memoryUsed for allocating resources like the network stack.
embedded-graphicsGraphics library for embedded systemsUsed for rendering text and graphics on the OLED display.
ssd1306Driver for SSD1306 OLED displaysUsed for controlling the OLED display to show parking lot status.
  1. First time trying sensors on RP
  2. Learning about IR receiver
  3. Demo
  4. Demo Final
This post is licensed under CC BY 4.0 by the author.

Trending Tags