# Designing and Managing a Smart Parking System Using Wireless Sensor Networks
## 3 Architecture of the Smart Parking System
### Parking Montoring Center  
The parking monitoring centre uses wireless sensor networks (WSN) and integrated RFID technology in these sensor nodes installed in each parking space. RFID technology is a technology based on radio frequency identification that helps to check and identify objects by radio waves. Thus, vehicles will be identified and parking fees will be collected via this system, to manage and monitor the parking area in an efficient and convenient manner. Once a car has just parked in a space i in a parking area j, the appropriate sensor detects the presence of the vehicle and it sends the two identifiers (IDzi, IDpj) with the occupied state of that space to the gateway, to transfer them to the central server in order to store them in the database. The RFID reader, integrated in each sensor node, reads the driver's data using the RFID tag installed in the \begin{table}
\begin{tabular}{c c c c c} \hline \hline
**Wireless Parameter** & **Bluetooth** & **IEEE 802.11 b** & **IEEE 802.11 ah** & **ZigBee** \\ \hline Frequency band & 2.4 GHz & 2.4 GHz & Sub-1 GHz & 2.4 GHz \\ \hline Range & 9 m & 75 to 90 m & 1000 m (without & 100 m (without \\  & & & repeaters) & repeaters) \\ \hline Current Consumption & 60 mA (Tx mode) & 400 mA (Tx mode) & 90–140 mA (Tx mode) & 25–35 mA (Tx mode) \\  & 20 mA (Standby mode) & 5 uA (Standby mode) & 3 uA (Standby mode) \\ \hline \hline \end{tabular}
\end{table} 
Table 1: The advantages of ZigBee over other wireless communications technologies. Figure 10: 802.15.4 ZigBee performance based on BER-SNR. vehicle (name, first name, vehicle number, telephone number, etc.) and transfers them by merging them with the state of the space towards the central server. This server will be used to calculate the duration of parking and to control the detected incidents during the parking of a vehicle. In the case of cars without any RFID tag, a message is sent to the parking officers with the two parking identifiers [1 Dzi, 1 Dpi]), to register the vehicle registration number into the system to guarantee the payment of parking fees. Algorithm 4 illustrates the process of managing the parking space in each area by the central server, when a vehicle arrives at the parking area. ```
1: Do
2: While (Reception the occupied state of a parking space [1 Dzi, 1 Dpi])
3: Update the information received in the database
4: Increment the number of occupied spaces
5: Decrease the number of available spaces
6: If (The RFID tag is detected) then
7: Update occupied space with RFID data received in the database
8: Else
9: Send a message to the parking agents with [1 Dzi, 1 Dpi] of the parking space that has just been occupied
10: The agent of the area 1 Dzi introduces the registration number of the car parked in 1 Dpi in the database
11: End if
12: Start counting the parking time: Tparkij //j = the parking area i = the parking space in the area j
13: Goto 1
```  
**Algorithm 4** Algorithm of managing the parking space in each area, when a vehicle arrives in the parking area. Once the car leaves the parking space, the sensor concerned detects the availability of the space by sending the two identifiers [1 Dzi, 1 Dpi] to the central server through the gateway so that it updates the state of the space in the database. After release of the space in the database the system checks whether the driver has made the payment for the duration of parking, otherwise a notice of infraction and a fine will be sent to the authorities after one hour so that the parking fees will be paid by the drivers. The payment of the parking time is made online using the mobile application or manually in the automated teller machine in each area. In both cases, only the registration number of the parked vehicle must be entered so that the system can detect it in the database and make the payment. The algorithm below (Algorithm 5) shows the operations performed for the management of the parking spaces in each area when a car leaves the parking area.