0% found this document useful (0 votes)
220 views71 pages

Final Project

Uploaded by

MAROOF OYEWO
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
220 views71 pages

Final Project

Uploaded by

MAROOF OYEWO
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 71

CHAPTER 1

INTRODUCTION

1.1 BACKGROUND OF STUDY

Nowadays, there is an unprecedented increase globally in the number of

cars in urban metropolis. Developments of parking spots which are usually

limited in number are implemented across most urban centres to address

the challenge of parking of vehicles. However, finding a parking spot in

public places such as shopping malls, offices, organisations, stadiums and

universities poses great challenge to motorists thereby increasing the

amount of productive time wasted and carbon soot released into the

atmosphere enroute to any destination. (Parmar J. et al. 2020)

Vehicle parking systems incorporating the use of parking lots and facilities

that can support maintaining a pleasant urban life for people and vehicles

have been proposed overtime. These parking management systems are

usually an integrated solution that can monitor, manage and optimize

parking spaces, thereby helping in improving overall flow and ensuring

that spaces are used efficiently. (Kalasova, A. et al. 2021)

According to Iyaka (2017), people make use of two different sort of parking management

systems namely: The Automatic Parking System and the Marshalling Parking System. The

Marshalling Parking System is a type of parking whereby an officer or officers are required

to be on ground so as to indicate to drivers where there is a slot available. The automatic car

parking system, on the other hand, is a type of parking that is designed to help the driver and

1
administrators of the parking status by putting screens to notify drivers of the number of

spaces available.

Over the years, the automated parking system as defined above has proven to be inefficient

thereby necessitating the development of more sophisticated system that integrates various

technologies such as IoT, Arduino, RFID and Bluetooth in the management of vehicle parks.

The resulting product became referred to as Smart Parking System. The implementation of a

smart parking guiding system can greatly minimize the difficulties in conventional parking

systems (Poonam, 2018).

Hence, this project work seeks to design and implement an IOT based Smart Vehicle Parking

System with automated reservation authentication to address the inefficiency associated with

previous vehicle parking systems.

1.2 Statement of the Problems

Free parking spots are very difficult to locate in a large traditional parking lot due to the

plethora of cars parked. Valuable time, effort and fuel are wasted in the process of looking for

a free spot not to mention the unnecessary increase in carbon footprint. Some car owners, out

of urgency, end up parking on illegal parking spaces such as on lawns and highways. These

situations lead to loss in productivity, traffic hazards and deterioration of the atmosphere by

increased output of greenhouse gases.

In previous works on smart car parks, the mode of verification and authentication of drivers

who enter to park in the spots that they subscribed to is usually a manual process needing the

attendance of security personnel who may be in limited number hence causing prolonged

waiting periods by car owners waiting to be authenticated especially at peak hours.

2
Lastly, the mode of payment in previous works on parking spot subscription payment is

usually not integrated with the web application section of smart parking systems. Payment is

designed to be made at a specific location in the vicinity of the parking lot. This poses

inconveniences as clients will have to walk or drive to make payment at that location before

making their way to the parking spot they subscribed to. Hence, there is need to develop an

IoT based Smart Vehicle parking system with automated reservation verification which can

eliminate these limitations.

1.3 Aim and Objectives of the Research

The aim of this project is to develop an IoT based Smart Vehicle Parking System with

Automated Reservation Verification.

The objectives of this research are to:

(a) Design an IoT based smart vehicle parking system for a mall in an urban centre.

(b) Build a physical miniature prototype of the designed IoT based smart vehicle parking

system

(c) Implement a smart vehicle parking system such that uses internet web application

services to generate billed reservations of varying durations with QR code for

verification and controlled access of car owners.

(d) Test the constructed IoT based smart vehicle parking system with automated

reservation verification for efficiency

1.4 Significance of the Research

This work would be relevant in the following ways:

3
(a) Environment: The proposed study, by reducing the duration in locating an

available parking space, cuts down heavily on the amount of CO 2 emissions,

noise and traffic congestions.

(b) Convenience: Finding a parking space on arriving at a destination can be very

frustrating, especially at peak hours, but with this study, the process can be

achieved with relative ease. Thus, this study would offer convenience for the

vehicle users.

(c) Ease in verification/authentication: The need for manual verification process

by parking lot personnel which could be labourious and sometimes inefficient is

eliminated due to the generation of a QR coded reservation used to gain access

to a parking space.

1.6 Scope of the Research

This research is focused on designing a seamless parking space subscription process and a

way of monitoring the status of the parking lot. Automated verification and authentication

process is introduced. All these features are powered by IoT technology. The case study of

this research shall be the parking lot at Delta Mall, Effurun.

4
CHAPTER 2

REVIEW OF RELATED WORKS

2.1 INTRODUCTION

In this chapter a summary of literatures reviewed on topics relating to vehicle parking

systems as published in accredited journals and conference papers is presented. It further

examined different concepts of vehicle parking management systems, their application and

how the related literatures can help shed more lights on this project.

2.2 RELATED WORKS

When the topical issue of vehicle parking system was studied, it was realized that some

research had already been done, although with different approaches. Therefore, a summary of

the recent studies are included in this work.

Banode et al., (2022), presented an automated car parking system that employs a monitoring

system comprising inductive sensors, LED strips and programmable logic controller (PLC).

LEDs were utilised as indicators to direct car drivers to available parking spaces. The

SIMATIC S7-1200 PLC was used in the project. It is an adapted industrial computer for

controlling manufacturing processes such as assembly lines, machineries, robotic devices, or

any activity requiring high dependability, ease of programming, and process fault

identification. This method is simplistic and lacking the sophistication needed for real time

and remote monitoring by clients of the parking status of the spaces in the lot. This

reinforcement can be implemented through a database and web server connected to

microcontrollers which receive signals from the inductive sensors. It also lacks an integrated

5
subscription and verification system which are services that can be provided by dedicated

software in the server.

According to Elechi P., (2022), in “Improved Automated Car Parking System”, the car is

detected by ultrasonic sensors placed at a given distance on the parking space. Once the

vehicle is detected it is expected to move into the stage of barcode generation. The barcode is

generated through the vehicle number plate. Once a vehicle has been captured, it moves to

get a parking spot but if a parking spot is not available, it waits until one is. When leaving the

parking lot, the barcode must revalidate the vehicle. During exit of the client, the barcode

will be revalidated again to compare the plate number captured during entry to that captured

during exit. If there is a match, access will be granted to the car to leave but if no match is

found, that means no access. Therefore, from the result, an ultrasonic sensor will have to

detect the presence of the car again at the exit route to grant access to leave. Although vehicle

verification is efficient in this work, clients do not have prior knowledge of an available

parking space before arrival at the car park due to absence of an integrated remote monitoring

system. They still have to wait on site until a space is available.

Chakravarthy et al., (2022) designed a system that aids drivers with information about

distances between the vehicle and a wall or obstacle. This system uses sensors like ultrasonic

to get the information about the distances and an LED strip to guide the driver about the

distances. Depending on the distances the LED will indicate either red or green and also the

number of glowing LEDs. The two signals to the LED are pre-calibrated after considering the

garage spacing. This system can effectively remove the chance of accidents while parking a

vehicle in the garage.

6
In Saranya et al., (2022), IR sensors were used in the object detection technique for assigning

parking spaces to the vehicles. When a vehicle approaches the IR sensor, the signal is sent to

Arduino UNO through which it is connected to the IR sensors. The Arduino is used for

connecting multiple IR sensors where each IR signal corresponds to their respective parking

space. A serial type communication between Arduino and Wi-Fi ESP8266 is represented as

the Wi-Fi module. The output of Arduino is sent to the Wi-Fi module which sends an output

signal to Blynk app. In Blynk app, the availability of parking slots is monitored and also the

LCD will display the number of vacant slots and occupied slots.

In the research of Wickramanayake et al., (2022), “ParkMate: An Image Processing Based

Automated Car Parking System”, the parking management was linked to the main system for

online booking facilities, monitoring vehicles by an automated number plate detection

system, and generating parking bills depending on parking time. A deep learning algorithm

technique to identify the registration plate accessing the parking space entrance using a PI

camera was included. Lastly, mobile application users can find and book a parking slot in

advance. This system, although, sophisticated misses out on client authentication.

Ritul et al., (2021) proposed a PLC based automatic car parking system which can be used in

multilevel parking. This system shows the driver exact place to park the vehicle at the entry

point of parking in a screen outside of the parking lot. Also, it counts the total number of car

parked and displays it outside the parking lot. Lastly, at the entrance the number of empty

spots is displayed. This helps in saving the time of the driver in locating where to park the

vehicle.

The architecture of the system designed by Alkhuraiji (2020) is based on a four-layer model

and the Users-Android application interface-Server-Parking area. Users can make a booking

7
through an android application interface that is linked to the server to send and receive

information about users. The server acts as an intermediary between the users and area

parking. The IR sensor devices are responsible for area parking (hardware) and

sending/receiving parking information to the server through the Arduino platform. The

application uses several programming techniques in Android Studio and SQL Database.

Results showed that the efficient management of the available parking spaces is

demonstrated.

Navaneetha et al., (2020) proposed a smart parking system which consists of an on-site

deployment of an IoT module that is used to monitor and signalize the state of availability of

each single parking space. A mobile application was also provided that allows an end user to

check the availability of parking space and book a parking slot accordingly. Lastly, the work

described a high-level view of the system architecture and discussed the working of the

system in form of a use case that proves the correctness of the proposed model.

Hunusekatte (2020) proposed automation of billing system for smart parking of vehicles at

Institutions. The system employed RFID tags and scanners connected to a server through a

Microcontroller (MCU) which communicates with a GSM module to process payment by

parking client. Also, the MCU send command to the GSM module to send the billing details

as an SMS to the user and also displays basic user data such as car model, amount and time of

transaction on the LCD screen. However, there is no provision to subscribe for a parking spot

beforehand and make payment through web services by internet prior to coming to the

parking lot.

Ali and Hamid, (2020) developed a smart parking system for Air University such that

whenever a car enters or leaves the parking, CCTV cameras are recording continuously. The

8
system software processes these videos, on the server-side and calculates the newly available

and occupied parking slots. Whenever a change in the parking slot occurs, a request is sent to

update the database. While on the client-side, an API service is running continuously, this

asks for the new data from the database. Whenever the database is updated, the new data is

sent as an API response. The response then updates the web application about the newly

available parking slots.

According to AbdulMalik (2020), a mobile web application is used for the purpose of

allowing the end user to check the availability of parking space and to make payments online.

This system is a much more efficient alternative as the user does not need to go and buy the

parking coupons manually and it does not require downloading any application. This work

will serve as the solution to the out dated and inconvenient old manual system. Users will

only need to register their vehicle information in the system and make online payment for

their parking space. Users will have the ability to search for empty parking space on the go

using the system’s web application because the parking lot data will be synced in real-time.

Parking attendants will also be able to check and monitor the user’s information limit through

the system within the parking time. The downside of this research is the manual method of

authentication of the parking clients through the use of parking attendants.

Kunwar, 2019, implemented an automated car parking system that ultimately allows a gate to

open as a car approaches the exit gate. Car owner was allowed to leave the parking space and

as s/he left, LCD displayed the parking spaces available as one occupied space has been

freed. Now to check the balance in web browser, browser is reloaded and it shows that 150

units have been deducted from the user balance. By this result, it has been confirmed that the

valid tag has worked successfully. The challenge of this system is that monitoring is

restricted to the screen display at the entrance of the parking lot. Parking clients cannot

9
remotely monitor the status of the parking spaces at the lot on their mobile devices or

computers through the internet. This limitation prevents drivers from planning their parking

positions ahead of time.

Azshwanth et al., (2019) implemented a CMOS, ultrasonic and electromagnetic sensor for

the conception of detecting the presence of the car in the parking slot. Then with the help of

an Arduino and modem the signal is transmitted wirelessly to the receiver. In display level

there are two aspects which are taken care of. Firstly, the parking area once booked changes

the colour of LED in the parking slot to indicate that it is taken. Secondly, the user’s mobile

application and the server work at the client level and admin level. This in turn helps the user

to understand the processes happening in real time with the help of the display unit in the

system optically. The limitation of this work is that upon arrival of the subscriber at his

parking space, verification has to be done manually by a checking officer or personnel before

he is allowed to park his vehicle.

Elakya (2019) developed a smart parking system using IoT wherein the data collected from

the sensor, is analysed and processed to obtain the output. When the user enters the parking

area, RFID card allotted to the registered user is scanned by the reader module thus ensuring

the security of the user identity. This enables the user to get the information of the available

parking space as well as SMS notification to the registered user’s mobile number. It consists

of three parts where first part is the parking area which include Arduino devices along with

IR Sensor. The user interacts with the parking area with the help of these devices. The second

part includes the cloud web services which act as a mediator between the user and the car

parking area. The cloud is updated according to the availability of parking area. The cloud

service is administered by the admin but it can also be viewed by the user to check the

availability. The third part is the user side. The user gets notified for the availability via SMS

10
through GSM module. The user interacts with the cloud as well as parking area. The user gets

the notification when the parking availability is full which saves the time for the user.

Ch’ng Shu Fen, (2019) proposed a web-based car parking slot monitoring system wherein an

NodeMCU V3 board and Arduino UNO are used to control the infrared (IR) sensor modules,

liquid-crystal display (LCD) and servo motor. When the NodeMCU V3 board receives the

signal from IR sensor at the entrance and exit, it controls the movement of servo motor. At

the same time, the parking slot available will also display on webpage. When the number of

cars is less than 12, cars will be allowed to enter until it reaches the maximum value, which

are 12 cars. When the number of cars in car park reaches maximum, no car will be allowed to

enter the car park. The number of car park slot available will be shown on the LCD display.

User may also scan QR code before entering the car park, so that they will know the exact

slot that is empty and find the empty slot in the shortest time frame.

According to Otchere et al., (2019), the authorized car parking alert application uses IR

technology and requires no human intervention when used for vehicle detection. This

technology helps the drivers to quickly check-in and checkout from the parking lot and also

makes the parking space secure. The IR sensor at the entry point helps in avoiding multi

check-ins thus avoiding traffic congestion in the parking lot. The IR technology enables

automatic Parking fee collection thus saving time of the drivers. The main components of IR

technology that are used for the purposes are IR labels, IR readers, software system and a

barrier to control the gate. The transaction management, reporting and operational tasks are

controlled by the software used in IR. A database management system is also used to manage

and record the vehicle tracking data.

11
Tahir, (2018), implemented an automatic car parking system that controls the entry and exit

of cars and know the status of the park before entering. It consists of sensors, a controller,

motors for enter and exit and other actuator to know the authorized persons. The system can

be divided into three parts, input unit, processing core, and the output unit. The input is RFID

(radio frequency reader) which is used to supply the microcontroller with input signals that is

required to process signals from a group of sensors. The sensors are used to read inside the

park, output terminals are used to handle the output signals from the microcontroller.

Savan et al., (2018) did a comparative analysis of different algorithms used in IoT based

smart car parking systems. The study showed how different algorithms or combination of

different algorithms (Hybrid Algorithm) can contribute to the efficiency in organizing any

automated car parking system. First Come First Serve (FCFS) is used for the car allocation in

queue. Priority (PR) is used for priority base queue assigning to the car. Distance Geometry

Problem (DGP) is used to determine absolute position of car in space. Vehicle-2-vehicle

(V2V) and Vehicle-2-infrastructure (V2I) technologies allow vehicles to communicate via

wireless to issue security warnings and to share traffic information. Round Robin (RR)

algorithm used for load balancing in smart parking system for reduce traffic problem. Study

State Evolutionary Algorithm (SSEA) used for optimal allocation of parking lots.

Alsafery et al. (2018) developed a system such that data is collected from different

distributed sensors in indoor parking and on-street parking, analysed and processed locally

with the help of IoT devices. The data is then evaluated by using machine learning

algorithms, which in turn processes according to predefined conditions. In addition, the

system includes mobile phone application that lets users easily check the nearest car parking

with avoiding possible traffic congestion via Google API, which provides a real time reading

of the traffic status. The cloud web service collect the data from fog micro-controller

12
distributed devices that are near users’ location to start analysing and processing data. Then

the data will be transmitted to users to indicate the nearest available parking which offers the

lowest traffic congestion. Therefore, the user will receive an immediate response from the

cloud showing the number of available parking places represented in the map with the less

crowded roads from users existing location.

Bharath et al., (2018), proposed a smart parking system that has less complex design with

fewer components, smaller installation space and reduced power consumption but allows pre-

booking. The system allows user to give individual parking preference. It automatically

deducts amount from user’s wallet. It de-allocates the parking slot once the car leaves and

makes payment. System notifies user of allocated slot through SMS during booking and

deducts charges during exit. User can check the status of parking slot through browser or

Android Application and reserve specified parking slot if available.

According to Iyaka (2017), an automated car parking system which enables drivers to enquire

about the availability of a parking space was developed. In the instance of a spot becoming

available, drivers can reserve the space in order to eliminate parking difficulties or conflicts

when they arrive at the parking lot. With the electronic parking system, drivers can book for a

spot in various ways such as: sending SMS, making a phone call and internet subscription. It

starts with the user booking for a spot by executing the right command which sends a signal

to the sensor which will reserve the selected spot for a specific duration. If the user arrives at

the spot before the expiry of the duration, he will have access to the parking and use the

reserved spot. If the user arrives after the reservation period, then he will have to get allocated

to another parking spot from the gate. The limitation of this system is the absence of payment

in the reservation process. The parking client would be required to pay only after arriving at

the destination at a specified location in the parking lot. This will cause unnecessary delay for

13
the driver before he parks his vehicle. Also there is no means of automated verification and

authentication of the client when he gets to the parking space.

Kaarthik et al., (2017) proposed an image processing based intelligent parking system that

uses cameras to register images of the parking. In the proposed idea, the camera is used to

sense the empty space by video image detection. The image of the moving vehicle is captured

and then allowed to go through image segmentation and edge detection through boundaries

with canny operator method. First the parking area is scanned zone by zone and then the

parking space is identified and checked whether there is an empty space available or not. The

problem faced with this method is when the car is moving at a high speed, it becomes

difficult for the cameras to take snapshots since they are not high motion sensor based. Also,

this monitoring system does not come with remote subscription to hold the space as another

client may occupy a targeted space before your arrival.

Myint (2016) developed an automated multi-storied car parking system using RFID in which

the user is informed about the availability of a particular parking spot. The details of the

space are collected using an RFID system and used to update the database periodically.

Entry-point and exit-point of the parking lots is under control with RFID readers, labels and

barriers. Each RFID tag is given a Unique ID (UID). When an RFID tag approaches the

RFID reader, the information and content recorded in the tag is transmitted to the RFID

reader and translated into the computational data which is stored in a database to be used later

for client authentication.

Sewagudde (2016) designed and implemented a smart-parking system for Helsinki Area in

which a driver finds a parking space; proceed to pay his parking fee which requires an action

by the system to check his credit balance to cover for the parking fee charged. Furthermore,

14
the driver will have to obtain an electronic parking permit by invoking the Permit Issuer – an

external system that manages the issuance of parking permit. The Admin and the driver, both

have to Login to the system to verify that they are who they claim to be by using the User

Authentication engine. The system admin manages User Accounts in case of any problem

which may occur during routine maintenance of the system. The Enforcement officer gets

info about parked Cars such as telling if a car has a parking permit or if it has the parking

event running on the system at the end of which the parking fee would be paid.

With respect to parking duration charging fee, Daur (2016) proposed a smart car parking

system that requires as cars exit, the driver’s card is rescanned. The exit time is recorded and

parking charges are calculated based on duration of parking. The parking cost is then

displayed on the display panel. The cost is then deducted from the car owner’s balance and

the database is updated. An SMS is then sent to give information about the amount deducted

and the remaining balance in the card. The System afterwards de-allocates the parking space.

The system notifies the user of the allotted spot through SMS during entry and of the

deducted charges and remaining balance during exit. However, the challenge with this system

of charging parking fee is that the fee is not known until during time of exit which might

cause delay and long queues of drivers at the gate.

Ali et al., (2016) designed and implemented a smart car parking system in which as cars enter

the park, the counter gives the order to the park gate such that it never opens for any car when

the number of cars in the car reaches maximum number. In addition, the same counter is

made for the exit gate (which is the same as the entrance gate in this project) which counts in

reverse order for the cars exiting the park. However, the operation of the park counter is

dependent on a piezoelectric sensor which when depressed by the weight of the car presses a

15
push button, the counter adds or subtracts one from the counter number. Hence, parking

subscription prior to reaching the car park is not feasible.

An intelligent car parking system that is more cost effective and user friendly was developed

by Kepuska H. A. (2016). The first phase of the system made cars detectable in the parking

lot through the use of two ultrasonic sensors, Arduino Uno module, XBee radio and two

LEDs (Red and Green). The second phase which consists of three Xbee radios, Arduino

Mega module and Arduino Uno module aimed at communicating the collected data to the

user remotely. The data contains information about parking lot status which is used in

carrying out corresponding changes in web page, mobile, section LEDs and respective

parking lot LED.

Kutb, (2016), opined that Parking Guidance and Information (PGI) systems provide the

drivers with information about the availability of parking spaces in controlled areas through

Virtual Message Signs (VMS) on the road or through the internet. Previous studies, showed

that PGI systems contribute to reducing the overall traffic congestion by assisting the drivers

in finding free parking spaces without wasting long times in queuing at car park entrances.

The PGI system consists of 4 main components: parking monitoring mechanism, parking

space information dissemination, telecommunications network and control center.

Conventional PGI systems typically use barriers and bar-code machines to count vehicles

entering and exiting the parking area. However, neither the driver nor the parking manager

knows the occupancy status of specific parking spots.

In Ahmed et al., (2016), an active IR sensor is engaged to detect improper parking. The

sensor employs an infrared light source which projects a beam of light that is detected at a

separate detector. The communication module of the receiver unit functions to collect data

16
from the sensor and process them to meaningful information to be forwarded to the entrance

display module and client’s module. Client module allows car drivers to interact with the

system by querying the system for available parking space. This module consists of the

parking application called parker and a website, which car drivers use to gain access to

required information. It also forwards its results to the entrance display and guidance module

for it to be displayed on the LCD board.

Mohammed et al., (2014) did a study on automated car parking system based on

Microcontroller which automatically senses the entry and exit of cars through the gate and

then displays the number of cars in the parking lot. This automated car parking system

reduces the time taken to check the space for vehicles by displaying the available spaces for

parking on a LCD displayer by using infrared (IR) sensors installed at the entrance and exit.

The main goal of this project work is to design and implement an IoT based smart vehicle

parking system with automated reservation authentication. This research project is also

centred on the previous research work shown above but with better modifications. The

development of a web application that allows client users to interact with the parking system

remotely by viewing space status and making reservation is the crux of this work. Also, this

research proposes a QR code scanning technology at the parking lot for driver authentication.

This QR code will be generated and downloaded by the car park client initially during

subscription on the system’s web application.

17
CHAPTER 3

METHODOLOGY AND SYSTEM DESIGN

3.1 METHODOLOGY

In our research monitoring the parking status of the various spaces in the parking lot employs

a set of MQ2 sensors and infrared sensors positioned at each parking space to detect presence

or absence of vehicles. The sensor, on detecting a vehicle, sends the signals to the Atmega328

Main Controller which then relays the signal to the ESP32-CAM scanner. From there, the

sensor signal is sent to the MQTT broker. The MQTT broker unit serves as an interface

between the web application client and the parking mall hardware system. It publishes

messages to web client via ESP32-CAM and vice-versa.

In our research, the web application client allows users to interact with the parking system

remotely by viewing space status and making reservation. This unit is sub-divided into front-

end and back-end. The front-end is graphical user interface (GUI) that users interact with

using their devices (phone or PC). The back-end on the other hand, includes the logic for

handling data storage, query and general requests handling.

It is important to mention at this stage that criteria for determining which client out of many

gets allocated a particular spot is based on First Come First Serve (FCFA) basis. The fact is

that in an instance where more than one client are about reserving a parking spot online, there

must be one of them who will complete this action before the others. The others remaining

will be informed about the update of the spot they were trying to subscribe for and alerted as

soon as a vacant spot is available. For clients who would like to reserve spots at special

parking spots due to their vantage positions, which would cost more than the regular parking

18
spots, will simply indicate a VIP spot of their choice on the online monitoring dashboard and

subscribe for it.

This research proposes a QR code scanning technology at the parking lot for driver

authentication. This QR code had to have been generated and downloaded by the car park

client initially during reservation on the system’s web application. On getting to the parking

lot, the client displays the QR code from his phone screen or downloaded copy directly facing

the QR scanner on the parking space gate. The QR scanner then captures the QR code and

sends it to the database server for authentication. If affirmative, the server acknowledges and

signals the actuator of the gate to open for the client to drive in to his space.

In our research, we have two scenarios:

a) When the parking client is ready to drive out and leave before the expiration of his

parking duration as subscribed for, he simply scans his QR code on the exit gate. On

sensing the QR code, the scanner sends a signal to the MCU comparing the QR code

with the array of valid codes in the database. If a match is found, then the gate is

opened. The sensors on the parking spot will also sense the departure of the car and

communicate with the MQTT broker updating the status of that spot as vacant on the

online monitoring dashboard.

b) The second possibility is if the parking duration expires while the vehicle is still

parked in the space. The QR code will expire and get deleted from the database in the

server rendering it invalid and begin counting for over time charges. The parking

client in this case would need to log in to the client web application to pay for the

added time and regenerate another QR code for the gate to open in order to be able to

drive out.

19
3.1.1 Area of the Study

The investigation of the research was carried out at Delta Mall situated in Effurun; Delta

State of Nigeria sited on a 13,980m2 area on coordinates 5.5708 degrees N, 5.7834 degrees E.

Figure 3.1 below, shows a Google map capture of the complex with the area of study
pinpointed.

Figure 3.1: Area of the study

3.2 DESIGN ANALYSIS

The implementation of this work is in two phases viz: the software design phase and

hardware design phase.

3.2.1 Software Design Analysis

There are two areas involving software design namely; Microcontroller programming and

Web Application programming.

(a) Microcontroller Program: three microcontrollers are involved in this research namely;

Atmega328p, and two ESP32-CAM; one for entry point reservation authentication

20
mounted at the entry gate while the other, mounted at the exit gate, for exit point

authentication.

(i) Atmega 328p program

This program is written in C++ using the Arduino IDE to instruct the microcontroller to

read signals from infrared sensors, send signals to motor driver to control opening-and-

closing of the gates, communicate with LCD to display message, turns LEDs on-and-off

to indicate parking space status, and communicates with the two ESP32-CAM QR

scanners via serial interface. This program provides central control and coordination of

the operation of the entire project hardware system. The source code can be found on the

index page.

(ii) Entrance ESP32-CAM microcontroller

This is used to scan a reservation QR code and send the encrypted value to the HTPP

server to determine its validity. Upon successful validation from the HTTP server, this

microcontroller sends a success status code to the Atmega328p to instruct it to open the

entrance gate. On the other hand, when a user makes a reservation, the MQTT broker will

broadcast it to this ESP32-CAM microcontroller, which it receives and sends it to the

Atmega328p via serial interface to update the status of the reserved parking space. The

status of parking space is also published to the MQTT broker via the entrance ESP32-

CAM. The source code can be found on the index page.

(iii) Exit ESP32-CAM microcontroller

The program for this microcontroller is the same as the one for the entrance ESP32-CAM

microcontroller. The exception is that, it does not publish to the MQTT broker, neither

does it subscribe to reservation change. The source code can be found on the index page.

21
(b) Web Application Program

The web application is written in Typescript using the Next.js framework. Both the front-

end and backend logic are written in Next.js. The backend is in the “api” directory, and it

is responsible for handling all requests such as authentication, reservation, admin actions,

profile set up and many others. The UI style is done using the Tailwindcss due to its

simplicity in creating responsive and beautiful user interface. The code was written in the

VS Code IDE, and it is available on GitHub under this repository:

https://github.com/belloshehu/smart-parking-system-with-qrcode

22
Start

Figure 3.2: System Flowchart


Client reserves a space and generates QR code

Web (http) server generates and


sends info to Atmega328p MCU
through ESP32-CAM

Atmega328p MCU activates the


parking space LED to switch ON to
indicate “Reserved”

Atmega328p MCU starts countdown


of parking duration indicated by
client

Client scans QR code @ entrance gate

ESP32-CAM scanner sends image to


http server for authentication

Is QR code
valid?

Http server sends fail command to Http server sends approval to Atmega328p to activate
Atmega328p to deny entry Welcome message on LED

LED displays “Invalid reservation”


LED displays “Welcome, drive in”

Client drives into space

Client scans QR code at exit gate

ESP32-CAM scanner sends image to


http server for authentication

Http server sends approval to


Atmega328p to activate goodbye
message on LED
Is QR code
valid?
Http sends fail command to
Atmega328p to deny exit LED displays “Bye,
thank you”

LED displays “Exit


denied, pay End
23
overtime”
Figure 3.3: Physical Model

24
3.2.2 Hardware Design Analysis
The system was broken down into units based on the various reviews and components.

A. Power Supply Unit

The power unit was achieved using buck converter module, which converts 12 volt input

voltage (from DC adaptor) to 5 volt required by Infrared sensors, micro-controller, ESP32-

CAM (QR scanner), ESP8266, Gates and LCD modules.

The circuit has the LM567 variable voltage regulator chip with other passive and active

components to provide the chip with ability to provide output voltage within the range of 0 to

12 volt.

+12V +5V

J2
6 5
GND ON/OFF
FEED_BACK
4 L1
3 C3
GROUND
2
OUTPUT
1 1mH
VIN
0.033u
LM2596S-5

Figure 3.4: Power circuit

B. Micro-controller unit

This unit is the heart of the entire circuit as it is where decision making takes place based on

instructions stored in the micro-controller’s program memory. Atmega328p micro-controller

was used in this case and all the peripheral/modules were interfaced with it to either provide

25
signals representing some physical properties or to convert some signals (generated by the

micro-controller) to their equivalent physical forms via INPUT/OUPUT digital and analog

pins respectively.

Clock signal generating circuit consisting of 16MHZ Crystal oscillator with two 2pf ceramic

capacitor provides a stable 16MHZ clock signal for the operation of the micro-controller.

To be able to reset the micro-controller to start from beginning, pin 1 (reset pin) is pulled up

through 10kohm resistor and connected to ground via a button when pressed. The reset pin is

an active LOW pin. Hence, the button is connected between the pin and ground.

+5V

RESET
R6
10k

U5
1 28
(PCINT14/RESET)_PC6 PC5_(ADC5/SCL/PCINT13)
2 27
(PCINT16/RXD)_PD0 PC4_(ADC4/SDA/PCINT12)
3 26
(PCINT17/TXD)_PD1 PC3_(ADC3/PCINT11)
4 25
C5 (PCINT18/INT0)_PD2 PC2_(ADC2/PCINT10)
5 24
(PCINT19/OC2B/INT1)_PD3 PC1_(ADC1/PCINT9)
6 23
(PCINT20/XCK/T0)_PD4 PC0_(ADC0/PCINT8)
7 22
VCC GND_2
22pf 8 21
GND_1 AREF
9 20
(PCINT6/XTAL1/TOSC1)_PB6 AVCC
X3 10
(PCINT7/XTAL2/TOSC2)_PB7 PB5_(SCK/PCINT5)
19
16MHz 11 18
(PCINT21/OC0B/T1)_PD5 PB4_(MISO/PCINT4)
12 17
C6 (PCINT22/OC0A/AIN0)_PD6 PB3_(MOSI/OC2A/PCINT3)
13 16
(PCINT23/AIN1)_PD7 PB2_(SS/OC1B/PCINT2)
14 15
(PCINT0/CLKO/ICP1)_PB0 PB1_(OC1A/PCINT1)
22pf ATMEGA328P-PN

Figure 3.5: Microcontroller Unit

26
C. QR scanner unit

To enable entry and exit through entrance and exit gates respectively, motorists are

authenticated using QR code associated with their reservations. The code is scanned using

QR code scanner and the decode data is sent to server for verification to ensure that the

reservation is not expired.

Two ESP32-CAM modules were used in this case as QR code scanners at the two gates.

Based on the response received from server, both can tell Atmega328p to either open or close

respectively. If a scanned reservation is valid, QR scanner informs the micro-controller to

open the gate it is associated with (entry or exit). Otherwise, the gate is closed. The

communication between the ESP32-CAM and Atmega328p is achieved via serial pins,

whereas the one between ESP32-CAM is via internet through an access point.

+5V

U5
8 9
5V 3V3
7 10
GND_1 IO16
6 11
IO12 IO0
5 12
IO13 GND_2
4 13
IO15 VCC
3 14
IO14 U0R Tx
2 15
IO2 U0T Rx
1 16
IO4 GND_3
ESP32-CAM

Figure 3.6: QR Scanner Unit

27
D. Vehicle detection unit

The parking system must indicate (at real time) whether a parking lot is occupied, free or

reserved. Using Infrared sensor, Atgema328p micro-controller continuously monitors each

parking and sends update (in case of change of status ) to the server via ESP8266 serving as

an access point. The update is stored in database and displayed on the application to inform

users.

+5V U2 +5V
1 28
2
(PCINT14/RESET)_PC6 PC5_(ADC5/SCL/PCINT13)
27 IR1 IR2 IR3
(PCINT16/RXD)_PD0 PC4_(ADC4/SDA/PCINT12) IR SENSOR IR SENSOR IR SENSOR
3 26
(PCINT17/TXD)_PD1 PC3_(ADC3/PCINT11)
4 25
C1 (PCINT18/INT0)_PD2 PC2_(ADC2/PCINT10)
5 24
(PCINT19/OC2B/INT1)_PD3 PC1_(ADC1/PCINT9)
6 23
(PCINT20/XCK/T0)_PD4 PC0_(ADC0/PCINT8)
7 22
VCC GND_2
22pf 8 21
GND_1 AREF
9 20
(PCINT6/XTAL1/TOSC1)_PB6 AVCC

GND

GND

GND
VCC

VCC

VCC
X2 10 19

D0

D0

D0
(PCINT7/XTAL2/TOSC2)_PB7 PB5_(SCK/PCINT5)
16MHz 11 18
(PCINT21/OC0B/T1)_PD5 PB4_(MISO/PCINT4)
12 17
C2 (PCINT22/OC0A/AIN0)_PD6 PB3_(MOSI/OC2A/PCINT3)
13 16
(PCINT23/AIN1)_PD7 PB2_(SS/OC1B/PCINT2)
14 15
(PCINT0/CLKO/ICP1)_PB0 PB1_(OC1A/PCINT1)
22pf ATMEGA328P-PN

Figure 3.7: Circuit unit showing connection between Atmega328p with 3 IR sensors

E. Gate/Motor driver unit

Using L293D motor driver, both entrance and exit gates are driven to open and close

depending on the signal applied to IN1, IN2, IN3 and IN4 input pins respectively. IN1 and

IN2 are input pins that drive entrance gate to open and close. IN3 and IN4 are input pins that

drive exit gate to open and close.

28
+5V

ENTRANCE 8 16 U3
5V
3 2
OUT1 VS VSS IN1 11
6 7
OUT2 IN2 12
1
EN1

5V 9
EN2
11 10
OUT3 IN3 13

GND
14 15
OUT4 IN4 14

L293D
EXIT

Figure 3.8: L293D motor driver connected to entrance and exit gates

F. Display unit

At the point of entry and exit, motorists require validation before either gate is opened. The

result of validation needs to be displayed to the motorists; hence there are two LCDs (one for

each gate).

In order to minimize the pins required to connect both displays to Atmega328p micro-

controller, inter-integrated communication (I2C) modules were used. Thereby, reducing the

number of required micro-controller pins from six to just two (SCL and SDA). These pins are

SCL and SDA which correspond to pin 27 and 28 respectively.

29
+5V

LCD (ENTRANCE)
VDD
SCL
SDA

VSS
JHD-2X16-I2C

LCD (EXIT)
VDD
SCL SCL
SDA SDA

VSS
JHD-2X16-I2C

Figure 3.9: Liquid Crystal Display for Entrance and Exit gates

The following components were used to develop the smart IOT parking system:

i. Atmega328p micro-controller

ii. Esp32-cam

iii. Infrared sensor

iv. Motor driver module

v. LCD LM160l module

vi. LED (red, green, blue)

vii. Crystal oscillator (16MHZ)

30
viii. Resistor (10k, 1k)

ix. Ceramic capacitor (22pf)

x. DC motor

xi. IC holder (28 pins)

xii. Buck converter module

 Atmega32 micro-controller

Atmega32 micro-controller is integrated circuit manufactured by Atmel (acquired by

Microchip). It has 40 pins which are for various purposes. Most of these pins are for input

and output, meaning they are used to send and signals in and out of the micro-controller.

They are grouped under different ports which are configurable (through program) to define

whether they are for sending signal from the chip to outside world or from outside world into

the chip. Some pins can be configured to work with analogue signals.

Atmega32 PIN count

Atmega32 has got 40 pins. Two for Power (pin no.10: +5v, pin no. 11: ground), two for

oscillator (pin 12, 13), one for reset (pin 9), three for providing necessary power and

reference voltage to its internal ADC, and 32 (4×8) I/O pins (see fig.3.2).

31
Figure 3.10: Atmega32 MCU

 ESP32 CAM module

The ESP32 CAM is a very small camera module with the ESP32-S chip that costs

approximately $10. Besides the OV2640 camera, and several GPIOs to connect peripherals, it

also features a microSD card slot that can be useful to store images taken with the camera or

to store files to serve to clients.

Figure 3.11: ESP32 CAM

32
Here is a list with the ESP32-CAM features:

 The smallest 802.11b/g/n Wi-Fi BT SoC module

 Low power 32-bit CPU, can also serve the application processor

 Up to 160MHz clock speed, summary computing power up to 600 DMIPS

 Built-in 520 KB SRAM, external 4MPSRAM

 Supports UART/SPI/I2C/PWM/ADC/DAC

 Support OV2640 and OV7670 cameras, built-in flash lamp

 Support image WiFI upload

 Support TF card

 Supports multiple sleep modes

 Embedded Lwip and FreeRTOS

 Supports STA/AP/STA+AP operation mode

 Support Smart Config/AirKiss technology

 Support for serial port local and remote firmware upgrades (FOTA)

 Infrared sensor module


33
The IR Sensor Module or infrared (IR) sensor is a basic and most popular sensor in

electronics. It is used in wireless technology like remote controlling functions and detection

of surrounding objects/obstacles. IR sensors mainly consist of an Infrared (IR) LED and a

Photo-diode, this pair is generally called IR pair. An IR LED is a special purpose LED; it is

can emitting infrared rays ranging from 700 nm to 1 mm wavelength.

IR sensor Pin configuration

i. VCC (5V) pin: This pin is connected to 5V terminal of DC supply.

ii. GND pin: This pin is connected to the ground or GND of the DC

source.

iii. OUT pin: This is the digital output pin that can be connected to an

input pin of a micro-controller.

Figure 3.12: Infrared module

 L239D motor Driver

34
As the name suggests it is mainly used to drive DC motors. A single L293D IC is capable of

driving two DC motors at the same time; also the direction of these two motors can be

controlled independently. It is a good choice if you have motors which has operating voltage

less than 36V and operating current less than 600mA, which are to be controlled by digital

circuits like Op-Amp, 555 timers, digital gates or even Micro-controllers like Arduino, PIC,

ARM etc.

L239D has the following features

 Capable of driving two motors independently

 4.5 to 7v supply voltage

 16 pins

 Maximum motor continuous current 600mA

 Maximum motor peak current 1.2A

 Motor voltage 4.5 to 36V

 Allow motor direction and speed control

 LCD LM160l module

An electronic device that is used to display data and the message is known as LCD 16×2. As

the name suggests, it includes 16 Columns & 2 Rows so it can display 32 characters

(16×2=32) in total & every character will be made with 5×8 (40) Pixel Dots. So the total

pixels within this LCD can be calculated as 32 x 40 otherwise 1280 pixels.

35
Figure 3.13: Specifications of LCD 16X2

 The operating voltage of this display ranges from 4.7V to 5.3V

 The display bezel is 72 x 25mm

 The operating current is 1mA without a backlight

 PCB size of the module is 80L x 36W x 10H mm

 HD47780 controller

 LED color for backlight is green or blue

 Number of columns – 16

 Number of rows – 2

 Number of LCD pins – 16

 Characters – 32

36
 It works in 4-bit and 8-bit modes

 Pixel box of each character is 5×8 pixel

 Font size of character is 0.125Width x 0.200height

vii. Red, Green and Blue LED

A light-emitting diode (LED) is a semiconductor device that emits light when an electric

current flows through it. When current passes through an LED, the electrons recombine with

holes emitting light in the process. LED allows the current to flow in the forward direction,

blocks the current in the reverse direction. It has just two terminals namely; cathode and

anode.

LED pins

i. Anode: This pin is connected to positive terminal of DC supply.

ii. Cathode pin: This pin is connected to the ground or GND of the DC source.

Figure 3.14: LED

37
viii. Crystal oscillator (16MHZ)

Crystal oscillators operate on the principle of inverse piezoelectric effect in which an

alternating voltage applied across the crystal surfaces causes it to vibrate at its natural

frequency. It is these vibrations which eventually get converted into oscillations. Oscillators

are responsible for supplying the clock signals in micro-controllers. All the instructions

executed by micro-controllers are in synchronization with clock signals. This clock signal

helps to determine the timing, and operation speed.

ix. Resistor

Resistor is a discrete component that is used to remit current flow in a circuit. The higher the

resistance, the lower the current as long as the voltage remains unchanged. 1k and 10k ohm

values were used in the circuit for LED and reset pin respectively.

Figure 3.15: Resistor

x. 22pf Ceramic capacitor

Two 22pF ceramic capacitors are used in the clock signal generating circuit to help suppress

harmonics in the generated signal. The value is in the range of 22 to 39pf. However, 22pf

and 33pf are mostly used.

38
Figure 3.16: 22pf Ceramic capacitor

xi. DC motor

DC motor is an electro-mechanical device that converts electrical energy to mechanical

energy based on the Fleming’s left hand rule. Its direction of rotation depends on the polarity

of the supply. Reversing the polarity of the supply will cause the direction of rotation to also

reverse.

Figure 3.17: 5V DC Motor

Features and Specifications

 Actual rated voltage: 6v

 Voltage range: 1v-6v

39
 Speed at 3v: 17,000rpm-18,000rpm

 Current: 0.35A-0.4A

 Dimensions: 20 x 15 x 25

 Axis length: 8mm

 Shaft diameter: 2mm

 Weight: 015 kg

xii. 28 pins IC holder

This 28-Pin DIP IC Socket makes it easy to connect your 28 Pin ICs to a permanent circuit

board so that you don’t have to unsolder any part from your circuit board again. If you fry a

chip, it is easy to replace. The Atmeg328p micro-controller used in this project is mounted on

the circuit board through the 28 pin IC holder.

Figure 3.18: 28 pins IC holder

40
41
+12V +5V
+5V
J2
6 5 LCD2
GND ON/OFF
4 L1
FEED_BACK
3 C3 VDD
GROUND SCL
2
OUTPUT SDA
1 1mH
VIN +5V
0.033uf
VSS
LM2596S-5
JHD-2X16-I2C
LCD1
+5V C1 R1 VDD
10k SCL
SDA
22pF
VSS
X1
16MHz JHD-2X16-I2C
C2
U1
1 28
(PCINT14/RESET)_PC6 PC5_(ADC5/SCL/PCINT13)
22pF 2 27
3
(PCINT16/RXD)_PD0 PC4_(ADC4/SDA/PCINT12)
26
R2
GND
VCC

GND
VCC

GND
VCC
D0

D0

D0

(PCINT17/TXD)_PD1 PC3_(ADC3/PCINT11)
4 25 220
(PCINT18/INT0)_PD2 PC2_(ADC2/PCINT10)
5 24 LED-RED
(PCINT19/OC2B/INT1)_PD3 PC1_(ADC1/PCINT9)
6 23
R4

42
(PCINT20/XCK/T0)_PD4 PC0_(ADC0/PCINT8)
7 22
VCC GND_2
8 21 220
GND_1 AREF
9 20 LED-GREEN
+5V (PCINT6/XTAL1/TOSC1)_PB6 AVCC
10 19
IR SENSOR IR SENSOR IR SENSOR
11
(PCINT7/XTAL2/TOSC2)_PB7 PB5_(SCK/PCINT5)
18
R5
(PCINT21/OC0B/T1)_PD5 PB4_(MISO/PCINT4)
12 17 220
(PCINT22/OC0A/AIN0)_PD6 PB3_(MOSI/OC2A/PCINT3)
13 16 LED-RED
8 16 U2 14
(PCINT23/AIN1)_PD7 PB2_(SS/OC1B/PCINT2)
15
R7
(PCINT0/CLKO/ICP1)_PB0 PB1_(OC1A/PCINT1)
3 2 ATMEGA328-PU 220
OUT1 VS VSS IN1
6 7 LED-GREEN
OUT2 IN2
1
EN1 R8
220
9 LED-RED
EN2
11 10
OUT3 IN3 R10
GND

14 15
OUT4 IN4
220

Figure 3.19 Circuit Design


LED-GREEN
L293D
+5V +5V
+5V U3
1
RST GPIO10
12 R6 U5 U4
2 13 1k
ADC MOSI
3 14 8 9 8 9
EN SCLK 5V 3V3 5V 3V3
4 15 7 10 7 10
GPIO16 GND GND_1 IO16 GND_1 IO16
5 16 6 11 6 11
GPIO14 GPIO15 IO12 IO0 IO12 IO0
6 17 5 12 5 12
GPIO12 GPIO2 IO13 GND_2 IO13 GND_2
7 18 4 13 4 13
GPIO13 GPIO0 IO15 VCC IO15 VCC
8
VCC GPIO4
19 R3 3
IO14 U0R
14 3
IO14 U0R
14
9 20 2.2k 2 15 2 15
CS0 GPIO5 IO2 U0T IO2 U0T
10 21 1 16 1 16
MISO RXD0 IO4 GND_3 IO4 GND_3
11 22
GPIO9 TXD0
ESP32-CAM ESP32-CAM
ESP8266
Figure 3.20: System Prototype Diagram

43
CHAPTER 4

RESULTS AND DISCUSSION

The following are the categories of tests carried out on the project and a report of the results

thereof:

4.1 Data Presentation

Data on the following categories of tests carried out on the project were recorded as presented

below:

4.1.1 Parking Status Test

The Smart Car Parking System prototype has 3 parking spots – SPC1 (VIP), SPC2 and SPC3

– each embedded with IR sensors to detect the presence of a car. The parking status of each

parking space was tested by placing miniature test cars in them. The status of each parking

space was monitored on the client web application as well as the LED indicators at each

parking space and the following results were recorded:

PARKING STATUS ON STATUS ON LED STATUS LED STATUS


SPACE WEB WEB (WITHOUT (WITH CAR)
APPLICATION APPLICATION CAR)
(WITHOUT (WITH CAR)
CAR)
SPC1 (VIP) RESERVE NOW RESERVED OFF ON

SPC2 RESERVE NOW RESERVED OFF ON

SPC3 RESERVE NOW RESERVED OFF ON

Table 4.1.1 Parking Status Test

44
Figure 4.1.1a (i) Plan View of Car Parked in SPC1 (VIP), SPC2 & SPC3

Figure 4.1.1a (ii) Screenshot of client application showing spc1 & spc2 reserved

45
4.1.2 Parking Space Reservation Test

We ran parking space subscription/reservation tests for each parking space and recorded the

following results:

PARKING PAYMENT SUBMISSION RESERVATION LED LED


SPACE BEFORE AFTER

SPC1 (VIP) SUCCESS SUCCESS SUCCESS OFF ON

SPC2 SUCCESS SUCCESS SUCCESS OFF ON

SPC3 SUCCESS SUCCESS SUCCESS OFF ON

Table 4.1.2 Parking Space Reservation Test

Figures 4.1.2 (a) Screenshot of client application showing spc1payment

46
Figures 4.1.2 (b) Screenshot of client application showing spc2 payment

4.1.3 Entry and Exit Authentication

At each of the instances a parking space was successfully reserved, the HTTP server

generated a QR code which was stored in a database at the backend of the client application

for authentication purpose and displayed for the user. We tested the generated QR codes for

each parking space by scanning them one by one on the ESP32 CAM scanner at the entry and

exit gates to test if the gates will open for entry and exit within the validity periods or not.

PARKING SPACE ENTRY ACCESS EXIT ACCESS

SPC1 (VIP) “WELCOME “BYE, THANK


DRIVE IN…” YOU”

SPC2 “WELCOME “BYE, THANK

47
DRIVE IN…” YOU”

SPC3 “WELCOME “BYE, THANK


DRIVE IN…” YOU”

Table 4.1.3 Entry and Exit Authentication

Figure 4.1.3 (a) Entry and Exit Authentication with QR Code for spc1

48
Figure 4.1.3 (b) Entry and Exit Authentication with QR Code for spc2

4.1.4 QR Code Validity Period

We tested the QR codes validity for each of the reservations before the start of the parking

duration at the entry and exit gates to see if they will open or not.

PARKING SPACE ENTRY ACCESS EXIT ACCESS RESERVATION


BEFORE START OF BEFORE START STATUS BEFORE
RESERVATION OF START OF
RESERVATION
PERIOD RESERVATION
PERIOD
PERIOD

SPC1 (VIP) “INVALID “EXIT DENIED, “RESERVED”


RESERVATION” PAY OVERTIME”

SPC2 “INVALID “EXIT DENIED, “RESERVED”


RESERVATION” PAY OVERTIME”

SPC3 “INVALID “EXIT DENIED, “RESERVED”


RESERVATION” PAY OVERTIME”

49
Table 4.1.4 (a) Showing Status before Start of Reservation Period

Figure 4.1.4 QR code validity before start and after expiration of reservation period

After the expiration of the parking duration of each of the reservations, we tested the validity

of the respective QR codes on the entry and exit gates to see if they will open or not.

PARKING SPACE ENTRY ACCESS EXIT ACCESS RESERVATION


AFTER AFTER STATUS AFTER
RESERVATION RESERVATION RESERVATION
EXPIRATION
EXPIRATION EXPIRATION

SPC1 (VIP) “INVALID “EXIT DENIED, “RESERVE NOW”


RESERVATION” PAY OVERTIME”

SPC2 “INVALID “EXIT DENIED, “RESERVE NOW”


RESERVATION” PAY OVERTIME”

SPC3 “INVALID “EXIT DENIED, “RESERVE NOW”


RESERVATION” PAY OVERTIME”

Table 4.1.4 (b) Showing Status after Expiration of Reservation Duration

50
4.2 Data Analyses

Table 4.1.1, above, shows that all parking spaces responded correctly to the presence and

absence of our test cars by reading “Reserved” and “Reserve Now” respectively. Parking

space 3 (SPC3) at a point in time during the testing phase of this project, remained stuck on

“Reserved” irrespective of whether a car is parked there or not. This was due a technical

glitch in the program algorithm of the Atmega328p microcontroller which we eventually

debugged. What was at play was a cyber-security concept known as Denial of Service (DoS).

This is a type of attack that disables, shuts down or disrupts a network, a website or service

through receiving a massive number of data traffic trying to access such network or website.

(Trend Micro, 2024)

Although, in this work, it was not a case of intended malware attack, but the HTTP server on

which the client application is being hosted was overwhelmed by excess MQTT updates

flowing in from the IR sensor in SPC3 thereby making the LED and web application label for

SPC3 stuck on one status.

Table 4.1.2 above shows that the processes of reservation for spc1, spc2 and spc3 were all

successful. A point in time during the testing phase of this project, that of spc3 failed

repeatedly due to same reason of DoS attack which resulted in the status of spc3 stuck on

“Reserved” and the parking LED always turned on.

In table 4.1.3, spc1, spc2 and spc3 QR code entry and exit authentications were all successful.

Again spc3 reservation used to fail during the testing phase since reservation cannot be done

on a space indicating “Reserved”.

51
In tables 4.1.4 (a) and (b), spc1, spc2 and spc3 QR code entry and exit authentications failed.

This was due to the QR code not yet valid before the commencement of the validity period

for the first case and QR code validity expiration for the second case.

52
CHAPTER 5

SUMMARY, CONCLUSION AND RECOMMENDATIONS

5.1 Summary

This research has been able to address the following issues as relates to smart car parking:

(i) The design of a IoT system using a network of wireless IR sensors – which are

used to detect presence or absence of cars in the parking spaces – programmed

microcontrollers, used to transmit real time data and status report from the sensors

to a certain HTTP server via an MQTT broker.

(ii) The design of a web application front end using, which a parking client uses to

reserve a space beforehand, and the backend which consists of the database to

store and manage reservation information and interfaces with the Microcontrollers

and/or MQTT broker.

(iii) The adoption of a billed QR code authentication system generated by the HTTP

server, which the user scans at both the entrance and exit gates of the parking lot.

The QR code was designed to have a validity period within which it can function.

After the expiration of the period, the QR code becomes invalid and therefore

cannot be used to gain entry or exit by the client.

(iv) Physical tests were carried out on the physical prototype using toy cars as the

parking client and the web application to reserve spaces while observing and

recording the responses. Certain glitches were observed and are still being worked

on such as parking space 3 (SPC3) not accepting new reservations and the QR

code validity period of SPC2 reservation not expiring.

53
5.2 Conclusion

Over the years, the automated parking system as defined above has developed into a more

sophisticated system that integrates various technologies such as IoT, Arduino, RFID and

Bluetooth in the management of vehicle parks. The resulting product became referred to as

Smart Parking System.

The smart car parking system employed in this research greatly minimises the difficulties in

conventional parking systems. By ensuring a completely unmanned smart parking system

through the interconnection of IR sensors, microcontrollers, and a web application for clients

linked to a billed QR code generation and QR code scanners, this work ensures convenience

from the point of reservation all the way to exiting the parking lot. This will ensure that time

and efforts are not wasted during the process and also generate income for the owners of the

parking lot as well as minimize the amount of carbon exhaust released into the atmosphere.

5.3 Recommendations

This research work will bring a lot of benefits if adopted on a large by industries, companies,

shopping malls, institutions, etc. Some of the recommendations that industries and businesses

can adopt from this project are:

(i) This project, if adopted on a large scale will help the establishment in generating IGR

through the billing section of the car parking reservation system

(ii) The system will help in the reduction of greenhouse gases through several minutes of

searching for a vacant parking space.

54
(iii) The smart car parking system executed in this work is time saving; from the

point of reservation through the online web application to the point of parking one’s

car on the space subscribed for.

(iv) The fact that the payment and verification/authentication system is fully automated

makes it a preferable option to other parking systems which is a hybrid between

automatic and marshaling parking system.

5.4 Contribution to Knowledge

The novelty introduced in this area of study to the best of our ability is the reservation

authentication/verification system used. Past works in this area of study use other modes of

client authentication for accessing the parking space. In this work, QR code authentication

system has been used which is relatively cheaper and faster in operation. The billing system

embedded with it also gives it additional credence.

5.5 Suggestion for Further Studies

Though the research brings a great deal of innovation, it is not without its flaws. The

following are recommendations to eliminate these challenges encountered during further

research in the future.

(i) A particular client might be done with his/her shopping at the mall early and

therefore decides to leave before the expiration of the period he/she subscribed

for. That parking space should automatically become available for another online

client instead of the system waiting for the period to expire first.

(ii) Further research can be done in order for the system to be able to send reservation

reminders, in form of SMS or emails, to clients when the validity period of their

55
reservation is close to expiring. The system can also be made to prevent

reservations that are more than say one hour in advance in order not to deprive

clients who are in immediate need of the space.

56
REFERENCES

1. Parmar, J., Das, P., Dave, S. M., (2020), “Study on demand and

characteristics of parking system in urban areas: A review”, Journal

of Traffic and Transportation Engineering, 7(1), pp. 111-124,

Retrieved from:

http://sciencedirect.com/science/article/pii/S2095756418305786

2. Kalasova, A., Culik, K., Poliak, M., Otawalova, Z. (2021), “Smart

Parking Applications and its Efficiency”, Research Gate, 13(11),

Retrieved from:

http://www.researchgate.net/publication/351916297_Smart_Parking

_Applications_and_Its_Efficiency

3. Iyaka, B. (2017), “Automated Car Parking System”, Heriot Watt University, Dubai,

p.10

4. Poonam, M. (2018), “Smart Parking System based on Internet of Things”,

International Journal of Applied Engineering Research”, 13(12), pp.10281-10285,

Retrieved from: http://www.ripublication.com

5. Banode, S. V., Kartikeya C., Abhishek M., Tejal A., Shubham S., Shrutika Y., (2022),

“Automated Car Parking System Using PLC”, International Research Journal of

Modernization in Engineering Technology and Science, 4(4), pp. 2-3

6. Elechi, P., Saturday N. R., Dickson R., (2022), “Improved Automated Car Parking

System”, Journal of Semiconductor Devices and Circuits, 9(2), p.20, Retrieved from:

http://engineeringjournals.stmjournals.in/index.php/JoSDC/index

7. Chakravarthy K. R. D et al. (2022), “Smart Parking Assisting System”, Department of

Mathematics and Natural Sciences, Blekinge Institute of Technology, Sweden, p.3

57
8. Saranya T., Sneha R., Nirmal S. D., Sandhya D. R. S., (2022), “Automated E-

Parking System”, International Research Journal of Engineering and Technology

(IRJET), 9(2), p.348

9. Wickramanayake W.T.S., Kumararathhe P.K.T.V., Jayashan U.G.B.A., Maduranga

MWP, (2022), “ParkMate: An Image Processing Based Automated Car Parking

System”, International Conference on Communication, Computing and Internet of

Things (IC3IoT), Retrieved from:

https://www.researchgate.net/publication/360588176

10. Ritul G., Naman G., Ananya, Ajay kumar D., Jinendra R. (2021), “PLC Based

Automatic Car Parking System”, International Journal of Innovative Research in

Technology, 8(2), p.99

11. Alkhuraiji S. (2020), “Design and Implementation of an Android Smart Parking

Mobile Application”, TEM Journal, 9(4), pp.1357-1360

12. Navaneetha M., Raj Mani M., Vaghish V. B., (2020), “Smart Parking System”,

Visvesvaraya Technological University, p.IV

13. Hunusekatte, D. (2020), “Automation of Billing System for Smart Parking of

Vehicles at Institutions”, International Journal of Intelligent Computing Research

(IJICR), 11(1), pp. 1074-1075.

14. Ali A. and Hamid Z. (2020), in “Smart Parking System for Air University”,

Department of Computer Science, Air University, Islamabad, p.6

15. AbdulMalik A. (2020), “Smart Parking System Based on IoT”, University of

Malaysia, Sarawak, P.2

16. Kunwar, S., (2019), “Automated Car Parking”, Metropolia University of Applied

Sciences, p.22

58
17. Azshwanth, D., Mithul T. K., Balachander T., (2019), “Automated Car Parking

System”, Journal of Physics, Conf. Ser. 1362 012059, p.3

18. Elakya R. et al. (2019), “Smart Parking System Using IoT”, International Journal of

Engineering and Advanced Technology, 9(1), p.6091

19. Ch’ng Shu Fen, (2019), “Web-based Car Parking Slot Monitoring System”, Faculty of

Engineering and Green Technology, Universiti Tunku Abdul Rahman, p.10

20. Otchere P. and Opare W. (2019), “Design and Construction of an Authorized Car

Parking Alert System”, Saudi Journal of Engineering and Technology, 4(12), p.525.

21. Tahir H. (2018), “Automatic Car Parking System”, University Of Science and

Technology, p.36

22. Savan K., Dhaval N., Foram K., (2018), “A Comparative Analysis of Different

Algorithms Used in IoT Based Smart Car Parking Systems”, International Research

Journal of Engineering and Technology (IRJET), 5(4), p.3244

23. Alsafery W. et al. (2018), “Smart Car Parking System Solution for the Internet of

Things in Smart Cities”, University of Leicester, p.1

24. Bharath R. et al. (2018), “Smart Parking System”, International Journal of Research

Trends and Innovation, 3(5), p.275

25. Iyaka, B. (2017), “Automated Car Parking System”, Heriot Watt University, Dubai,

p.17

26. Kaarthik, K., Sridevi A., Vivek C., (2017), “Image Processing Based Intelligent

Parking System”, International Conference on Electrical, Instrumentation and

Communication Engineering, p.1

27. Myint, S. N., Min Min Oo, (2016), “Automated Multi-storied Car Parking System

Using RFID”, American Scientific Research Journal for Engineering, Technology,

and Sciences (ASRJETS), 26(3), p.65

59
28. Sewagudde, C. W., (2016), “The design and implementation of a smart-parking

system for Helsinki Area”, Aalto University School of Science, pp. 11-12

29. Daur, V., (2016), “Smart Car Parking System”, International Journal of Advanced

Research in Computer Science and Software Engineering, 6(5), pp.225-227.

30. Ali A., Murtada F. H., Zain H. M., (2016), “Design and Implementation of Smart Car

Parking System”, Al-Mustaqbal University College, pp.1-2

31. Kepuska H. A. (2016), “Smart Car Parking System”, International Journal of Science

and Technology, p.7

32. Kutb A. O. (2016), “Smart Parking: Guidance, Monitoring and Reservations”,

University of Liverpool, Department of Electrical Engineering and Electronics, pp.10-

12

33. Ahmed A. et al. (2016), “Developing Smart Car Parking System Using Wireless

Sensor Networks”, 2nd International Conference on Computing Research and

Innovations, 1755(8), p.203.

34. Mohammed A., Wang G. W., (2014), “Study on Automated Car Parking System

Based on Microcontroller”, International Journal of Engineering Research &

Technology (IJERT), 3(1), p.256

35. Trend Micro, (2024), “Denial of Service”, Retrieved from:

http://www.trendmicro.com/vinfo/in/security/definition/denial-of-service-dos#

60
Appendix A

Atmega 328p MCU C++ program code on Arduino:

#include <Arduino.h>

#include <WiFi.h>

#include <HTTPClient.h>

#include <ESP32QRCodeReader.h>

#include <PubSubClient.h>

#include <ArduinoJson.h>

#define WIFI_SSID "pipeline_mon"

#define WIFI_PASSWORD "pipe2024"

#define WEBHOOK_URL
"https://smart-parking-system-eta.vercel.app/api/reservation/verify"

#define DOOR_RELAY_PIN 12

JsonDocument doc;

// MQTT Broker

const char *mqtt_broker = "broker.emqx.io";

const char *topic = "/";

const char *mqtt_username = "emqx";

const char *mqtt_password = "public";

const int mqtt_port = 1883;

61
unsigned long lastMillis = 0;

String testData[6] = {"spc2=1", "spc2=0", "spc1=1", "spc1=0", "spc3=1", "spc3=0"};

ESP32QRCodeReader reader(CAMERA_MODEL_AI_THINKER);

struct QRCodeData qrCodeData;

bool isConnected = false;

WiFiClient espClient;

PubSubClient client(espClient);

bool connectWifi()

if (WiFi.status() == WL_CONNECTED)

return true;

WiFi.begin(WIFI_SSID, WIFI_PASSWORD);

int maxRetries = 10;

while (WiFi.status() != WL_CONNECTED)

delay(500);

Serial.print(".");

maxRetries--;

if (maxRetries <= 0)

return false;

62
}

Serial.println("");

Serial.println("WiFi connected");

return true;

void callWebhook(String code)

HTTPClient http;

// http.begin(String(WEBHOOK_URL) + "?code=" + code);

http.begin(String(WEBHOOK_URL)+ "/" + code + "/checkin");

int httpCode = http.GET();

if (httpCode == HTTP_CODE_OK)

deserializeJson(doc, http.getString());

// String message = doc[String("message")];

// Serial.println("cam: " + message);

String message = doc[String("access")];

Serial.println("cam: " + message);

else

Serial.println("cam: Error occured");

http.end();

63
}

String received = "";

void callback(char *topic, byte *payload, unsigned int length) {

for (int i = 0; i < length; i++) {

received += (char) payload[i];

String msg = "update:" + received;

msg.trim();

if(msg.indexOf("update:") != -1){

Serial.print(msg);

//Serial.println(msg.substring(msg.indexOf("update:") +7, 11));

//Serial.println(msg.substring(msg.indexOf("update:") +12, 13));

received = "";

void send_test_data(){

static byte count = 0;

if (millis() - lastMillis > 5000) {

lastMillis = millis();

byte len = testData[count].length() +1;

char buff[len];

testData[count].toCharArray(buff, len);

client.publish("/car/parking/system/space", buff);

Serial.print("Sent " + String(buff));

64
count +=1;

if(count >=5){

count = 0;

void setup()

connectWifi();

//connecting to a mqtt broker

client.setServer(mqtt_broker, mqtt_port);

client.setCallback(callback);

while (!client.connected()) {

String client_id = "esp8266-client-";

client_id += String(WiFi.macAddress());

if (client.connect(client_id.c_str(), mqtt_username, mqtt_password)) {

// Serial.println("Public emqx mqtt broker connected");

} else {

// Serial.print("failed with state ");

// Serial.print(client.state());

delay(2000);

// publish and subscribe

client.subscribe("/car/parking/system/reservation");

// Serial.begin(115200);

Serial.begin(9600);

65
Serial.println();

reader.setup();

reader.begin();

delay(1000);

void loop()

client.loop();

if (reader.receiveQrCode(&qrCodeData, 100))

Serial.print("cam: Scanning QR code");

if (qrCodeData.valid)

callWebhook(String((const char*) qrCodeData.payload));

else

Serial.print("cam: Invalid QR code");

delay(300);

// publish data received to broker

if(Serial.available()>0){

66
String payload = Serial.readString();

byte len = payload.length()+1;

char buff [len];

payload.toCharArray(buff, len);

client.publish("/car/parking/system/space", buff);

Appendix B

ESP-32 Entrance and Exit CAM Scanner program:

#include <Arduino.h>

#include <WiFi.h>

#include <HTTPClient.h>

#include <ESP32QRCodeReader.h>

#include <PubSubClient.h>

#include <ArduinoJson.h>

#define WIFI_SSID "pipeline_mon"

#define WIFI_PASSWORD "pipe2024"

#define WEBHOOK_URL
"https://smart-parking-system-eta.vercel.app/api/reservation/verify"

JsonDocument doc;

ESP32QRCodeReader reader(CAMERA_MODEL_AI_THINKER);

struct QRCodeData qrCodeData;

bool isConnected = false;

67
bool connectWifi()

if (WiFi.status() == WL_CONNECTED)

return true;

WiFi.begin(WIFI_SSID, WIFI_PASSWORD);

int maxRetries = 10;

while (WiFi.status() != WL_CONNECTED)

delay(500);

Serial.print(".");

maxRetries--;

if (maxRetries <= 0)

return false;

Serial.println("");

Serial.println("WiFi connected");

return true;

void callWebhook(String code)

HTTPClient http;

68
http.begin(String(WEBHOOK_URL)+ "/" + code + "/checkout");

int httpCode = http.GET();

if (httpCode == HTTP_CODE_OK)

deserializeJson(doc, http.getString());

// String message = doc[String("message")];

String message = doc[String("access")];

Serial.println("cam: " + message);

else

Serial.println("cam: Error occured");

http.end();

void callback(char *topic, byte *payload, unsigned int length) {

for (int i = 0; i < length; i++) {

Serial.print(*payload);

void setup()

connectWifi();

69
// Serial.begin(115200);

Serial.begin(9600);

Serial.println();

reader.setup();

//reader.setDebug(true);

Serial.println("Setup QRCode Reader");

reader.begin();

Serial.println("Begin QR Code reader");

delay(1000);

void loop()

if (reader.receiveQrCode(&qrCodeData, 100))

Serial.print("cam: Scanning QR code");

if (qrCodeData.valid)

callWebhook(String((const char*) qrCodeData.payload));

else

Serial.print("cam: Invalid QR code");

delay(300);

70
}

Appendix C

Web Application program

The code was written in the VS Code IDE, and it is available on GitHub under this repository:

https://github.com/belloshehu/smart-parking-system-with-qrcode

71

You might also like