iPark: Parking Management System Based on Arduino and Cloud Platform

In order to have a better use of cross-platforms. We adopt the B/S architecture design and implement a parking management system. This system can not only view parking spaces, but also meet other needs, such as parking reservation and position recording. The node-based development can realize a flexible changing function that adds or removes nodes at any time. Based on cloud platforms, sever is built by PHP, MySQL database and other technologies and tools. Sensor networks are established relied on Arduino and nRF24L01 model.


Introduction
With the development of the Internet technology and embedded technology, as well as the increasing demand of intelligence and facilitation from society, the convenience of online management system becomes evident.The high development of the Internet is bound to make type and quantity of its terminals grow faster and faster.The internet changes from previous PC as a main networking tool to the mobile phone terminal, even up to now, "everything is connected."The parking management system can achieve the purpose of information collection, data processing and data real-time transmission via sensor, micro controller and communication module.Finally, dealing by a control center, information feedbacks to users then interacts with users, too.
Because the traditional parking management fails to connect to the Internet, it cannot interact with owners.That failure brings difficult for owners to find parking spaces.As the internet of things technology continues to mature, it gets rid of complex and inconvenient of the traditional parking management.This paper, based on wireless communication, combines the Internet with the embedded technology, and then designs a parking management system.The cloud platform completes parking information visualization, parking occupancy information and parking lot reservation and other functions.

System architecture design
According to data transmission, processing and feedback process, the system is divided into three parts: car park internal network, cloud platform and mobile terminal.
Those three parts are developed individually, and do not affect each other.They all use open and call interface to interact with information, which can increase system stability.The system structure diagram is shown in Figure 1.
The terminal is controlled by users.First, it transmits data to cloud platform, and data processed by the cloud platform will go through a router in the parking place.Second, gateway nodes obtain data and instructions which will be sent to every perceptual control node in the parking lot through a wireless module.Ultimately, we achieve the purpose of sensing surveillance and controlling equipment.The level of hardware system structure is shown in Figure 2.

Parking lot sensor node network
Setting the micro controller with the nRF24L01 module as basic configuration, defining a node according to different sensors and modules by functionality, an internal distributed network is built in the park.Data processing is independent of each other, and they have a direct communication through the 2.4G band or have an indirect communication through the parking gateway.If a single node is destroyed, it is not going to affect the whole network.
Every network node has a unique identification number that can collect and process related data independently.For instance, parking lot nodes collect and process occupancy data and that information are sent to cloud server through parking gateway.
The distributed network is an important basis for incremental development of intelligent parking field, which can dynamically add or delete nodes without affecting original functions.A new node accesses the network gateway without confirmation, which can communicate with servers by gateway identification and password.
The gateway node is a bridge between the internal distributed network and Internet communication.In addition to the nRF24L01 module, the gateway node also has a W5100 Ethernet module for connecting Internet.The robust stability of cloud server also provides protection for high concurrency, which has become the first choice for control center.Cloud server uses PHP, MySQL database to build a control center.It is used to manage users' account information, integrate and process datum from network nodes, and provide a remote management system.
The Cloud server stores a unique ID number of all nodes in database, and it establishes a table to associate users' account with related nodes.That method brings convenience to manage, and users can flexibly increase or delete nodes.

Mobile terminal
Through browser on the mobile terminal accessing to cloud serve, we can obtain real time data and realize remote real-time monitoring by running JavaScript code, and using ajax technology.The user interface applies the JQuery Mobile, which imitates the style of mobile terminal APP, to improve user's experience.Through the ajax technology to achieve a seamlessly transfer page without refreshing [2].
Benefitting from B/S architecture, the mobile terminal platform has no restriction.Whether PC or intelligent mobile phone, or any kind of operating system, the browser is just supported by JavaScript can manage and use the intelligent parking lot system, and also meets the demand of users on each platform.

Node of platform
Nodes use Arduino as a development platform.The Arduino includes software and hardware which are Arduino IDE and a variety of Arduino boards (using AVR chips).The flexibility and convenience of platform for post-packaging of the AVRGCC library allows developers to pay more attention on creativity and implementation.Thus the Arduino IDE cross-platform can run on following three systems: Mac OS, Windows and Linux [1].
Selection of Arduino boards depends on the function of nodes.Gateway nodes use the Arduino UNO board equipped with Ethernet Shield and nRF24L01 wireless module in some of the more stringent requirements on the size of environment.For example, the smart node switch adopts the smaller volume of Arduino Pro Mini, so it can be easily embedded into various products.
The high flexibility of node development is usually to develop nodes quickly with specific function under specific demands.At the same time, nodes also comply with the independence of platform.If they obey the system construct, nodes can also be exploited by other platforms.Nodes among different platforms communicate with each other, which can also be composed of the distributed network.The deployment of experiment is shown as Figure 3.In the node development, you should pay more attention to select multiple subordinate devices, so that you can avoid conflicts.For example, when you use nRF24L01, SS stitches of SD and W5100 linking Ethernet Shield should be set as a high level output, and the CS stitches of nRF24L01 should be set as a low level of output.On the contrary, the Ethernet Shield will be used in the same way.

Software architecture of the node
Each node on devices, have written a corresponding driver, and export interface for system calls.According to the function of node, when the system is written, the required interface is selected to call.nRF24L01 commonly used third party libraries have Mirf and RF24, etc.; While W5100 uses the official library Ethernet, on the basis of the preparation of the project dedicated HTTP_Client for access to the cloud platform.The software architecture of the node is shown in Figure 5.
The gateway node is the most important kind of node, which is responsible for connecting internal network with the internet.It adopts Arduino UNO board [3], Ethernet Shield and nRF24L01 as the basic configuration, and uses the official Ethernet Shield library files, and even connects to the Internet to create a Socket completing TCP connection with servers.Based on that, iPark project specially prepared a HTTP protocol database for data interaction with the server.After completing this server response, connections are broke down to save server resources, and the next connection request is initiated by a node again.Using the POST method in HTTP, the unique identifier of gateway node and data transmitted by other nodes are submitted to a server.The server judges and verifies the node identifier and returns to instruction.After a gateway node receives returned instructions, node identifiers and instructions are parsed, and instructions are sent to relate node identifiers to complete a communication between internal network and cloud server.A real project

Wireless network based on nRF24L01 module
In the application scenario of intelligent parking, the distance between two nodes in general is from ten meters to 100 meters.So considering cost conditions, the use of nRF24L01 module can meet a variety of demands.The distance between two nodes is short, and nodes can communicate directly with each other wirelessly.nRF24L01 works between 2.4GHZ to 2.5GHz with low current consumption and small size.The operating frequency, protocol address, transmission rate and data packet length all can be set by software, and the nRF24L01 supports automatic response.As the application applied for the parking lot with advantages of short-distance transmission, wireless network can be regarded as a fully connected network where each node communicates directly.The gateway node plays an important role in wireless network when communication among remote control nodes is required.After getting remote instruction and node address, those gateway notes send instruction to the assigned node.Nodes analyze the address of the other nodes in the instruction, and start to communicate with it according to the instruction.Nodes can also send broadcasts to each other to identify "neighbor" nodes.

Cloud platform control center implementation
By Adopting MySQL database and PHP to build the cloud control center, we use the form, which makes the car park node network to call control center API, to achieve monitoring and management of network nodes in parking lot.
MySQL is one of the most popular relational database management systems.It has the characteristics of small size and fast speed, so that it attracts many developers.Compared with CGI or Perl, PHP can implement dynamic web pages rapidly.Matching MySQL and PHP together is a mainstream.
The control center stores parking information of users in a database.Users can book a parking space in user interface.When the user operates and manages parking space remotely in control center, the server will find gateway node which is bound with the user's parking place in MySQL database.And then operation instructions and identifiers of gateway nodes are written in an instruction table in the database.Through constant polling server, gateway nodes query instructions issued by the bound account, after being acquired, and they are forwarded to a wireless network inside the parking lot to complete user's remote management.When the internal network node of the parking lot uploads data, data will be sent into servers by POST in HTTP through gateway notes.Eventually, the server responses the treated content to gateway nodes.All of those complete a data collection of control center.

IST2017
The control center connects the user's mobile terminal and internal network nodes in the user's parking lot.Therefore, there are two kinds of API for external calls.One is the interface for the mobile terminal calls, and the other is for internal network of the parking lot.After opening the API in control center, you can allow more developers to develop third party nodes to rich application.

Mobile terminal implementation
User interaction in iPark system is based on B/S architecture that is Browser/Server architecture with good cross platform.A browser which only supports JavaScript can complete node management on the network.Currently, on the market, most of the browsers support it.
In data interaction, data can be accessed and submitted by AJAX technology in real-time.In pages switch, the experience of native App switches without refreshing can be achieved by JQuery animation effect.AJAX allows asynchronously transmit data between browser and server without reloading the entire page and without blocking users, and it receives data returned by the server and then processes and displays them on the page, as shown in figure 6.
When users log in to the iPark, the browser will encrypt users' information and store them in local cookies.It is easy to automatically login in the next time and reduce the cumbersome procedures.Cookies is a kind of data, which a website uses to identify the user's identity and stores in the user's local terminal.Sites cannot extract Cookies information from other sites other than they place.
In security, because of the AJAX technology, every time the user account and encrypted password are summited to verify that each operation is carried out by the user himself.That approach can prevent hackers from intercepting packets to steal passwords and prevent unnecessary security holes due to stateless HTTP protocols.

Conclusion
Nowadays, sensor technology and wireless network technology are becoming more and more mature in the age of information, so Internet of Things is bound to become a hot spot to meet the people's pursuit of quality of life, intelligent life, and the demand for convenience.Thus, the Internet of Things market owns characters of vast, potentially and huge application value that arouse the concern of much more manufacturers.The emergence of Arduino, with its good support for each sensor, has become the first choice for the rapid development of prototypes related Internet of Things.In this paper, a kind of intelligent parking management system based on nodes is designed, and a feasible, fast and effective scheme is proposed based on Arduino implementation.

Figure 1 .
Figure 1.The system structure diagram.

Figure 2 .
Figure 2. The hardware system structure diagram.

Figure 3 .
Figure 3.The Parking space node deployment.

Figure 4 .
Figure 4.The hardware architecture of node

Figure 5 .
Figure 5.The software architecture of node

Figure 6 .
Figure 6.Parking space information interface