Smart parking management system using SSGA MQTT and real-time database

ABSTRACT


INTRODUCTION
The use of cars as the transportation mode has been something common -particularly in urban areas.This fact then demands a more increasing need for parking area especially in the public service areas such as offices, shopping centres, hospitals and playgrounds.Now, the number of parking spaces is not balanced with the number of users and this has made the drivers frequently find it difficult to find the availability of comfortable and safe parking space either in shopping centre or in office areas [1][2][3].This issue indirectly not only can consume more times but also might create a traffic jam just to find the empty parking space [4,5].To cope with the issue, the parking management commonly will help the users by manually giving the information about the available parking areas.In fact, this method still is unhelpful much as the users of parking area still find it difficult to seek the empty parking area.Hence, the idea on how to create a system that can rapidly and efficiently seek the empty parking are for the drivers is deemed necessary.
In recent years, many researches have been developed to help the management of parking system more efficiently compared to a manual management.The ultrasonic sensor to recognize a parking area based upon the distance of inter cars has been conducted [6,7] or it uses the RFID [8][9][10][11][12][13].However, the sensor requires more times to inform the users about the availability of parking area.IoT technology has been widely used to support the management of smart city in any sectors [14,15], IoT for smart grid [16][17][18][19].The researches in [20][21][22] have discussed about the placement of IoT modules to manage the available parking spaces.The research [23] proposed a smart parking system using wireless sensor in the form of bluetooth low energy (BLE), unfortunately this system did not display any detailed information about  [24] has proposed the use of IoT technology using the ultrasonic sensor and camera to send the availability of empty parking space to the information centre of RESTful that can access by the parking users.In the RESTful web the data communication used is based on the HTTP protocol in which, when there are many users needing the information of empty parking spaces, the time response of RESTful system will be slower.Based on the research that has been previously presented, there is a need for a further research on the protocol system that is capable of coping with the slow response of the system in the application of smart parking management.One of the ideas that can be proposed is apply a message queue telemetry transport (MQTT) protocol to communication of the data of the smart parking system, it is a broker-based messaging protocol for publish or subscribe information [25][26][27][28], MQTT is a lightweight messaging protocol, simple designed and straightforward to implementation.
This research proposed an application of smart parking management system using MQTT protocol with the real-time database with steady state genetic algorithm (SSGA).The system provided the detailed information related to monitoring and controlling of parking location and empty parking slot, SSGA used to optimize the allocation of the empty parking slot.MQTT protocol is used to more rapidly obtain the response of the system time when many users are accessing the application website with a low power consumption and low bandwidth usage.The advantage of the proposed system is that it uses a real-time database via a global positioning system (GPS) module connected to the Raspberry Pi.

RESEARCH METHOD 2.1. System design
Figure 1 illustrates the design of the proposed system consisting of three blocks of system parts: client publish block, broker MQTT block and website application.The block of client publish used the ultrasonic sensor by means of the principles of continuously emitting an ultrasonic sound wave that would be reflected by an object in front of it and received by the receiver [29].Ultrasonic sensor in this system functioned to detect parking slot every 60 ms and would send data to the controller.

Figure 1. Smart parking management system
In each parking slot, there was an ultrasonic sensor detected whether the slot was occupied.When the ultrasonic sensor did not detect a vehicle, then MCU node would send a condition of "0" or empty, while if it detected a vehicle, it would send the condition "1" or occupied.The data about the condition would be sent to firebase through a broker using the MQTT protocol by means of the SSGA.The broker using the MQTT protocol was used as a controller in managing the smart parking application as shown in Figure 2 using a star topology whose advantage was that if one client was disconnected, it would not interfere with other clients to connect with the broker.Any changes to data sent to firebase would be read by the website application by displaying the real-time condition of each parking slot.

Steady state genetic algorithm (SSGA)
The research on the smart parking contains several algorithms that can be used for optimization, one of the algorithms is the schedule of round Robin implementing the preemptive strategy based upon the processing schedule called as quantum.[28][29].The algorithm of a hybrid genetic assignment search procedure (HGASP) is used to seek the nearest route to the parking area.In this algorithm, the time taken to seek the route is relatively short in comparison to Dijkstra algorithm [30].Research [31] proposed TELKOMNIKA Telecommun Comput El Control  Smart parking management system using SSGA MQTT and real-time database (Putri Sandika Juwita) 1245 an algorithm to guide the parking by considering the factors of distance and route time, traffic and parking cost.To optimize the information for both the parking management and the users about the allocation of empty parking slot, this research used an algorithm that can optimize the issue of multi-objectives, one of which is modify algorithm of SSGA [32] for get the empty parking slot, Table 1 presents the pseudo-code for this algorithm.

RESULTS AND ANALYSIS
The test was conducted in the parking area at the Faculty of Applied Science, Universitas Telkom in which the test of the system included the test on the sending delay from client publish to the broker MQTT, delay of broker MQTT to firebase and delay of client publish to firebase.Then, the test was continued to test on the sensor accuracy, system resistance, and website application.

Delay of sending data from client publish to broker MQTT
This test was conducted to learn the time length of client publish to send the input data and received by the broker MQTT with a test scenario through the sending of each client and if the clients send the data at the same time.Figure 3 shows the variation of delays from each data reception started from client 1 to client 5. Started from delay at 4 seconds to 26 seconds, a queue occurred when the data were sent to the server.This was caused by the internet network.

Delay of sending data from broker MQTT to firebase
This test was conducted to learn the time length of data sending from broker MQTT to firebase with the test scenario of sending to the firebase when the broker MQTT received the data from client publish at the same time and from the data sending of each client publish.Table 2 shows the results of the test on the delay of data sending from broker MQTT to firebase with the average delay of 0.9 second.

The test on the delay client publish to firebase
This test was conducted to calculate the time length of sending from client publish to firebase with the test scenario when each client publish sent and when the client publish sent the data simultaneously.Figure 4 shows the graph of delay in the data sending from publish to firebase with the variation started from 4 seconds to 25 seconds.The more delay numbers were caused by the queue of data sending from the client to broker MQTT.

The delay of website application of data sending and data reception to database
The test on the delay on the website application was conducted using the website that, as shown in Figure 5, would be accessed by two different sensors to send the data from the website to database.The technique was conducted by activating and deactivating the devices to obtain the different results of delay from users.Table 3 shows the average delay of data sending with the value in sensor 1 at 1 second and in sensor 2 at 1.18 seconds, and reception delay at 1.2 seconds for sensor 1 and 1.15 seconds for sensor 2. The results of the test on those two delays were highly affected by the process of taking data from the website to database.However, it was still categorized into the real-time data sending.

The test on the information of condition and slot of parking location
The page of parking location was made to facilitate the driver or parking management to see the detailed information about the parking.Figure 6 shows the color change in maps whether the parking slot was still available.Red means the occupied parking slots (filled) and green means that the availability of parking slot.

Test on real-time monitoring sensor status on website
The test was conducted to monitor the sensor condition in the ON or OFF state as shown in Figure 7 (a) to detect the existence of cars in the parking slot.The status in each sensor was determined from the status condition in database as shown in Figure 7 (b).If the sensor was in the ON state, then the condition in database was 1 and when sensor was in the OFF state, the condition in database was 0. When the sensor in the location of parking slot has not detected the existence of car, then the condition of the sensor on the website was still in the ON or OFF state as shown in Figure 8 and the graphic was seen in a static condition.When the sensor in the location of parking slot detected the existence of car, then the sensor on the website application automatically changed into an ON state.

Test on the load of traffic increase on website
Figure 9 shows the test of traffic increase on website conducted for 3 days with the load of 100 users.Then the time required for users to click all urls was 19ms on average in which the fluctuation of graphic was related to the demand of more than 100 users.The test results on the optimization, as presented in Table 4, showed that from 26 of 100 users, the average time obtained was 350 ms for the time needed by the users to do the clicking process on the website.In user 1, from 1.665 clicks, it was only 1 the error occurred, and from user 3, from 1.652 clicks, there was no any errors found (0).From the 3-day test, it was found that the website could be long-lasting with the load from the more demands of the users.

CONCLUSION
This paper shows an implementation of monitoring and controlling system on the application of smart parking lot using MQTT protocol.In the application of monitoring system, the parking management obtained the information in the form of coordinate point from the parking location and could learn the parking slot availability in real time connected to GPS.On the controlling feature, the parking management could learn the frequency of parking slot used by the drivers by seeing the history in the form of real time graphic in each parking slot.The results of the experiment showed that the quite little variation of delay on the website with MQTT sent the data to the database at 1 second and 1.18 seconds and the delay of the data reception from the database to website was 1.2 seconds and 1.5 seconds.

Figure 3 .
Figure 3. Graph of delay client publish to MQTT broker

Figure 4 .Figure 5 .
Figure 4. Graph of delay from client publish to firebase

Figure 7 .Figure 8 .
Figure 7. Monitoring sensor status on website and database

Figure 9 .
Figure 9. Test on the traffic increase on website for 100 users

Table 2 .
Delay broker to firebase

Table 3 .
Delay of sending and receiving data ExperimentDelay of Data Sending to Database (second) Delay of Data Reception to Database (second)

Table 4 .
Test on website optimization