ESP 2 : Embedded Smart Parking Prototype

A R T I C L E I N F O A B S T R A C T Article history: Received: 16 October, 2020 Accepted: 16 December, 2020 Online: 25 December, 2020 The technological evolution and the frequent use of the Internet as a technology within the framework of the Internet of Things and Robotics has affected various fields such as Industry 4.0, smart agriculture, smart cities, home automation and autonomous cars. These advances applied to everyday life have facilitated the implementation of new concepts to minimize pollution, traffic jams and accidents while making life easier. In this article, we propose an intelligent parking concept based on embedded systems. In order to solve the problem of permanent traffic jams and their repercussions on large cities we have implemented this system. It is a complete platform allowing remote reservation from different platforms. It will also collect the various data obtained by parking sensors. These data will be processed and saved if necessary. This concept was first developed to highlight the feasibility and adaptability of this system in the context of smart cities. It has been realized using wireless sensor networks connected to embedded platforms. These platforms are not only connected to motors, sensors and actuators but also to servers to save data and deploy reservations. These reservations are made via web and mobile application.


Introduction
The robotics automation, wireless sensors, artificial intelligence and embedded systems are famous scientific research fields with a wide margin for innovation and growth. Although these are areas that are literally different and divergent. However, they remain compatible. One can thus join these different axes in order to carry out applications that make life easier for mankind.
In this framework, we can mention several types of uses such as smart houses [1], smart agriculture [2] and smart parking [3], which are smart city [4] applications. We can also talk about ehealth [5] and Industry 4.0 [6] which are applications in constant development.
In this work, we're going to touch on smart parking. The automated systems for vehicle parking management [7] are widely available in the recent years. However, it is still an exclusive product that is not largely used for a couple of reasons including being very cost expensive and complex. These difficulties also contribute to other problems such as hard maintenance and resource management issues [8]. Nowadays, android applications and Arduino based technologies [9] are the mainstream and the most popular solution in numerous domains due to being open sourced. This attribute makes them easy to implement and heavily supported with the majority of hardware and software. For these reasons we used android based application for our embedded smart parking and management system that outperformed the other available options in resource optimization and performance.
In our previous work [10] we presented a fully embedded architecture for an automated intelligent parking system that communicates through an Android application, which delivered an intelligent parking management and a top-notch costumer service for smart parking.
In this paper, we describe in details our previous work [10] while we expand on the practical implementation and the communication interface. With the objective of having a functional prototype that develops the research work and can be integrated in the field of smart cities, we will present two platforms: • an embedded platform that has the role of data acquisition and processing in our parking lot. The use and architecture will be described later on.
• a client/server platform with Android and Web applications: these will describe the reservation, confirmation and payment parts of the proposed service.

ASTESJ ISSN: 2415-6698
Our paper will be presented as follows. We start by an overview on the smart parking state of the art. In the theoretical analysis section, we will introduce the architectural design of the car parks on one hand and the developed computer application to be realized on the other. Then, we present the practical implementation section where we demonstrate the developed applications as well as the implemented embedded architecture. Finally, we compare between the implemented Intelligent Parking results before we declare the conclusion and perspectives.

State of Art
Several works have presented smart parking. In [11], they present a flexible and real time information system. This parking is easy to use for the client via web connexion. A CMOS cam is used to control the parking. The disadvantages of this system are the need to inquire for the available slot, the high implementation cost. The most important disadvantage is the bottlenecks due to an overload of incoming informations.
In [12], they use RFID technology. It permits to have not only secured but also an easy and fast checking out of the vehicles in less time. The data security is provided by ZigBee Wireless Technology. The data of the arrival and departure of the vehicle are stored in database. To inform the driver informations are displayed on the LCD proposed screens in the parking. Despite all the advantages, the system has many disadvantages. It allows one by one. That's why it consumes a lot of time and prevent multiple check out and check in at the same time. The drive can't make a reservation via mobile device. Another disadvantage of RFID is the increase of cost and of the node to node implementation time.
In [13], if the most important disadvantage is that the parking does not alarm the user about the car theft, the proposed smart parking use ultrasonic sensors and RFID. Needing for deployment ZigBee and 3G (or 4G, 5G…), the most important advantages of the proposed work are the use of the Car Parking Framework that gives two performance classes in term of financial and consumption cost deployment. In addition, the heterogeneous wireless sensor network cause energy fluctuations. To remedy they use LIBP gathering protocol.
In [14], they use Zigbee for deployment and ferromagnetic sensor. Suryady and al introduced another concept of smart parking based on cloud-based platforms as a service (PaaS). This technology gives the smart parking an interesting quality. The smart-parking system is faster to use. It reduces time, cost and system maintenance. The platform has the advantage of being flexible to collaborate with other platforms. This system has also disadvantaged. It does not provide neither guidance for the drive nor payment due to the application insecurity to protect user privacy. The user has no possibility to display spaces for user on smartphone or parking LCD.
In [15], the smart parking is more complete. It has many qualities like his flexibility and security increase. This security appears for the user because of less of human interaction for booking slots. The drive can find the availability of parking space and then books slots. The IoT's devices provide data storage. The data are processed and collected to be saved. The drive has another security aspect to preserve the user from steals by theft management.
As we already declared, there are numerous automated parking management systems, yet only three methods which are Park Assist [16], Hectronic [17] and Parking plus [18] that stand out and achieve respectable results. These intelligent car parks are available on the market but have some missing features that need to be addressed.

Park Assist smart parking system
the TKH group developed this smart parking system that have various traits including guiding the client to the empty parking space while providing access to a mobile application with the vehicle geolocation and the reliance on machine learning analysis for the parking spaces to insure the right exploitation.

Hectronic intelligent parking
Contrary to Park assist, this intelligent parking system delivered by the German international company Hectronic has a separate entrance and exit terminals. The main feature of this system is their powerful and well built security alongside other adequately constructed services.

Parking Plus mobile application
This parking system is based on a mobile application that delivers a central parking service by gathering information from a cluster of parking zones to provide the driver with the details about the nearest empty parking place and the possibility to reserve it and pay for it by the phone.
When we analyze these various methods, we found that some of them have security shortcomings both in capturing information for reservation and payment or in securing vehicles in case of theft. Therefore, in this work we present an intelligent car park allowing the capture of information on the different vehicles when they enter, exit and during their presence in our car park. An offline backup is made throughout the day before being transmitted to the cloud in order to maintain a trace if necessary.
Reservation, payment and placement of the car in the car park are done in a secure way via not only web but also mobile applications compatible on different types of terminals.
Given the lack of space proposed for parking lots and the permanent increase in the number of cars in large cities generally and particularly in Tunisia, our goal is to set up an intelligent system to give the user the choice, if possible, to choose his parking space, if not to allocate an automatic space to optimize the space.
Indeed, thanks to the automatic parking system chosen, we will have the possibility: • to secure the parking lot by minimizing human intervention: cars will be closed and parked at the entrance of the parking lot. Their placement will be carried out automatically afterwards.
• to optimize space and minimize accidents: the cars will be parked automatically and therefore no space or accidents due to bad maneuvers will occur.
• to minimize pollution and traffic jams: by allowing the reservation system to not search for parking spaces in a random way and therefore optimize fuel consumption and minimize pollution.
The innovation proposed in our paper is to create a fully automated parking system that solves the limitations described above.
This design will present not only the architecture of the realized prototype but also the technologies based on the IoT to allow the automatic placement of cars in the proposed concept.
There will be a design part, an IoT part and a hardware implementation part which will be described in parts 3 and 4.

Theoretical Analysis
Looking at the systems available on the market, we can initially assume that depending on their points of strength we can choose from them a tolerable approach [19]. However, these methods have many apparent concerns such as the inefficient space exploitation with Park Assist and Hectronic by the need for a driving pavement to connect the vehicle to the driving spot and the capacity problem caused by the lack of long term parking strategy [20]. We can also point out the high service cost and the absence of security plan for Parking Plus. In this section we will describe the different axis of our own parking architecture that fix these issues.
We begin with our proposed parking architecture for car parks that is set up in narrow plots of land. We present a cylinder shape architecture as shown in figure 1. The second part of this theoretical analysis introduce the proposed embedded system to collect, process and update the information before transmission step. The last part describes the frontend and the backend of the application architecture. It will describe different actors and secured reservation and payment service to be used by the driver.

Proposed smart parking architecture
In order to solve the parking management concerns that the previous methods failed to answer, we conceptualized a structure with a cylinder-shaped architecture for vehicle parking as revealed in figure 1. We choose using this architectural shape in an attempt to reduce the space spent on pavement allowing the vehicle movement within the structure and switching to a unique vehicle area, which is the mechanical component that act as an elevator and the selector for the parking place simultaneously.

Detailed units of the architecture
To simplify and optimize the driver's access to the proposed architecture, the parking place selection is done via the android mobile application. Afterwards, the driver has to station his vehicle on the entrance elevator panel that has the same size as standard parking place as shown in figure 2. Having reserved a parking space via web or mobile application, the customer will provide the information for the car registration number. This number will be the reference to allow the car to enter the parking place.
Once the vehicle is checked to the entrance panel, a two-armed cart raise the panel as an elevator. Figure 3 present an example of this activity.
Afterwards, the vehicle will be directed directly to the parking space relying on the elevator's ability to rotate 360 degrees. This feature allows the system to set the vehicle in the appropriate location selected in advance by the customer. The exit process is also similar to the entry procedure but backwards. The customer has to do his check out and pay for the service via the mobile application and once he does the elevator selects the vehicle corresponding to the car registration number and bring it down to the exit of the parking lot.
The full automation of elevator with the minimization of manpower and human intervention in the parking process will make the process secure by avoiding human errors and effective by efficient exploitation of the parking facility.

Hardware embedded architecture
Having chosen a suitable architectural form for our intelligent car park, we will present the embedded implementation of our system in this section. It will, in fact, consist of three parts. Firstly, we have chosen a set of sensors and actuators that will be installed in order to obtain information about the parking spaces if they are available or occupied. Second, a system will collect this information from the installed sensors to update and save the occupancy in the parking lot. This data will be saved locally and subsequently updated in the cloud. In part C, we will present the software backup platform implemented.

Used set of sensors and actuators (SSA)
As described in the state-of-the-art section, our intelligent car park will not only make the driver's life easier by offering him an available space but will also provide him with a secure space for both him and his vehicle.
Thus, a surveillance camera at the entrance but also on each floor of the car park will detect the license plate of the car in order to validate its access to the car park but also to the reserved space.
As soon as the car reaches its space a sensor will transfer the information and cancel the space for any other reservation. At the exit of the car park, the information is transmitted directly to the driver and the space will be directly released for another reservation.
The billing for this operation will be proportional to the time occupied in our car park.
To sum up, we'll need: -Surveillance cameras at the entrance and exit of the car park but also at the entrance and exit of each floor of our car park.
-Barrier level detection sensors to validate entry and exit to the car park.
-Infrared sensors to transmit information on the presence and absence of the car from the reserved space.
In parallel with the sensors, the need for actuators is equally important. Indeed, these will allow us to manage the different engines of our car park remotely. We can therefore mention the following: -The motors of the car park barriers -The engines of the car lift -Vehicle placement jacks as shown in Figure 3.
Due to the importance of precision in the realization of our system. Different electrical voltage values must be received from the sensors and sent to the different motors. The accuracy of these data requires a system that can directly manipulate the analog data by minimizing the use of digital-to-analog and analog-to-digital converters. This will be detailed in the section sensor and actuators control and collection platform.

Sensor and actuators control and collection platform (SAC2P)
In order to control the various sensors and actuators present in our system, we will use an on-board platform that can receive and transmit analog data. In the prototype that will be described in section IV, part B, we will use an embedded Arduino platform that will allow us to validate the proposed approach. This platform will be connected via Bluetooth to both actuators and sensors. It will thus control entry to the car park, the placement of the car and the sending of information to the information backup and transfer platform. Figure 4 describes sensor and actuators control and collection platform.

Information backup and transfer platform (IBTP)
The Information backup and transfer platform part offers a digital embedded platform.
Several types of platforms can be proposed such as GPUs, FPGAs, ASICs. This platform will have four main tasks with the following priorities: a) Acquisition and processing of information from surveillance cameras.
b) The administration of the Sensor and actuators control and collection platform via Bluetooth.
c) The offline backup and management of the various data recovered. d) Updating information and saving it on the cloud server via wifi or 4G Since, for our application, obtaining a real-time result is not paramount, it is not necessary to use GPUs that are quite expensive in terms of hardware and energy costs. Thus, a simple multiprocessor architecture based on 4 processors working in parallel is largely enough.
For our application, we decided to use a Raspberry Pi as a platform to meet the needs of our Smart Parking prototype. In part 4, we will describe in more detail the system implemented.
In figure 5, there is a description of information backup and transfer platform.

Software reservation platform architecture
After having described and set up the architecture part 3.1 and the hardware part 3.2, we will highlight in part 3.3 the software part and particularly the online booking platform.
In the reservation part we will have several interfaces.
Firstly, the administrator will access the different functionalities via the web. He will be able to modify the terms of payment, accept complaints, validate possible subscriptions from members and deal with disputes.
It is the administrator who will be able to manipulate the number of spaces, the availability as well as the occupation of the car park, the rates per hourly session, penalties for late payment.
The customer will access the online booking platform either via mobile application or via web.
Each customer must first register on the system either via mobile application or via the web. He will indicate his personal data (surname, first name, telephone number, e-mail, license plate, make and colour of the car, ...). He will then choose the method of payment either by credit card or in cash.
As a nominal scenario, a customer will be able to reserve a place on one or the other of the applications. He will indicate the duration of his parking period. At the time of reservation, the user will indicate the method of payment. At 15 minutes from the end of the indicated parking period, a SMS and an e-mail will be sent to inform the customer. He will be able to extend his reservation by reply or maintain the duration indicated at the time of reservation.
On leaving the car park, the parking space is released and is therefore open for a new reservation.
If the customer leaves the car park on time and has paid by credit card, they will leave the car park directly: the camera at the car park entrance will identify the car and open the entrance barrier. If he is going to pay in cash, a machine will take the coins or notes and give him the rest of the amount.
If the customer is late without replying to the SMS received, he will have to pay a penalty. The amount charged for leaving the car park will be the equivalent of a full day's parking.
If the customer is late and this delay has been indicated by message, the customer will pay the difference when leaving the car park.

Practical implementation
In this part we will present the parts describing the implementation and setup of our demonstrator. We will start with the modeling part including the class diagram and the use case diagram.
Then we propose the mobile SW part (Arduino application) and finally the implementation of the embedded part implemented on an Arduino platform.

Uses case diagram
In this section we will present the actors of our platform. The administrator, the client as a physical actor and the system as a logical actor. 0As shown in Figure 6, the administrator has the possibility to access to the different functionalities via the web. He will be able to accept claims, check the number of seats and set rates per hourly session.
The administrator can also be able to manipulate the penalties for late payment, validate the possible subscription of the member and change the terms of payment, etc. The client, as mentioned in Figure 7, must start by registering on the system either via mobile application or via the web. He I indicate his personal data such as surname, first name, phone number, e-mail, license plate, make and color of the car, etc. After that, he chooses the method of payment either by credit card or cash. He will be able to reserve a place by indicate the duration of his parking period.
At the time of his reservation, the client will indicate the method of payment. He will be able to extend his reservation by reply or maintain the duration indicated at the time of reservation.
The last actor is the system, as represented in Figure 8, it must be able to identity the car, take coins or bills, remit the rest of the amount, open the entry barrier and before 15 minutes of the end of the period subscription, it sends a SMS to client to inform him; if he wants to extend the period or he free the space.

Android application
The Android operating system is by far the largest used operating system for smartphones in the world for the recent years. To communicate with our automated smart system, we developed an Android application to exploit the ease of implementation, compatibility and support [21]. We used the App Inventor development tool generate by Google to create our Android web application for smartphones [22]. Our application contains a main menu for the user to select the desired parking floor from the parking structure as shown in figure 9.
From this menu the driver first selects the floor and then searches for the empty parking location. Finally, the application creates a security code for the specific location to be used by the user when he exits the parking facility. It is also possible for the user to let the parking system to choose automatically which place to allocate.

Arduino technology embedded system:
To control the various parts of our system we choose to work with a simple Arduino board [23] and we have decided on the Arduino mega board. This embedded bored is responsible for the communication with the client commands coming from the Android application. It is also responsible for checking and monitoring the sensors that provide the information about empty locations and vehicle presence, while managing the mechanical elements of the elevator and the rotating panel.
For the communication part, the Arduino mega board needs the Arduino WIFI shield in order to connect to the network via WIFI [24]. As displayed in figure 10, this wifi shield is pin by pin compatible with the Arduino mega board, which makes it easy to work with. In order to collect the information about the availability of the parking locations and the elevator panel a cluster of spread out sensors is crucial for our system. Therefore, we decided to lay out a collection of the PIR (Passive Infrared Sensor) in every parking location, the entrance, the exit and in the elevator panel. As shown in figure 11, connecting the PIR sensor to our Arduino mega board is a very simple operation that demands the use of only three pins. We also considered using the HC-SR04 ultrasonic sensor for the same operation mainly for compatibility reasons since it is also an Arduino technologies component. However, considering the low expensive PIR sensor was the optimal choice since it does not compromise the proficiency of our system [25].
To manage the mechanical part of our system, which are the elevator panel motor and the rotation motor, we also relied on our Arduino mega board. For our prototype , we sufficed with the use of simple direct current motor driver to emulate a real life situation where our Arduino mega board can also control the motor of the elevator using two relays and terminal levers for the 230V alternative current motor [26]. Our choice for a simple DC motor driver is the L298N circuit that grants our Arduino board full authority over the speed and the rotation direction of the direct current motor [27]. For the panel rotation motor, we used a servomotor connected to the Arduino mega. The servomotor delivers an immense management and control to every detail of the panel rotation and angular rotation manipulation [28]. With the use of the servomotor, we guarantee that our smart parking system is capable to reach all parking positions throughout the facility thanks to the 360 degrees of freedom available to the rotating panel. In figure 12 we present the wiring diagram for both the DC motor and the servomotor.

Result comparison
Comparing the system we have set up with the different intelligent parking lots existing in the literature we notice that our system has several points in common with them but has advantages in terms of space optimization and automation of the system. Table 1 illustrates this comparison.  Table 1, it can be seen that all the systems described in the literature offer a mobile application for booking.
However, the car parking requires the intervention of the man (driver or parking manager) to park the car unlike our system which is fully automated based on sensors, IoT and embedded systems.
The minimization of human intervention makes it possible to secure the system against theft, minimize human errors and save energy consumption.
Finally, as Parking+, our system has an intelligent part to update the status of the parking lot and therefore make it easier to park the car while minimizing the waiting time for parking.

Conclusion
Throughout this paper we introduced a smart vehicle parking system that effectively manage the storage and automates vehicle parking using an Android application as the front-end user communication platform with our embedded control system. Our embedded control unit includes the main Arduino mega embedded board and the Arduino WIFI shield that ensures WIFI connection. The information for the presence of vehicles and the availability of empty parking location is acquired by the collection of PIR sensors and provided to the Arduino mega board to take the appropriate decision. This main control unit is also responsible for the management and control of the elevator panel and the rotation engine in charge of accessing the empty locations and stored vehicles.
Our novel smart parking system with the Android customer communication unit has delivered a better storage management capability than the previously mentioned commercially available competitors. The dominance of our developed system over Park Assist and Hectronic parking system is clearly manifested in the long term cost gained from the smart management of the allocated space that our competitors sacrifice in order to provide the driving pavement needed to connect the vehicle to the driving spot. The Parking Plus application also miss the security quality that our solution provides compared to their nonexistent answer to this problem.
Although our system is a great solution for smart parking, we do not deny the fact that it has a few shortcomings such as the need for more flexibility when it comes to the architectural structure of the facility and the power management of the mechanical parts (elevator panel and rotation engine). These limitations can be the subject of future research that can include introducing a sustainable energy resources and other architectural designs. we can also ensure a better security by implementing a decentralized Blockchain based security control system in case of an expansion to a multiple units of smart parking systems.