Online Parking Reservation

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 13

QR Code Scanner Enabled Smart Car

Parking System using Raspberry Pi with


Android App Access
Yesha Patel1[ ], Preksha Gandhi1, Swapnil Shah1, Shital Soman1, Arpan Desai1
1
Charotar University of Science and Technology, Changa, India
[email protected]

Abstract: - A smart parking system using Raspberry Pi and android app access is
proposed in this article. An automated smart parking system which provides the user to
pre-book along with on the spot booking facility of parking spaces available around the
area is implemented. The system also helps to store the user’s information in database
which enables for fast parking access thus reducing the traffic congestion. The hardware
is realized using Raspberry Pi and IR sensor. In addition, the system is controlled
through an app which is made using Kodular App Development tool, that helps the user
to keep track of the updates about available parking spaces. The scalable and precise
database can be created on firebase and host it on an application in real-time which is
useful to store data in a json format (bucket format).The system is a perfect partner for
people to book the parking spaces at their ease from remote locations without wasting
time and avoiding traffic congestion.

Keywords: QR code scanning, Real-time Database, Slot booking, Admin Management

1. Introduction
Internet of things (IoT), a topic most discussed nowadays is a concept that connects
billions of devices with the internet at any time and any place. The increasing traffic
congestion has also led to increase in pollution. The number of vehicles is skyrocketing
in India which causes imbalance in the ratio of vehicle and available parking spaces. In
metropolitan areas, the traffic has also caused increase in anxiety level of drivers [1].
One of the most common problems today is less availability of parking spaces. Vehicles
continue to outnumber existing parking spaces, thus clogging roads. Incidences of
violence due to occupancy, deformed cars due to a space crunch, and overcharging for
parking are some of the problems. The families are getting smaller but the total number
of motor vehicles is exceeding the total number of heads per family which worsens the
current parking scenario in the country. The situation is such that on any given working
day approximately 40% of the roads in urban regions are taken up just for parking the
cars. The problem has been further exacerbated by the fact that people from low-income
groups are also able to own cars. Most cities propose increasing parking spaces to
combat the problem. Parks and vacant plots are used as potential parking spaces. Multi-
level facilities are being built, irrespective of the limited land space and resources [2].
The other major problem is that the organizations do not have a secured and updated
data of the drivers parking in their area. There is a huge proliferation in the population
along with the number of vehicles in the country. This has led to mismanagement of
parking spaces which has further created some problems like traffic congestion [3].
Thus, an automated smart parking system is required to be developed. It would help
driver to locate the parking slot easily and also help in decreasing air pollution.
According to a survey, 60% of driver’s on-road feel anxious and stressed due to the
road concession [4]. Barcodes were first invented but the storage capacity for barcode
was less as it can store only 20 alphanumeric characters of information and the demand
of users was to have more storage capacity and so new type of code was introduced
called QR code. QR stands for Quick Response which was termed by Denso Wave
Company. QR is used to take a piece of information from a temporary media and put it
in the mobile [5-6]. QR codes are two-dimensional matrix barcode that has to be
scanned. QR code can hold up to 7089 characters. Nowadays QR code is used by users
in mobile phones itself to scan anything or to purchase any product [7]. The QR code
is combination of white and black square patterns and is having encoding and
functioning region. Alternative to QR codes is implementation of devices with antennas
which has higher range and directivity. There are many antennas proposed for smart
applications which can be used for such applications [8-11]. The devices can be made
smaller if the antenna sizes are reduced [12-13]. However in the current application as
the distance between user and system is not far, QR code will suffice the purpose.
In this article, the above problems are taken care of by deploying a smart parking system
which helps to reduce the traffic congestion while providing easy access to available
parking spaces through a touch on the phone. The application installed on the phone
helps the user to find exact location of the free slots. The user can preregister in the app
to reduce the time while arriving at the parking facility. QR code which is installed on
the vehicle is scanned at the entrance which gathers the user information and checks the
booking data with database thus allowing fast access to the parking slots. The user is
directed to the available parking spots according to the data gathered using raspberry
pie and sensors employed in the parking lot. It reduces time consumption and also
parking issues [14].

2. Methodology
The successful implementation of the proposed smart car parking system includes
Raspberry Pi, IR Sensor, Servo motors, Firebase Database, Android application all
combined together where the real-time database management is done. A database is a
collection of information that is structured in a systematic way so it is easily accessed,
updated and available. Firebase is “NoSQL” database which is useful for data stored in
more than one computer which is located in the same physical location or over network
of linked computers. “NoSQL” stands for “not only SQL” and is useful for big data
carrying out problems [15]. The aim behind creating a database is to store data in a
minute way and to get the data whenever needed [16]. We consider firebase as web
application platform. It stores data in JavaScript object notation (JSON) format which
doesn’t use any question for updating, deleting or adding any data to it. It is used to
store the data and hence it is backend of a system [17]. To create the mobile app and
web application firebase provides a particular platform and also can update it
immediately [18]. The main features of firebase are real-time database, Authentication,
storage, and cloud messaging. The real-time database is accessed through cloud
platform and allows users to host it without having its dedicated hardware. Data is
stored as JSON and is occurred at the same time to each related client. The user demand
is more based on Real-time data example and when the new data is updated the instance
gets change or updated. Firebase authentication gives backend services. For proving the
identity of the user firebase uses password, email-id, or user name, phone number. The
transferred documents can be easily stored and also can be downloaded. The message
can be transferred through Cloud messaging without any expense.
The IR sensor and servo motor are interfaced with Raspberry Pi, which combinedly
makes the network of hardware. This proposed system is divided into three parts: User,
Developer and Staff Manager of the particular Building. The programming of the
Raspberry Pi is done in such a manner that whenever any IR sensor senses a car, it will
reflect as the change in status of the spot on the firebase database. The servo motor is
interfaced with Raspberry Pi for entry and exit barrier, which will be enabled due to the
entry IR sensor and exit IR sensor. If the parking is full or there will be no slots
available, in this situation entry servo motor will not open the barrier. The entry IR
sensor will count the total number of cars visited the parking area.

(a) (b)

Fig. 1. (a) Block Diagram of Hardware Set-up (b) Block Diagram of Software Set-up

As depicted in figure 1, the Real-Time Database is created on the firebase. The


database contains the status of all the parking spots, app-user details, details of QR
code. The proposed system helps the user to find an appropriate parking slot to park
the car. It also provides the direction on google maps so that the user can find the path
easily. The proposed system also allows the user to pre-book the parking slots. The
User app and Super admin app are created using Kodular App editor.

Fig.2. Flowchart for developing the application

The admin app as illustrated in figure 2 is designed in such a way that the admin can
add as many locations as per the requirement. Only the admin has the authority to add
locations of the parking spaces and make them available to the users. As the admin
opens the Parkspot App, the information about entering the latitude, longitude and
unique ID of the place to be generated is asked. Once the submit button is pressed, the
next step comprises of QR generation for the same location, place marker on the map
and creating the database. Once this is done, new location can be added in the app which
can be used by the users.
Fig.3 Flowchart of hardware for on the spot booking

Figure 3 illustrates the user app which is designed in such a way so that the people
can book the parking slot on the spot or pre-book the parking slot at their convenience.
Once the user logged in to the app, the user uses the app for parking reservations.
Once the QR code is scanned, the app prompts to confirm the details such as verifying
the mobile number and vehicle number. The user can select the slot from the list of
available slots through the android app. After the QR code is scanned, the servo motor
will open the parking barrier. Scanning the QR code assures the user's database has
been stored and gets updated once again when the user exits the parking area. The
user app is developed in such a way that the user can easily understand the
functionality.

Fig.4 Flowchart for User interface using App-on the spot booking

Figure 4 shows the steps to be followed by the user using app for on the spot booking.
When the user reach at Parkspot Parking area, the QR code needs to be scanned placed
near the entrance. After scanning the QR code there will be one pop-up window to
confirm the details and select the parking slot from the available spots. After clicking
on confirm button, the selected slot will be allocated to the user.
Fig.5 Flowchart (User App-Pre booking)

The pre-booking facility as shown in figure 5 is designed to control the chaos and
traffic around the metropolitan areas. Once the user enters their details, they are asked
to move the marker of Parkspot to the location they want to park their car. Once the
location is selected, the available slots will be shown on the screen. If the slots aren’t
available the pop-up reads “No slot available”, else the available slots can be selected.
The pop up further reads “you’ve successfully booked”.

3. Experimental Setup
The block diagram of the system is as shown in figure 6. Various hardware’s used in
the experimental setup are Raspberry pi 4 B, Servo motor, IR Sensor and Led.

IR Sensor

Raspberry Pi

Servo Motor LEDs

Fig 6. Block diagram of experimental setup

Fig.7 Raspberry Pi
Raspberry pi 4 B as shown in figure 7 is the latest module of the entire raspberry pi’s
invented. Though it retains similar backward compatibility and power consumption, the
processor speed has increased and also multimedia performance, memory, and
connectivity compared to the last generation. Pi B 4 is ameliorated by high-Performance
Quad-core 4-bit Broadcom 2711.It also has a cortex A72 processor clocked at 1.5GHz
speed. The memory has been upgraded by 1GB-4GB LPDDR4 SDRAM. It has built-
in cypress BLE chip for Bluetooth 5.0. It gives high-speed gigabit ethernet over USB
3.0. There are 40 GPIO header pins and 2 micro HDMI ports. For storage both micro
SD card slot and data storage is available. Additionally for multimedia it has H 265
Decode (4Kp60), H.264, MPEG-4 decode (1080p60). H.264 encode (1080p30).
OpenGL ES 1.1, 2.0, and 3.0 graphics.

Fig.8. Servo Motor

The servo motor as shown in figure 8 is high-quality servo used for the mechanical
needs like in our project needed as parking barriers. It has three pins which include
+Vcc (connected to red wire), GND (brown wire connected to ground) and control pin
(orange wire which drives the motor). The operating voltage of a servo motor is 4.8V
to 6V. It is categorized as an analog servo. The rotary angle of the servo motor is
180degrees. The most important factor that is torque, the motor operates here. SG90
has torque of 2.5kg/cm. This means that 2.5 kg of weight can be loaded on the servo
when it is suspended at a distance of 1cm.

Fig.9. IR Sensor

IR sensor as shown in figure 9 is used to sense the infrared radiations and give the
output based on it. An IR sensor consist of both IR LED and IR Photodiode. It has built-
in IR transmitter and IR receiver. The infrared transmitter is LED which emits infrared
radiations and Infrared receivers detect radiations from IR sensor. Though the Led looks
like a normal LED but the radiations emitted are invisible to human eye. When the
radiations are emitted, they reach the object and some of the radiations reflect back to
the receiver thus giving us the output.
Fig.10. LED

An LED as illustrated in figure 10 is a semiconductor light source, which emits


radiations when it is activated. When the appropriate voltage is passed the electrons and
holes recombine within the device and energy is released in the form of photons. The
colour depends on the energy band-gap of the semiconductor. 30mA is the continuous
forward current and 100mA is the peak forward current of this device. The reverse
voltage is 5V. The hardware setup of the proposed system is shown in figure 11.

Fig.11 Hardware setup of System

Here, the IR sensor senses the car at a particular slot and reflects the change in firebase
database with the help of Raspberry Pi. The entry IR sensor will count the number of
cars entering a day and refreshes the counter after every 24 hours (or any required time
limit). If the parking area is full, the entry servo will not allow the car to enter the
parking area. Other duties like maintaining slots data management of the particular
parking area is done by the staff manager who collects the data from firebase.

4. Results & Discussion


The user-friendly mobile app is developed for the users through which they are able to
book the parking slot as per the occupancy. As the IR sensor, led and servo are
interfaced with raspberry pi the state of occupancy can be known that is, if the car
parked is detected then the user will not be able to book that particular slot. The admin
side has only the authority to add a new location and also the total number of car entries
can be known through admin app.

Case 1: On the Spot Booking

As shown in fig-12, B2 and B3 are pre-booked by users. The available slots are B1,
B4, and B5. For booking the parking slot, the user has to log in into the app.
Fig.12 Firebase Database

As the user opens the app, the following symbol is shown in the app screen as shown
in figure 13. The user has to click on the scan option. So, the QR code appears on the
app which is to be scanned when the user enters the parking area as depicted in figure
14.

Fig. 13. App Screenshot-1 Fig. 14. App Screenshot-2

As the QR code is scanned the user has to check the phone number and vehicle number
for verification as shown in figure 15. Once the required information is entered, the
available slots gets visible as illustrated in figure 16. The user has to choose one of
the slots available.

Fig. 15. App Screenshot-3 Fig. 16. App Screenshot-4


As soon as the user completes all the previous steps, a pop up shows up as shown in
figure 17 which indicates that the slot is booked and the same will be updated in the
firebase as shown in figure 18. As the user booked the slot B5 the firebase shows only
B1 and B4 as available thus updating it in the app.

Fig. 17. App Screenshot-5 Fig. 18. Firebase Database

Case 2: Power of Admin

As the admin opens the application, 3 choices are available as shown in the figure 19.
Once the admin clicks on the location services, the screen as shown in figure 20 show
up. The admin further has 3 options

Fig. 19. Admin App Screenshot-1 Fig. 20 Admin App Screenshot-2


As the admin clicks on the first option for adding location, the following details are to
be filled as shown in figure 21.
Fig.21. Admin App Fig. 22. Admin App Fig. 23. Admin App
Screenshot-3 Screenshot-4 Screenshot-5

As the details are filled up, the admin is taken to the next step where the confirmed
details are shown and further admin can generate QR code as shown in figure 22. The
QR code is generated in the browser thus adding a location which is illustrated in figure
23.

The admin is taken back to the main menu as shown in figure 24 where if the admin
clicks on the “delete location”, admin is taken to the next page as shown in figure 25.
The admin will be asked to choose an ID that needs to be deleted as shown in figure 26.
A confirmation page shows up and on clicking continue the location selected is deleted
as depicted in Figures 27 and 28.

Fig.24 Admin App Fig.25 Admin App Fig.26 Admin App


Screenshot-5 Screenshot-6 Screenshot-7
Fig.27 Admin App Fig.28 Admin App
Screenshot-8 Screenshot-9

The admin is further taken to the main menu. The next case is if the admin wants to see
the updated database, the admin can click on the database option as shown in figure 29.
On clicking the database option there are 2 choices wherein the admin can choose the
firebase as depicted in figure 30. Thus, the admin is taken to a firebase webpage where
the admin is shown the updated list of parking spaces available and occupied. The
admin can also see the locations available as shown in figure 31.

Fig.29 Admin App Fig.30 Admin App Fig.31 Admin App


Screenshot-10 Screenshot-11 Screenshot-12

Case 3: Hardware Implementation

Fig.32 B2 and B3 slots are Fig.33 B5 slot is occupied (case-1)


booked (case-1)
As shown in figure 32, when one car enters the parking slot, B3 and B2 are already
booked and the car has scanned the QR code and book the slot. Then the car moves
forward where the entry IR sensor senses the car, thus the servo motor opens and it can
occupy the booked parking space. The other car scans the QR code while first car is
parking in B5 as depicted in figure 33which helps in decreasing traffic congestion.

Fig.34 No slots available (U-turn) Fig.35 Parking area full

When the car enters the parking space and scans the QR code as illustrated in figure 34,
a message pops up saying all the parking slots are full, thus not passing the command
to the servo. This doesn’t allow the servo to open the barrier and the car takes a U-turn
from the gate itself as shown in figure 35 which is an indication of parking full. This
decreases the time consumption in finding spaces and also decreases the fuel
consumption.

5. Conclusion
This paper presents a smart parking system. The struggle of finding a parking space in
the metropolitan areas will be eliminated through the proposed system. Consumers will
save time through this system and the organizations will be able to keep updated and
secured information of the consumers parking in their area. The proposed online
booking system will also alleviate traffic congestion and pollution in the cities.

References
[1] Jain, V., Sharma, A. and Subramanian, L., 2012, March. Road traffic congestion in
the developing world. In Proceedings of the 2nd ACM Symposium on Computing for
Development (p. 11). ACM.
[2] Alsafery, W., Alturki, B., Reiff-Marganiec, S. and Jambi, K., 2018, April. Smart
Car Parking System Solution for the Internet of Things in Smart Cities. In 2018 1st
International Conference on Computer Applications & Information Security
(ICCAIS) (pp. 1-5). IEEE.
[3] Idris, M.Y.I., Leng, Y.Y., Tamil, E.M., Noor, N.M. and Razak, Z., 2009. Саг park
system: a review of smart parking system and its technology. Information Technology
Journal, 8(2), pp.101-113.
[4] Mejri, N., Ayari, M., Langar, R., Kamoun, F., Pujolle, G. and Saidane, L., 2014,
June. Cooperation versus competition towards an efficient parking assignment solution.
In 2014 IEEE International Conference on Communications (ICC) (pp. 2915-2920).
IEEE.

[5] Tarjan, L., Šenk, I., Tegeltija, S., Stankovski, S. and Ostojic, G., 2014. A readability
analysis for QR code application in a traceability system. Computers and Electronics
in Agriculture, 109, pp.1-11.
[6] Zainuddin, M., Baswaraj, D. and Riyazoddin, S.M., 2012. Generating SMS (Short
Message Service) in the form of Quick Response Code (QR-code). J. Comput. Sci. Inf.
Technol, 1(1), pp.10-14.
[7] Pandya, K.H. and Galiyawala, H.J., 2014. A Survey on QR Codes: in context of
Research and Application. International Journal of Emerging Technology and
Advanced Engineering, 4(3), pp.258-262.
[8] Desai, A., Upadhyaya, T., Palandoken, M., Patel, R. and Patel, U., 2017, November.
Dual band optically transparent antenna for wireless applications. In 2017 IEEE Asia
Pacific Microwave Conference (APMC) (pp. 960-963). IEEE.
[9] Desai, A., Upadhyaya, T.K., Patel, R.H., Bhatt, S. and Mankodi, P., 2018. Wideband
high gain fractal antenna for wireless applications. Progress In Electromagnetics
Research, 74, pp.125-130.
[10] Desai, A., Upadhyaya, T. and Patel, R., 2019. Compact wideband transparent
antenna for 5G communication systems. Microwave and Optical Technology
Letters, 61(3), pp.781-786.
[11] Desai, A., Upadhyaya, T. and Palandoken, M., 2018. Dual band slotted transparent
resonator for wireless local area network applications. Microwave and Optical
Technology Letters, 60(12), pp.3034-3039.
[12] Patel, R.H., Desai, A.H. and Upadhyaya, T., 2015. Design of H-shape X-band
application electrically small antenna. International Journal of Electrical Electronics
and Data Communication (IJEEDC), 3, pp.1-4.
[13] Patel, R.H., Desai, A. and Upadhyaya, T., 2015. A discussion on electrically small
antenna property. Microwave and Optical Technology Letters, 57(10), pp.2386-2388.
[14] Goyal, S., Yadav, S. and Mathuria, M., 2016, September. Exploring concept of
QR code and its benefits in digital education system. In 2016 International Conference
on Advances in Computing, Communications and Informatics (ICACCI) (pp. 1141-
1147). IEEE.
[15] Chatterjee, N., Chakraborty, S., Decosta, A. and Nath, A., 2018. Real-time
Communication Application Based on Android Using Google Firebase. Int. J. Adv. Res.
Comput. Sci. Manag. Stud.
[16] Yu, P.S., Wu, K.L., Lin, K.J. and Son, S.H., 1994. On real-time databases:
Concurrency control and scheduling. Proceedings of the IEEE, 82(1), pp.140-157.
[17] Chatterjee, N., Chakraborty, S., Decosta, A. and Nath, A., 2018. Real-time
Communication Application Based on Android Using Google Firebase. Int. J. Adv.
Res. Comput. Sci. Manag. Stud.

[18] Srivastava, N., Shree, U., Chauhan, N.R. and Tiwari, D.K., 2017. Firebase Cloud
Messaging (Android). International Journal of Innovative Research in Science,
Engineering and Technology, (An ISO 3297: 2007 Certified Organization), 6.

You might also like