## 4 Road Sensing
### Detecting and Monitoring Moving Vehicles
#### 4.1.2 Anisotropic Magneto-Resistance (AMR) Sensors  
AMR sensors are the most common sensors for detecting vehicles because of their small size and detection properties [57, 58]. They are low power and provide accurate detections using low sampling rates of few Hz. The operation of these sensors is based on measuring the variation produced in the Earth's magnetic field by the ferrous elements of a vehicle, providing outputs for the X, Y and Z magnetic axes. Their range of detection is low, quickly fading out with the distance. Consequently, they are used to detect traffic on a single lane. One of their main drawbacks is that they are very sensitive to the orientation of the sensor and the lateral offset of vehicles with respect to the sensor, which noticeably affects the signature produced by vehicles. In addition, they are also sensitive to temperature which influences the detection threshold values, requiring frequent adjustments. The signature given by AMR sensors offers valuable information. A signature example can be seen in Figure 6, which corresponds to a sensor placed at the roadside. Besides detecting a vehicle, it allows determining the direction in which it travels inspecting the output provided by the magnetic axis longitudinal to the road. If the falling edge of the signal waveform occurs before the rising edge, the vehicle is traveling in the direction of the axis. Conversely, if the rising edge occurs first, the vehicle is traveling in the opposite direction to the axis orientation. AMR sensors can be placed either by the roadside or at the center of a lane. Placement at the roadside is more appropriate for detecting vehicles, since the Z axis produces a peak while the vehicle is inline with the sensor, and determining direction of travel. Location at the center of lanes requires to perforate the road in order to install the sensor node flush with the pavement surface and therefore they must withstand vehicles passing over them. To this end, encapsulations based on harsh plastic box as well as epoxy filling may be used as in [57]. Nevertheless, this placement produces more characteristicsignatures, with greater precision than the provided by other traditional sensors such as inductive loops. The drawback is that these signatures complicate vehicle detection since it is possible to either report two detections upon the passing of a vehicle or report a single detection for two consecutive vehicles. On the other hand, they are very useful for vehicle classification and re-identification purposes, which can be performed with higher sampling rates, up to 128 Hz. However, the sensitivity to the lateral offsets of vehicles may lead to improper classification if the lateral offset does not correspond to the one with which the reference signature was obtained. A possible solution consists of placing an array of sensors transversally on the lane and selecting, from all the measured signatures, the one that best matches any of the reference signatures [59]. In addition, this also improves the detection of small vehicles like motorcycles, which are only detected when they are closer to the sensors, requiring at least two sensors per lane [55]. The process of matching the signatures requires simple algorithms to enable real-time calculations at the nodes. It is based on obtaining simpler vectors of characteristic parameters from the signatures which can be used to simplify calculations. Representative examples are the Average-Bar and the Hill-Pattern transformations [60]. The former divides the signature into a fixed number of pieces and calculates the average value of each one, thus obtaining an easier but yet valuable simplification. The latter transforms the signature into a sequence of 1, 0 and \(-1\) values by comparing the slope of the signature with certain thresholds.