Design and Research of a Vehicle Approaching Reminder Device Based on ZigBee Wireless Sensor Network

warning system are developed vigorously.


Introduction
e wireless sensor network appeared in the 1970s. It was gradually formed with the continuous development of semiconductor technology, information technology, and network technology. In recent years, with the development of the Internet of ings, wireless sensor networks have attracted worldwide attention, and countries have increased their investment in related research [1]. Among them, ZigBee technology is a new wireless communication technology and also an advanced product [2]. e wireless sensor network is composed of sensor technology, microelectromechanical technology, advanced network, and wireless communication end-to-end intelligent computing platform. It has broad prospects. It is one of the most popular researches in the computer eld, and it is also a major technology that will change future life. is article will apply it to the research of vehicle collision avoidance warning system [3]. e system can be divided into three modules, namely, signal acquisition module, signal processing module, and execution module. e signal acquisition module includes obstacle detection, distance measurement, and road condition selection [4]. Regarding obstacle detection, this research mainly uses millimeter wave radar and CMOS camera to con rm the existence of obstacles and then uses millimeter wave radar to con rm the location of obstacles and to see obstacles [5]. Whether the object is within the collision range of the vehicle, the millimeter wave radar is used to measure the relative distance between the obstacle and the vehicle. Early warning technology to prevent vehicle collisions is an important part of vehicle active safety. In practical applications, it mainly analyzes the driving conditions of the vehicle and the traffic environment around the vehicle and provides early warning to the driver of possible road accidents [6]. en, in order to reduce road traffic accidents, this article has also done a lot of research on vehicle collision avoidance, which is broken down by data collection methods, including machine-based vehicle collision warning, distance measurement-based reminder vehicle approaching device and communicationbased vehicle collision avoidance warning; among them, vehicle approaching reminder devices include infrared, ultrasonic, millimeter wave, and laser methods; communication-based vehicle collision avoidance early warning includes DSRC, LTE-V, Zigbee, cellular networks, and other methods [7]. e research on collision avoidance systems is a hot topic today, and will continue to pave the way for future driverless driving [8]. At present, the research of anticollision warning system mainly uses one of the vehicle sensors (ultrasonic, laser, radar, infrared, machine vision, etc.) to detect and identify objects outside the vehicle [9]. Wireless sensor network is a key tool to realize the intelligent perception and interconnection of heterogeneous elements in the physical world. e digital twin system realizes the dynamic real-time interaction between the physical world and the digital world [10][11][12]. e vehicle approval reminder device based on ZigBee wireless sensor network studied in this paper also provides a certain degree of support for the realization of the digital twin system in the vehicle field. e focus of the entire research is on the accuracy of signal acquisition, real-time signal processing, accurate obstacle detection, real-time distance tracking, correct road pattern recognition, and organic fusion of received data and finally making the correct decision quickly, so as to avoid collisions and reduce traffic accident [13]. e remainder of this paper is organized as follows. Section 2 presents the methods used in the designed vehicle approaching reminder device based on Zigbee wireless sensor network, which contains theoretical basis, algorithm principle, and the detailed methods. Section 3 is the main research content, which contains vehicle driving road mode selection, model of vehicle approaching reminder device, communication and braking influence factors and algorithm simulation, and evaluation. Section 4 discusses the research results and designs the device software and hardware and data processing module, which is followed by concluding remarks in Section 5.

eoretical Basis.
Wireless sensor networks are currently an interdisciplinary and highly integrated hot research direction, and they have received considerable attention all over the world. e development of sensor technology, microelectromechanical systems, modern networks, and wireless communication has contributed to the emergence and development of modern wireless sensor networks [14]. e wireless sensor network expands people's ability to collect data, connects the physical data of the objective world to the transmission network, and provides humans with the most direct, efficient and reliable data on the next-generation network. is section is mainly a basic introduction to wireless sensor networks, mainly introducing the architecture, key features, design, and applications of wireless sensor networks [15]. e sensor node is usually an embedded system. Owing to the limitation of size, price, and power, its processing power and storage capacity are relatively small, and the data transmission distance is also very limited [16]. In terms of network functions, each sensor node has the dual functions of collecting and routing data. In addition to collecting and exporting data locally, it must also store, manage, and integrate data sent from other sites and perform certain tasks in collaboration with other sites [17,18]. e receiver node usually has powerful processing, storage, and communication skills.

Algorithm Principle.
e weighted average method can divide the three components of R, G, and B more reasonably, so as to obtain a more reasonable gray image. In the MATLAB simulation software, the weighted average of the three components of the system function R, G, and B is as follows: (1) e formula expression is as follows: e gray value of the gray image is between 0 and 255. In order to better identify the target image and extract the edge, the gray value must be redesigned and set.
is is a binarization process. Image binarization is a basic image processing technology. Binarization technology plays a very important role, whether it is compressing image data, extracting edges, or analyzing shapes.

Research Methods.
e transmitted signal of millimeter wave radar is as follows: e received signal of the millimeter wave radar is as follows: where: t x -delay time.
e distance between the car and the stationary obstacle is as follows: 2 Scientific Programming It can be seen from earlier that the relationship between vehicle distance and delay time is as follows: When the millimeter wave radar is working, the continuous waveform emitted by the transmitter will be decomposed into signals when it hits an obstacle in front of it. When the front barrier is a fixed object, the echo frequency received by the receiving end is the same as the frequency of the transmitted signal, as shown in Figure 1.

Vehicle Driving Road Mode Selection.
Nowadays, the four driving modes of the car are quiet and stable pure electric mode (EV), efficient and energy-saving economic mode (ECO), stable normal mode (NORMAL), and surging sport mode (SPORT). When the EV pure electric mode runs at low speed and short distance, the vehicle only works on the power provided by the battery. At this time, the engine does not intervene, the noise of the vehicle is almost equal to zero, and zero emission is realized at the same time. When switching to sport mode, the energy output of the battery will increase instantaneously, the power response will be rapid, and the steering operation will be obvious. At the same time, traction control system and vehicle stability control system will reduce the intervention in driving.
A moving car uses an emergency braking system in an emergency. e car has a certain distance when braking. is distance is called the braking distance. Different cars have different braking distances on different roads. When designing a collision warning, the determination of the safety distance of the vehicle in the execution phase is mainly based on the braking distance of the vehicle. In addition, the braking distance is mainly determined by these road conditions. erefore, before investigating the braking distance, first determine the road on which the car is traveling. e current investigations of roads at home and abroad are mainly based on the relationship between sliding speed s and adhesion coefficient μ. e maximum µ value is determined using the µ-s ratio graph and the slope of the small slider in the speed range. When installing the sensor, tilt the position of the sensor to the front of the vehicle so that the sensor can detect the road conditions in front of the vehicle during operation, thereby predicting the road conditions ahead and keeping the vehicle in the best position safely. e sensor used to detect road traffic in this article is an ultrasonic sensor. As the waveform attenuates during transmission and along the same path, the attenuation of the waveform is different under dry and wet conditions, resulting in different received waveforms. e waveform received in this way can be used for spectrum analysis of the spectrum difference to distinguish path types. Signal analysis and feature removal are mainly based on time domain, frequency domain, or time-frequency domain. When extracting attributes from the time domain, if the signal is uncertain or the weather changes, or an unknown interference signal appears during transmission, its robustness should be considered. When extracting attributes from a frequency range, it is only for a limited signal interval, so the signal time range must be cut off, which leads to information leakage, and the amplitude, frequency, and phase of the resulting individual spectrum can lead to further errors.
As shown in Table 1 for the impact data of the vehicle braking distance, it can be seen from the table that the driver's reaction and braking distance increase with the increase of speed. Figure 2 shows the relationship between starting speed and stopping distance under various road conditions after simulation. It can be seen from the figure that the braking distance of a car is different on different roads, and the braking distance is the largest under icy roads. Figure 3, based on the automatic tracking theory, the Berkeley safety distance model and the hidden Markov model, a collision warning system that can objectively and accurately calculate and assess traffic hazards has been designed, including an improved safety distance model, through the analysis of vehicles e characteristics of different stages of braking and the characteristics of car-following behavior of the vehicle optimize the safety distance model. e risk assessment process of the early warning model is introduced, the problem of low accuracy of risk assessment based on vehicle data is optimized, and the hidden Markov model is used to conduct risk assessment according to the observation sequence of the periodic process. At the same time, an improved safety distance model is used to mark the state of vehicle data, and the K-Average method is used to classify and discretize the observation data. e evaluation of the early warning situation is based on the statistics of the angle of the vehicles on the road section, and according to different direction values, the current scene is regarded as a circular arc, a straight road or an intersection.

Model of Vehicle Approaching Reminder Device. As shown in
According to the car-following theory, this provides a theoretical basis for analyzing vehicle braking and assessing the possibility of collision. As shown in Figure 4, assuming that the driver detects a dangerous situation ahead and the vehicle starts to brake, he should depress the brake pedal with his right foot while the vehicle is running until the vehicle maintains a minimum safe distance from the vehicle.     Figure 3: Schematic diagram of collision avoidance warning model. e driver depresses the brake pedal to brake until the vehicle is out of danger and the entire braking process is completed.

Communication and Braking
In uence Factors. V2X communication technology is an important research direction for vehicle intelligence and networking. Among them, the dedicated short range communication (DSRC) standard was mainly formulated in the United States, Europe, and Japan in the 1990s; and C-V2X (Cellular Vehicle to Everything) was developed by 3GPP (Cooperative Project No. 3) Development. Table 2 shows the main indicators of DSRC and C-V2X. e comparison shows that C-V2X has greater advantages over DSRC in terms of transmission distance, delay, and evolution. e application scenarios of the future intelligent networked vehicles include tra c safety, tra c e ciency, and information services, of which 19 are safety, 12 e ciency categories, and 9 information service categories. Table 3 shows intersection collision warning, frontal collision warning, and a statistical table of 8 typical V2X safety applications such as side collision warning. e C-V2X standard is composed of the LTE-V2X standard and the 5G V2X standard and can seamlessly develop from LTE-V2X to 5G V2X. e C-V2X standard includes two modes of operation: direct data transmission and mobile communication. e di erent operating modes correspond to the communication interface PC5 and the communication interface Uu. e PC5 communication interface can support vehicle-to-vehicle V2V communication, V2I vehicle-to-road communication, and V2P humanvehicle communication through the Uu communication interface. Figure 5 shows the network architecture of the DSRC system and the network architecture of the C-V2X system.
First, the braking process is analyzed for the reaction time.
e factors related to the process performance can complement the driver's response time. It is often believed that a rear-end collision between two vehicles must be related to the following distance and the driver's reaction time. However, the following distance and reaction time need to be considered. erefore, in this section, we will analyze the characteristics of the braking behavior process and nd the relationship between each driving mode and reaction time. Factors related to response time include braking response time, initial monitoring distance (IHD), and distance (BHD). e statistical data of the relevant variables are shown in Table 4. Behavior 1, Behavior 2, Behavior 3, Behavior 4, Behavior 5, and Behavior 6, respectively, represent the normal driving state that occurs under normal driving conditions, and the emergency events that occur under the conditions of communication behavior, voice information behavior, chat and drinking, yawning, and so on, and give abnormal driving behavioral reaction time and following distance. Table 5 shows the signi cant di erence results of different driving behavior variables. e analysis of variance shows that di erent abnormal driving habits have a signi cant impact on the reaction time of the driver in the braking process (F 8.971, P 0.003 ≤ 0.05), the initial following distance and braking following distance are related to the driver's braking response Time does not signi cantly a ect the relationship. e nonparametric K-M estimation method is used to estimate the survival probability of di erent driving behaviors according to the braking reaction time, as shown in Figure 6.

Algorithm Simulation and Evaluation.
e simulation value of the vehicle position prediction result in Figure 7 basically ts the curve of the horizontal position and the longitudinal position. In this test case, the prediction error of the horizontal position is −0.015 ± 0.252 m, and the prediction error of the longitudinal position is 0.089 ± 0.207 m. e prediction error of the vehicle speed is calculated based on the expected speed and the actual speed. e analysis of the results in Figure 8 shows that in this test case, the prediction error of the lateral speed is −0.028 ± 0.279 m/s, and

Device Software and Hardware
Design. According to demand analysis and hardware design block diagram (Figures 3 and 4), it can be concluded that the hardware platform of the whole system is mainly divided into main control module, DSRC wireless communication module, GPS module, CAN bus module and USB module, and power supply module. e main control module selects the i.MX6 DualLite processor produced by Freescale, and the core board integrates the CAN controller required by the procurement system. e communication module adopts the integrated module model THE0-P173 of Cohda Wireless, which combines a wireless radio frequency transceiver module and a protocol converter unit, and can use the 5.9 GHz frequency band to complete DSRC communication. e pins of the NEO-M8U chip are connected in series with the LED light, and the status of the LED light is used to indicate the working status of the GPS module. Steady ON indicates that the module is turned ON but not inserted; ashing indicates that the positioning is successful and GPS location information is sent. e CAN bus module    e middle layer application is developed on the basis of the Linux operating system. Its task is to collect vehicle data, convert it into BSM data, and send it within a certain period of time through the V2X communication module. At the same time, it receives BSM data sent by other vehicles. As a high-level application, the user terminal is developed using QT software, which mainly realizes socket communication with the middle layer, realizes data reception, data preprocessing, use of early warning algorithms, and early warning prompts. e program has multiple I/O functions. In order to avoid I/O deadlock, multiple I/O technologies are used, so that multiple I/O functions can be reused in the same query block, allowing the program to process multiple I/O's at the same time. Each I/O request becomes single-threaded time. e query function independently creates a pollfd structure for each monitored le graph, which determines the appearance of the le graph. In the main function, rst initialize each module of the system, including the initialization of the GPS module, CAN module, and communication module P1609 layer.
e structured data are stored in the StateStore structure.
e channel synchronization event triggers the BSM message every 50 ms. e data stored in the structure must be recorded before each transmission, as de ned in the BSM message in the compiled message format and must be adapted to the structure of the data storage structure in the StateStore. After the P1609 layer encodes the BSM message, it encapsulates it as a WSM message and sends it to the receiving device. e transmitted data packet can be saved in a log le; the P1609 layer of the receiving device receives the data packet in accordance with the SAE J2735 standard. e BSM message is decrypted, and the received data packet can also be saved in the log le. First set the serial port GPS parameters such as baud rate and stop bit, open the serial port, and start receiving the serial buffer data stream; after receiving the data, process the data frame starting from $GPRMC, and extract the corresponding fields in the chassis value, such as current time. e vehicle position and angle convert the ASCII code into a real number and then into an unsigned integer to receive and store the vehicle data. When other threads need GPS data, they are read from the memory structure; when the GPS update time expires, they continue to read the next data stream to obtain the latest vehicle position information. After the data are updated, the top-level application initiates an event update every 50 ms, encapsulates the BSM message and sends the request to the WSMP protocol layer [16]. e request contains the required parameters. When the WSMP layer receives a request to send a WSM message, it first checks the validity of the length of the data packet sent by the request. If it meets the specified length requirement, it adds WAVE data element, version and other extended header information values to the WSM message. Encapsulated in the WSM message and sent its MAC layer and PHY layer, after LLC lower layer processing, the data packet is sent to the WSMP protocol layer. e WSMP layer determines whether the packet format is a standard WSM message [19,20]. If the PSID value matches, the hit is successful, and it is sent to the upper unit corresponding to the PSID value, otherwise it is discarded [21].

Device Signal and Display Processing.
e collected signal is sent to the signal processing module for digital processing, which is called digital signal processing (DSP). Digital signal processing is a series of processes such as conversion, filtering, enhancement, and compression of the received signal in the form of a computer or special equipment to obtain necessary or useful information [22].
TMS320F28335 digital signal processor uses 176 pins, and its compression method is PGF/PTP thin four-channel flat package (LQFP). Its main features are as follows: (1) CMOS technology is a high-performance static technology with an instruction cycle of only 6.67 ns and a base frequency of up to 150 MHz; (2) the processor is a 32-bit high-performance processor, and the arithmetic unit is a single-precision floating-point number. (3) e 16-bit words of 256 KB of flash memory, 16-bit words of 34K SARAM memory that can be accessed in a single cycle, and 16-bit words of 1K OTPROM that can be programmed once are all password-protected; (4) With TMS320F281X series processors. In comparison, it contains eight external interrupts, but there is no special interrupt pin; (5) e processor contains two CAN modules (CANTXA, CANRXA and CANTXB, CANRXB), using standard IEEEll49.1 chip scan simulation interface (JTAG).
is product uses 12864 liquid crystal displays for visual display. 12864 LCD is a graphic dot matrix liquid crystal display, which is composed of a row controller, a column controller and a 128 × 64 dot matrix liquid crystal display. It can not only display 8 × 4 16 × 16 dot matrix Chinese characters, but also display graphics, realize cursor display, screen movement, and custom icon and sleep mode [23].

Data Processing Module Design.
Based on the analysis of the on-board terminal, the on-board terminal functions are mainly divided into on-board data collection and communication functions, which are mainly used to support data in collision avoidance warning applications [24]. In order to facilitate the retrieval and use of data at the application algorithm layer and weaken the connection between the application layer and the underlying functional modules, this paper designs a data acquisition module between the basic layer and the application layer as an intermediate layer, and the data cache module supplements the data management function [25]. e anticollision software structure is divided into three layers according to the hierarchical structure. e lower layer is a data acquisition module and a communication module, which provides initial data support for the middle layer; the middle layer is a data cache module, which is used to manage the data structure for ease of use and application layer efficient retrieval of data saves program use time; the application layer includes a module that evaluates the driver's reaction time and an adaptive collision avoidance warning module, which uses the collected data to determine the data of the vehicle's early warning situation [26]. e data acquisition module can also be called the data acquisition module, which mainly uses equipment to measure and collect physical data during the driving process of the vehicle. It is the basis for the accurate operation of the collision warning system. e data collection module mainly includes the collection of vehicle position data, vehicle attitude data or CarMaker simulation data. e main purpose of collecting vehicle position data is to read the NMEA0183 command information provided by the GPS/BDS positioning module through the UART serial port of the processor, and then use the following commands to analyze: $GPRMC, $GPGGA, $GPGSA, $GPGSV, and $GPGGA. GPS-pa required by GPVTG is mainly information such as latitude and longitude, angle, time, date, and altitude. e terminal installed in the car first initializes the accelerometer and gyroscope module; initializes the registers, and then can periodically read the three-dimensional acceleration and three-dimensional angle data of the vehicle. Since the GPS/BDS positioning module updates data slowly, and the data update cycle of the accelerometer and gyroscope modules is short, the data collected by the IMU module can be used to supplement the calculation of the vehicle position data, thereby shortening the update cycle of the vehicle position data. As there are many external factors that affect the accuracy of the test during the actual vehicle test during the test phase. erefore, it is necessary to carry out the simulation test of the algorithm in real time before the actual vehicle test and improve the error correction of the algorithm. e communication module also represents a component of the underlying module. e communication module enables the communication between vehicles, the communication between vehicles and roads, and the communication between the terminals installed in the vehicles and the mobile terminals to be carried out stably.
rough the network communication module, the vehicle-mounted terminal can  send anticollision warning information to the mobile terminal to realize the sound and light warning for the driver;  the vehicle-mounted terminal device can use the Bluetooth  communication module and the vehicle-mounted OBE device to receive vehicle body usage data; the vehicle can send  the vehicle to the mobile terminal through the V2X communication module. e surrounding vehicles send their own vehicle information, and at the same time receive the vehicle motion data sent by the surrounding vehicles, so as to realize the communication between the vehicles. Owing to the rapid development of the mobile Internet, mobile devices are ubiquitous. Mobile devices can warn drivers not only through visual animation, but also through audio transmission without affecting the driver's visual awareness. e terminal installed in the vehicle calculates the vehicle collision avoidance warning and then sends the warning result to the mobile terminal, and the mobile terminal reminds the driver based on the calculation result of the collision avoidance warning algorithm. If the vehicle-mounted terminal is connected to the Internet through a 3G/4G mobile communication device or WiFi communication device, it can interact with the mobile terminal through the network communication module, send an anticollision warning algorithm, and determine the warning situation from the vehicle to the mobile terminal to the mobile device. At the same time, the vehicle-mounted terminal can also send the traffic data and road information received by the roadside device to the mobile terminal through the network communication module, thereby displaying information out of sight to the driver in advance, improving the driver's field of vision and driving experience.

Conclusion
Aiming at the problem of node power constraints in wireless sensor networks, this paper uses the general characteristics of wireless transmission and the temporal and spatial correlation of data collected in the network, and uses energy-saving routing protocols and data compression and aggregation technologies, such as compressed sensing, network coding, and predictive models. Reduce the amount of data collected and transmitted in the wireless sensor network, reduce the energy consumption of the nodes in the network, and alleviate the problem of node energy limitation, and then apply it to the current research status of vehicle collision warning technology. For traditional collision warning algorithms without considering the impact of abnormal driving behavior on the collision warning algorithm, which leads to problems such as incompatibility of collision warning applications, a vehiclevehicle cooperative collision avoidance warning method based on driving behavior is proposed. In this paper, combined with the emergency braking process of the vehicle, the influence of abnormal driving behavior on the driver's braking reaction time is studied, and the driver's braking response time is simulated according to the driving behavior. According to the software function requirements, this paper designs a collision avoidance early warning software architecture based on layered thinking. e software architecture is divided into three layers, namely the bottom layer, the middle layer, and the application layer. e bottom layer includes a data acquisition module and a communication module, the middle layer is a data cache module and application programs, and the application layer is an anticollision warning module.
With the increase of car ownership year by year, the contradiction between people and vehicles in China's transportation system is becoming more and more serious. As the core technology of developing intelligent transportation system, vehicle road cooperation technology can not only improve the traffic efficiency in the transportation system but also play a key role in improving the safety of people and vehicles in the transportation system. is research plays an important role in promoting the information interaction of vehicle road collaborative system.

Data Availability
e data used to support the findings of this study are available from the corresponding author upon request.

Conflicts of Interest
e authors declare that they have no conflicts of interest.