#12 Car Parking System With micro:bit
Today, buildings such as hospitals, schools, business centers, etc., often have open or closed parking lots where a large number of people enter and exit. The main reason for the construction of these parking lots is the significant increase in automotive usage in cities. Barrier systems are installed at the entrances of these parking lots to control access. While people were assigned to control these barrier systems in the past, nowadays, with the advancement of sensor technologies, automatic access systems are used. Vehicles are detected using various sensors, the barriers are raised using motor systems, and vehicle passage is allowed.
In this project, we will use the ultrasonic distance sensor connected to PicoBricks to create a barrier system by using waste bins found in our home, depending on the value detected by the sensor. By moving the servo motor connected to the prepared barrier system to the desired angle and we will allow vehicle passage. A checkmark icon (✓) will appear on the Micro:Bit Matrix LED when permission is granted for passage, and a cross (X) icon will appear when permission is denied.
Connection Diagram:
You can prepare this project by breaking down PicoBricks modules at proper points.

Project Images:
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
MakeCode Code of The Project
Python Code of The Project:
#Car Parking System
from microbit import *
from picobricks import *
motor = motordriver()
motor.servo(1,90)
while True:
distance = measure_distance()
#print(distance)
if round(distance)<6:
motor.servo(1,180)
display.show(Image.YES)
sleep(1000)
else:
display.show(Image.NO)
motor.servo(1,180)
MicroBlocks Code of The Project