Abstract

Traffic flow monitoring involves the capturing and dissemination of real-time traffic flow information for a road network. When a vehicle, a ferromagnetic object, travels along a road, it disturbs the ambient Earth’s magnetic field, causing its distortion. The resulting distortion carries vehicle signature containing traffic flow related information such as speed, count, direction, and classification. To extract such information in chaotic cities, a novel algorithm based on the resulting magnetic field distortion was developed using nonintrusive sensor localization. The algorithm extracts traffic flow information from resulting magnetic field distortions sensed by magnetic wireless sensor nodes located on the sides of the road. The model magnetic wireless sensor networks algorithm for local Earth’s magnetic field performance was evaluated through simulation using Dar es Salaam City traffic flow conditions. Simulation results for vehicular detection and count showed 93% and 87% success rates during normal and congested traffic states, respectively. Travel Time Index (TTI) was used as a congestion indicator, where different levels of congestion were evaluated depending on the traffic state with a performance of 87% and 88% success rates during normal and congested traffic flow, respectively.

1. Introduction

Magnetic-based wireless sensor networks (WSN) offer installation and implementation costs flexibility advantage when used to monitor traffic flow in cities with chaotic traffic mostly in developing countries [1]. However, the major constraint is powering the sensors [2] which require an independent source away from the main power supply. Other challenges include cost and technological limitation [3, 4]. A vehicle detection wireless sensor node has four main components, namely, a sensor to sense physical signals modified by vehicles passing, a processor to process the sensed data, a communication unit to transfer the processed data to the base station for further processing, and an energy source [5, 6]. Conventional vehicle detection technologies, such as inductive loop detectors, are not preferable for large-scale deployment in developing country cities with chaotic traffic because they are intrusive and disruptive to traffic and have high installation and maintenance costs [5]. The advancement in microelectronics and MEMS technologies [7] provides an alternative solution where a single board wireless sensor node can be assembled combining all the necessary components with energy harvesting capability. This alternative can lower installation and maintenance costs when sensor nodes are located on the roadside, powered by a renewable energy source, and operated with energy-efficiency algorithms. Due to easy availability, installation, and maintenance of magnetic WSN, they can be installed all over the city road networks to perform traffic flow monitoring and management [8]. Therefore, a wireless sensor node processes the sensed data locally and sends traffic flow information to the base station hence optimizing bandwidth requirement [9, 10].

Most signal processing algorithms used for traffic flow monitoring in magnetic WSN were designed for developed countries traffic conditions where sensor nodes are buried under the road surface [11]. Developing countries face many challenges to implementing such systems. We observed that mostly in developing countries traffic monitoring systems should be cost-effective to realize and maintain. It is a big challenge to implement the sensor buried under the road surface due to economical and maintenance factors. The alternative and effective implementation strategy are to localize the magnetic wireless sensor nodes on the roadside, thus creating a new challenge in developing an effective algorithm for detection and extraction of traffic flow information.

This research deployed a newly developed wireless sensor node called KiliNode depicted in Figures 1 and 2. KiliNode is built based on the PIC24FJ128GC006 microcontroller which has a number of features suitable for high signal processing in energy efficient environment such as high-performance CPU:(i)17 bit × 17 bit single-cycle hardware fractional/integer multiplier(ii)32 bit by 16 bit hardware divider(iii)16 × 16 bit working register array

KiliNode integrated with HMC1052 AMR magnetometer from Honeywell has two-axis high sensitivity and is reliable for low field sensing which had the following characteristics:(i)sensitivity 1 mV/V/gauss(ii)resolution 120 nT(iii)maximum current consumption 0.5 A(iv)low voltage supply 1.8 V(v)set/reset strap current 0.5 A

Most signal processing algorithms based on magnetic field for vehicular traffic detection are deployed on sensor nodes buried under the road. The adaptive threshold detection algorithm (ATDA) is an efficient vehicle detection algorithm with high precision of 97%, but its classification scheme is not efficient having a low performance where the overall recognition rate is below 60% [12]. Its implementation depends mostly on sensors buried under the road surface to monitor single lane individually, which is demanding for multilane and chaotic environments. This drawback will be similar to all other intrusive algorithms based on ATDA such as magnetic sensors-based vehicle classification algorithm (MVSCA) [13, 14].

Earth magnetic fields depend on geographical location. The field strength differs from the North poles to the Equator. On the poles, the field is about 50,000 nT, and on the Equator, it is about 30,000 nT. Most detection algorithms using magnetic field were conducted in America and Europe with stronger Earth magnetic fields compared to East Africa which lies near the Equator with a less strong field. Therefore, the vehicular magnetic anomaly detection requires high-resolution sensors and alternative signal processing algorithms to extract desired traffic flow information.

3. Theoretical Model Formation

This work assumes that magnetic wireless sensor nodes are installed on the sides of the road, above the ground for traffic flow monitoring. When a vehicle travels along a road, it disturbs local ambient Earth’s magnetic field causing changes in its direction and strength. Magnetic wireless sensor node senses both Earth’s magnetic field and magnetic distortions due to vehicular ferromagnetic contents. The wireless sensor node is integrated with three axes anisotropic magnetoresistance (AMR) sensor [15] which is installed at Cartesian coordinates relative to the origin at the ground as depicted in Figure 3. A road link is located at Cartesian coordinates perpendicular to the origin . The vehicle at an instant location is moving along the road with speed . Magnetic wireless sensor node x-direction is aligned parallel with the road making an angle with Earth’s magnetic north on the horizontal x-y plane. Sensor node -direction is aligned perpendicularly to the road link in the horizontal x-y plane. Sensor node z-direction is aligned parallel with Earth’s magnetic downward component in a vertical z-y plane. Vehicular magnetic moment induced by total Earth’s magnetic field [16] has the same direction as inducing field.

The magnetic moment of any ferromagnetic object is caused by induced and permanent magnetization [17]. This research assumes that vehicles can be modelled as a dipole moment, which is influenced by only induced magnetization due to its soft-iron composition [15]. Each ferromagnetic part of a vehicle has its own induced moment based on the inducing field. The total magnetic moment of a vehicle is the vector sum of individual ferromagnetic part moments based on the inducing total Earth magnetic field . Therefore, the total induced vehicular magnetic moment is given by Equation (1). The shortest proximity distance between the wireless sensor node and vehicular current location at coordinate is given by Equation (2):where N is the total number of ferromagnetic parts within a vehicle, is the vehicle’s ferromagnetic part moment, is the vehicle’s ferromagnetic part volumetric susceptibility constant, is the vehicle’s ferromagnetic part volume, and is the total Earth’s magnetic field. The vehicle is travelling along a straight line (road) near an observation spot (magnetic wireless sensor node). Therefore, and can be treated as constant distances measured during wireless sensor node installation, and varies as the vehicle moves.

The vehicle can be considered as a dipole model if its total length is very small compared to a distance between its centre and observation spot. Basic expression for establishing the maximum amplitude of an anomaly due to the magnetization [17] is given bywhere T is the magnetic anomaly in nanotesla (), is the target magnetic moment in Ampere-meter2 (), is distance between observation spot and dipole in meters (), and is a measure of the rate of decay with distance or fall-off rate ( for dipole; for monopole).

The total magnetic anomaly of a dipole (vehicle) at distance from the vehicle to the observation spot (wireless sensor node) based on Equation (3) is given by the following equation:where is the total magnetic anomaly (vehicular target) due to magnetization, is the vehicular magnetic moment, and r is a proximity distance between a vehicle and wireless sensor node.

The dipole (vehicular target) magnetic anomaly can be resolved into two components in spherical coordinates at any distance r from the centre of a dipole with magnetic moment m on a radius that makes an angle to the dipole axis [17, 18]. As depicted in Figure 4, the magnetic anomaly has radial component and tangential component given in the following equation:

is an angle between vehicle instant position on the road and y-axis. When a vehicle is moving, changes depending on the current position and direction. When , r is the shortest proximity distance between a vehicle and the wireless sensor node. is the angle between vehicle current position in the x-y plane and .

The two anomaly magnetic components and are resolved into the horizontal component and the vertical component [19] as shown in Equations (6) and (7), respectively. In this case, the vehicle is moving along the road at a distance r away from the wireless sensor node:

Model formation established the localization of the magnetic wireless sensor node on the roadside for traffic flow monitoring. When a vehicle travels along a road, it disturbs local ambient Earth’s magnetic fields, causing its anomaly scattering in all directions [16]. The anomaly reaches the magnetic wireless sensor node and then senses and processes to extract vehicular signature and traffic flow information. However, locating the magnetic wireless sensor node on the roadside causes an increase in the proximity distance to the vehicle target resulting in the dipole anomaly field to weaken. Therefore, the wireless magnet sensor node with high resolution will give an added advantage when selected for traffic flow monitoring. Model formation showed how to extract magnet anomaly components in the horizontal and vertical directions. These fields are essentials in magnetic signal models for traffic flow monitoring.

4. Magnetic Signal Models

The construction of vehicular magnetic signals , , and at the respective direction of the wireless sensor node is presented. The signals are the functions of space and time. Figure 5 shows the summary of all the magnetic field components and their directions in a horizontal x-y plane and vertical z-y plane, respectively. Figure 5(a) shows horizontal x-y plane magnetic fields; Earth’s magnetic North , East , and horizontal are components of total Earth’s Magnetic field . is the declination angle between and . Wireless sensor node horizontal plane () is aligned at an angle with Earth’s magnetic plane (). Vehicular magnetic anomaly horizontal component is at an angle with sensor node East . Figure 5(b) shows vertical z-y plane magnetic fields; total Earth’s magnetic field is at an angle with the horizontal plane x-y. Earth’s magnetic downward component is a vertical component of . is a wireless sensor node downward component in a vertical plane x-y. is a vertical component of the vehicular magnetic anomaly. These fields are the basis of magnetic signal models to be sensed by the wireless sensor node for further processing and extraction of traffic flow information of the designated road network.

4.1. Anomalous Signal

Total magnetic signal observable at the magnetometer in the x-direction is composed of two magnetic field components: total Earth’s field horizontal component and horizontal vehicular anomaly . Both were aligned to the wireless sensor node North, given bywhere , , , and are functions of time and space; and are the angles of declination and the horizontal component of total Earth’s field , respectively; and is the angle between magnetic north and magnetometer north. This angle is measured during wireless sensor node installation. is a noise due to different environmental sources. According to research, the noise influencing the magnetometer is regarded as White Gaussian Noise, that is normally distributed [20]. The magnetic anomalous signal in Equation (9) depends on vehicular moment and sensor location relative to the moving vehicle.

4.2. Anomalous Signal

Total magnetic signal observable at the magnetometer in the y-direction is composed of two magnetic field components: total Earth’s field horizontal component and horizontal vehicular anomaly . Both were aligned to the wireless sensor node East, given bywhere , , , and are functions of time and space; and are the angles of declination and the horizontal component of total Earth’s field , respectively; is the angle between magnetic Earth’s North and magnetometer’s North ; and magnetic anomalous signal in Equation (11) sensed by the magnetometer depends on vehicular moment and sensor location relative to the moving vehicle .

4.3. Anomalous Signal

Total magnetic signal observable at the magnetometer in the z-direction is composed of two magnetic field components: total Earth’s field downward component and vertical vehicular magnetic anomaly . Both signals have the same downward direction as . The magnetic anomalous is given as follows:where , , and are functions of time and space; and are the angle of inclination and total Earth’s magnetic field; and magnetic anomalous signal Equation (13), sensed by a magnetometer, depends on vehicular moment and magnetometer location relative to the moving vehicle.

4.4. Anomalous Signal Graphs

Considering traffic monitoring in Dar es Salaam City located at latitude −6.8° and longitude 39.1°, the total Earth magnetic field at this geographical location is approximately 33,125 nT [21]. The magnetic sensor node (KiliNode) is located at z = 3 m above the ground and y = 5 m from the road. Assume sensor observability is between x = −30 m and 30 m. A small car such as the Toyota Vitz moves along the road (x-axis). The magnetic susceptibility of a ferromagnetic parts content of a car is quite high, 1000 [22]. Assume the wireless sensor node and road are aligned to the Earth magnetic North direction (). Figure 6 depicts magnetic anomalous field plots using Matlab; Figure 6(a) shows magnetic anomalous field sensed by the magnetic wireless sensor node in the x-direction and plotted against the vehicle position x. Figure 6(b) shows magnetic anomalous field sensed by the magnetic wireless sensor node in the y-direction and plotted against the vehicle position x. Figure 6(c) shows magnetic anomalous field sensed by the magnetic wireless sensor node in the z-direction and plotted against the vehicle position x.

5. Proposed Signal Processing Algorithm

Scanning and decision algorithm (SDA) is a novel energy efficient, time-domain signal processing algorithm for vehicular detection and extraction of traffic flow information such as count, speed, and Travel Time Index (TTI) based on three axes magnetic WSNs located noninvasive on sides of the road. This algorithm is a combination of mathematical and logical operations on the observed magnetic signal to extract output traffic flow information.

5.1. Algorithm Development

The magnetic anomalous signals , , and are sensed by the wireless sensor node in x, y, and z-direction, respectively, are sent into the system through the A/D converter block as depicted in Figure 7. The anomalous signal magnitudes are then converted to digital signal, respectively. From the A/D converter, the digital signals are then sent into the difference equation (moving average filter) and adaptive baseline blocks. The content of the input signal could be either baseline or anomalous . When the magnetometer senses Earth magnetic field without any moving vehicle, the signal captured is referred to as baseline, while when sensing Earth magnetic field together with the moving object the captured signal is referred to as anomalous. Adaptive baseline block is controlled by the error signal to identify whether the input signal is anomalous or baseline using logical operations:If , then If , then If , then

Baseline signals are updated and stored to be used by the difference equation block. Earth magnetic fields are not constant over a period of time. It is influenced by small fluctuation due to factors such as noise, magnetic storms, or temperature drift [21, 23]. Therefore, the baseline signals are updated periodically by repeating the logical operations at some fixed intervals of time.

Difference equation filters in Equations (14)–(16) are used to extract the error signal from anomalous and baseline signals:where n is the sample size; , and are the error signals; and, , and z are the anomalous signals sensed when vehicles are moving near the wireless sensor node. , , and are baseline signals sensed when no vehicle is moving near the wireless sensor node.

The square decimator block [5] is used to calculate the signal energy in Equation (17) and in Equation (18) from the error signals and and then put into the SDA blocks. Signal is used to deduce the vehicular direction, and therefore, it is not necessary to calculate its energy:

SDA logic has two blocks depicted in Figure 7: “SDA-scanning” and ”SDA-decision.” When the energy signal enters the SDA-scanning block, it is sliced into small segments , , and . Their width depends on the sampling frequency of the wireless sensor node . Each segment contains traffic flow raw data that will be used for further operations within SDA-decision block to extract vehicular traffic flow information.

5.2. SDA Finite State Machine

This section presents SDA state machine for calculating vehicle counts, speed, and TTI by using only a single energy signal . However, both energy signal and can be used for the same operation for high precision results.

5.2.1. Vehicular Detection, Count, and Average Speed

In the scanning state as depicted in Figure 8, the signal segment is tested whether it is anomalous by comparing the transition condition . If the transition is true, the detection is made by updating the detection flag , where is the current window. Otherwise, the operation will proceed to the decision state either Decision_1 or Decision_2 depending on the current value. In the decision state, there are three options in each depending on the transition condition: either Decision_11, Decision_12, Decision_13 or Decision_21, Decision_22, Decision_23. The Decision_11 or Decision_21 states are used to update vehicular count variable and increment period () counter . The Decision_12 or Decision_22 is used to calculate total observation time , average speed , and Travel Time Index . Decision_13 or Decision_23 states are used to increment period () counter . Finally, the Init_12 or Init_22 states are used to update local variables before completing and exiting the cycle. Vehicular speeds were calculated based on a single sensor node:where is the vehicle speed, is the average vehicle speed for vehicles, is the estimated vehicle length, and is the vehicle observation time by the wireless sensor node.

The main inputs into the algorithm are magnetic signals (, , and ) and the constant free flow speed . The main outputs are vehicle count and .

5.2.2. Congestion State

Traffic congestion can be described as the condition that occurs when the traffic flow demand exceeds by far the infrastructure supply resulting in long queues, travel delays, and increased travel costs [24]. Expressing the congestion state of a road segment is one of the key aspects of traffic flow monitoring. Many research works were conducted to study the congestion behaviour and formation. The challenges still remain due to the nonlinearity nature of congestion formation [24]. Selection of congestion metric is paramount; how do we measure the congestion state of a road network or city? This work adopted a congestion metric called , proposed by Schrank and Lomax [25], which is a ratio of travel time in the peak period to travel time at free-flow conditions while accounting for both recurring and incident delays such as traffic accident. It determines how long it takes to travel during a peak hour and uses both main and arterial travel rates. This index has the advantage of expressing traffic congestion in terms of space and time, given by the following equation:where is the Travel Time Index, is the average peak period travel time, is the free-flow travel time, is the free-flow travel speed, and is the average peak period travel speed. of 1.35 indicates a 20-minute free-flow trip takes 27 minutes at the peak. Note that free-flow speed of 50 km/h at arterial roads in Dar es Salaam is used in this study.

The can be understood by relating the value to a percentage. If the is 1, then the average travel time is the same as the free flow travel time, meaning there is no delay. If the is 1.5, then the actual travel time is 150% of the free flow time, or it takes 1.5 times longer to travel a road segment than it would under uncongested conditions. For this analysis, it was assumed that the cannot be less than 1, which occurs when the average speed is greater than . requires only two parameters on its calculation as shown by Equation (21) Therefore, the TTI computation is simple and suitable for deployment in the wireless sensor networks in an energy efficient environment.

6. Simulation

A simulator for traffic flow monitoring was developed using Matlab based on discrete-event simulation formalization [26, 27]. It simulates the proposed SDA algorithm and other wireless sensor events. Figures 9 and 10 show the simulator interfaces, respectively.

The simulation was conducted along a designated double road network of the city. The for the road system was set to 50 km/hour. The road segment was installed with four sensor nodes, one sink node, and TMC. Each sensor node detects a vehicular presence, travel speed, and count. It then computes and . These data are sent to the TMC so that the average and the vehicular count will be calculated and stored in the database periodically. The stored data are useful for estimating traffic congestion for the designated road network or city.

Perforated lines show the wireless communication links between sensor nodes based on the IEEE 802.15.4 protocol [28, 29]. Communication between a base station and TMC is achieved through mobile communication technology such as GPRS, LTE, or EDGE. The simulator has a specific discrete event to record manually vehicular counts, speed, and calculate TTI. The manual traffic flow data are used to validate the data from the wireless sensor node. The two road signs show the manual vehicle count over a road segment and a maximum free flow speed.

7. Results and Evaluation

The simulation was conducted for 30 minutes, where normal and congested traffic flows were simulated on eastbound and westbound lane, respectively, of the double road system.

Congested traffic flow results were plotted in Figure 11. Two sensor nodes were installed on eastbound lanes (nodes 1 and 5). Figure 11(a) shows vehicle count graphs performed manually and by sensor nodes 1 and 5. Figure 11(b) shows the TTI calculation graph done manually and by sensor nodes 1 and 5. The threshold line has TTI = 1, and the area above the threshold line represents high delays (congested) while below represents normal traffic flow.

Normal traffic flow was depicted in Figure 12. Two sensor nodes were installed on westbound lanes (nodes 2 and 6). Figure 12(a) shows vehicle count graphs performed manually, by the sensor nodes 2 and 6. Figure 12(b) shows the TTI calculation graph done manually and by the sensor nodes 2 and 6.

Table 1 summaries the performance based on traffic flow data captured by four sensor nodes with respect to the manual counts. The manual count was used to validate wireless sensor nodes performance. On the westbound, normal traffic flow was simulated and results on vehicular counts were 462 manually and 428.5 average counts on nodes. Therefore, the wireless sensor node missed 33.5 counts out of 462 during normal traffic flow. It is equivalent to 93% success rate. On the eastbound, congested traffic flow was simulated and results on vehicle counts were 1022 manually and 781 average counts on nodes. Wireless sensor nodes missed 241 out of 1022 during the congested traffic flow state. It is equivalent to 76% success rate.

Table 2 summaries the performance based on traffic flow data captured by four sensor nodes with respect to manual TTI calculation. Manual TTI was used to validate TTI based on wireless sensor nodes. During normal traffic flow, TTI of 1.1 for manual and 0.96 for wireless sensor nodes were calculated. Therefore, wireless sensor node showed 87% success rate. During congested traffic flow state, TTI of 2.8 for manual and 2.48 for wireless sensor node was calculated. Wireless sensor node showed 88% success rate.

8. Conclusion

This work proposed a novel traffic flow monitoring algorithm called SDA based on magnetic WSNs installed on the sides of the road above the ground. The model formation and performance evaluation of the proposed magnetic-based WSNs algorithm for vehicular traffic flow monitoring in a chaotic environment were studied. The performance evaluation of simulation results for traffic flow monitoring in chaotic cities of developing countries using SDA based on WSNs showed 93% vehicular detection and count success rate for the normal traffic flow state and 76% for the congested traffic flow state. Congestion state metric, TTI, was used to measure the congestion state of the road segment with a performance of 87% and 88% success rates during normal and congested traffic flow states, respectively. This research suggests further studies on microscopic and macroscopic mathematical algorithms to improve detection, especially during the congested traffic flow.

Data Availability

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

Conflicts of Interest

The authors declare that they have no conflicts of interest.