Design of Intelligent Vehicle Monitoring System Based on ZigBee

In order to meet the needs of real-time positioning and remote dispatching of vehicle, this paper designs a ZigBee-based embedded vehicle terminal and the corresponding ZigBee-GPRS information communication network in hardware and software. With LPC2366 processor and CC2430 RF chip as core, the vehicle terminal acquires the vehicle's status in cycle, and completes the vehicle monitoring and scheduling by transmitting data to communication nodes by ZigBee and passing the data on to the monitoring center by GPRS. This vehicle terminal is characterized by small size, low energy consumption and ideal communication distance, which makes the monitoring center effectively monitor and schedule the


INTRODUCTION
In the era of Internet of Vehicles, vehicles with special purposes such as buses, ambulances and danger carrying vehicles were the application pioneers due to their strong real-time monitoring needs (Wang Xinjian, 2014).In order to satisfy the need of wireless real-time acquisition and monitoring over the target vehicle's position and status information, the intelligent vehicle terminal needed to meet two basic functions -acquisition and uploading of vehicle status information.
The realization of the above two functions are independent.The current research is quite mature in terms of acquisition of the vehicle status information.Besides, the vehicle speed, temperature, engine status and other information could be easily acquired by using the transducer.The vehicles might be positioned by using GPS or BDS (Liu Yongguang, 2007).Currently, however, the solution to uploading the vehicle status information is still in its infancy, which is mainly shown in the following aspects: (1) 3G/4G.3G and 4G are cellular mobile communication technologies that support high-speed data transmission.Based on the existing mobile phone network coverage, the Internet of Vehicles can be implemented by installing the corresponding module on the vehicle terminal (Jia Baoxin, 2017).
(2) Bluetooth.Bluetooth is a wireless technology standard that enables short-range data exchange between fixed devices, mobile devices and personal area networks in buildings with low price and power consumption.It had been widely applied to the vehicle, such as the hands-free vehicle phone (Xiao Yang, 2005) and rear-passenger wireless control vehicle audio and video (Su Jun, 2014).
However, the above communication solutions fail to meet the networking needs of the vehicle monitoring terminal.Although 3G and 4G have high communication quality and wide range, if this technology is directly used to communicate with a monitoring center, the terminal module would cause high costs; the long-term low-load transmission between the vehicle terminal and the monitoring center resulted in a large waste of high-speed wireless communication bandwidth (Li Wenhua, 2003).Due to the excessively small Bluetooth transmission range (10~100m), the high-density Bluetooth network coverage for the construction of transmission monitoring data will result in excessive cost and unstable transmission effects.
There is another wireless communication way called ZigBee.ZigBee is a low-power LAN protocol based on the IEEE802.15.4.It not only inherited Bluetooth's transmission features of low cost, speed and power consumption; yet its transmission distance could be extended to 1~2km and transmitted further by the communication relay of routing nodes (Zhu Zhou, 2005).
Compared with 3G and 4G, GPRS (General Packet Radio Service) belongs to the second generation mobile communication technology.Although its transmission rate is lower than 3G, the maximum transmission rate of 171.2kbps can already meet the demand of sufficient vehicle data upload.And GPRS system's cost is much lower than 3G and 4G, and it's easier to be built and maintained.
Considering the transmission rate, network quality and module cost, ZigBee is selected as the communication mode between the vehicle terminal and acquisition nodes, and GPRS is used as the communication mode between the acquisition nodes and monitoring center to form the vehicle monitoring communication system, with the schematic diagram shown in Figure 1.In this way, the advantages of ZigBee can be utilized, and the existing GSM mobile communication network can be relied on to save the transmission cost from the communication nodes to monitoring center.The program achieved a better balance in terms of its cost, reliability and transmission efficiency.

HARDWARE DESIGN
CPU main board consists of a CPU module responsible for data acquisition and processing, a large-capacity storage module for historical data storage, a CAN bus interface module for acquisition of vehicle-related parameters, an RF module for data transmission and receiving and a power management module.Among these, the RF module and the CPU module are the core of the whole system.The block diagram is shown in Figure 3.

CPU AND CAN INTERFACE DESIGN
With the LPC2366 microprocessor as the core, the CPU main board is responsible for controlling the entire terminal processing operations.Its data transmission with other modules ensure the terminal has sufficient data processing capabilities and ZigBee communication effectiveness and reliability.
The intelligent vehicle terminal only responds to commands that the address is in line with local address.After completion of the information exchange with communication nodes, it automatically points to the beacon frame channels of the next communication nodes.When the terminal operates normally, the CPU module automatically acquires signals from the front-end transducer or CAN bus interface module at fixed intervals, sends them to the CPU for processing through the conditioning circuit, and finally transmits the results to communication nodes through wireless network.

RF MODULE DESIGN
The communication distance, quality and power consumption of RF module directly determine whether the wireless monitoring network can operate normally.In order to reduce the terminal's power consumption and improve its portability and reliability, the wireless RF module was built with CC2430 in this study.CC2430 communicates with the CPU module through the SPI mode.
RFCC2420 is the core of CC2430.It integrates the ZigBee RF front end, memory and microcontroller on a single chip, and uses fewer peripheral circuits to send and receive wireless signals.Besides, the chip adopts 0.18pm CMOS production process, which is featured by very low current loss during the working period and extremely short time for conversion between dormancy and active mode (Liang Guangsheng, 2010).So it is particularly suitable for applications that require long battery life.In order to ensure that the vehicle terminal can be automatically switched to be powered by its own battery when necessary, the CC2430 ADC function is adopted in design to implement the working voltage detection and alarm function, with the reference voltage of 3V.

DATA ACQUISITION MODULE DESIGN
The terminal includes analog and switching quantity acquisition channels.The analog part is used to acquire analog values of vehicle monitoring points (like temperature and speed); the switching quantity is used for acquire the status of switching quantity inspection points on the acquisition device (such as the engine on/off state), which depends on the specific vehicle type and interface type.The design of this module would greatly expand the functionality and usability of the terminal system, so as to meet the requirements of more vehicles.

VEHICLE TERMINAL SOFTWARE PROCESS
The software design of the vehicle terminal mainly includes the communication between the vehicle terminal and the monitoring center, as well as the transmission and reception of the collected data.The design idea is as follows: The monitoring center wakes up the communication nodes by giving commands with GPRS network, and the ZigBee network composed by the radiation of the communication nodes transmits the broadcast information periodically; after the vehicle terminal receives the polling information, the reply information will be sent to the communication nodes through ZigBee, and the data will be transmitted to the monitoring center through GPRS.

TERMINAL ACCESS
After the vehicle terminal is powered on and initialized, the CPU module sends commands through the SPI interface, so as to make the CC2430 enter the working state and start searching whether there is a network in its communication range and apply for network access.
After the terminal's successful access, the terminal waits for polling information and sends a reply message to the coordinator, and the coordinator judges whether the vehicle terminal has entered a normal working state.Figure 4 shows the software process for communication access between the vehicle terminal and monitoring center.The LPC2366 periodically collects the vehicle status information from the CAN interface and forwards it to the CC2430 chip through the SPI interface.After the data is sent, check whether the acknowledgement frame (ACK) has received; if not, it will be sent repeatedly.When the number of transmissions is more than five and no acknowledgment frame is received, then a transmission failure signal is sent.
When CC2430 receives the data request signal sent by LPC2236, it will generate an interrupt, send the received data to the stack generated when the driver initializes, and check the stack through the SPI interface.If there is data in the stack, the driver empties the data that has been read.The software process is shown in Figure

CPU PROCESS
The CPU module based on LPC2366 mainly finishes the communication with CC2430's SPI interface, collects the vehicle information through CAN bus, and processes the collected data.LPC2366 initializes CC2430 through ISP, and encapsulates the collected data, and then uploads to monitoring center through CC2430.The flow chart is shown in Figure 6.

CONCLUSION
The " ZigBee-GPRS Vehicle Monitoring System " , composed of the vehicle terminal, communication node network and monitoring scheduling center can effectively combine the respective communication advantages of ZigBee and GPRS, have the characteristics of high transmission stability, high channel utilization and low cost, and it's thus very suitable for the application scenarios of vehicle status monitoring, operation and scheduling.
The proposed ZigBee-based vehicle terminal has strong practicability.The hardware platform is built by combining ARM microprocessor with independent RF chip, which not only greatly reduces the size of the terminal, but also makes the terminal have better mobility to meet the vehicle monitoring system's requirements over the terminal.The terminal is characterized by stable reliable hardware and software in the experiment and strong real time property that can meet different needs of the industrial field.Furthermore, it can be expanded into a variety of networks to meet the needs of vehicle monitoring and scheduling.

Figure 2 .
Figure 2. Overall Block Diagram for Vehicle Terminal.

Figure 3 .
Figure 3. Block Diagram for CPU Board Hardware.

Figure 4 .
Figure 4. Flow Chart for Vehicle Terminal Network Entry.

Figure 5 .
Figure 5. Flow Chart for Terminal Sending (Left) and Receiving (Right) Data