Design and Evaluation of a Wireless Sensor Network for Monitoring Traffic Yuhe Zhang 1, 2, Xi Huang 1, 2, Li Cui 1,, Ze Zhao 1 Tel: +86-10-6260 0724, Fax: +86-10-6256 2701 1 Inst. of Computing Technology, Chinese Academy of Sciences, Beijing, China, 100080 2 Graduate School of the Chinese Academy of Sciences, Beijing, China, 100049 Corresponding Author {zhangyuhe, huangxi, lcui, zhaoze }@ict.ac.cn Abstract. The real-time detections of road parameters, such as traffic volume, velocity and time occupancy, are essential for ITS. Traditional systems are unable to meet the requirements of deployment convenience, detection accuracy, and overall cost. In this paper, we present the design and implement of a traffic monitoring system based on WSN technology. We describe the systematic architecture design and hardware platform. We provide efficient algorithms for detections of traffic volume, velocity, lane occupancy and for vehicle classification. We also evaluate the system with performance data collected from on road experiments. Keywords: ITS, WSN, wireless traffic monitoring system, vehicle classification 1. INTRODUCTION With the rapid development of modern cities and fast increasing amount of vehicles, ITS has become crucial in many megalopolises. ITS is comprised of different elements [11], such as arterial management, freeway management, information management and so on. These elements are based on the road condition represented mainly by the traffic volume, velocity and lane occupancy [8]. Recent studies [10, 12] indicated that the relationship between the traffic volume and velocity on expressway of Beijing is likely in accordance with the Greenshields s quadratic curve model proposed in 1935 [8] shown as in Figure 1. This relationship indicates the states of road and can further be used to estimate if the road is free, in a queue, or in traffic congestion. Therefore, to obtain the parameters of traffic volume, velocity and time occupancy in real-time is essential for ITS. Vf Vf/2 Free Queuing Traffic Jam Traffic Volume (number of vehicles/hour) Figure 1. Greenshields s Model, 1935 Traditional traffic monitoring systems, like inductive loop, video, microwave and infrared etc [1], can t meet the requirements of deployment convenience, detection accuracy and overall cost. Besides, nearly all the current traffic monitoring systems are wired, which is costly in the implementation and maintenance of the system. In this work, we present the design of a wireless traffic monitoring system based on Wireless Sensor Network (WSN) technology. The WSN-based system has advantages over the traditional systems in many ways, including the flexibility in deployment, its scalability and con- 1
venience in maintenance [3, 5]. A networked wireless sensor system may be even more powerful since it can be used to collect and process real-time information in a distributed and coordinated fashion. To construct the sensor node, the basic component of such a wireless sensor system, we choose magnetic sensor to detect vehicles. Vehicle detecting nodes are fixed by the roadside, which is the easiest way for system implementation. There are many technical challenges in the system development. Firstly, the traffic volumes are very heavy on the busy roads in Beijing so that we need to develop efficient signal processing algorithm to improve the detection accuracy. Secondly, bicycles are common transportation tools in China so that the false positive detection caused by bicycles may seriously lower the accuracy of traffic volume which needs to be identified. Finally, to measure the velocity of vehicles by using a pair of detecting nodes, an accurate time-synchronization mechanism needs to be investigated. This paper is organized as follows: The second section presents traffic monitoring system architecture and the hardware design of sensor node. In the third section, we show the details studies of road parameters measurements, including the design of vehicle detecting algorithm, the classification algorithm of vehicles and bicycles, the principle of measurements of velocity and lane occupancy. Experimental results are presented and analyzed in the fourth section. Finally, we discuss the potential application of this system and the future work. 2. SYSTEM ARCHITECTURE AND HARDWARE DESIGN The wireless traffic monitoring system is comprised of wireless vehicle detecting nodes, wireless data aggregation sink node, and a monitoring unit, as shown in Figure 2. Vehicle detecting nodes collect signals and process the information in a distributed fashion. They transmit the results to the sink. The sink then uses the information to control traffic light or sends the information to the monitor unit. Figure 2. Architecture of Wireless Traffic Monitoring System The wireless vehicle detecting node consists of four modules as shown in Figure 3(a), which are signal collecting module, signal processing module, wireless communicating module and a power module. Figure 3(b) shows a photo of the sensor node made in-house [7]. (a) Hardware Composition of Vehicle Detecting Node (b) Vehicle Detecting Node Figure 3. Wireless Vehicle Detecting Node. 2
There are sensor, signal pre-processing unit, DC / DC converting unit and set/reset circuit on the sensor board. The resolution of the magnetic sensor (HMC1021Z, from Honeywell) is 85μGauss, with sensitivity of 1mV/V/Gauss. When the outside magnetic field changes, the output voltage changes proportionally. The principle of vehicle detection is according to the distortion of magnetic field when a vehicle approaches. However, the distortion of magnetic field aroused by the vehicle is very small. According to [2], it s about 1mGauss when a vehicle passes at the distance of 7 meters. As a consequence, the output of sensor is 3μV or even lower. This tiny signal is difficult to be processed so amplification is needed before A/D conversion. We select a low-noise amplifier as the pre-amplifier and a common one as another amplifier on the next level. And a DC/DC converter is chosen as a power supply which generates ±6V from a 3V battery. Another key part of sensor board is the set/reset circuit. Any strong disturbance (10 Gauss or above) will change the sensor s characteristics. The set/reset unit is introduced to solve this problem. When the sensor is disturbed by a strong field, a set and reset pulse will be applied to the sensor through the set/reset unit. The pulse lasts for 2μs with a current at 0.5A. The communication board EZ210 is also made in-house [7] and there are micro-processor and communication chips on this board. We use EZ510 [7] as the sink node which is responsible for aggregating the data from the detecting nodes and forwards the information to the monitoring unit. In this work, a notebook computer is used as the monitoring unit which was connected to the sink. 3. CHARACTERISTICS OF ROAD STATUS Traffic volume, velocity and lane occupancy are three basic parameters indicating road status. These parameters can be measured using the proposed wireless system. In this section, we investigate signal processing and vehicle classification techniques and propose efficient algorithms for the measurements of the basic parameters. 3.1. TRAFFIC VOLUME DETECTION Traffic volume (expressed as Q) is the total number of vehicles passed per unit time. Since vehicle detecting nodes are fixed by the roadside, they are easily to be interrupted. The response signal of vehicle decreases with its distance to the sensor node. If this small signal is disturbed by the interference, the vehicle count may be missed, which is called false negative detection. Some commonly used filtering methods, such as FIR digital filter [6] and weight moving average [9] methods, are not suitable for processing tiny signals as in this case. Here we designed a Matching Filter based Signal Processing Algorithm, namely MFSPA. Matching filter is the optimal detector for an object. It makes the useful signal s(t) strengthen, whilst restraining the noise n(t). The function of matching filter can be expressed as s(τ-t). The principle is based on the cross-correlation of original signal (s(t)+n(t)) and s(t), which is recognized as the sum of the self-correlation of s(t) (corr(s(t),s(t))) and the cross-correlation of s(t) and n(t) (corr(s(t),n(t))). The maximum Signal-Noise-Ratio may be achieved at the judgment point. 3
The key issue of matching filter is the choice of reference signal s(t). The criterion in choosing s(t) is to get the least correlation of noise. We adopted the curve-fitting technology to get the reference signal as shown in Figure 4(a) and (b). Figure 4(a) shows a typical original signal pattern collected by the sensor node within its response time. The magnetic field downward is caused by a passing vehicle which is in good match with a Gaussian function as shown in Figure 4(b). Thus we may use Gaussian function as reference signal. We evenly select points from the fitting result as the reference signal, and then let the original signal correlate with it. As the response time of sensor node varies with the type and velocity of vehicles, we used multiple matching filters to achieve the best detecting effect. The experimental data showed that most of the response time is between 0.7s and 4s. We thus adopted 2 Gaussian functions as reference signals, that is, the 0.85s and the 3.4s respectively. The procedure of MFSPA is shown as in Algorithm 1. 0.2 0-0.2-0.4-0.6-0.8-1 0 0.5 1 1.5 2 0 0.5 1 1.5 2 (a) Original Signal (b) Fitting Result Figure 4. Original Signal Fitting using Gaussian Function Algorithm 1. Algorithm for Vehicle Detection 1: set IsAVehicle = 0 0.2 0-0.2-0.4-0.6-0.8-1 Time (s) 2: CorrRes1(m) = Corr(signal(m-n+1 : m), ref1(1 : n)) 3: CorrRes2(m) = Corr(signal(m-n+1 : m), ref2(1 : n)) 4: if IsAVehicle == 0 then 5: if (CorrRes1(m-1) < 0.8 and CorrRes1(m) > 0.8) or (CorrRes2(m-1) < 0.8 and CorrRes2(m) > 0.8) then 6: IsAVehicle = 1 7: Report "There is a vehicle" 8: end if 9: else 10: if (CorrRes1(m-1) > 0.8 and CorrRes1(m) < 0.8) or (CorrRes2(m-1) > 0.8 and CorrRes2(m) < 0.8) then 11: IsAVehicle = 0 12: end if 13: end if 3.2. CLASSIFICATION OF VEHICLES AND BICYCLES As mentioned above, the bicycles passing nearby also cause significant disturbance to the node, which will reduce the accuracy in measurements as we call as false positive detection. To identify the number of bicycles may greatly improve the accuracy of vehicle volume measurements. There have been researches [4, 9] concerned with vehicle classification, which are unsuitable in this case. Here we proposed an efficient algorithm to classify vehicles and bicycles using the information of velocity and response time. Ideally, when a magnetic object with length l passes a node at a velocity of v, the response time (RT) equals to l/v. Taking the signal expansion into account, the value of v*rt may be proportional to the length of the object. Based on this principle, vehicles and bicycles may be distinguished since the lengths of bicycles are usually smaller than that of vehicles. The feasibility of the principle is illustrated in Figure 5 with data collected from experiments, and the procedure is shown in Algorithm 2. 4
Algorithm 2. Algorithm for Classification of vehicles and bicycles 1: get RT and v of the object 2: RTVvalue = RT*v 3: if RTVvalue > Threshold then 4: Report "This is a vehicle" 5: else 6: Report "This is a bicycle" 7: end if Figure 5. The Identification of Vehicles and Bicycles 3.3. VELOCITY AND LANE OCCUPANCY For the detection of vehicle velocity (expressed as v), we use a pair of nodes (A and B). Assuming L is the distance between A and B, T ApBp is the time interval they detect the same vehicle, then v=l/t ApBp. To estimate T ApBp accurately, the two nodes must be time-synchronized. Here we define the time at the peak position of a response curve as the detecting time. At the beginning of synchronization, Node A sends its local time T A. Node B receives it and sets its local time as T B. We define (T B -T A ) as t, as illustrated in Figure 6. We define T PA as the time interval A prepares to send the synchronization packet (SynPac for short), T TA as the interval A transports SynPac, T TAB as the interval SynPac is transmitted from A to B, T RB as the interval B receives SynPac, T PB as the interval B processes SynPac, R dt as data transporting rate, R dr as the data receiving rate and N Syn as the length of SynPac. T PA, T TAB, T PB are negligible compared with T TA or T RB. In general, R dt is equal to R dr, and we use R d to represent them, so, t 2*R d *N Syn (1) After Node B setting T B as T A + t, Node A and Node B are synchronized. T ApBp can be calculated. The algorithm for calculating velocity is also provided. T A T PA T TA T TAB T RB T PB t T A + t Figure 6. Time Interval in Transmitting SynPac. Algorithm 3. Algorithm for Computing the Velocity 1: initialize the variables of T Ap and T Bp and WaitForB to 0 2: while Node A and B are working do 3: if Node A detects a vehicle and WaitForB == 0 then 4: set T Ap as the time of Node A detecting the vehicle 5: WaitForB = 1 6: end if 7: if Node B detects a vehicle and WaitForB == 1 then 8: set T Bp as the time of Node B detecting the vehicle 9: T ApBp = T Bp - T Ap 10: v = L / T ApBp 11: WaitForB = 0 12: end if 13: end while Lane occupancy (expressed as K) is also called density of traffic volume. It may be calculated by the average velocities of vehicles on road at different states [10, 12]. t 5
4. PERFORMANCE EVALUATION We deployed the traffic monitoring system by a two-way double-lane road. Vehicle detecting nodes monitor two lanes simultaneously, as shown in Figure 7(a) and (b). After data aggregation node receives the original signal, it sends the information to the monitor. (a) Scene of On Road Test (b) Picture of On Road Test Figure 7. Scene of Vehicle Detecting Test on Road. 4.1. TRAFFIC VOLUME VEHICLE DETECTING TEST We compared the performance of two signal processing algorithms. One is the original Band-Pass Filtering Algorithm (BPFA); the other is MFSPA. Two group s experiments were carried out in parallel based on the two algorithms. Figure 8(a) and (b) show the results. To evaluate the accuracy of the system, the total number of vehicles actually (Act #) passed during the test was measured manually at the same time. The curves on the top parts in Figure 8(a) and (b) are original signals, the middle parts are the counting results using BPFA, while the lower parts are the counting results using MFSPA. False negative detections (FND) are circled by solid loops, whilst false positive detections (FPD) are circled by dotted loops. The total statistic results are listed in Table 1. It can be seen that MFSPA achieves higher accuracy (Acc) than BPFA. (a) Group 1 (b) Group 2 Figure 8. Comparison of BPFA and MFSPA in Detecting Vehicle. Act # FND by BPFA FND by MFSPA FPD by BPFA FPD by MFSPA Acc of BPFA Acc of MFSPA Group1 32 2 0 3 0 84.4% 100% Group2 32 1 0 6 4 78.1% 87.5% Table 1. Statistic Results of Two Signal Processing Algorithms. 6
4.2. VELOCITY Velocity test aims at analyzing the velocity detected using a pair of sensor nodes. Figure 9 shows the design of the velocity test. In our test, L is set to 3 meters. As a reference, we used a video camera to capture images and calculated the actual velocity of moving vehicles. The sampling rate of the video image is 30 frames per second. We did four groups of tests, group 1 was of 8 vehicles, group 2 was of 11 vehicles, group 3 was of 5 faster bicycles, and group 4 was of 5 slower bicycles. The results of average velocity for each group are listed in Table 2. The average accuracy of velocity measurement was estimated to be 90%. Average Velocity (km/h) Average Reference Velocity (km/h) Average Accuracy of Velocity S Node A 3 m Node B Figure 9. A Pair of Nodes in Velocity Test Average Response Time (s) N Average RT*v (s*km/h) Group1 40 39 87% 1.56 58 Group2 31 31 94% 1.60 54 Group3 23 24 93% 0.79 18 Group4 12 11 88% 1.42 18 Table 2. Velocity Detecting Results and Classification Results. 4.3. VEHICLE AND BICYCLE CLASSIFICATION As indicated in 4.2.2, to classify vehicles and bicycles, we used the combination information of velocity and response time. In experiments above, the velocity can be obtained. We also measured the response time in the same tests as above. Individual values of v and RT were displayed on X and Y axis in Figure 5, where the data of vehicles were marked as circles and bicycles were marked as snowflakes. The RT results are also listed in Table 2. We can see from Figure 5 that v and RT for vehicles and bicycles are overlapping with each other. However, by using RT*v, which is the Z axis in Figure 5, it is possible to separate vehicles and bicycles. We set 25(s*km/h) as the threshold to separate vehicles and bicycles. As confirmed in Table 2, the mean (RT*v) value of vehicles is 54(s*km/h), whilst it s 18(s*km/h) for bicycles. We tested the efficiency of RTV algorithm with 60 vehicles and 25 bicycles. The results are listed in Table 3. In this test, most of the vehicles were cars, whose length is about 5 meters, and the common length of bicycles is 1.7 meters, so the length ratio of vehicle and bicycle is about 3. This indicates that this classification algorithm is reasonable. Classified as Bicycle Classified as Vehicle Accuracy Bicycle 24 1 96% Vehicle 1 59 98% Total Accuracy 98% Table 3. Classification Results of Vehicles and Bicycles. 7
5. CONCLUSION AND FUTURE WORK This paper presented the design and implementation of a wireless traffic monitoring system based on WSN. The basic parameters of road states such as traffic volume, velocity and lane occupancy can be measured in real-time using the system. In the future, we intend to implement MFSPA on vehicle detecting nodes and further improve the detection accuracy. We will also do more experiments on road to optimize the performance of the WSN-based system. We will also investigate the cooperation of distributed sensor nodes in information processing. ACKNOWLEDGMENT This work was supported by NSFC general project (60572060), NSFC key project (60533110) and CAS "100 Talents Project". The authors wish to acknowledge the helpful discussion with Transportation Research Center, Road and Transportation Lab of Beijing University of Technology. REFERENCES (1) "A Summary of Vehicle Detection and Surveillance Technologies used in Intelligent Transportation System". In The Vehicle Detector Clearinghouse, Southwest Technology Development Institute (SWTDI), 2003. (2) Caruso, M. J., Withanawasam, L. S.. "Vehicle Detection and Compass Applications using AMR Magnetic Sensors". Available at www.ssec.honeywell.com. (3) Chen, W., Chen, L., et al. "A Realtime Dynamic Traffic Control System Based on Wireless Sensor Network". In Proceedings of the 2005 International Conference on Parallel Processing Workshops (ICPPW 05), pp. 258-264, 2005. (4) Cheung, S. Y., Coleri, S., et al. "Traffic Measurement and Vehicle Classification with a Single Magnetic Sensor". In Journal of Transportation Research Board, 2005. (5) Coleri, S., Cheung, S. Y., et al. "Sensor Networks for Monitoring Traffic". In Forty-Second Annual Allerton Conference on Commuinication, Control, and Computing, 2004. (6) Ding, J., Cheung, S. Y., et al. "Signal Processing of Sensor Node Data for Vehicle Detection". In 7th International IEEE Conference on Intelligent Transportation Systems (ITSC), pp. 70-75, 2004. (7) Easinet. Available at http://www.easinet.cn/products.htm (8) Greenshields, B. D.. "A Study of Traffic Capacity". In Highway Research Board Proceedings, 14:448-477, 1935. (9) Gu, L., Jia, D., et al. "Lightweight Detection and Classification for Wireless Sensor Networks in Realistic Environments". In Proceedings of the 2 nd International Conference on Embedded Networked Sensor Systems (SenSys 05), pp. 205-217, 2005. (10) Guo, J., Quan, Y., et al. "Study on the Traffic Flow of the Expressway in Beijing". In Urban Transport, China, 11:42-44, 2000. (11) http://www.itsoverview.its.dot.gov/. (12) Yang, Y., Liu, X., et al. "Research on Three Traffic Flow Parameters". In Journal of Beijing University of Technology, China, 32(1):43-47, 2006. 8