Iot-Based Smart Parking For Smart Cities
Iot-Based Smart Parking For Smart Cities
Iot-Based Smart Parking For Smart Cities
Abstract—The advance in computing brought also solutions to accessed. Thus, IoT is supported by cloud computing, since it
problems that can improve citizen’s life. One significant problem is well suited for large scale data-storage [6].
involves parking vehicles, which is related to traffic congestion, Those concepts can meet each other in order to solve urban
air pollution and driver stress. Due to that fact and the increase
in the number of vehicles, it becomes necessary a smart parking problems and improve citizens’ life. One well-known problem
proposal that mitigates those problems and interacts with the is the increasingly use of private vehicles in large cities on
drivers. In this paper we will describe a smart parking system a daily basis, that affects urban mobility. In 2013, VEJA
able to gather quantitative information and provide it trough an magazine published a research performed by YE consultancy
extensible platform to drivers and other smart city applications. in which fifteen districts from the expanded center of São
The proposed system is implemented disposing ultrasonic sensors,
a web service, the FIWARE platform, and a mobile application Paulo (a zone that concentrates the major parts of services,
to Android devices, on a three-layer architecture. The paper also jobs, and leisure and cultural equipment of this Brazilian
aims to present the results of a proof of concept, which shows metropolis) if summed could receive around 509,000 cars by
that this approach is appropriate for monitoring parking systems day, however there is space just for 384,000 [7]. Thus, 125,000
and exhibit the parking lot situation at any given moment. Thus, cars cannot park and so they waste much time looking for
it is the first step to propose a comprehensive solution for smart
cities. parking spaces, and when the drivers do not get a spot, they
park in inappropriate places.
I. I NTRODUCTION The large amount of vehicles on the streets is caused
mainly by the shortage of parking spaces and also by the
In recent years, ubiquitous computing (or “ubicomp”) is improper management of the available spots. This situation
presented as one of the major challenges of research in leads to traffic congestion that harms urban mobility. Another
Computing [1], [2]. Ubicomp is viewed as a fusion of mobile consequence is the increase of air pollution provoked by
computing and pervasive computing [3]. The first one is vehicle pollutants gases, since the more time they take to park,
characterized as the user’s capability of carrying computational the more gases will be released.
services with him, which becomes an extension of the user. Therefore, it is needed computational solutions that enable a
The latter implies that the computer is embedded in such a good flow of vehicles on the streets and dispose of services to
way that blends to the environment and sometimes is not ease parking, such as checking the parking situation before go
perceived by the users. This situation can allow the gathering out. It could be also useful some method to identify the drivers
of environment data, also known as context, and that can be which parked, especially if they parked on reserved parking
used by a system to provide relevant information to the user, spaces (in this paper we use the expression reserved parking
marking the system as context-aware [4]. In light of this, spaces for those which are allocated to specific groups, like
ubicomp emerges from that need to integrate mobility with elderly, disabled people or women, except in the Section II),
the usefulness of pervasive computing allowing the users to in order to make sure they have that right.
interact with the environment [3]. Furthermore, a system of that domain could be also em-
Ubiquitous computing talks about interconnected objects but ployed both in public areas, such as commercial centers,
which are not necessarily available on the Internet. For this which have strong demand for parking spaces (especially on
reason “the term Internet of Things (IoT) has come to describe Christmas season, for example), and private areas, making sure
a number of technologies and research disciplines that enable drivers can park in a fast and practical way.
the Internet to reach out into the real world of physical objects” Thus, this paper aims to present a smart parking system
[5]. With the quick development of IoT applications and the for gathering quantitative information, proposing an exten-
increasingly quantity of connected devices, a large amount sible platform where those data are available for smart city
of data is generated and needs to be stored, processed and applications and to the drivers. The proposed system follows
1 http://www.zigbee.org/ 2 https://developers.google.com/maps/
32
Due to the research field dynamism and the different project
requisites and goals, sometimes that architecture needs some
kind of adaptation. Thus, for this work we propose a three-
layer architecture as presented in the Figure 1 and which will
be discussed in the rest of this section.
33
or the previous one. That is done in order to avoid multiple One of the best ways to reach out the users is through
registrations from a single spot. With that ID, the spot can the smartphones, since this is more and more present in
communicate to the context broker. people’s daily life6 . Moreover, although small they have great
processing power which before was only possible in desktops.
C. Context Broker Therefore, it is currently possible to interact with the users
The intermediate layer also handle with context information, through a mobile application and dispose the parking system
given that implementing smart applications requires gathering data on it. This approach is more practical to the users than
and managing context information, as was introduced previ- using web applications. Thus, we developed an application
ously. FIWARE is a middleware platform supported by the for helping drivers to get the parking information in real time.
Future Internet Public-Private Partnership (FI-PPP) project of This approach is cheaper and more effective for showing the
the European Union and has been vastly used on Europe parking places and even guide the drivers to them.
[23]. Moreover, FIWARE platform provides a rather simple
yet powerful set of APIs. IV. E XPERIMENTAL R ESULTS
Orion Context Broker is a Generic Enabler4 from FI- In this section we discuss how the system proposed was
WARE platform that implements the NGSI (Next Generation implemented and therefore present the results.
Service Interfaces) REST API, which is used to allow the A. Experimental Setup
communication among the different Generic Enablers (GEs).
There is a circuit at each parking space that is responsible
NGSI is defined based on context entities, which are virtual
for monitoring the vehicle entrance and exit from a spot. This
representation of the several characters of the real world, such
circuit is composed by an HC-SR04 ultrasonic ranging sensor7
as a bus, a table, a room or even a person. The context entities
and an ESP-12 chip, in accordance with the Figure 3.
are represented through context elements, which holds a set of
context element attributes. This last can hold a set of meta-
data.
Orion supports the management of the whole life cycle of
context information including updates, queries, registrations
and subscriptions. The context elements are registered and
managed through updates and queries. It is also possible to
subscribe to context information so when some condition
occurs, such as a change in a context element, Orion sends
a notification [24].
D. Applications Layer Fig. 3. Circuit for managing a parking space.
The users have access to parking system information
through the Application Layer. The range distance measurement of the sensor vary from
FIWARE has a class of GEs to applications/services and 2 cm to 4 m and the thresholds definition depends on the
data delivery, where WireCloud is well-known. WireCloud5 dimensions of the parking spaces. For this experiment we have
is a application mashup platform useful for creating web set the ultrasonic sensor minimum threshold as 4 cm (given
applications that interacts with others FIWARE GEs, and that if some pin disconnects then it always reads 0 cm) and
prototype or even produce final solutions. The following the maximum threshold as 100 cm, being appropriated for our
description was entirely taken from the documentation [25], tests. The sensors were positioned in front of the vehicles at
which introduces that mashups in WireCloud are built in the each parking spot.
context of workspaces. A workspace consists of the set of The project intends to use the energy source available in
widgets and operators that can be mashed-up, even spanning the parking lot, that is to say electric sockets will be used
multiple tabs. Widgets and operators in a workspace can for powering all the circuit. However, the hardware devices
share data though data flow or event-based mechanisms. Once operate with direct current flow (DC) and so it is needed a
you have chosen the desired widgets, you can wire them to device for converting alternating current (AC) into DC. Thus,
enable their intercommunication and to achieve coordinated in this project is used an adapter power supply and a MB102
behaviour. Widgets and operators in WireCloud, are capable power supply module8 for supplying the proper voltage to
of sending and/or receiving events and data through well- sensors and ESP8266.
identified ports called endpoints. When you connect two The web service employed was implemented using Python
compatible endpoints, the second one (i.e. the input or target and some useful libraries. Pymongo9 was used in order to work
endpoint) prepares to receive data flows and/or events coming 6 http://www.pewglobal.org/2016/02/22/smartphone-ownership-and-
from the first one (i.e. the output or source endpoint). internet-usage-continues-to-climb-in-emerging-economies/
7 http://www.micropik.com/PDF/HCSR04.pdf
4 https://forge.fiware.org/plugins/mediawiki/wiki/fiware/index.php/ 8 http://www.petervis.com/Raspberry PI/Breadboard Power Supply/
Summary of FIWARE Open Specifications YwRobot Breadboard Power Supply.html
5 https://wirecloud.readthedocs.io/en/stable/ 9 https://api.mongodb.com/python/current/
34
with MongoDB database. Two web application frameworks singular FIWARE instance which was deployed using Docker
were also used: CherryPy10 and Flask11 . The main methods Compose15 .
supported are: The user mobile application was developed to Android
• /clearSpots: a GET request that removes all docu- devices using Java and a Google Maps API for presenting
ments from the database collection of parking spots; the parking occupancy situation, where each marker represents
• /getSpots: a GET request that returns a JSON holding a parking space and the colors shows its status. A red one
the ID, type and geographical position (latitude and represents an occupied spot, while a green one represents a
longitude) of each parking spot registered; vacant spot without restrictions. A blue marker represents that
• /createSpot: a POST request that receives a JSON a disabled parking place is vacant. Moreover, the application
payload with the parking spot type and its geographical queries the context broker at each 3 seconds.
position (latitude and longitude). After that, it stores the
B. Results
new entry in the database and registers it on Orion. This
method returns an ID to the new spot. The parking system information are presented as in Figure
The latitude and longitude attributes were took manually 5 and Figure 6. The first one is part of the mashup application
and the sensors were deployed at each respective location. that runs on WireCloud, and the other is the main screen of
The spots context information registered on Orion have the the mobile application which will be used by the drivers.
same structure and an example is shown in Figure 4.
"contextElement" : {
"type" : "Spot",
"isPattern" : "false",
"id" : "Spot2",
"attributes" : [
{
"name" : "isOccupied",
"type" : "boolean",
"value" : "true"
},
{
"name" : "latitude",
"type" : "float",
"value" : "-5.832565"
},
{
"name" : "longitude",
"type" : "float",
"value" : "-35.205331"
}, Fig. 5. Widget running on WireCloud showing the parking occupancy
{ situation.
"name" : "type",
"type" : "string", The map is centered on our testing area (Metrópole Digital
"value" : "elderly" Institute) and the satellite image is given by Google Maps and
}
]
is not in real time. The map holds markers for each parking
} space that was configured and the marker color changes
dynamically in accordance to spot status changes. The color
scheme is as described previously.
Fig. 4. Orion context information about Spot 2. Thus, the driver can have real time access to the parking
lot information at any given moment. The driver has also a
The WireCloud mashup just holds one widget and two notion of spot location.
operators. An NGSI Source12 and a Spot To Pol (implemented
for this work) operators are used in order to access the context V. F INAL R EMARKS AND F UTURE W ORKS
broker and process valid data for showing visually through In this paper, we described the development of a smart
the widget. A Map Viewer13 is a widget used for showing the parking system able to gather quantitative information and
parking occupancy situation. provide it trough an extensible platform to drivers and other
The middleware layer which includes the processing and smart city applications. The solution was implemented with
storage components, and the context broker were deployed in ultrasonic sensors, a web service, using the FIWARE platform,
a private cloud created using OpenStack14 . We also have a and a mobile application to Android devices in which the
10 http://cherrypy.org/ drivers can have a feedback of the parking lot occupancy.
11 http://flask.pocoo.org/ Furthermore, the solution is based on the proposed three-layer
12 https://github.com/wirecloud-fiware/ngsi-source-operator architecture which is responsible for modularize the system
13 https://github.com/WireCloud/map-viewer-widget
14 https://www.openstack.org/ 15 https://docs.docker.com/compose/
35
[6] D. Linthicum, “The cloud is the secret weapon in the Internet of
things,” http://www.infoworld.com/article/2608029/cloud-computing/
the-cloud-is-the-secret-weapon-in-the-internet-of-things.html, 2014,
Last access in: 2017-04-29.
[7] A. Pinho, “A dificuldade de parar o carro em São Paulo,” http://vejasp.
abril.com.br/cidades/deficit-de-vagas-para-estacionar-carros-sao-paulo/,
2013, Last access in: 2017-04-29.
[8] S. Srikanth, P. Pramod, K. Dileep, S. Tapas, M. U. Patil et al., “Design
and implementation of a prototype smart parking (SPARK) system using
wireless sensor networks,” in Advanced Information Networking and
Applications Workshops, 2009. WAINA’09. International Conference on.
IEEE, 2009, pp. 401–406.
[9] H. Wang and W. He, “A reservation-based smart parking system,” in
Computer Communications Workshops (INFOCOM WKSHPS), 2011
IEEE Conference on. IEEE, 2011, pp. 690–695.
[10] A. Kianpisheh, N. Mustaffa, P. Limtrairut, and P. Keikhosrokiani,
“Smart parking system (SPS) architecture using ultrasonic detector,”
International Journal of Software Engineering and Its Applications,
vol. 6, no. 3, pp. 55–58, 2012.
[11] A. Grazioli, M. Picone, F. Zanichelli, and M. Amoretti, “Collaborative
mobile application and advanced services for smart parking,” in Mobile
Data Management (MDM), 2013 IEEE 14th International Conference
on, vol. 2. IEEE, 2013, pp. 39–44.
[12] L. Da Xu, W. He, and S. Li, “Internet of things in industries: A survey,”
IEEE Transactions on industrial informatics, vol. 10, no. 4, pp. 2233–
2243, 2014.
[13] K. Yamada and M. Mizuno, “A vehicle parking detection method using
image segmentation,” Electronics and Communications in Japan (Part
III: Fundamental Electronic Science), vol. 84, no. 10, pp. 25–34, 2001.
[14] M. Idris, Y. Leng, E. Tamil, N. Noor, and Z. Razak, “Car park system:
A review of smart parking system and its technology,” Inf. Technol. J,
vol. 8, no. 2, pp. 101–113, 2009.
Fig. 6. The mobile application main screen. [15] G. Revathi and V. S. Dhulipala, “Smart parking systems and sensors:
A survey,” in Computing, Communication and Applications (ICCCA),
2012 International Conference on. IEEE, 2012, pp. 1–5.
and achieve a low coupling, making it extensible and easy to [16] “ESP8266EX datasheet,” http://espressif.com/sites/default/files/
maintain. documentation/0a-esp8266ex datasheet en.pdf, 2017, Last access
in: 2017-05-18.
Based on the results, we concluded that this approach is [17] D. Fensel and C. Bussler, “The web service modeling framework
appropriate for monitoring parking systems and exhibit the WSMF,” Electronic Commerce Research and Applications, vol. 1, no. 2,
parking lot situation at any given moment. Thus, it is the first pp. 113–137, 2002.
[18] Wikipedia, “Representational state transfer,” https://en.wikipedia.org/
step to propose a comprehensive solution for smart cities. wiki/Representational state transfer, 2017, Last access in: 2017-05-06.
As future works, we intend to incorporate cameras for [19] M. Vaqqas, “Restful web services: A tutorial,” http://www.drdobbs.
monitoring parking spaces, since it is an interesting scalable com/web-development/restful-web-services-a-tutorial/240169069,
2014, Last access in: 2017-05-06.
solution and the architecture supports its insertion. We also [20] M. Asay, “Why you need NoSQL for the internet of things,” http://
intend to acquire qualitative information by knowing which readwrite.com/2014/11/28/internet-of-things-nosql-data/, 2014, Last ac-
driver is parked at each parking spot. This can be done through cess in: 2017-05-04.
[21] E. Marchal, “Why nosql is the future of IoT,” https://thestack.com/iot/
RFID tags for each driver or by inserting QR codes at each 2016/02/15/why-nosql-is-the-future-of-iot/, 2016, Last access in: 2017-
spot, which would be scanned by the mobile application that 05-04.
should send both driver credentials and the spot identification [22] MongoDB, “Advantages of NoSQL,” https://www.mongodb.com/scale/
advantages-of-nosql, 2017, Last access in: 2017-05-04.
to the parking system. [23] “Fiware map,” http://map.fiware.org/actors/smes, 2017, Last access in:
2017-05-18.
R EFERENCES [24] Orion, “Welcome to Orion context broker,” https://fiware-orion.
[1] A. d. L. Carvalho, F. d. Ponce de Leon et al., “Grandes Desafios da readthedocs.io/en/master/, 2017, Last access in: 2017-05-04.
Pesquisa em Computação no Brasil–2006–2016,” São Paulo: Sociedade [25] Wirecloud, “User guide,” http://wirecloud.readthedocs.io/en/latest/user
Brasileira de Computação, 2006. guide/, 2017, Last access in: 2017-05-04.
[2] J. M. Frye, “NSF Major Research Centers Programs,” https://www.nsf.
gov/od/oia/presentations/jf/HBCU-UP Talk.pdf, 2009, Last access in:
2017-04-29.
[3] R. B. de Araujo, “Computação ubı́qua: Princı́pios, tecnologias e de-
safios,” in XXI Simpósio Brasileiro de Redes de Computadores, vol. 8,
2003, pp. 11–13.
[4] G. D. Abowd, A. K. Dey, P. J. Brown, N. Davies, M. Smith, and
P. Steggles, “Towards a better understanding of context and context-
awareness,” in International Symposium on Handheld and Ubiquitous
Computing. Springer, 1999, pp. 304–307.
[5] C. Floerkemeier, M. Langheinrich, E. Fleisch, F. Mattern, and S. E.
Sarma, The Internet of Things: First International Conference, IOT 2008,
Zurich, Switzerland, March 26-28, 2008, Proceedings. Springer, 2008,
vol. 4952.
36