«Carles Gómez Josep Paradells José E. Caballero Edita: Fundación Vodafone España Autores: Carles Gómez Montenegro* Universitat Politècnica de ...»
15. Localization techniques and wireless sensor networks A sensor node is capable of obtaining one or more physical magnitudes such as the temperature or humidity of a certain place. This value has to be interpreted, either at the moment in which it is captured or later. In either case, the more information about the context of the measurement, the better will be the interpretation of the measurement. For example, if the measurements are taken by close sensor nodes, the measurements may be correlated to reinforce the sensed data, to eliminate faulty sensor nodes or to identify an estrange event (for example an increase in the temperature in one sensor can identify a localised fire). Location itself can be considered one of the most important context parameters to improve the usage of sensed data. In fact, the location of a node can constitute a sensed parameter. A sensor node can be used to provide location to other sensed physical variables, but also location can used to provide location to objects or persons carrying the sensor node or being sensed.
Location can either be physical (e.g. geographic coordinates, distance, etc.) or logical (e.g. the third floor of the C3 building, a campus, etc.). Logical location is more useful and, commonly, location applications derive logical locations from physical ones. In order to know the location of a node, there must exist a reference. If the reference is absolute, the location that can be derived will be absolute. Otherwise, the location obtained will be a relative parameter. One of most popular physical location techniques is based on the GPS system. However, it is not an adequate solution for certain type of WSNs applications because it is inaccurate (i.e. it exhibits higher error than
required), it cannot work indoors and it is power-hungry. The last limitation is disappearing as ultra low power receivers are being introduced in the market .
Location can be obtained by proximity, positioning or fingerprinting methods [2, 3]. Proximity relies on relating the node location with that of its closest reference or a set or close references. Positioning aims at determining the coordinates of the object. For this purpose, measurement of distance, angle or a combination of both can be used. Three-dimensional location requires three of these magnitudes (see Fig. 15.1 for examples of positioning). Fingerprinting is based on relating signal patterns to locations.
Fig. 15.1. Positioning using a) three distances (trilateralization), b) three angles (triangularization) and c) mixing measures of distance and angle The types of signals used in location are radio, infrared and ultrasound signals. Radio signals are available from the communications interface, while the other ones have to be transmitted and received on purpose.
Chapter 15. Localization techniques and wireless sensor networks Sections 15.1, 15.2 and 15.3 are devoted to the description of proximity, positioning and fingerprinting methods respectively.
15.1. Proximity location The simplest location approach is based on receiving reference signals and deciding the reference to which the signal with highest strength is received. The location of the node is the one of the reference. The signals used for this purpose are radio and infrared signals. As an infrared signal is not able to go across walls, this type of signal is used to assure the node is inside a room. The usage of radio signals in indoor environments has to pay special attention to two physical phenomena. The first one is the propagation of the signal across walls and ceilings, and the second one is the relation between signal strength and distance. Depending on the gain of the antennas (of both receiver and transmitter) and the effect on the surroundings (i.e obstacles, reflections), the received signal presents different signal strengths for locations at the same distance. With this uncertainty, it is difficult to map signal strength to distance, and as a consequence with proximity.
It is possible to combine more than one close reference to improve the precision in the location of a person of object by these type of system. For example, with three close references the location can be approximated by the center of mass or barycenter of the triangle defined by the three references (see figure 15.2).
15.2. Positioning Location by positioning is done using distances, angles or a combination of both. The usage of three distances is known as trilateralisation and the usage of three angles is known as triangularisation. As measured distances and angles have errors, it is quite common to use more than three signals to compensate errors using a multilateralisation. Fig. 15.3 gives an example of zone error when trilateralization is done with erroneous distances.
Fig. 15.3. Representation of the error area in a trilateralization with distances erroneously measured When using measures with error is quite common to employ a mean least square algorithm to provide an estimated location.
Measuring distances is done mainly performed by using radio and ultrasound signals. It is easy to measure absolute times or differences of times (by taking advantage of the sensor nodes clocks) with ultrasound signals, as they are characterized by a low propagation speed, equal to 330 m/s. These times can be converted into reception angles and distances, which in turn
Chapter 15. Localization techniques and wireless sensor networks
can be combined to offer the position with regard to references. Ultrasound signals cannot penetrate walls, their maximum range is typically fifteen meters and transmitters are quite directive. Location by using ultrasound signals requires the presence of at least three references per room.
However, they offer centimeter precision.
The measurement of the propagation time is commonly done with the help of a radio signal that is used to synchronize transmitter and receiver.
The ultrasound transmitter sends an ultrasound pulse and a radio signal towards its neighbours at the same time. As the propagation time for radio signals can be neglected in comparison to the employed by ultrasounds and also the short distances involved (several meters), the radio signal triggers a timer at the receivers that will count the time employed by the ultrasound signal to reach each neighbour node. This approach is used by systems like Cricket -, which is shown in Fig. 15.4.
Fig. 15.4. Cricket node
The directivity of the ultrasound transmitters and receivers with aperture angles from 30º to 60º is solved in some systems using different receivers and transmitters pointing to different directions. Systems such the one proposed in  use this solution.
Ultrasound receiver and transmitter can be integrated in the same device, but it is more common to used separate devices for each purpose.
Fig 15.5 shows an ultrasound device with separated transmitter and receiver.
When using narrowband radio signals, such as IEEE 802.15.4 ones, to measure distance, the most common approach is to use the relationship between attenuation and distance to estimate the distance from a reference. Commonly, this approach is also called RSSI-based. With three measurements of distance to a reference, a position can be calculated.
Because there are phenomena, in addition to distance, that affect signal propagation (see Chapter 3), distance estimation may be affected by errors of several meters if correction techniques are not applied. The Texas Instruments CC2431 chip provides software implementing this approach .
The RSSI based method can be used with short distances (several meters).
When a larger range is required the precision degrades. There exists an IC from Jennic, the JN5148  that offers a function for the measurement of the time of flight of the signal radio. The manufacturer claims the solution can be used as a complement to the RSSI method for larger ranges.
In order to obtain distance measurements based on the time of flight with centimeter precision, the IEEE 802.15.4a specification was developed, but at the time of writing this book, DecaWave announces a product  which is not commercialised.
When the number of references required is not available, it is possible to use mutual or derived location (also called multi–hop location in contrast to
Chapter 15. Localization techniques and wireless sensor networks
the presented location approaches classified as a one hop). This approach aims at finding the location of a number of sensor nodes based on a limited number of references and the relative locations that the nodes obtain among them. There exist several algorithms (see section 6 of ) that implement this technique, but they are too complex for sensor node capabilities.
Location by patterns, also known as fingerprinting, mainly uses radio signals, but the method can be used for any type of signal. It is based on a number of references which transmit different signals (generally at different frequencies) which cover the space where location has to be carried out.
Transmitters have to be placed in such a way that any place where a node can be located should receive the signals from different references. Systems using this method require a two phased procedure. In a first phase, the system has to be trained by creating a data base that includes the locations and signals received in a given point. This requires to take measurements at any place a node should be located, as well as to inform manually about the location associated with this set of measures. After this phase, the device to be located must continuously measure the reference signals and reports the signal levels to a central element. This element will search for similarities between the reported measurements and the ones stored in the data base for several positions. The location assigned to the object will be the one that has the measurements stored in the data base most similar to the current measurements.
The accuracy of this method depends on the calibration carried out and the number of reference signals. If the environment of radio propagation suffers changes, the location system must be calibrated again. Existing systems offer precision of various meters.
REFERENCES Vicontech GPS receiver.
 A. Boukerche, H.A.B.F. Oliveira, E.F. Nakamura, A.A. Loureiro, “Localization systems for wireless sensor networks”, IEEE Wireless Communications – Special Issue on Wireless Sensor Networks Vol. 14, 2007, pp. 6–12.
 G. Mao, B. Fidan, B. D. Anderson, “Wireless sensor network localization techniques”. Comput. Netw. Vol. 51, No 10, Jul. 2007, pp. 2529-2553..
 H. Balakrishnan, R. Baliga, D. Curtis, M. Goraczko, A. Miu, B. Priyantha, A.
Smith, K. Steele, S. Teller, and K. Wang, “Lessons from developing and deploying the Cricket indoor location system” MIT Computer Science and Artificial Intelligence Laboratory (CSAIL), 2003.
 N. B. Priyantha, A. Chakraborty, H. Balakrishnan, “The cricket locationsupport system,” in MobiCom ’00: Proceedings of the 6th annual international conference on Mobile computing and networking, (New York, NY, USA), pp. 32–43, ACM, 2000.
 Harry S. Sameshima, Edward P. Katz, Experiences with Cricket/Ultrasound Technology for 3-Dimensional Locationing within an Indoor Smart Environment, 2009.
 A. Nishitani, Y. Nishida, and H. Mizoguch, “Omnidirectional ultrasonic location sensor,” IEEE Sensors, Oct. 30, Nov. 3, 2005, pp. 684 - 697.
 cc2431 datasheet, http://focus.ti.com/lit/ds/symlink/cc2431.pdf  JN5148 datasheet:
http://www.jennic.com/files/product_briefs/JN-DS-JN5148-1v2.pdf  DecaWave ScenSor datasheet:
16. Middleware WSN middleware can be defined as a software entity which uses several communications and functional mechanisms, such as the ones described throughout this book, to facilitate the communication and coordination of distributed components in order to offer good service and correct operation to the applications running on top of a WSN. Therefore, middleware deals with management functionality (e.g. self-management, self-configuration), network reliability, quality of service, data management, energy management, etc. In short, middleware facilitates the development, maintenance, deployment and execution of WSN applications.
This chapter presents the current state of the art of middleware for WSNs. The contents are organized as follows: Section 16.1 points out the main differences between middleware for WSNs and middleware for traditional environments; Section 16.2 describes the components of a generic middleware solution for WSNs; Section 16.3 presents the main middleware system services; Section 16.4 shows examples of middleware solutions for WSNs and finally, Section 16.5 discusses the current status of middleware for WSNs.
16.1. Middleware for WSNs vs. middleware for traditional environments As previously explained (e.g. see Chapter 1), a WSN is a distributed system composed of nodes with limited resources (e.g. memory, processing power, link rate and battery). Programming such a network efficiently re
quires low level programming, which may be very complex. To deal with of this situation, new paradigms and tools have been developed by means of adding middleware software infrastructure, which constitutes the most common solution to facilitate the execution for a wide set of sensor applications on top of a wide set of heterogeneous underlying hardware platforms.
Thus, middleware in distributed systems (like a WSN) lies between the operating system and applications running on each node of the system, but also covers any device, network, database or application development framework connected to the WSN. This type of software has been compared to a “glue” that joins hardware, operating systems, network stacks and applications .