Shalini Doc Final
Shalini Doc Final
Project submitted in partial fulfillment of the requirements for the award of the degree of
BACHELOR OF TECHNOLOGY
IN
D.SHALINI 17C91A0536
2020 – 2021
HOLY MARY INSTITUTE OF TECHNOLOGY & SCIENCE
(COLLEGE OF ENGINEERING)
(Approved by AICTE New Delhi, Permanently Affiliated to JNTU Hyderabad, Accredited by NAAC with ‘A’ Grade)
CERTIFICATE
This is to certify that the major project entitled “AUTOMATED PARKING SYSTEM USING IoT
TECHNIQUES” is being submitted by , D. SHALINI (17C91A0536), in partial fulfillment of the
academic requirements for the award of the degree of Bachelor of Technology in
“COMPUTER SCIENCE AND ENGINEERING” HOLY MARY INSTITUTE OF
TECHNOLOGY & SCIENCE, JNTU Hyderabad during the year 2020- 2021.
EXTERNAL EXAMINER
ACKNOWLEDGEMENT
The satisfaction and euphoria that accompany the successful completion of any task would
be incomplete without the mention of the people who made it possible, who’s constant
guidance and encouragement crowns all effort with success.
I take this opportunity to express my profound gratitude and deep regards to My Guide Mr.
Shaik Mahaboob Basha, Assistant Professor, Dept. of Computer Science & Engineering,
Holy Mary Institute of Technology & Science for his / her exemplary guidance, monitoring
and constant encouragement throughout the project work.
I also thank to Dr. P. Bhaskara Reddy, the honorable Director of my college Holy Mary
Institute of Technology & Science for providing me the opportunity to carry out this work.
At the outset, I express my deep sense of gratitude to the beloved Chairman A. Siddharth
Reddy of Holy Mary Institute of Technology & Science, for giving me the opportunity
to complete my course of work
I am obliged to staff members of Holy Mary Institute of Technology & Science for the
valuable information provided by them in their respective fields. I am grateful for their
cooperation during the period of my assignment.
Last but not the least I thank ALMIGHTY and My Parents, and Friends for their constant
encouragement without which this assignment would not be possible.
DECLARATION
This is to certify that the work reported in the present project titled “AUTOMATED
PARKING SYSTEM USING IoT TECHNIQUES” is a record of work done by me in the
Department of Computer Science & Engineering, Holy Mary Institute of Technology and
Science.
No part of the thesis is copied from books/journals/internet and wherever the portion is taken,
the same has been duly referred in the text the reported are based on the project work done
entirely by me not copied from any other source.
D.SHALINI 17C91A0536
ABSTRACT
The Internet of Things (IoT) is able to connect billions of devices and services at anytime in any place, with
various applications. Recently, the IoT became an emerging technology. One of the most significant current
research discussion topics on the IoT is about the smart car parking. A modern urban city has over a million of
cars on its roads but it does not have enough parking space. the problem of finding unoccupied parking space
and ignore some other critical issues such as information about the nearest car parking and the roads traffic
congestion, this paper goes beyond and proposes the alternative method. The paper proposes a smart car parking
system that will assist users to solve the issue of finding a parking space and to minimise the time spent in
searching for the nearest available car park.Smart Parking uses sensing devices such as cameras, vehicle
counting equipment, sensors installed in pavements, etc. to determine occupancy of the parking lot.Internet of
Things wireless sensors detect the vacant parking spaces and transmit the data to help the drivers get an idea
about the vacant spaces for parking.Smart car parking project aims at providing a confusion free and easy
parking. This project helps the drivers of the cars to park their vehicles with minimum wastage of time with
accurate information of the availability of the space to park the car.The LCD displays the availability of the
space, the ultrasonic sensors keeps the check of the number of cars entering and exiting the parking space. The
ultrasonic sensors detect the availability of the parking space.The system counts the number of cars in the garage
and checks if there’s any vacancy. There’s an entry and exit path. When vehicle enters,the number plate of the
vehicle is scanned and will be allotted a sequential parking slot from the available slots.The slot that is nearest to
the vehicle will be allotted to it.As soon as the car is allotted with a slot,that slot is will be displayed on the
screen.Similarly when the vehicle leaves from the exit point,the number plate will be scanned again and will
show the vacancy of that particular parking slot.The goal of Smart Parking is to reduce the time taken and the
hassle factor of locating an available parking space. Being able to accurately direct a driver to an available space
has many environmental benefits; it reduces CO2 emissions, noise and other pollutants
CONTENTS
ABSTRACT
1. INTRODUCTION 1
2. REQUIREMENT ANALYSIS 3
Requirement Gathering 3
Requirement Specification 3
3. DESIGN 7
Existing System 7
Proposed System 8
4. IMPLEMENTATION 12
Output Screen 12
5. TESTING 19
6. RESULTS 55
AUTOMATED PARKING SYSTEM USING IOT TECHNIQUES
1.INTRODUCTION
Seeking a vacant parking space during peak hours in areas like Hospitals, Hotels & Shopping
Centres, Airports, Universities, and Exhibitions & Convention Centre has always been
frustrating for many drivers. Surveys says that traffic generated by cars searching for
vacancies in Parking Spaces is up to 40% of the total traffic. Now that is a serious issue to
look after, and Smart Parking System is one of the best available solutions to at least reduce
the traffic congestion caused due to the above problem. This application gives information
about the occupancy status of the spaces in the parking lot equipped with sensors that
detect \application, used to detect the available parking slots. This app uses ultrasonic sensor
to detect the presence of a vehicle (whether the parking slot is occupied or not). Based on the
parking slot occupancy, the status (occupied/unoccupied) is displayed on the web application
dashboard. In real time, the environment has sensors and devices embedded into parking
spaces, transmitting data on the occupancy status; and the vehicle drivers can search for
parking availability using their mobile phones or any infotainment system that is attached to
the vehicle. Hence the driver would know where there is an available spot to park his vehicle
in less time, reducing the energy consumption and air pollution. The second part in this
application is doing analysis on parking trends in a parking lot. The analysis gives
information about which parking space is most occupied and least occupied and at what times
of the day. This information is helpful in choosing one parking space when there are multiple
available, keeping in mind the history of that space. For example, when there is more than
one vacant slot the driver will want to choose the one that has less occupancy rate because the
high occupancy rated slot might be wanted by many other drivers and you don't want to
waste your time reaching that slot. Automated Parking System using RFID Technology
Project is mainly based on the RFID technology. There has been a considerable amount of
reduction in transaction costs and decrease in stock shortage with the use of Radio Frequency
Identification (RFID) technology in automation. Most of the RFID networks include a wide
range of automation technologies. These technologies are RFID readers, RFID writers, RFID
barcode scanners, and RFID controllers. In this study, a solution has been provided for the
problems encountered in parkinglot management systems via RFID technology. RFID
readers, RFID labels, computers, barriers and software are used as for the main components
of the RFID technology. The software has been handled for the management, controlling, and
operation tasks for parking lots. The problem of finding unoccupied parking space and ignore
DEPARTMENT OF CSE.HITS 1
AUTOMATED PARKING SYSTEM USING IOT TECHNIQUES
some other critical issues such as information about the nearest car parking and the roads
traffic congestion, this paper goes beyond and proposes the alternative method. An
Automated Parking system will assist users to solve the issue of finding a parking space and
to minimize the time spent in searching for the nearest available car park. An Automated
Parking uses sensing devices such as cameras, vehicle counting equipment, sensors installed
in pavements, etc. to determine occupancy of the parking lot. There’s an entry and exit path.
When vehicle enters, the number plate of the vehicle is scanned and will be allotted a
sequential parking slot from the available slots. The slot that is nearest to the vehicle will be
allotted to it. As soon as the car is allotted with a slot, that slot is will be displayed on the
screen. Similarly when the vehicle leaves from the exit point, the number plate will be
scanned again and will show the vacancy of that particular parking slot. The goal of an
Automated Parking is to reduce the time taken and the hassle factor of locating an available
parking slots.
DEPARTMENT OF CSE.HITS 2
AUTOMATED PARKING SYSTEM USING IOT TECHNIQUES
2. REQUIREMENT ANALYSIS
DEPARTMENT OF CSE.HITS 3
AUTOMATED PARKING SYSTEM USING IOT TECHNIQUES
Framework works, how to connect to database with Hibernate instead of JDBC, also seen
some best practices in writing JavaScript.
These are the technical requirements to develop Smart Parking System web application.
Database: MySQL
RAM: 2GB
Users who want to use the application can directly deploy the war file in Tomcat server and
run the app using localhost with the port number that is configured during installation of the
web server. The path to the web application is passed along with localhost to the browser.
In order to understand our choice of frameworks we have to describe Smart Parking System's
particular application requirements. This project has two primary components; a web service
DEPARTMENT OF CSE.HITS 4
AUTOMATED PARKING SYSTEM USING IOT TECHNIQUES
that receives the occupancy status from the client or the sensor and a web application that
displays the parking slot occupancy status and also the parking history trends. The Java based
web service is built with Spring and Hibernate to connect to the backend system which is
MySQL database. The web service is deployed in Apache Tomcat Server. And the web
application has front end designed using HTML5, CSS, JavaScript and jQuery. And has Ajax
call to the web service URL.
Spring Framework
The Spring Framework is an application framework and inversion of control container for
the Java platform. It has become popular as a replacement for, alternative to, or even addition
to the EJB model. The Spring Framework provides about 20 modules which can be used
based on an application requirement. The below figure shows typical Spring Framework
which can be categorized into 4 groups: Core Container, Data Access/Integration, Web and
Miscellaneous.
Core Container
The Core Container consists of Beans that provide Bean Factory, Core that provides features
like Dependency Injection and Inversion of Control, Context that provides Application
Context which is the focal point of this module, Spell provides a powerful expression
language for manipulating and querying an object graph at runtime.
Data Access/Integration
This module consists of JDBC that provides an abstraction layer, ORM that provides
integration layers for Java Persistence API, hibernate etc., OXM provides an abstraction layer
that support Object/XML mapping implementations, Java Messaging Service which contains
features for producing and consuming messages, and Transactions to support programmatic
and declarative transaction management for classes that implement POJOs.
Web
This module consists of Web-Socket that provide support for two-way communication
between client and server, Web-MVC that contains MVC implementation, Web that provides
basic web-oriented integration features and Web-Portlet that provides MVC implementation
for Portlet environment.
DEPARTMENT OF CSE.HITS 5
AUTOMATED PARKING SYSTEM USING IOT TECHNIQUES
Miscellaneous
Some other components on Spring Architecture are AOP that provides aspect-oriented
programming implementation, Aspects that provide integration with AspectJ which is an
AOP framework, Instrumentation that provides class instrumentation support and class loader
implementations, Messaging that provides support to STOMP, Test to support the testing of
Spring Framework components with JUnit or TestNG frameworks.
Hibernate ORM
The Hibernate architecture is as shown. Let us discuss a little bit of it here. Hibernate uses
Java APIs like JTA (Java Transaction API) – To integrate with J2EE application servers
JDBC (Java Database Connectivity) – Provides abstraction to allow any database with JDBC
drivers to be supported by Hibernate. JNDI (Java Naming and Directory Interface) - To
integrate with J2EE application servers Brief about core interfaces of Hibernate Framework:
1) Configuration:
It is used to configure and bootstrap hibernate. The instance of this interface is used by the
application to specify the location of hibernate specific mapping documents.
2) Session Factory:
This delivers the session objects to hibernate application. There will be a single Session
Factory for the whole application and it will be shared among all the threads.
3)Session:
The instances of this interface are lightweight, they are not thread safe. Session interface is
the primary interface used by hibernate applications.
4) Transaction:
DEPARTMENT OF CSE.HITS 6
AUTOMATED PARKING SYSTEM USING IOT TECHNIQUES
The above three interfaces are mandatory, whereas this is an optional interface that abstracts
the code from any kind of transaction implementations.
This allows user to perform queries and also control the flow of the query execution.
JavaScript
The front end of the application is developed using JavaScript and jQuery library of
JavaScript. It is the programming language of HTML and the Web. Smart Parking System
application uses: HTML to define the content of web page CSS to specify the layout of web
page JavaScript to program the behaviour of the web page And AJAX (Asynchronous
JavaScript and XML) calls are made to the web service every 2 sec to display the latest
occupancy statuses retrieving data from the database.
3.DESIGN
EXISTING SYSTEM
In legacy parking management systems, only the administrator has information about the
parking spaces occupied by vehicles. Since the existing parking system cannot use the active
information exchanging, it did not provide useful parking information for drivers. To solve
this problem, smart sensors and the middleware for handing them are needed. The vehicle
parking location service has been proposed on the using of RFID devices. In this service, the
DEPARTMENT OF CSE.HITS 7
AUTOMATED PARKING SYSTEM USING IOT TECHNIQUES
drivers have to receive an RFID tag on the entrance of parking lot. The tag provides the
vehicle location service for drivers through the RFID reader of parking space. However, this
approach is inconvenient because the driver must receive the RFID tag in the entrance. In
addition, the cost for RFID tag is needed. In the year 2006, 458,293 new registered vehicles
were reported compared to the year 1999 where there were only 296,716 new registered
vehicles, which makes it a rough estimate of 54.5% increase in a span of 7 years (Malaysian
Ministry of Transportation, 2007). Referring to the aforesaid statistics provided by the
Malaysian Ministry of Transportation, the current transportation infrastructure and car park
facilities are deemed insufficient in sustaining the influx of vehicles on the road. Enable the
driver to collect ticket upon entrance: car Parking system should be able to allow the driver to
get his ticket after he press the button of the gate barrier. The system should record the entire
cars that pass through the entrance. The system should allow the gate to open whenever a
driver has pressed the button and take his ticket. Allow the drivers to make payment: if it's of
commercial use, the system should enable the drivers to make payment of their charges
before exiting. Allow the driver to exit: if the driver has paid his charges and require exiting,
the system should open the gate to allow him exiting.
DEPARTMENT OF CSE.HITS 8
AUTOMATED PARKING SYSTEM USING IOT TECHNIQUES
PROPOSED SYSTEM
When the user enters the parking lot, the welcoming message is displayed. Then the RFID of
the user’s car is scanned and prompted user to select his desired location at the time of his
exit. The slot number is allotted according the size of the car and the entry time is recorded. If
the slot according to the car’s size is not available, a random slot is allotted and asked with
the user to confirm the slot. These details are then updated in the database and are sent to
user’s registered mobile number which is available at the time of his car’s registration on
successful confirmation from the user. On failure the system prompts with the appropriate
failure message and terminate the session and if required the user can try after some-time.
Guidance to the slot is also provided by glowing LED at the slot. At the time of user’s exit,
the user’s RFID is scanned and interval between the time of entry and the time of exit is
calculated. The system then checks for the fine and prompts the user to pay the fine and
confirms the location where the user had provided at the time of entry. Here a choice is
provided whether to confirm or to redefine the desired location. The exit gate opens
immediately if the choice of confirmation is success else the exit gate number is sent to user’s
mobile and the above checks are made once again except with the re-entry of the location.
When the user enters to that exit gate and the corresponding exit gate opens thus making user
much convenient and system much more automated and efficient. Parking uses sensing
devices such as cameras, vehicle counting equipment, sensors installed in pavements, etc. to
determine occupancy of the parking lot. Internet of Things wireless sensors detect the vacant
parking spaces and transmit the data to help the drivers get an idea about the vacant spaces
for parking. The ultrasonic sensors detect the availability of the parking space. When vehicle
enters, the number plate of the vehicle is scanned and will be allotted a sequential parking
DEPARTMENT OF CSE.HITS 9
AUTOMATED PARKING SYSTEM USING IOT TECHNIQUES
slot from the available slots. The slot that is nearest to the vehicle will be allotted to it.As
soon as the car is allotted with a slot, that slot is will be displayed on the screen. Similarly
when the vehicle leaves from the exit point, the number plate will be scanned again and will
show the vacancy of that particular parking slot.
DEPARTMENT OF CSE.HITS 10
AUTOMATED PARKING SYSTEM USING IOT TECHNIQUES
A. Parking Sensors – IR sensors: For the parking system we have used infrared (IR)
sensors to detect the presence of vehicle in parking slot. The sensors are connected to cloud
using raspberry pi. The sensors are connected to a 5V supply from raspberry pi. The
raspberry pi is connected to external power source.
C. Cloud: Google’s firebase server is one the powerful and easy to use cloud server
service. It maintains a hierarchical form of database and uses secured HTTP protocols to send
and receive data. Firebase provides services like cloud storage, authentication services for
users, analytics as well as ML kit. It works on real-time database which means as soon as
data is changed in server immediately change is visible to all the users using the app. It keeps
track of every user connected to the system and maintains information such as time at which
the car was parked and time duration for parking a car.
D. Mobile Application: The application provides an easy-to-use interface for the user to
see the status of the parking slot and it also allows the user to reserve a parking spot for
empty slots. The application is made using Android Studio and is seamlessly connected to
firebase servers using the firebase APIs. The data is transferred from and to server in JSON
format. There is no need for the mobile and raspberry pi to be on the same network as
firebase provides message passing over the internet without any constraint of a particular
channel.
Once the user opens the app for the first time the following screen comes. User can either
signup if first time use or can simply login through Google Sign in option. Once logged in
user can either see the parking layout or go to booking page or see their account info. The
DEPARTMENT OF CSE.HITS 11
AUTOMATED PARKING SYSTEM USING IOT TECHNIQUES
slots which are already reserved by others are shown in orange with Reserved written,
Available slots are in green and non-available slots are in Red. User details needs to be
entered on this screen to get the booking and then clicked on reserve. If booking is done
successfully the following ticket will be available in the account section of the user. The 5-
digit number on the ticket is the OTP which needs to be entered in the admin panel in the
parking slot to gain access to the slot. In the parking zone the admin panel outside the parking
slot will display the following screen. Once the car is parked in the slot the value of the
sensor will change and it will show Slot full to other users till the car is not removed. Since
the system is free for use time constraint is very important. Once the user crosses the time
limit of stay which is max for 1 hour for free use the user will be notified about the exceeding
time and that his parking is now be levied a fine on an hourly basis. To facilitate easy
payments online payment option is given. If the user wants to raise the bar to his slot and take
the car out without paying it will not be possible. He will have to pay first and then leave. IF
IR detects vehicle: Read location of Sensor or parking slot Update reading in cloud (0 means
occupied) IF object moved out or IR doesn’t detect vehicle: Read location of Sensor or
parking slot. Using intelligent sensors can help parking lots to realize in time parking space
inventory control. Nowadays, the parking problem is more than a nuisance. Parking managers
and relevant researchers tried hard to solve that problem. Induction loop, camera and
magnetic sensors have been installed in intelligent parking systems, thus cars can be counted
easily in the entrance and exit and the occupation of every single parking space can be
detected. Meanwhile, ultrasonic sensor fitted on the side of a car is used to detect parked cars
and vacant spots. Thus, it can be more efficient to do parking survey in ground or
underground parking lots. Enable the driver to collect ticket upon entrance: car Parking
system should be able to allow the driver to get his ticket after he press the button of the gate
barrier. The system should record the entire cars that pass through the entrance.
DEPARTMENT OF CSE.HITS 12
AUTOMATED PARKING SYSTEM USING IOT TECHNIQUES
4.IMPLEMENTATION
Smart Parking System is a web application that is developed to help drivers in finding a
vacant parking space during any time of day. The main objective of the application is to
provide the occupancy status (vacant/occupied) of the parking spaces and also to get
information about the parking history data on any particular date. The user is allowed to
choose any date and can get the information related to parking spaces occupancy throughout
that day. The main features of the application are: Parking Slot Occupancy: This is the first
part of the application where there is a dashboard that has occupancy statuses of the parking
slots. The dashboard is refreshed every 2 sec and the latest information is displayed for the
user. Parking History Analysis: This is an extension to the application where User is able to
see the occupancy rate of each parking lot on any particular day in the form of charts. Using
this data, driver can choose the less occupied slot when there is more than one slot available.
Also, the parking lot owners can rent the spaces by charging based on their occupancy rates
at any particular time of the day. The Smart Parking Application is developed on Eclipse IDE
with STS Plugin using Java 1.7. The user interface is designed using JavaScript and the
business logic I coded in Java. The application also makes use of annotations in Java,
especially Spring Framework and Hibernate annotations. The backend database is MySQL
and I have used MySQL Query Browser in order to manage the database. The web
application developed is archived to a war file and then deployed in Tomcat Server.
The Graphical User Interface for this application is designed by keeping in mind that the
application's user interface is everything that the user can see and interact with. Technologies
used to develop this user interface are mainly JavaScript, jQuery, HTML5 and CSS. To
interact with backend web service written in Java, jQuery methods get () and post () are
DEPARTMENT OF CSE.HITS 13
AUTOMATED PARKING SYSTEM USING IOT TECHNIQUES
mainly used. Ajax calls are made every 2 seconds by passing URL to be hit, and the required
data from the database is retrieved and passed back to the caller. Accordingly, the Occupancy
Status Message and Occupancy Indicator in the front end are updated every 2 seconds.
Similar thing is with the chart showing the parking history. JavaScript FusionCharts are used
to show the occupancy of parking spaces starting from zeroth hour to 24th hour. Here we can
see the parking history of any day, by just setting the required date by using the calendar
provided. 5.1.1 Smart Parking System It is seen when the Tomcat Server is started and then
we run the application by calling the localhost in any browser. This screen contains a table
that shows the occupancy status of the parking slots and a chart that depicts the parking
history. In the table, the first column is Parking Slot Number or Id, second column is the
Occupancy Indicator, and third column is the Occupancy Message. Occupancy Indicator have
two buttons or LEDs red and green. Green indicates that the parking slot is vacant and red
indicates that it is already occupied by other vehicles. The last column is to display the
Occupancy Message, i.e., 'Vacant' or 'Occupied'. In the chart below the table, we can see that
there are Slot no’s and Slot Occupancy Status at particular 4-hour slot of the day. Upon
hovering on the small blue bars, we can see the exact time when there was a vehicle in that
slot. The User Interface of Smart Parking web application meets all the initial goals, being
very precise and making every detail clear on screen. The UI is designed in a way where the
occupancy statuses of parking slots are very clearly visible by just looking into the colors of
the indicators. And further information can be seen in the Occupancy message column. And
this UI can be extended to mobile platforms with the same design, as it is very much
compatible with the mobile screen size as well. One can view the occupancy status in one
panel and can see the parking history by scrolling down in the mobile screen. Communication
between multiple arduinos will be successfully established. We have used and programmed
the popular I2C communication bus to receive and send data between the microcontrollers.
I²C (Inter-Integrated Circuit): I-squared-C, is a multi-master, multi-slave, single ended, serial
bus invented by Philips Semi-conductor. It is typically used for attaching lower-speed
peripheral ICs to processors and microcontrollers in short-distance, intra board
communication. Alternatively, I²C is spelled I2C (pronounced I-two-C) or IIC (pronounced I-
I-C). I²C uses only two bidirectional open-drain lines, Serial Data Line (SDA) and Serial
Clock Line (SCL), pulled up with resistors. Typical voltages used are +5 V or +3.3 V
although systems with other voltages are permitted. Common I²C bus speeds are the 100
kbit/s standard mode and the 10 kbit/s low-speed mode. Recent revisions of I²C can host
more nodes and run at faster speeds (400 kbit/s Fast mode, 1 Mbit/s Fast mode plus and 3.4
DEPARTMENT OF CSE.HITS 14
AUTOMATED PARKING SYSTEM USING IOT TECHNIQUES
Mbit/s High Speed mode). These speeds are more widely used on embedded systems than on
PCs. Suitable Backend system to receive the sensor’s data is successfully created and tested.
We are using the popular PHP 5.6 and Maria-db as our preferred database for the same. Pre-
processor hypertext is a server-side scripting language designed primarily for web
development also used as a general-purpose programming language. Originally created by
Rasmus Lerdorf, the PHP reference implementation is now produced by The PHP
Development Team. PHP originally stood for Personal Home Page, but it now stands for the
recursive acronym PHP: Hypertext Pre-processor. PHP code may be embedded into HTML
or HTML5 code, or it can be used in combination with various web template systems.
Suitable frontend for the same is designed. We are using the latest web view technology from
Bootstrap to make it device independent compatibility. The webpage is highly responsive.
However, we are yet to program the backend system with the same. Bootstrap is a front end
free open-source framework for, designing websites and web applications. It contains HTML
and CSS-based design templates for typography, forms, buttons, navigation and other
interface components, as well as optional JavaScript extensions. The style sheets are
generally compiled into a bundle and included in web pages, but individual components can
be included or removed. Bootstrap provides a number of configuration variables that control
things such as color and padding of various components. The raspberry pi which acts as
gateway is successfully programmed to receive and store the sensor’s data from the
microcontroller. We are using the latest version of raspberry pi with built Bluetooth and wifi
technology to make the system completely wireless and accessibility of portal anywhere and
anytime. The Raspberry Pi is a series of small single-board computers developed in the
United Kingdom by the Raspberry Pi Foundation to promote the teaching of basic computer
science in schools and in developing countries. The original model became far more popular
than anticipated, selling outside of its target market for uses such as robotics. Peripherals
(including keyboards, mice and cases) are not included with the Raspberry Pi.
a) TCPDF:
It is a free and open-source software for generating PDF documents. TCPDF is the only PHP-
based library. TCPDF is a PHP class for generating PDF files on-the-fly without requiring
external extensions. TCPDF library also includes classes to extract data from existing PDF
documents and classes to generate 1D and 2D barcodes in various formats. TCPDF is also
DEPARTMENT OF CSE.HITS 15
AUTOMATED PARKING SYSTEM USING IOT TECHNIQUES
one of the most used PHP libraries, Since it has been already included most of Applications:
Drupal, Moodle, phpMyAdmin, TCExam, Xoops, Elxis CMS, Impress CMS, Jelix and many
others.
There is no requirement for external libraries for performing the basic functions. All the
formats like standard page formats, custom page formats etc are considered. Sub setting of
fonts. Several methods to publish some JavaScript and Forms. Several images, graphic and
transformation methods are involved. It supports JPEG, PNG images natively and all images
are supported via ImagMagick. Automatic page header and footer management. Secure
document encryption up to 256 bit and digital signature certifications. Also supports
transactions UNDO commands annotations, including links, text and file attachments.
It allows an Arduino board to control servo motors. Servos have integrated gears and a shaft
that can be accurately controlled. Standard servos allow the shaft to be positioned at various
angles, usually between 0 and 180 degrees. The Servo.h library supports up to 12 motors on
most Arduino boards and 48 on the Arduino Mega. On boards other than the Mega, use of the
library disables AnalogWrite() (PWM) functionality on pins 9 and 10, whether or not there is
a Servo on those pins. It supports functions like: attach() ,write() ,write Microseconds(),
read() attached() ,attach()
Circuit:
Servo motors have three wires: power, ground, and signal. The power wire is typically red,
and should be connected to the 5V pin on the Arduino board. The ground wire is either black
or brown and should be connected to a ground pin on the Arduino board. The signal pin is
typically yellow, orange or white and should be connected to a digital pin on the Arduino
board. Note that servos draw considerable amount of power, so if you need to drive more
than one or two, you'll probably need to power them from a separate supply (i.e. not the +5V
pin on your Arduino). Be sure to connect the grounds of the Arduino and external power
supply together.
Adafruit_GFX: It provides a common syntax and set of graphics functions for all of our LCD
displays. This allows Arduino sketches to easily be adapted between display types,
performance improvements and bug fixes will immediately apply across our complete
DEPARTMENT OF CSE.HITS 16
AUTOMATED PARKING SYSTEM USING IOT TECHNIQUES
offering of color displays. The Adafruit_GFX library always works together with a second
library Adafruit_ST7735 which is provided for each specific display type .
SPI LIBRARY:
DEPARTMENT OF CSE.HITS 17
AUTOMATED PARKING SYSTEM USING IOT TECHNIQUES
It helps to communicate with SPI devices, with the Arduino as the master device. Serial
Peripheral Interface is a synchronous serial data protocol used by microcontrollers for
communicating with one or more peripheral devices quickly over short distances. It can be
used for communication between two microcontrollers. [17] SPI devices communicate in full
duplex mode using a master-slave architecture with a single master. The master device
originates the data frame for reading and writing. Sometimes SPI is called a four-wire serial
bus, contrasting with three-wire, two-wire, and one-wire serial buses. The SPI can be
described as a synchronous serial interface, but it is different from the Synchronous Serial
Interface (SSI) protocol, which is also a four-wire synchronous serial communication
protocol. But SSI Protocol employs differential signaling and provides only a single simplex
communication channel. With an SPI connection there is one master device (usually a
microcontroller) which controls the peripheral devices. Typically there are three lines
common to all the devices.MISO - Master In Slave Out - Slave line for sending data to the
master.MOSI - Master Out Slave In - Master line for sending data to the slaves. SCK - Serial
Clock - The clock pulses synchronize data transmission. SS – Slave or Chip Select - the pin
on each device that the master can use to enable and disable specific devices. When a device's
Slave Select pin is low, it communicates with the master. When it's high, it ignores the
master. This allows us to have multiple SPI devices sharing the same MISO, MOSI, and CLK
lines. For Example:-Multi RFID.Mode Clock Polarity (CPOL) Clock Phase (CPHA) Output
Edge Data Capture SPI_MODE0 0 0 Falling Rising SPI_MODE1 0 1 Rising Falling
SPI_MODE2 1 0 Rising Falling SPI_MODE3 1 1 Falling Rising MFRC522 there are RFID
modules that can read and write Mifare's tags. RFID-RC522 (MF-RC522), the
microcontroller and card reader uses SPI for communication. The card reader and the tags
communicate using a 13.56MHz electromagnetic field or radio frequency to be more precise.
The Wire: This library allows you to communicate with I2C devices. On the Arduino boards
with the R3 layout 1.0 pinout, SDA (the data line) and SCL (the clock line) are on the pin
headers close to the AREF pin. The Arduino Due has two I2C / TWI interfaces SDA1 and
SCL1 are near to the AREF pin and the additional one is on pins 20 and 21. The following
reference table shows the pin numbers of TWI pins that are located on various Arduino
boards. Board I2C / TWI pins Uno, Ethernet A4 (SDA), A5 (SCL) Mega2560 20 (SDA), 21
(SCL) Leonardo 2 (SDA), 3 (SCL) Due 20 (SDA), 21 (SCL), SDA1, SCL1 [17] As of
Arduino 1.0, the library inherits from the Stream functions, making it consistent with other
read/write libraries. Because of this, send() and receive() have been replaced with read() and
DEPARTMENT OF CSE.HITS 18
AUTOMATED PARKING SYSTEM USING IOT TECHNIQUES
write Hardware There are three components involved: 1. Micro Controller: An Arduino is
used as microcontroller. Also Raspberry pi, is also used which is a microcontroller as well as
microprocessor with Broadcom chipset. 2. Proximity Coupling Device (PCD): The PCD is
the actual RFID Reader based on NXP MFRC522 Contactless Reader Integrated Circuit). 3.
Proximity Integrated Circuit Card (PICC): The PICC is the RFID Card or Tag using the
ISO/IEC 14443A interface for protocols .
1. The micro controller and the reader use SPI for communication. The protocol is described
in the NXP datasheet.
2. The reader and the tags communicate using a 13.56 MHz electromagnetic field. The
protocol is defined in ISO/IEC 14443-3:2011
Type A:- The reader does not support ISO/IEC 14443-2
Type B:-Security: This library only supports crypto1-encrypted communication. Crypto1
cryptographic protocol has been known as broken from a few years, so it does NOT offer
ANY security, it is virtually unencrypted communication. An Automated Parking System like
this helps drivers make smart decisions which will reduce congestion and make the most of
available spaces. Finding a parking space has become a daily concern these days, and that is
where the motivation for this project came up from. With the evolution of technology, we
have smartphones, sensors that detect the presence of any object and my idea is having a
system where parking spaces are equipped with these ultrasonic sensors that tells about the
occupancy status of the parking spaces and a central management system that posts this
occupancy status to a web application to guide the drivers in finding a vacant slot.
DEPARTMENT OF CSE.HITS 19
AUTOMATED PARKING SYSTEM USING IOT TECHNIQUES
5.TESTING
DEPARTMENT OF CSE.HITS 20
AUTOMATED PARKING SYSTEM USING IOT TECHNIQUES
sensedata = GPIO.input(14)
sense2 = GPIO.input(4)
sense3 = GPIO.input(27)
sense4 = GPIO.input(26)
getdata = fbase.get('nodes/node1/reading','')
getdata2 = fbase.get('nodes/node2/reading','')
getdata3 = fbase.get('nodes/node3/reading','')
getdata4 = fbase.get('nodes/node4/reading','')
if sensedata==int(getdata):
print("No state change in node 1")
else:
print("State changed in A1")
res = fbase.put('nodes/node1','reading',str(sensedata))
if sensedata == 0:
print("car parked in A1")
sleep(2)
elif sensedata == 1:
print("Car Left from A1")
sleep(2)
if sense2==int(getdata2):
print("No state change in node 2")
else:
print("State changed in 2")
res = fbase.put('nodes/node2','reading',str(sense2))
if sense2 == 0:
print("car parked in A2")
sleep(2)
elif sense2 == 1:
print("Car Left from A2")
sleep(2)
if sense3==int(getdata3):
DEPARTMENT OF CSE.HITS 21
AUTOMATED PARKING SYSTEM USING IOT TECHNIQUES
DEPARTMENT OF CSE.HITS 22
AUTOMATED PARKING SYSTEM USING IOT TECHNIQUES
DEPARTMENT OF CSE.HITS 23
AUTOMATED PARKING SYSTEM USING IOT TECHNIQUES
"execution_count": 2,
"outputs": [
{
"output_type": "stream",
"text": [
"\n",
"Enter your authorization code:\n",
"··········\n",
"Mounted at /content/drive\n"
],
"name": "stdout"
}
]
},
{
"metadata": {
"id": "xsw7UKpUFj-P",
"colab_type": "code",
"colab": {}
},
"cell_type": "code",
"source": [
"# !pip install jupyterlab"
},
"execution_count": 0,
"outputs": []
},
{
"metadata": {
"id": "Tia0L7qmGmgt",
"colab_type": "code",
"colab": {}
},
"cell_type": "code",
DEPARTMENT OF CSE.HITS 24
AUTOMATED PARKING SYSTEM USING IOT TECHNIQUES
"source": {
"# !npm config set prefix /usr/local"
],
"execution_count": 0,
"outputs": []
},
{
"metadata": {
"id": "_S3IQsrSFrh4",
"colab_type": "code",
"colab": {}
},
"cell_type": "code",
"source": [
"# !npm install localtunnel\n"
],
"execution_count": 0,
"outputs": []
},
{
"metadata": {
"id": "lPlbXThWFwAw",
"colab_type": "code",
"colab": {}
},
"cell_type": "code",
"source": [
"# jupyter_running = !jupyter notebook list | grep 8888\n",
"# if not jupyter_running:\n",
"# !mkdir -p /content/.jupyter\n",
"# !echo '{ \"NotebookApp\":
{ \"password\": \"4d6ed2c10da3aeaba70c40a26ed2e659b75e3dfd\" } }' >
/content/.jupyter/jupyter_notebook_config.json\n",
"# get_ipython().system_raw('jupyter lab &')\n",
DEPARTMENT OF CSE.HITS 25
AUTOMATED PARKING SYSTEM USING IOT TECHNIQUES
DEPARTMENT OF CSE.HITS 26
AUTOMATED PARKING SYSTEM USING IOT TECHNIQUES
],
"execution_count": 0,
"outputs": [
{
"output_type": "stream",
"text": [
"Cloning into 'Mask_RCNN'...\n",
"remote: Enumerating objects: 923, done.\u001b[K\n",
"remote: Total 923 (delta 0), reused 0 (delta 0), pack-reused 923\u001b[K\n",
"Receiving objects: 100% (923/923), 139.77 MiB | 11.17 MiB/s, done.\n",
"Resolving deltas: 100% (521/521), done.\n"
],
"name": "stdout"
}
]
},
{
"metadata": {
"id": "ghN6PD0zR7dw",
"colab_type": "code",
"outputId": "a01e61df-81b5-479c-ebe9-d90fbef2a843",
"colab": {
"base_uri": "https://localhost:8080/",
"height": 287
}
},
"cell_type": "code",
"source": [
"!pip3 install twilio"
],
"execution_count": 3,
"outputs": [
{
"output_type": "stream",
DEPARTMENT OF CSE.HITS 27
AUTOMATED PARKING SYSTEM USING IOT TECHNIQUES
"text": [
"Collecting twilio\n",
"\u001b[?25l Downloading
"Requirement already satisfied: chardet<3.1.0,>=3.0.2 in
/usr/local/lib/python3.6/dist-packages (from requests>=2.0.0; python_version >= \"3.0\"-
>twilio) (3.0.4)\n",
"Requirement already satisfied: certifi>=2017.4.17 in
/usr/local/lib/python3.6/dist-packages (from requests>=2.0.0; python_version >= \"3.0\"-
>twilio) (2018.11.29)\n",
"Installing collected packages: PyJWT, twilio\n",
"Successfully installed PyJWT-1.7.1 twilio-6.24.0\n"
],
"name": "stdout"
}
]
},
{
"metadata": {
"id": "jS4wbKWTL42_",
"colab_type": "code",
"colab": {}
},
"cell_type": "code",
"source": [
"import os\n",
"os.chdir(\"/content/drive/My Drive/AK49/Mask_RCNN/\")\n",
"# os.chdir(\"..\")"
],
"execution_count": 0,
"outputs": []
},
{
"metadata": {
"id": "87-fJea6aqVa",
DEPARTMENT OF CSE.HITS 28
AUTOMATED PARKING SYSTEM USING IOT TECHNIQUES
"colab_type": "code",
"outputId": "de6b3d52-96e7-4c5e-8290-3200787a8d0b",
"colab": {
"base_uri": "https://localhost:8080/",
"height": 35
}
},
"cell_type": "code",
"source": [
"import numpy as np\n",
"import cv2\n",
"import mrcnn.config\n",
"import mrcnn.utils\n",
"from mrcnn.model import MaskRCNN\n",
"from pathlib import Path\n",
"from twilio.rest import Client"
],
"execution_count": 5,
"outputs": [
{
"output_type": "stream",
"text": [
"Using TensorFlow backend.\n"
],
"name": "stderr"
}
]
},
{
"metadata": {
"id": "wv6XJBd_bzv5",
"colab_type": "code",
"colab": {}
},
DEPARTMENT OF CSE.HITS 29
AUTOMATED PARKING SYSTEM USING IOT TECHNIQUES
"cell_type": "code",
"source": [
"import matplotlib as pt"
],
"execution_count": 0,
"outputs": []
},
{
"metadata": {
"id": "pvYO3F9g-j0X",
"colab_type": "code",
"colab": {}
},
"cell_type": "code",
"source": [
"# !rm -r ak\n",
"# !mkdir ak"
],
"execution_count": 0,
"outputs": []
},
{
"metadata": {
"id": "jQ9SvpJXHvua",
"colab_type": "code",
"outputId": "270177a2-bc2c-470e-8a82-af38442f6903",
"colab": {
"base_uri": "https://localhost:8080/",
"height": 2539
}
},
"cell_type": "code",
"source": [
"# Mask-RCNN config\n",
DEPARTMENT OF CSE.HITS 30
AUTOMATED PARKING SYSTEM USING IOT TECHNIQUES
"class MaskRCNNConfig(mrcnn.config.Config):\n",
" NAME = \"coco_pretrained_model_config\"\n",
" IMAGES_PER_GPU = 1\n",
" GPU_COUNT = 1\n",
" NUM_CLASSES = 1 + 80 \n",
" DETECTION_MIN_CONFIDENCE = 0.6 #setted to 60%\n",
"\n",
"\n",
"# Filter to only cars\n",
"def get_car_boxes(boxes, class_ids):\n",
" car_boxes = []\n",
"\n",
" for i, box in enumerate(boxes):\n",
" if class_ids[i] in [3, 8, 6]:\n",
" car_boxes.append(box)\n",
"\n",
" return np.array(car_boxes)\n",
"\n",
"# Twilio config\n",
"twilio_account_sid = 'aaaaaaaaaaaaaaaaaaaaa'\n",
"twilio_auth_token = 'aaaaaaaaaaaaaa'\n",
"twilio_phone_number = '+9999999'\n",
"destination_phone_number = '+199999999'\n",
"client = Client(twilio_account_sid, twilio_auth_token)\n",
"\n",
"# Root dir\n",
"ROOT_DIR = Path(\".\")\n",
"\n",
"#Trained model loc\n",
"MODEL_DIR = os.path.join(ROOT_DIR, \"logs\")\n",
"\n",
"COCO_MODEL_PATH=os.path.join(ROOT_DIR, \"mask_rcnn_coco.h5\")\n",
"\n",
"if not os.path.exists(COCO_MODEL_PATH):\n",
DEPARTMENT OF CSE.HITS 31
AUTOMATED PARKING SYSTEM USING IOT TECHNIQUES
" mrcnn.utils.download_trained_weights(COCO_MODEL_PATH)\n",
"\n",
"VIDEO_SOURCE = \"test_images/stace_park.mp4\"\n",
"\n",
"model = MaskRCNN(mode=\"inference\", model_dir=MODEL_DIR,
config=MaskRCNNConfig())\n",
"\n",
"model.load_weights(COCO_MODEL_PATH, by_name=True)\n",
"\n",
"# spotted parking spaces\n",
"parked_car_boxes = None\n",
"\n",
"video_capture = cv2.VideoCapture(VIDEO_SOURCE)\n",
"\n",
"free_space_frames = 0\n",
"sms_sent = False\n",
"count = 0\n",
"temp = np.array(4,)\n",
"\n",
"parked_car_boxes1 = [None] * 11\n",
"\n",
"def checkEqual2(iterator):\n",
" print(iterator)\n",
"# return len(set(iterator)) <= 1\n",
" \n",
"# Loop over each frame in the video\n",
"counter = 0\n",
"ref_image = None\n",
"ref_image_color = None\n",
"cumm_image = None\n",
"img_thresh_sub1 = None\n",
"final_ref = None\n",
"while video_capture.isOpened():\n",
" success, frame = video_capture.read()\n",
DEPARTMENT OF CSE.HITS 32
AUTOMATED PARKING SYSTEM USING IOT TECHNIQUES
" \n",
" #image = frame\n",
" if not success:\n",
" print(\"couldn't read video\")\n",
" break\n",
" \n",
" elif counter<40:\n",
" #create another video reader object to compare the two frames and verify the
possibility of motion\n",
" success, frame2 = video_capture.read()\n",
" d = cv2.absdiff(frame, frame2) \n",
" grey = cv2.cvtColor(d, cv2.COLOR_BGR2GRAY)\n",
" blur = cv2.GaussianBlur(grey, (1, 1), 0)\n",
" ret, th = cv2.threshold( blur, 20, 255, cv2.THRESH_BINARY)\n",
" \n",
" #perform these morphological transformations to erode the car which is moving
so that it is not detected by MASKRCNN. Take the eorsion levels to be high. \n",
" dilated = cv2.dilate(th, np.ones((30, 30), np.uint8), iterations=1 )\n",
" eroded = cv2.erode(dilated, np.ones((30, 30), np.uint8), iterations=1 )\n",
" \n",
" #fill the contours for even a better morphing of the vehicle\n",
" img, c, h = cv2.findContours(eroded, cv2.RETR_TREE,
cv2.CHAIN_APPROX_SIMPLE)\n",
" frame2 = cv2.drawContours(frame2, c, -1, (0,0,0), cv2.FILLED)\n",
" \n",
" \n",
" # for cont in c:\n",
"# epsilon = 0.01 * cv2.arcLength(cont, True)\n",
"# approx = cv2.approxPolyDP(cont, epsilon, True)\n",
"# frame2 = cv2.drawContours(frame2, [approx], 0, (255,255,255),
cv2.FILLED)\n",
" \n",
"# rect = cv2.minAreaRect(cont)\n",
"# box= cv2.boxPoints(rect)\n",
DEPARTMENT OF CSE.HITS 33
AUTOMATED PARKING SYSTEM USING IOT TECHNIQUES
"# box=np.int0(box)\n",
"# frame2 = cv2.drawContours(frame2, [box], 0, (0,0,0), cv2.FILLED)\n",
"\n",
"\n",
"# print(c)\n",
"# cv2.drawContours(frame2, c, -1, Scalar(255), cv2.FILLED)\n",
"# des = cv2.bitwise_not(frame2)\n",
"# contour,hier =
cv2.findContours(des,cv2.RETR_CCOMP,cv2.CHAIN_APPROX_SIMPLE)\n",
"\n",
"# for cnt in contour:\n",
"# cv2.drawContours(des,[cnt],0,255,-1)\n",
"\n",
"# gray = cv2.bitwise_not(des)\n",
"# cv2.fillPoly(img, pts =[c], color=(255,255,255))\n",
"\n",
"\n",
" \n",
" if counter%5 == 0:\n",
" print(\"Current frame counter\" + str(counter))\n",
" pt.pyplot.imshow(frame2)\n",
" pt.pyplot.show()\n",
" \n",
" counter = counter + 1\n",
" continue\n",
" \n",
" # Converting the image from BGR color used by OpenCV to RGB color. \n",
" if counter==40:\n",
" rgb_image = frame2[:,:,::-1]\n",
" counter+=1\n",
" else:\n",
" rgb_image = frame[:, :, ::-1]\n",
" \n",
" results = model.detect([rgb_image], verbose=0)\n",
DEPARTMENT OF CSE.HITS 34
AUTOMATED PARKING SYSTEM USING IOT TECHNIQUES
"\n",
" # Mask R-CNN assumes we are running detection on multiple images.\n",
" # We only passed in one image to detect, so only grab the first result.\n",
" r = results[0]\n",
"\n",
" # The r variable will now have the results of detection:\n",
" # - r['rois'] are the bounding box of each detected object\n",
" # - r['class_ids'] are the class id (type) of each detected object\n",
" # - r['scores'] are the confidence scores for each detection\n",
" # - r['masks'] are the object masks for each detected object (which gives you the
object outline)\n",
" if parked_car_boxes is None:\n",
" print(\"going in to mark vehicles. Frame number: \", counter)\n",
" video_capture = cv2.VideoCapture(VIDEO_SOURCE)\n",
" # This is the first frame of video - assume all the cars detected are in parking
spaces.\n",
" # Save the location of each car as a parking space box and go to the next
frame of video.\n",
" parked_car_boxes = get_car_boxes(r['rois'], r['class_ids'])\n",
" \n",
" else:\n",
" # Get where cars are currently located in the frame\n",
" car_boxes = get_car_boxes(r['rois'], r['class_ids'])\n",
"\n",
" # See how much those cars overlap with the known parking spaces\n",
" overlaps = mrcnn.utils.compute_overlaps(parked_car_boxes, car_boxes)\n",
"\n",
" # Assume no spaces are free until we find one that is free\n",
" free_space = False\n",
"\n",
" # Loop through each known parking space box\n",
" for parking_area, overlap_areas in zip(parked_car_boxes, overlaps):\n",
"\n",
" # For this parking space, find the max amount it was covered by any\n",
DEPARTMENT OF CSE.HITS 35
AUTOMATED PARKING SYSTEM USING IOT TECHNIQUES
" # car that was detected in our image (doesn't really matter which car)\n",
" max_IoU_overlap = np.max(overlap_areas)\n",
"\n",
" # Get the top-left and bottom-right coordinates of the parking area\n",
" y1, x1, y2, x2 = parking_area\n",
"\n",
" # Check if the parking space is occupied by seeing if any car overlaps\n",
" # it by more than 0.15 using IoU\n",
" if max_IoU_overlap < 0.15:\n",
" # Parking space not occupied! Draw a green box around it\n",
" cv2.rectangle(frame, (x1, y1), (x2, y2), (0, 255, 0), 3)\n",
" # Flag that we have seen at least one open space\n",
" free_space = True\n",
" else:\n",
" # Parking space is still occupied - draw a red box around it\n",
" cv2.rectangle(frame, (x1, y1), (x2, y2), (0, 0, 255), 1)\n",
"\n",
" # Write the IoU measurement inside the box\n",
" font = cv2.FONT_HERSHEY_DUPLEX\n",
" cv2.putText(frame, f\"{max_IoU_overlap:0.2}\", (x1 + 6, y2 - 6), font, 0.3,
(255, 255, 255))\n",
"\n",
" # If at least one space was free, start counting frames\n",
" # This is so we don't alert based on one frame of a spot being open.\n",
" # This helps prevent the script triggered on one bad detection.\n",
" if free_space:\n",
" free_space_frames += 1\n",
" else:\n",
" # If no spots are free, reset the count\n",
" free_space_frames = 0\n",
"\n",
" # If a space has been free for several frames, we are pretty sure it is really
free!\n",
" if free_space_frames > 120:\n",
DEPARTMENT OF CSE.HITS 36
AUTOMATED PARKING SYSTEM USING IOT TECHNIQUES
DEPARTMENT OF CSE.HITS 37
AUTOMATED PARKING SYSTEM USING IOT TECHNIQUES
"outputs": [
{
"output_type": "stream",
"text": [
"Current frame counter0\n"
],
"name": "stdout"
},
{
"output_type": "display_data",
"data": {
"image/png";
}
//If there Exist any Slot Allocation for the vehicles from other Arduino.
Allocate a slot;
void printAlloc() {
//Print the Scanned RFID and request the user for destination.
DEPARTMENT OF CSE.HITS 38
AUTOMATED PARKING SYSTEM USING IOT TECHNIQUES
if(destination!=other arduino) {
Allocate a slot;
else {
Main of Arduino
void setup() {
void loop() {
Scan RFID;
Database Connection.
<?php
DEPARTMENT OF CSE.HITS 39
AUTOMATED PARKING SYSTEM USING IOT TECHNIQUES
mysql_connect(‘Host_Ip',‘User_name',‘Password')
or die(mysql_error());
mysql_select_db(‘Database_name') or die(mysql_error());
?>
Forms Creation.
</form>
Session Creation.
<?php
require ‘databse_connection_file_name';
if (isset($_SESSION['user'])) { header("Location:
session_filename"); exit;}
?>
Report Generation
function fetch_data()
$output = '';
$output .= '<tr>
Tabular rows
DEPARTMENT OF CSE.HITS 40
AUTOMATED PARKING SYSTEM USING IOT TECHNIQUES
</tr>';
return $output;
function validateform2()
$(function() {
$("form[name="form name"]").validate({
rules: {
},
messages: {
},
submitHandler: function(form) {
validateform2();
DEPARTMENT OF CSE.HITS 41
AUTOMATED PARKING SYSTEM USING IOT TECHNIQUES
});
});
Even though there exists many for loops, the number of comparisons are constant.
(b) Even though there are unlimited number of cars that are capable of
entering the parking slots, there are finite slots. Hence there is a limit to
Mathematically,
As the efficiency is observed to be constant for all the three cases as explained, it can
DEPARTMENT OF CSE.HITS 42
AUTOMATED PARKING SYSTEM USING IOT TECHNIQUES
(1) As per the Oracle documentation MySQL uses indexing for searching. As far
(2) B+ tree takes ܱ(log ݊) asymptotic complexity for searching the elements.
Worst case:ܱ(݊)
It takes worst complexity only when user avails the following services:
(2) Check the current availability of the parking slots in the mall.
A process of executing a program with the explicit intention of finding errors, that is
making the program fail. It is the process of detecting errors and performs a very critical -
role for
quality assurance, also for ensuring the reliability of software. The results of testing are used
later
Unit Testing
It concentrates on each unit of the software as implemented in source code and is a white
box oriented. Using the component level design description as a guide, important control
paths are tested to uncover errors within the boundary of the module. In the unit testing, the
steps can be conducted in parallel for multiple components in my project I tested all the
modules individually related to main function codes and attacks also.
DEPARTMENT OF CSE.HITS 43
AUTOMATED PARKING SYSTEM USING IOT TECHNIQUES
Below are the unit test cases that are run manually:
Pass
Pass
Pass
Pass
DEPARTMENT OF CSE.HITS 44
AUTOMATED PARKING SYSTEM USING IOT TECHNIQUES
parking slot 1
Pass
parking slot 1
Pass
parking slot 2
Pass
parking slot 2
DEPARTMENT OF CSE.HITS 45
AUTOMATED PARKING SYSTEM USING IOT TECHNIQUES
Pass
parking slot 3
Pass21
parking slot 3
Pass
Status as ‘Occupied’
indicator
Pass
Status as ‘Occupied’
DEPARTMENT OF CSE.HITS 46
AUTOMATED PARKING SYSTEM USING IOT TECHNIQUES
‘Vacant’ to ‘Occupied’
Pass
Status as ‘Vacant’
indicator
Pass
Status as ‘Vacant’
‘Occupied’ to ‘Vacant’
Pass
recorded timings
Pass
Integration Testing
Here focus is on design and construction of the software architecture. Integration Testing is a
systematic technique for constructing the program structure while at the same time
conducting tests to uncover errors associated with interfacing. The objective is to take unit
DEPARTMENT OF CSE.HITS 47
AUTOMATED PARKING SYSTEM USING IOT TECHNIQUES
tested components and build a program structure that has been dictated by design. The goal
here is to see if modules can be integrated properly, the emphasis being on testing interfaces
between modules. This testing activity can be considered as testing the design and hence the
emphasis on testing module interactions. In this project the main system is formed by
integrating all the modules. When integrating all the modules I have checked whether the
integration effects working of any of the services by giving different combinations of inputs
with which the two
Below are the few Integration Test Cases that are done manually:
Display correct occupancy status messages for all the parking slots and also display
occupancy trends of all parking
Pass
Status as ‘Occupied’
‘Vacant’ to ‘Occupied’
Pass
Status as ‘Vacant’
DEPARTMENT OF CSE.HITS 48
AUTOMATED PARKING SYSTEM USING IOT TECHNIQUES
‘Occupied’ to ‘Vacant’
Pass
Display the presence of vehicle at that particular time in the chart and also change in the
occupancy status and message.
Upon refreshing the html page Sync data with the database and
Validation Testing
I made sure I have covered all the requirements that were discussed earlier at the start of the
project. And also confirmed that the application works just the way it has to.
User Testing
User testing is a technique used to evaluate a product by testing it on different users. This can
be seen as inimitable practice, as it gives direct input on how real users use the system. I have
asked couple of my friends to try installing and running this application on their machines
and got expected results. I have also presented this application in front of my Major Professor
where I only completed the first phase of the application that the application would display
the occupancy status of the parking space. But later we discussed on extending the
application to display parking trends on a chart for any given date. I successfully completed
implementing that part as well and tested to result as expected. The application was tested in
all possible aspects and got just expected results.
Performance Testing
Performance Testing is performed to determine how fast a system performs under a particular
load. It is also used to validate and verify other attributes of the system such as scalability,
DEPARTMENT OF CSE.HITS 49
AUTOMATED PARKING SYSTEM USING IOT TECHNIQUES
reliability and resource usage. Load testing is primarily concerned with testing that can
continue to operate under specific load be it large amount of data or be it numerous users.
I have used Apache JMeter to perform load testing which can be used to test performance
both on static as well as dynamic resources (files, Servlets, Perl Scripts, Java Objects,
Databases and Queries, FTP Servers and more). It can be used to simulate a heavy load on a
server, network or object to test its strength or to analyze overall performance under different
load types. Using JMeter I have taken increased number of users while using the page with
the same Ramp-Up period and Loop Count.
50 5 100 11,645.9/min
Using JMeter I have taken increased number of users while using the page with the same
Ramp-Up period and Loop Count. We can see that with increase in the number of users, the
throughput is increased.
The graphs below shows Response Times over Time. The vertical axis is the Response Time
in milliseconds and the horizontal axis is Elapsed Time i.e. granularity/500 milliseconds. In
all the three test cases, we can see that the Response Times over Time is a constant graph.
DEPARTMENT OF CSE.HITS 50
AUTOMATED PARKING SYSTEM USING IOT TECHNIQUES
DEPARTMENT OF CSE.HITS 51
AUTOMATED PARKING SYSTEM USING IOT TECHNIQUES
DEPARTMENT OF CSE.HITS 52
AUTOMATED PARKING SYSTEM USING IOT TECHNIQUES
DEPARTMENT OF CSE.HITS 53
AUTOMATED PARKING SYSTEM USING IOT TECHNIQUES
DEPARTMENT OF CSE.HITS 54
AUTOMATED PARKING SYSTEM USING IOT TECHNIQUES
DEPARTMENT OF CSE.HITS 55
AUTOMATED PARKING SYSTEM USING IOT TECHNIQUES
DEPARTMENT OF CSE.HITS 56
AUTOMATED PARKING SYSTEM USING IOT TECHNIQUES
6.RESULT
In this project, it has been proved that by utilizing RFID readers and RFID labels with a
centralized database system, all the parking-lots in a city could be operated in an economical,
dynamic and fast way. The given prototype will provide an atomized operation and
controlling ability for all of the parking-lots in a city by using standardized devices. At the
end of each month, the total fees for each of the parking-lot member drivers can be
calculated. The additional facility is also available that these fees could be drawn from their
bank accounts and transferred to the parking-lots' accounts automatically, issuing an invoice
for each transaction. Via such a system, personnel costs will be cut off because of less direct
human intervention. As is in the case of ATM machines, realization of unmanned, completely
atomized parkin. lots will be possible in the near future. Without having to stop vehicles,
check-ins and checkouts will be possible. In that way, there won't be any traffic jam problems
and with limited infrastructure traffic can be managed dynamically. According to the
DEPARTMENT OF CSE.HITS 57
AUTOMATED PARKING SYSTEM USING IOT TECHNIQUES
traditional parking lot systems, drivers will no longer be bound to take and process parking
tickets during check-ins and check-outs. Moreover there won't be any ticket jamming
problems either. Vehicle owners will have the facility where they will not have to make
payments upon every check-out. This will minimize congestion to greatest possible extent.
The following conclusions will lead to clear understanding of the project “Automated Parking
System Using Internet of Things (IoT) The proposed system will overcome the current
challenges thus avoiding the congestion with in the parking lot itself. This parking system can
be either used in Public places or at apartments thus making it area independent. Minimizing
Man power thus maximizing throughput. Exact calculation of the time interval between the
Entry time and Exit time and automated report/bill generation or mechanism. This system
will be developed for the very first time in the world with these many unique plugins. A Win-
Win situation for both Users as well as the authority members. As per our assumption that
RFID itself is the car’s registration number, the proposed system can thus be made reality on
the following enhancements:
i) Create One-One Mapping. (Recommended) between the RFID and the CAR’s
Registration Number
ii) Image and Video processing. (Secondary Approach): Use a high quality camera to
record the image and with appropriate image processing algorithms derive the car’s
registration number and continue with the process.
iii) The goal of an Automated Parking system is to reduce the time taken and the hassle
factor of locating an available parking space. Being able to accurately direct a driver
to an available space has many environmental benefits; it reduces CO2 emissions,
noise and other pollutants. An Automated Parking system will assist users to solve
the issue of finding a parking space and to minimize the time spent in searching for
the nearest available car park. The problem of finding unoccupied parking space and
ignore some other critical issues such as information about the nearest car parking
and the roads traffic congestion. In this way we can get a disciplined parking system.
DEPARTMENT OF CSE.HITS 58
AUTOMATED PARKING SYSTEM USING IOT TECHNIQUES
DEPARTMENT OF CSE.HITS 59