## 4 Road Sensing
### Detecting and Monitoring Moving Vehicles  
The detection of vehicles traveling on the roads is essential for most traffic safety and control applications. It is characterized by the low time available to detect a moving target, which is bound to the period during which a sensor reports an altered output because of the passing vehicle. In order to properly detect the vehicle at least one measurement must be performed during this period (more measurements for greater reliability), which must be higher than a predefined threshold value. For example, a 4 meters vehicle traveling at a maximum speed of 120 Km/h would require at least a 12 Hz sampling rate, provided that the vehicle produces a noticeable sensing output during all the period where it is close to the sensor; a higher sampling frequency would be required if the excitation of the sensor is not constantly over the chosen threshold value. The selection of the sampling rate is an important issue, since it has a considerable impact on power consumption. Low sampling rates promote the use of duty cycle schemes where both sensor and CPU may sleep while it is not necessary to perform any measurement. Consequently, the lower the sampling rate and the wake-up time of sensors and CPU are, the more energy efficient the system is. Note that there are a considerable number of applications that use cameras for vehicle detection, however we consider it out of the scope of this paper, since they usually involve image processing schemes that exceed the processing capabilities of wireless sensor nodes. An additional magnitude which can be measured by WSNs is velocity. Although it is possible to obtain the speed of a car using a single node it presents some difficulties according to the method that is employed. A straightforward solution consists of mounting two closely spaced sensors in the same node and computing speed as the quotient between their separation and the difference between detection times. However, in order to provide accurate results, the sampling rate must be very high, thus exhausting power reserves. There are more effective methods for computing speed with a single node, but they require additional information. For example, in order to obtain the speed of vehicles traveling in a platoon, the mean vehicle length is necessary [55]. Using collaborative processing nodes is a more appropriate solution in terms of power consumption since placing sensors at greater distances in separate nodes alleviates the inaccuracy introduced by inadequate sampling rates and minimal displacements of sensors from their optimal positions. At least two nodes separated by several meters are necessary to perform this calculation, though three nodes provide slightly more accurate estimations, since they allow to compensate errors introduced by computing and transmission delays [56]. Provided that the speed is known, it is possible to calculate the length of the vehicles, which can be used as a basic classifier, distinguishing between small, medium and large vehicles (or either between passenger car/minivan, truck, _etc._). In order to estimate this magnitude several measurements of a same vehicle are required from every single sensor, thus demanding an increase in the sampling rate. However, this must not necessarily increase power consumption since not all deployed nodes need to perform such estimation. Instead it is possible to increase sampling rates only when neighbor nodes detect an incoming vehicle, thus maintaining power consumption low as well as offering accurate length estimations. The estimation of the vehicle length requires almost no computations but gives a very rough classification. More complex classifications are feasible using the vehicle signatures which sensors may provide. The signature of a vehicle for a particular type of sensor is the variation in time of the sensor output that produces a vehicle traversing the sensing area.