Fuzzy Logic-Based Smart Parking System

Fuzzy Logic-Based Smart Parking System

Taner TuncerOkan Yar 

Department of Computer Engineering, Firat University, Elazig 23119, Turkey

Corresponding Author Email: 
ttuncer@firat.edu.tr
Page: 
455-461
|
DOI: 
https://doi.org/10.18280/isi.240501
Received: 
22 June 2019
|
Revised: 
1 October 2019
|
Accepted: 
8 October 2019
|
Available online: 
26 November 2019
| Citation

OPEN ACCESS

Abstract: 

Wireless sensor networks consist of many sensors designed to provide an information flow from a specific area. Sensors communicate with each other to receive information from the physical environment they are in and transfer the results to the electronic environment. In recent years, advances in wireless sensor networks have made it necessary to control and monitor large physical fields, and collect and store the resulting data. In particular, it is very important to collect and process data on infrastructure, air pollution, traffic and many other similar issues in crowded cities. The smart city structure aims to combine data originating from different sources for different purposes. This study proposes a fuzzy logic-based solution to the driver parking problem. This solution recommends the best parking spot to the customer by processing the number of empty parking spaces in different places within the city, the distance from the customer to the parking spot and the relevant traffic information. The customer can find the best parking spot using the developed android-based interface. First, the number of empty spaces and the locations of the parking areas were stored in a cloud database. The time associated with the traffic information and the routes between the customer and the car parking spots were obtained using Google services. While the inputs for the developed fuzzy logic-based system were the number of empty parking spaces, and the distance and time, the output is the recommendation or the car park preferred by the customer. Thus, a smart solution to the parking problem is presented and the availability of parking spaces, prevention of lost customer time and the reduction of costs has all been achieved.

Keywords: 

fuzzy logic, mobile communication, wireless sensor networks

1. Introduction

Sensors communicate with each other to receive information from the physical environment they are in and transfer the results to the electronic environment. It has become important to store, combine, process and obtain meaningful information about the environment using the data obtained by the sensors. The acquisition of information about different physical environments, the creation of useful data from this information and its implementation has accelerated the formation of smart environments. As a result, smart cities and platforms have become a topic of interest for research.

A smart city can efficiently use resources such as water, electricity and roads that are equipped with information and communication technologies to improve the quality of life in the city, and all of which will work as a single automated system. Measuring environmental and air pollution, monitoring water, and gas and electricity networks are all examples of smart city applications [1, 2].

One smart city application is to monitor and control the city traffic and parking. Intelligent traffic systems are systems that guide traffic using traffic lights and regulatory signs according to traffic density with the help of sensors installed at intersections and roads, and which provide parking or traffic information to people via the internet or via mobile applications by considering time, distance and weather conditions. Due to intense urbanization and an increasing number of cars, the parking spots in metropolitan cities are low in number and expensive. Drivers spend a lot of time searching for empty parking spaces, which causes additional traffic congestion, fuel consumption and air pollution. Smart parking systems are needed to eliminate these disadvantages. A smart parking system has the following advantages:

• The customer can receive information about the parking spot in advance

• The customer can plan their use of public transportation from the car park

• The car park owner can provide pricing strategies to their customers

• The car park owner can plan parking spaces according to park usage data

• Measures can be taken against theft and the car park can be transformed into a secure parking area

• The need for staff is reduced

• Generally, cost and time advantages are provided to the customer.

The Intelligent Parking Service is part of an Intelligent Transportation System (ITS). In an ITS, a solution to the parking problem can be found, and vehicle routing and information can be provided according to traffic information [3-6]. Applications for this purpose have been used in crowded cities in England, the USA and Japan in recent years. Hanif et. al. proposed a reservation system via a short message service (SMS) using GPS (Global Positioning System) to solve the parking problem [4]. Tang et.al proposed a wireless sensor network-based, 3-layer intelligent car park management system [5]. A user interface was developed to access the system, which used Wi-Fi technology. A smart parking system that detects and finds a parking spot for the customer’s vehicle was developed [6]. The proposed system is able to accurately detect vehicles inside and outside parking areas with the use of ultrasonic and magnetic sensors. Using Bluetooth technology, the car park information is sent to the users’ mobile phones. Bagula et al. [7] proposed a system that recognizes the vehicles and obtains parking information using RFID (Radio-frequency identification), and then informs the car park owner and enables the owner to invoice the customer. Yang et.al. proposed a system to overcome from the problem of illegal parking [8]. The proposed system makes parking and routing in real time. Nocera et al. [9] proposed a mechanism that automates the selection of parking spaces according to user preferences, thereby reducing traffic congestion and carbon emissions. Wang et al. [10] proposed a reservation-based intelligent parking application to find and reserve empty parking spots. A solution with RFID technology was introduced for problems encountered in smart parking management systems [11]. The software developed in this study performs the management, control, reporting and parking operations in the car parks located in various parts of the city.

There are also smart parking systems where sensors are installed in parking spots to detect vehicles. Villanueva et.al proposed a parking system to obtain a real-time map of the empty spaces in the streets [12]. The empty spaces in the streets were detected using the magnetometer sensor in mobile phones while the vehicle was moving. Araujo et. al. proposed an internet-based e-park system [13]. The proposed e-park system is a smart parking system that uses a parking meter. The parking information is obtained via sensors with a 32-bit Wi-Fi module and the empty parking space information is then transmitted to the mobile phone users via the internet. Wang et al. [14] proposed a smart car park which uses ultrasonic detectors, and which has a four-tier architecture. The intelligent parking problem had been transformed into an optimization problem and the suggestion was made to use the ant colony algorithm. Khanna et.al. proposed an IoT (Internet of Things), cloud-based integrated smart parking system using Passive Infrared (PIR) and ultrasonic sensors [15]. The empty parking space information is presented to the customer via Wi-Fi. Pham et.al proposed a cloud-based smart parking system using the empty car park location information obtained from parking areas located in different parts of the city and the distance between the drivers and the parking areas [16]. Thus, the average time drivers waited to park was considerably reduced. Safi et al. [17] proposed a cloud-based smart vehicle parking system. Reservation and other suggestions were made in the proposed architecture to consider using the parking fee, the traffic congestion and the distance of the cars from the parking spots. Safi et al. [18] proposed an algorithm to find the best parking space by considering the real-time status of the car parks. In the algorithm, suggestions were made using parameters such as traffic congestion and cost. Simulation tests were performed to assess the effectiveness of the algorithm.

In this study, a framework was presented to initially obtain instantaneous parking information from the car parks located in different parts of the city. From this, the number of empty parking spots in the car parks and their location were stored in a cloud database through the sensors at the entrance to the car parks. Two sensors were installed, one in the entrance and one in the exit of the car park. Thus, the available empty parking spaces could be monitored by counting the vehicles entering and leaving. However, the number of empty parking spaces is not sufficient to solve the parking problem because there may not be an empty parking space left when the customer arrives at the car park. In other words, the car park could be full by time the customer arrives when lost time, traffic congestion and distance is considered. In this situation, two suggestions can be put to the user. The first is to make a reservation and the second is to recommend a car park. Making an early reservation will involve an additional cost to the customer. In order to try and eliminate this disadvantage, a fuzzy logic-based intelligent parking system was developed and a suitable parking suggestion was made to the customer. The customer can use the proposed system using android-based software. The inputs to the proposed fuzzy logic-based parking system are the number of empty parking lots, the distance to the car park and the time to get to the car park depending on traffic congestion.

The contribution of this study to the literature can be summarized as follows:

• A framework for smart parking systems is presented.

•An android application has been developed to use the recommended system. Thanks to this application, customers can easily access parking information regardless of time and location.

• A fuzzy logic-based system is proposed that considers the cost and time for the customer.

• The suggestion of a suitable parking spot is made by taking into account the number of empty parking spaces as well as the distance and the traffic density.

2. Fuzzy Logic Based Smart Parking System

Time and traffic density parameters play an important role in the minimum cost of parking. Considering these parameters, parking systems are unclear, time-varying and complex systems. Therefore, fuzzy logic in parking systems is used as a simple and safe solution. The Fuzzy Logic-Based Smart Parking System (FSPS) developed in this study was designed with a modular, multilayered framework built on a wireless sensor network. Figure 1 shows the general structure of the system which consists of four layers. These layers are detection, network, software and application, respectively.

Figure 1. Intelligent parking system architecture

2.1 Sensing layer

In this layer, vehicle detection is achieved using a Raspberry Pi Zero minicomputer with a Linux Operating System (OS), 512MB of RAM, a 1GHz single-core processor, a micro USB power input and a 40-pin I/O (Input / Output) module. In addition to these features, the Raspberry Pi Zero supports 802.11b/g/n Wireless LAN and Bluetooth protocols. The motion sensor used for vehicle detection is an E18-D80NK, which is an infrared distance measurement sensor with a measurement range of 3 to 80 cm. The possibility of interference with visible light is very low. Thus, the margin of error due to external factors is very low. The installation of the layered structure shown in Figure 1 is given in Figure 2.

The vehicle detection system was designed to detect when the vehicles entering and exiting the car park use the same access point. The Raspberry Pi Zero was programmed to detect the vehicles entering or exiting the car park. The parking status was stored in a database so that end users could obtain information about the car park. The pseudo code for the software developed to identify and update the parking capacity is shown in Algorithm 1.

Figure 2. Sensing layer equipment

The Network Layer enables customers to obtain information about the car park. The ingress or egress information for the vehicles detected by the sensors is sent to the database with the help of this layer. The Raspberry Pi Zero is connected to the internet via a wireless access point with an 802.11b/g/n Wireless LAN connection.

Algorithm 1. Car detection pseudo code

public Sense_Car(   ){

            while(true){

               if (button1_pressed==true)

                     pressed1(  );

               if (button2_pressed==true)

                     pressed2(  );

}}

2.2 Network layer

The Network Layer enables customers to obtain information about the car park. The ingress or egress information for the vehicles detected by the sensors is sent to the database with the help of this layer. The Raspberry Pi Zero is connected to the internet via a wireless access point with an 802.11b/g/n Wireless LAN connection.

2.3 Software layer

This layer is also called the cloud architecture. In general, the task of this layer is to connect to units such as databases and web services over the internet, and to provide communication between the application and network layer. This layer is the most important one for the storage of the car park information and its submission to the user. The task of this layer is to manage the databases, associated servers, and all other software for the smart parking system. These services include MySQL and the Windows Azure platform. This layer sits between the application layer, where the services provided by the parking systems are requested (i.e. the layer where smartphones operate) and the detection layer. All these layers communicate through the network layer. The Microsoft Windows Azure platform is a large cloud platform with extensive features. Services provided by Microsoft Windows Azure include web hosting, virtual machines, databases and mobile services. Briefly, database and mobile services are used in this layer to store the car park information and provide mobile user access to the database. Algorithm 2 shows the code used to connect and fetch data from the database.

Algorithm 2. Checking the connection, Connecting to database

// Connecting to the database

public class Connect {

           private String url="………//";

           private String user;

           private String passwd;

           Connection myCon;

 public Connect(String url, String port, String user, String passwd){

            this.url+=url+port;

           this.user=user;

           this.passwd=passwd;

           connection(); }

// Checking the connection to the database

private void connection() {     }

// Obtaining the results of the ID number from the database

public String getData(String id){ }

2.4 Application layer

This layer is where both the mobile users and the car park owner can access the system. An android-based interface was created so that the customers can get information about the car parks. The number of empty parking space can be obtained by accessing the database in the third (software) layer from this layer.

Figure 3. Car park information for a vehicle entering the car park

Figure 4. Car park information for a vehicle leaving the car park

Also, the location of the car park, its name and the time and date are stored in the database. Figure 3 and Figure 4 show the car park capacity accessed from the database for entering and exiting the car park over different time periods.

3. The Proposed Parking System

The fuzzy logic-based parking system, which works in real-time and provides recommendations about car parks to the customer, is given in Figure 5. During the first phase of the system, vehicle detection is performed by the Raspberry Pi Zero installed at the entrance and exit of each car park, and the number of empty spaces is stored in the database. During the second phase of the system, the parking space recommendation is made to the customer.

Figure 5. The proposed fuzzy logic-based smart parking system

Algorithm 3. Customer location, Traffic status and Parking location information on the mobile phone

public void displayDirection (String[] directionList){

  nMap.setMyLocationEnable(true);

  nMap.setTrafficEnabled(true);

  int count=directionsList.length;

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

    PolylineOptions options=new PolylineOptions();

    options.color(Color.Blue);

    options.width(5);

    options.addAll(PolyUtil.decode(directionsList[i]));

    nmap.addPolyline(options);

}}

The developed android application offers suggestions via fuzzy logic. The inputs to the fuzzy logic system are the number of empty spaces, the distance between the user and the car park, and the estimated access time. With the developed application, customers can obtain their own coordinates (latitude and longitude) via the GPS of their mobile phone. The customer also receives the coordinates (latitude and longitude) and the number of empty spaces of the car park on their mobile phone. The last parameter is the traffic information (time and distance) for the route between the customer and the car park, and this information is obtained using Google Maps services. Algorithm 3 shows the code that provides the user location, traffic status and the car park location to the mobile phone in real time.

Figure 6. Fuzzy logic input membership functions

The first parameter of the proposed system is the distance between the user and the car park. This distance was set to 10 km in the application. Figure 6.a shows the membership function used for the distance. The membership functions are determined to be Near(N), Medium(M) and Far(F). The second parameter is the time for customers to get to the car park. The time is in minutes, and it is determined as shown in Figure 6.b by the membership functions selected as Low(L), Medium(M) and High(H). The third parameter is the number of empty parking spaces and determined as shown in Figure 6.c by the 5 membership functions: Low(L), Low–Medium (LM), Middle(M), Middle–High (MH) and High(H). The maximum number of empty spaces in the car parks was 10. As a result of the calculations obtained from the 3 parameters, a parking spot suggestion was made. For this, the output of the fuzzy logic system is shown with 5 membership functions in Figure 7. This is the preference or the recommendation value of the membership function, and it is set to be Low(L), Low–Medium (LM), Middle(M), Middle–High (MH) and High(H).

Figure 7. Output membership function of the fuzzy logic system

Table 1. Some of the rules

Rule No.

Rules

5

If (Distance=N and Time=L and Number of Empty Space= H) then Preference Value=H

9

If (Distance=N and Time=M and Number of Empty Space= MH) then Preference Value=MH

12

If (Distance=N and Time=H and Number of Empty Space= LM) then Preference Value=L

17

If (Distance=M and Time=L and Number of Empty Space= LM) then Preference Value=LM

21

If (Distance=M and Time=M and Number of Empty Space= L) then Preference Value=L

24

If (Distance=M and Time=M and Number of Empty Space= MH) then Preference Value=MH

29

If (Distance=M and Time=H and Number of Empty Space= MH) then Preference Value=M

33

If (Distance=F and Time=L and Number of Empty Space= M) then Preference Value=M

36

If (Distance=F and Time=M and Number of Empty Space= L) then Preference Value=L

39

If (Distance=F and Time=M and Number of Empty Space= MH) then Preference Value=LM

43

If (Distance=F and Time=H and Number of Empty Space= M) then Preference Value=L

45

If (Distance=F and Time=H and Number of Empty Space= H) then Preference Value=LM

 

Net input values are converted into fuzzy input values by using input membership functions. The fuzzy input values obtained are used together with a rule table for processing. There are 45 rules in the proposed system and some of the rules are given in Table 1. By using these 45 rules, fuzzy results are obtained from the input membership functions. The fuzzy outputs obtained are converted to net output values using the output membership function. According to the 5th rule given in Table 1, if the distance between the user and the car park is Low, the access time to the car park is Low and the number of empty spaces in the car park is High, so the preference or the recommendation value of this car park is High.

4. Application Results

In this study, the car park preferred by the customer was determined via an android application that suggests the most suitable parking space with the help of fuzzy logic. The latitude and longitude of the car park, the available parking quota, and time and distance information are given to the fuzzy logic input on the android application side. Figure 8 shows the location of three car parks in Elazığ city center, the location of the user, the time and the distance. As a result of the calculations from the three parameters obtained, the car park suggestion is made. Figure 9 shows the user location and the car park recommended by the system using the information from the three car parks. The preferred car park is indicated by purple in Figure 9.

Figure 8. The location of the user and the car park

Figure 9. The car park recommended to the user

Table 2 shows the distance to three different car parks, the access time, the number of empty spaces and the proposed car park for a customer at any location. For example, the fuzzy logic inputs are [4.3; 8; 5], which means the distance of the customer to the car park is 4.3 km, the estimated time to get there is 8 minutes and the number of empty spaces in the first car park is five. For these values, the preference value is 0.363. The preference values obtained from membership functions for each car park are between [0, 1]. The parking space is recommended to the customer by selecting the largest of the parking preference values P1pre, P2pre and P3pre.

Table 2. The preferred and recommended car park according to fuzzy logic

P1

P2

P3

P1pre

P2pre

P3pre

The proposed park

[4.3;8;5]

[3.3;5;3]

[2.7;6;2]

0.363

0.201

0.230

P1

[1.9;3;4]

[2.8;4;1]

[4.7;6;5]

0,450

0.283

0.451

P3

[0.5;1;8]

[0.3;2;9]

[0.6;1;2]

0.798

0.891

0.500

P2

[6.9;8;2]

[5.3;6;2]

[4.2;7;4]

0,113

0.102

0.327

P3

[2.2;5;6]

[3.5;6;2]

[4.9;6;3]

0.500

0.191

0.109

P1

[1.3;3;3]

[1;3;6]

[2.2;5;5]

0,378

0.500

0.373

P2

[9.5;9;1]

[8.6;8;4]

[8.4;6;8]

0.100

0.236

0.474

P3

[6.2;9;5]

[7;7;5]

[8;7;2]

0.265

0.319

0.114

P2

[3.3;4;4]

[3.9;6;4]

[4.7;8;8]

0.382

0.331

0.643

P3

[5.5;7;6]

[5.1;7;8]

[3.9;4;3]

0.497

0.682

0.241

P2

[8;8;3]

[7.1;8;9]

[6.4;8;4]

0.109

0.552

0.288

P2

[2.3;4;9]

[1.7;4;2]

[1.2;5;7]

0.888

0.325

0.700

P1

[4,5,2]

[4,3,1]

[5,4,2]

0.163

0.263

0.164

P2

[3,6,2]

[3.5,5,2]

[4.8,5,4]

0.216

0.191

0.332

P3

[6,9,9]

[5,8,9]

[4,8,8]

0.589

0.739

0.643

P2

5. Conclusions

Thanks to the improvements in wireless sensor networks, many cities have become ‘intelligent’ cities. Academic studies about smart cities and systems are increasing day by day and even special conferences are organized. In this study, a general structure for a fuzzy logic-based smart parking system was presented and an application was developed. This cloud-based system can be used in different smart city applications. For intelligent parking systems, the number of empty parking spaces is not sufficient information to solve the parking problem, because there may not be an empty parking space left when the customer reaches the car park from where they started. In order to eliminate this disadvantage, both the distance of the customer from the car park and the time to get to the car park – depending on traffic congestion – were considered. The proposed fuzzy logic-based smart parking system helps the customer to schedule time and reduce costs with the help of information about traffic congestion and car parks. Since the proposed system is a simple and effective application, it can be easily used in a mobile device with limited hardware resources.

  References

[1] Novotný, R., Kuchta, R., Kadlec, J. (2014). Smart city concept, applications and services. Journal of Telecommunications System & Management, 3(2): 1-8. https://doi.org/10.4172/2167-0919.1000117

[2] Talari, S., Shafie-khah, M., Siano, P., Loia, V., Tommasetti, A., Catalão, J.P.S. (2017). A review of smart cities based on the internet of things concept. Energies, 10(4): 421. https://doi.org/10.3390/en10040421

[3] Lotlikar, T., Chandrahasan, M., Mahadik, A. (2016). Smart parking application. International Journal of Computer Applications, 149(9): 32-37.

[4] Hanif, N.H.H.M., Badiozaman, M.H., Daud, H. (2010). Smart parking reservation system using short message services (SMS). 2010 International Conference on Intelligent and Advanced Systems, Manila, Philippines, pp. 1-5. https://doi.org/10.1109/ICIAS.2010.5716179

[5] Tang, V.W.S., Zheng, Y., Cao, J. (2006). An intelligent car park management system based on wireless sensor networks. 1st International Symposium on Pervasive Computing and Applications, Urumqi, China, pp. 65-70. https://doi.org/10.1109/SPCA.2006.297498

[6] Lee, C., Han, Y., Jeon, S., Seo, D., Jung, I. (2016). Smart parking system for Internet of Things. IEEE International Conference on Consumer Electronics, Las Vegas, NV, USA, pp. 263-264. https://doi.org/10.1109/ICCE.2016.7430607

[7] Bagula, A., Castelli, L., Zennaro, M. (2015). On the Design of smart parking networks in the smart cities: An optimal sensor placement model. Sensors, 15(7): 15443-15467. https://doi.org/10.3390/s150715443.

[8] Yang, C.F., Ju, Y.H., Hsieh, C.Y., Lin, C.Y., Tsai, M.H., Chang, H.L. (2017). iParking – a real-time parking space monitoring and guiding system. Vehicular Communications, 9: 301-305. https://doi.org/10.1016/j.vehcom.2017.04.001

[9] Di Nocera, D., Di Napoli, C., Rossi, S. (2014). A social-aware smart parking application. In Proceedings of the 15th Workshop, From Objects to Agents, Catania, Italy. https://doi.org/10.13140/2.1.4114.3040

[10] Wang, H., He, W. (2011). A reservation-based smart parking system. 2011 IEEE Conference on Computer Communications Workshops (INFOCOM WKSHPS), Shanghai, China, pp. 690-695. https://doi.org/10.1109/INFCOMW.2011.5928901

[11] Pala Z., Inanc N. (2007). Smart parking applications using RFID technology. In RFID Eurasia. Istanbul, Turkey. https://doi.org/10.1109/RFIDEURASIA.2007.4368108

[12] Villanueva, F.J., Villa, D., Santofimia, M.J., Barba, J., Lopez, J.C. (2015). Crowdsensing smart city parking monitoring. IEEE World Forum on Internet of Things, Milan, Italy, pp. 751-756. https://doi.org/10.1109/WF-IoT.2015.7389148

[13] Araújo, A., Kalebe, R., Giraõ, G., Filho, I., Gonçalves, K., Neto, B. (2017). Reliability analysis of an IoT-based smart parking application for smart cities. 2017 IEEE International Conference on Big Data (Big Data), Boston, USA, pp. 4086-4091. https://doi.org/10.1109/BigData.2017.8258426

[14] Wang, M., Dong, H., Li, X., Song, L., Pang, D. (2017). A novel parking system designed for smart cities. 2017 Chinese Automation Congress (CAC), Jinan, China, pp. 3429-3434. https://doi.org/10.1109/CAC.2017.8243373

[15] Khanna, A., Anand, R. (2016). IoT based smart parking system. 2016 International Conference on Internet of Things and Applications (IOTA), Pune, India, pp. 266-270. https://doi.org/10.1109/IOTA.2016.7562735

[16] Pham, T.N., Tsai, M.F., Nguyen, D.B., Dow, C.R., Deng, D.J. (2015). A cloud-based smart-parking system based on internet-of-things technologies. IEEE Access, 3: 1581-1591. https://doi.org/10.1109/ACCESS.2015.2477299

[17] Safi, Q.G.K., Luo, S., Pan, L., Liu, W., Hussain, R., Bouk, S.H. (2017). SVPS: Cloud-based smart vehicle parking system over ubiquitous VANETs. Computer Networks, 138: 18-30. https://doi.org/10.1016/j.comnet.2018.03.034

[18] Shin, J.H., Jun, H.B. (2014). A study on smart parking guidance algorithm. Transportation Research Part C: Emerging Technologies, 44: 299-317. https://doi.org/10.1016/j.trc.2014.04.010