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
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.
All the boards communicate with between them 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
Week 19 - 25 May
Hardware
Detail in a few words the hardware used.
Schematics
Bill of Materials
Device | Usage | Price |
---|---|---|
2 x Raspberry Pi Pico WH | The secondary boards | 2 x 56 RON |
Raspberry Pi Pico 2 W | The main board | 40 RON |
Infrared Sensor VS1838B | Receive IR signals | 1.77 RON |
Infrared Remote | Send IR signals | 10 RON |
SG90 Servo Motor | Used to move the barrier | 12 RON |
Display SSD1306 | Display parking space info | 34 RON |
Motion Sensor PIR HC SR505 | Detects a parked car | 10 RON |
LEDs | Used to signal certain events | 0.30 RON |
Resistances | Fundamental in every circuit | 0.10 RON |
Software
Library | Description | Usage |
---|---|---|
cyw43 | Rust driver for the CYW43439 wifi+bluetooth chip | Used for WIFI communications between the boards |
embassy-rp | Access to the boards' peripherals | Used for various interactions between components and actions |
defmt | Logging framework | Logged certain events and actions to the console for debugging |
fixed | Provides fixed-point numbers | Used when configuring PWM |