wireless sensor node localization using spectral graph...

14
Wireless Sensor Node Localization Using Spectral Graph Drawing and Mesh Relaxation ABSTRACT This work approaches the problem of localizing the nodes of a distributed sensor network by leveraging distance con- straints such as inter-node distances or distances between nodes and a globally observed event. Previous work has shown this problem to suffer from false minima, mesh fold- ing, slow convergence, and sensitivity to initial position es- timates. Here, we present a localization system that com- bines a technique known as spectral graph drawing (SGD) for initializing node position estimates and a standard mesh relaxation (MR) algorithm for converging to refined position estimates based on the initial estimates. We describe our combined localization system in detail and build on previous work by testing these techniques with real 40-kHz ultrasound time-of-flight range data collected from 58 nodes in the Pushpin Computing network, a dense hard- ware testbed spread over an area of one square meter. To the best of our knowledge, this is the first instance of the spectral graph drawing technique being used with data col- lected from a real sensor network. We discuss convergence characteristics, accuracy, distributability, and future direc- tions, as well as compare the algorithm to previous results derived from a lateration-based localization solution. Keywords Sensor Networks, Localization, Mesh Relaxation, Spectral Graph Drawing, Pushpin Computing 1. INTRODUCTION Location services are a fundamental tool for any wireless sen- sor network. In most applications, the time and location of sensor data is relevant, and many classes of applications re- quire each node to know its location in a globally shared co- ordinate system. Achieving localization across many sensor nodes has been the goal of recent research in distributed sen- sor networks, where location-rich information such as net- work adjacency [20], radio proximity [22], or distance to a global sensory stimulus [33, 23] is leveraged to form a global coordinate system. These methods all place various distance constraints on the locations of node coordinates, forming a (usually non-linear) optimization problem. Localization can be boiled down to the general problem of drawing a graph given a set of vertices V and a set of edges E that connect certain vertices. A vertex may represent a sen- sor node or it may represent the location of a distinct global event detected by a subset of nodes in the network (e.g. the distance to a lightning strike or beacon). Edges represent the distances between vertices in the graph. These distances may be relatively precise (e.g., a sonar time of flight mea- surement) or coarse (e.g. a binary variable denoting whether two nodes are adjacent in the network). Together, the ver- tices and edges form a graph G(V,E). The goal of a local- ization algorithm is to determine the spatial coordinates of the vertices V given G(V,E). Assuming certain simplifying assumptions, linear solutions to the localization problem exist. In general, these simpli- fying assumptions take the form of each node determining its distance to each of a set of “anchor” nodes of known po- sition. Such linear anchor-based schemes include lateration [33] and bounding box methods including APIT [14] and min-max [26]. In contrast, anchor-free localization schemes are generally non-linear but do not rely on such strong assumptions. Non- linear algorithms used in this case include semi-definite pro- gramming [8], gradient descent [24], and metric multi-dimensional scaling (MDS) [27]. Non-linear schemes can handle a more general set of constraints (e.g. a network in without an- chor nodes or beacons with a priori knowledge of their co- ordinates), but a solution is not necessarily unique or even guaranteed. For example, a non-linear optimization algo- rithm may still converge to a solution that does not reflect the true physical topology of the sensor nodes, correspond- ing to a local minimum in the optimization landscape. See [25] for a more complete description of the solution degener- acy problem. Additional constraints, such network distance between nodes [12, 25], can be used to disambiguate the solution. However, even the existence of a unique solution does not guarantee that an optimization algorithm will con- verge. The best way to speed up convergence and avoid false solutions is to pick a good initial guess of the nodes’ actual coordinates and use this as a starting point for the optimization algorithm.

Upload: others

Post on 03-Oct-2020

4 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Wireless Sensor Node Localization Using Spectral Graph ...web.media.mit.edu/~joep/Outgoing/pushpin-sensys05-last.pdfactuator (an RGB LED). Of these, the phototransistor and ultrasound

Wireless Sensor Node Localization Using Spectral GraphDrawing and Mesh Relaxation

ABSTRACTThis work approaches the problem of localizing the nodesof a distributed sensor network by leveraging distance con-straints such as inter-node distances or distances betweennodes and a globally observed event. Previous work hasshown this problem to suffer from false minima, mesh fold-ing, slow convergence, and sensitivity to initial position es-timates. Here, we present a localization system that com-bines a technique known as spectral graph drawing (SGD)for initializing node position estimates and a standard meshrelaxation (MR) algorithm for converging to refined positionestimates based on the initial estimates.

We describe our combined localization system in detail andbuild on previous work by testing these techniques with real40-kHz ultrasound time-of-flight range data collected from58 nodes in the Pushpin Computing network, a dense hard-ware testbed spread over an area of one square meter. Tothe best of our knowledge, this is the first instance of thespectral graph drawing technique being used with data col-lected from a real sensor network. We discuss convergencecharacteristics, accuracy, distributability, and future direc-tions, as well as compare the algorithm to previous resultsderived from a lateration-based localization solution.

KeywordsSensor Networks, Localization, Mesh Relaxation, SpectralGraph Drawing, Pushpin Computing

1. INTRODUCTIONLocation services are a fundamental tool for any wireless sen-sor network. In most applications, the time and location ofsensor data is relevant, and many classes of applications re-quire each node to know its location in a globally shared co-ordinate system. Achieving localization across many sensornodes has been the goal of recent research in distributed sen-sor networks, where location-rich information such as net-work adjacency [20], radio proximity [22], or distance to a

global sensory stimulus [33, 23] is leveraged to form a globalcoordinate system. These methods all place various distanceconstraints on the locations of node coordinates, forming a(usually non-linear) optimization problem.

Localization can be boiled down to the general problem ofdrawing a graph given a set of vertices V and a set of edges Ethat connect certain vertices. A vertex may represent a sen-sor node or it may represent the location of a distinct globalevent detected by a subset of nodes in the network (e.g. thedistance to a lightning strike or beacon). Edges representthe distances between vertices in the graph. These distancesmay be relatively precise (e.g., a sonar time of flight mea-surement) or coarse (e.g. a binary variable denoting whethertwo nodes are adjacent in the network). Together, the ver-tices and edges form a graph G(V, E). The goal of a local-ization algorithm is to determine the spatial coordinates ofthe vertices V given G(V, E).

Assuming certain simplifying assumptions, linear solutionsto the localization problem exist. In general, these simpli-fying assumptions take the form of each node determiningits distance to each of a set of “anchor” nodes of known po-sition. Such linear anchor-based schemes include lateration[33] and bounding box methods including APIT [14] andmin-max [26].

In contrast, anchor-free localization schemes are generallynon-linear but do not rely on such strong assumptions. Non-linear algorithms used in this case include semi-definite pro-gramming [8], gradient descent [24], and metric multi-dimensionalscaling (MDS) [27]. Non-linear schemes can handle a moregeneral set of constraints (e.g. a network in without an-chor nodes or beacons with a priori knowledge of their co-ordinates), but a solution is not necessarily unique or evenguaranteed. For example, a non-linear optimization algo-rithm may still converge to a solution that does not reflectthe true physical topology of the sensor nodes, correspond-ing to a local minimum in the optimization landscape. See[25] for a more complete description of the solution degener-acy problem. Additional constraints, such network distancebetween nodes [12, 25], can be used to disambiguate thesolution. However, even the existence of a unique solutiondoes not guarantee that an optimization algorithm will con-verge. The best way to speed up convergence and avoidfalse solutions is to pick a good initial guess of the nodes’actual coordinates and use this as a starting point for theoptimization algorithm.

Page 2: Wireless Sensor Node Localization Using Spectral Graph ...web.media.mit.edu/~joep/Outgoing/pushpin-sensys05-last.pdfactuator (an RGB LED). Of these, the phototransistor and ultrasound

Figure 1: Pushpins are placed by hand on a 1.2-mby 1.2-m planar substrate that provides them withconnections for power and ground. Placing a push-pin node is as simple as pressing a thumbtack intoa cork-board.

In this paper, we discuss a promising method called spec-tral graph drawing to produce a set of initial coordinate es-timates given a set of distance constraints between nodes[17]. The resulting initial estimates closely approximate theactual spatial coordinates. Furthermore, this method hasbeen shown to be easily distributable regardless of the sizeof the network. These initial coordinate estimates and theset of distance constraints they were derived from subse-quently serve as the starting point for a combination meshrelaxation/lateration algorithm, which in turn arrives at afinal estimate of the position of each node in the network.

The distance constraints used in both the spectral graphdrawing and mesh relaxation algorithms can in principleoriginate from any number of sources (e.g. nearest neigh-bor received signal strength). The work presented here usestime-of-flight measurements between each node and a glob-ally observable ultrasonic “ping” event as distance constraints.Ping events are generated by a special handheld hardwaredevice (the “Pinger”) that simultaneously generates a flashof light and pulse of 40-kHz ultrasound at the press of a but-ton. Distance is measured as the time difference of arrivalbetween these two signals divided by the speed of sound. Al-though the Pinger is an artificial signal source, it is meantto emulate a global sensor stimulus that might appear ina natural setting. For example, lightning and thunder pro-vide a similar pair of stimuli that could be used to localize asensor network spread over the area of several square kilome-ters, as demonstrated by the NASA Kennedy Space Center[5]. In principal, any pair of signals with coincident timeand space origins and differing propagation speeds could beused to generate time-of-flight distance constraints. Muni-tions, fireworks, and gunshots are examples of phenomenathat generate flashes of light and audible wavefronts. Signalsalso propagate at different speeds through different materi-als. For example, it might be possible to measure the dis-tance to an explosion by detecting it both in the air andthrough the ground. Additionally, since the first pulse pri-marily serves to synchronize the sensor nodes, it is possibleto localize by measuring the time of arrival of a single signal

if the clocks of the sensor nodes are synchronized by someother means.

The localization scheme we propose here relies solely on dis-tance constraints generated by triggering the Pinger. Theseconstraints are sufficient for localizaiton: no prior knowledgeof the coordinates of any sensor nodes is required. Our lo-calization technique occurs in two stages. In the first stage,a small subset of nodes in the network are elected as an-chor nodes. Non-degenerate approximations of both the an-chor node coordinates and the ping event coordinates aresimultaneously estimated using the spectral graph drawingalgorithm. These coordinates are then used as the initialguesses in a mesh relaxation optimization algorithm thatrefines the positions of the anchor nodes and ping events.In the second stage, the remaining non-anchor nodes usethe estimated coordinates of the pings to infer their own po-sition using lateration. In addition, our localization schemeincludes pre- and post-processing steps for rejecting spuri-ous, outlying measurements in the sensor data.

The remainder of this paper describes the experimental setup,the constituent individual algorithms used in our localiza-tion scheme, the workings of the localization scheme as awhole, a quantitative characterization of the results of ourlocalization scheme, and directions for future work, includ-ing improvements, possible modifications, and open ques-tions.

2. EXPERIMENTAL SETUPDeveloping an algorithm on a sensor network is much likedesigning an electronic integrated circuit – much of the de-sign process is spent either in simulation or on a physicalprototype. Simulations can rapidly determine optimal sys-tem parameters and facilitate exhaustive testing over a widerange of inputs without invoking an expensive fabricationprocess. Such tests are impractical or too time-consumingto implement in a physical system. On the other hand, pro-totyping is essential for verifying that the design is robustto noise, non-isotropic signal propagation, part variability,processing and power limitations, and other non-ideal char-acteristics of the real world. We have capitalized on thestrengths of both of these approaches in our developmentof the Pushpin localization system. In this section, we givean overview of our platforms for hardware prototyping andsimulation.

2.1 Pushpin Computing Hardware TestbedThe Pushpin Computing testbed [31, 30] is a dense wire-less sensing platform with facilities for fast prototyping ofhardware and algorithms. See Figure 1. The experimentsand results presented in this paper made use of 58 Pushpinsensor nodes distributed randomly over an approximately1-m2 planar area. A single Pushpin node is shown in Figure2. The Pushpin name originates from the two metal pinsprotruding from the underside of each node from which thenode derives its power and ground connections. These pinsare pressed into a 1.2-m by 1.2-m board, where they makecontact with two parallel sheets of metal foil (which carrypower and ground) that are sandwiched between layers ofinsulating foam. A single Pushpin node measures 3-cm indiameter by 3-cm in height and consists of a modular stackof four circuit boards, one for each basic function of a wire-

Page 3: Wireless Sensor Node Localization Using Spectral Graph ...web.media.mit.edu/~joep/Outgoing/pushpin-sensys05-last.pdfactuator (an RGB LED). Of these, the phototransistor and ultrasound

Figure 2: A single Pushpin node, shown fully as-sembled with the ultrasound time-of-flight expan-sion module. Each node is approximately 3-cm indiameter.

less sensor node: power, communications, processing (eachnode is driven by a 22-mips, 8-bit 8051-core micro-controllermade by Silicon Laboratories [1]), and sensing.

The Pushpin platform is an unusually dense realization of awireless sensor network; a feature made possible by its useof infrared (IR) communication, which is easier to constrainto short distance than radio frequency (RF) signals. De-spite their high density, the Pushpins have only 10 networkneighbors on average (approximately 17% of the network),hence the Pushpins have a similar network topology to amuch sparser sensor network such as might be deployed “inthe wild.” However, whereas access to individual nodes in alarge sensor network may be limited by the very large areaover which it is distributed, the entire Pushpin network sitswithin arms reach of the sensor network developer, makingit ideal for rapid prototyping and testing of distributed, adhoc algorithms and applications. For example, new code canbe simultaneously uploaded to every node in the network inless than a minute via an IR spotlight connected to a PC[32].

2.1.1 Time-of-flight expansion moduleThe ultrasound time-of-flight (TOF) expansion module is asensing layer designed specifically for Pushpin localizationexperiments. It contains three sensors (a phototransistor,a sonar transducer, and an electret microphone) and oneactuator (an RGB LED). Of these, the phototransistor andultrasound transducer are used for localization, while themicrophone and LED serve as additional I/O. The moduleis shown attached to a Pushpin in Figure 2.

2.1.2 The Pinger

Figure 3: The “Pinger” delivers a simultaneous flashof light and burst of 40-kHz ultrasound. Each Push-pin can measure the difference in time of arrival ofthese two signals and thus calculate the distance be-tween itself and the Pinger.

Using the localization system developed in this paper, asensor network deployed in the field might use global phe-nomenon detected in common across several nodes, such aslightning strikes or exploding munitions, to aid it in ad hoclocalization. In order to test these algorithms on the Push-pin network, we developed a device that generates similarstimuli (a flash of light followed by an acoustic pulse) on amuch smaller scale. This device, which is referred to simplyas the “Pinger,” generates a simultaneous flash of light andburst of 40-kHz sonar. These signals are detected by thephototransistor and sonar receiver on the TOF Expansionmodule on each Pushpin. A Pushpin estimates its distanceto the Pinger as the time difference of arrival of these twosignals divided by the speed of sound in air (343.6 m/s at20oC). To generate a global stimulus for localization, thePinger is held somewhere (anywhere) above the Pushpinnetwork and triggered with the press a button. The Pingeris shown in Figure 3.

2.2 The Pushpin SimulatorThe Pushpin Simulator is custom software that emulates aPushpin network of between 10 and 100 nodes. Each virtualPushpin is given its own memory and a thread of executionon the host machine via POSIX threads. Pushpin threadsinteract by passing data packets to their nearest neighbors.This architecture closely resembles the distributed nature ofreal Pushpins, therefore code written for simulated Push-pins is very similar to code for Pushpins in the hardwaretestbed. Simulated Pushpins collaborate, share state, andrespond to sensor data by passing and processing networkmessages. In this respect, the Pushpin Simulator is moresimilar to high-level simulators such as HLSIM [2] or Swarm

Page 4: Wireless Sensor Node Localization Using Spectral Graph ...web.media.mit.edu/~joep/Outgoing/pushpin-sensys05-last.pdfactuator (an RGB LED). Of these, the phototransistor and ultrasound

[4] than low-level simulators such as NS-2 [3], which focuseson accurate simulation of network protocols, or Avrora [29],which provides a cycle-accurate, processor instruction levelsimulator.

The Pushpin Simulator lends itself to testing and debuggingad hoc localization algorithms. For example, the currentestimate of the nodes’ coordinates is graphically displayedduring all stages of the localization process. This is usefulfor monitoring the dynamics of the localization algorithm inways that would be inconvenient or impossible on a hard-ware platform. Common localization errors such as skewingor folding of the coordinate system, instability and oscilla-tion in the algorithm’s convergence, or nodes with outlyingcoordinates are easily recognized in the dynamic plot of theestimated coordinates.

The simulator allows easy control over the input to the local-ization algorithm; namely the ultrasound time-of-flight mea-surements. The simulator can either use real measurementsrecorded from the hardware testbed or simulated measure-ments generated according to some statistical model. Simi-larly, the placement of the simulated Pushpins in the virtualenvironment can be random, or set to the actual “groundtruth” positions of the real Pushpins in the hardware testbed.In essence, the simulator is capable of using completely re-alistic or completely simulated data.

3. LOCALIZATION ALGORITHMSWe employ three localization algorithms in the Pushpin lo-calization system: spectral graph drawing, mesh relaxation,and lateration. We focus here primarily on spectral graphdrawing and mesh relaxation, since they have received rel-atively little attention in the current localization literature.Lateration, which is a form of triangulation, is a compar-atively well-known technique for sensor network localiza-tion, therefore we will not cover it explicitly. The interestedreader should refer to [18] for an overview of lateration andother linear localization techniques.

3.1 Spectral Graph DrawingSpectral Graph Drawing (SGD) is a technique for producinga set of vertex coordinates in k dimensions given only aset of edge lengths that connect the vertices. The resultingcoordinates closely adhere to the constraints imposed by theedge lengths. Like multi-dimensional scaling, force-directedgraph drawing, and principal component analysis, SGD wasconceived as a technique to help visualize high dimensionaldata in a low dimensional space. The technique itself is quiteold, dating back to the work of Hall [13] in 1970. However,it has seen little use since that time and has only recentlybeen championed as a technique for sensor node localizationby Yehuda Koren[17] and Craig Gotsman[12].

3.1.1 Theoretical overviewA sensor network can be described abstractly as a set of ver-tices V = {V1, ..., Vn} and edges E = {〈i, j〉} that make upa graph G(V, E). Edges have associated weights wij propor-tional to the adjacency of two vertices Vi and Vj . The weightis larger if the vertices are more closely connected (e.g. ifthey are physical closer to each other). If two vertices arenot connected, wij = 0. It is significant that adjacency

is inversely related to distance. In practice, Koren recom-mends that a measured distance between two nodes can beconverted to an adjacency weight via wij = −exp(dij) orwij = 1

1+dij(we use the former mapping in our implemen-

tation)[17].

The connectedness of the graph can be summarized by plac-ing these weights in an adjacency matrix A, where

Aij =

0 i = j

wij i 6= j

Next, we define the degree of a node to be the sum theweights between itself and other nodes:

deg(i) =X

j

wij

The values of deg(i) are placed into a diagonal matrix Dsuch that Dii = deg(i).

These definitions allow us to formulate a 1-dimensional graphdrawing problem. Specifically, we would like to find a n-dimensional vector called x that contains the 1-dimensionalcoordinates of n vertices by solving the following constrainedoptimization problem:

x = argminx′

S(x′) (1)

given: xT Dx = 1,xT D1n = 0

where: S(x) = argminx

X<i,j>∈E

wij(xi − xj)2

Here, 1n is a vector of length n that contains only 1’s. Thereare two forces at play in this minimization problem. Mini-mizing S(x) tends to shorten the lengths between the ver-tices proportionally according to the weights wij , therebypulling the graph into the correct shape. At the same time,the constraint that xT Dx = 1 provides a repulsive force,preventing this minimization process from collapsing into adegenerate solution in which all edge lengths are all equalto zero. The second constraint, xT D1n = 0, is equivalentto saying that x should have a mean of zero. That is, itremoves translational ambiguity from the solution vector byforcing x to be zero-centered.

The presence of D in the constraints achieves what is calleddegree normalization of the solution vector x. Without it,a vertex that has a much lower degree than the rest (e.g.if it had missing measurements or had fewer constraints tobegin with) has significantly less attractive force acting onit in the minimization of S(x). As a result, it will be overlyseparated from its neighbors when its final coordinates arecomputed, and the remainder of the nodes will be closelyclustered in comparison. A degree normalized solution cor-rects for this, adding an extra repulsive force to nodes withhigher degrees, thus preventing them from bunching up atthe origin while one vertex with a substantially lower degreeis left as an outlier. Degree normalization is one of Koren’sprimary contributions in [17]. It is essential for creating awell-distributed layout of vertices that is useful as an initialguess for mesh relaxation.

The power of spectral graph drawing lies in the fact that thisminimization problem has a very convenient solution: The

Page 5: Wireless Sensor Node Localization Using Spectral Graph ...web.media.mit.edu/~joep/Outgoing/pushpin-sensys05-last.pdfactuator (an RGB LED). Of these, the phototransistor and ultrasound

vector of coordinates x that minimizes equation (1) accord-ing to the given constraints is the eigenvector v2 associatedwith the second largest eigenvalue of the matrix

Z =1

2(I + D−1A) (2)

A lengthy, though not complicated, proof of this can befound in the appendix of [17]. One notable detail, however,is that 1n is the eigenvector associated with the largest eigen-value of Z. The method for finding coordinates in a seconddimension is identical except that x is forced to be orthogo-nal to both 1n and v2. In this case, the solution is the eigen-vector v3 that is associated with the third largest eigenvalueof (2). Coordinates in a third dimension can be found if xis forced to be orthogonal to 1n, v2, and v3, and so on.

In essence, the problem of determining a geometrical lay-out for a set of vertices has been reduced to an ordinaryeigenvector computation. Many well-understood algorithmsexist for finding eigenvectors. In this case, power iteration[11] is an appropriate choice, since it is convenient to ap-ply the constraints at each step in the iteration (xT Dx = 1via normalization, xT D1n = 0 via Gram-Schmidt Orthogo-nalization). Koren’s spectral graph drawing algorithm withdegree normalization is based on this scheme. Pseudocodefor this technique appears in Algorithm 1.

Algorithm 1 Spectral Graph Drawing (adapted from [17])

function SpectralGraphDrawing( A - adjacency ma-trix , k - dimensions )% Computes u2, · · · , uk, the top (non-degenerate) eigen-vectors of D−1A

ε← 1.0e− 9 % Desired tolerencefor i = 2 : k do

ui ← randomui ← ui

||ui||

repeatui ← ui

% D - orthogonalize against previous eigenvectorsfor j = 1 : i− 1 do

ui ← ui − uTi Duj

uTj Duj

uj

end for

% Perform the power iteration stepui ← 1

2(I + D−1A)ui

% Normalizeui = ui

||ui||

until uTi ui < 1− ε

% Halt when direction change is negligible.end forreturn u2, · · · , uk

3.1.2 Distributed spectral graph drawingAn attractive property of spectral graph drawing is thatit can be formulated as a fully distributed algorithm thatrequires only neighbor-to-neighbor communication transac-tions. Gotsman and Koren demonstrate in [12] that the

power iteration technique is mathematically equivalent to di-recting a node to repeatedly move its estimated coordinatesto the centroid of the estimated coordinates of its neighbors.This technique, sometimes referred to as the diffusion tech-nique for localization [6], has also been developed by Balusuet. al.[9]. However, these researchers do not explicitly drawa connection to spectral graph drawing in their implemen-tations, and therefore do not benefit from the deeper theo-retical insight of the more mathematical formulation givenby Gotsman and Koren.

We have opted to implement a centralized version of this al-gorithm on a single node in our work because we have globalstate (the locations of the pinger events) that cannot beshared using only neighbor to neighbor interactions. How-ever, regardless of whether it is centralized or distributed,the result of running the algorithm is the same.

3.2 Mesh RelaxationA mesh relaxation algorithm aims to simulate a physical sys-tem of masses connected by springs. It is a useful approachto consider in a distributed system, since it only requirespassing of information between nodes connected by a springconstraint. In the common case where spring constraintsonly exist between nodes that can directly communicate,localization can be achieved without flooding the networkwith traffic.

Consider a graph, or mesh, with n vertices. Each vertex Vi

maintains an estimate Xi[t] of its own 3-dimensional spatialcoordinates. The goal of mesh relaxation is to incrementallyimprove the estimate during each discrete time step t. Dis-tances between some, but not necessarily all, vertices havebeen measured and recorded such that each vertex Vi retainsa set of measurements between itself and other nodes in themesh, Di = {dij}. Estimated coordinates can initially bechosen randomly or they can be selected using the resultsof the spectral graph drawing technique described in Sec-tion 3.1 (or by some other technique for generating a goodinitial guess such as inertial measurements integrated overtime[15] or an approximate coordinate system built usinglogical distance over the network [25]).

During each discrete time step in the relaxation process,every node computes the force acting on it due to the con-straints imposed by the positions and relative distances of itsneighbors. The force due to each neighbor is proportional tothe difference between the estimated distance (i.e. the normof the difference between two sets of estimated coordinates)and the measured distance to the neighbor. This is a vectorwith a magnitude and direction equal to

|fij [t]| = k(||Xi[t]−Xj [t]|| − dij)

∠fij [t] = ∠(Xi[t]−Xj [t])

In the equation above, ||·|| is the Euclidean norm and k is thespring constant that controls the speed of convergence of thealgorithm. We found the value of k must be tuned depend-ing on the number of vertices and the lengths of the distanceconstraints. If k is too large, the system will be unstable andoscillations will result. If it is too small, convergence will beslow. We found that k = 0.15 was appropriate in our simu-lation with 15 vertices (10 anchor Pushpin nodes and 5 pingevents) and average distance constraints of 1.0-m (distance

Page 6: Wireless Sensor Node Localization Using Spectral Graph ...web.media.mit.edu/~joep/Outgoing/pushpin-sensys05-last.pdfactuator (an RGB LED). Of these, the phototransistor and ultrasound

between Pushpin nodes and ping events). The sensitivityof k to the number of vertices and edges would certainly bea drawback to mesh relaxation in a system without a fixednumber of vertices and edge constraints, as we have.

The total force acting on a vertex is the sum of these in-dividual forces; Fi[t] =

Pj fij [t]. A node’s new coordi-

nate estimate is the sum of the old estimate plus this force;Xi[t + 1] = Xi[t] + Fi[t].

To measure convergence, the following definition of the stressin the mesh is used. For a given set of coordinates for a giveniteration of mesh relaxation, stress is computed as,

stress =Xi6=j

abs(||Xi[t]−Xj [t]||2 − dij)

As the estimated distance between nodes i and j approachesthe measured distance dij , the stress approaches zero.

4. LOCALIZATION SYSTEMOn their own, the algorithms described in Section 3 do notconstitute a complete localization solution. For example,the spectral graph drawing and mesh relaxation algorithmscan be considered anchor free in the sense that they do notrequire prior knowledge of any node’s coordinates in orderto find a localization solution, but they are relatively slowand the centralized versions of these algorithms (as we haveimplemented) do not scale well as the number of nodes in-crease. Lateration, on the other hand, is very efficient andscales well, however it requires that anchor nodes or beaconexist on the network.

The Pushpin localization system combines non-linear andlinear techniques. First, the flexible but computationallyexpensive spectral graph drawing and mesh relaxation al-gorithms are used to find the coordinates for a small set of10 anchor nodes as well as the coordinates of the 5 globalPinger events given only the distance constraints betweenthe anchor nodes and the global events1. This is referred toas the primary phase of localization. Once they are found,the coordinates of the global events are shared with the en-tire network. At this point, the remaining nodes, which arecalled passive nodes, have enough information to triangulatetheir position using lateration. This is the second phase oflocalization.

The Pushpin localization scheme also includes pre- and post-processing steps for minimizing the impact of spurious lo-calization errors due to bad range measurements. Such er-rors are common in real-world sensor data such as sonartime-of-flight measurements, which are prone to destructiveinterference, multi-path, and poor sensor calibration. Thecomplete Pushpin localization process is consists of five pri-mary phases. These are described in detail below.

A. Calibration Pushpin localization relies on ultrasoundtime-of-flight (TOF) measurements to generate distance con-straints for localization. It is reasonable to assume, there-fore, that the accuracy of the localization solution will be

1These numbers were chosen to ensure that there was suffi-cient information to find a unique localization solution. Theanalysis that motivated this selection can be found in [32]

closely tied to the accuracy of the ultrasound measurementsthemselves. Many effects come into play that degrade theaccuracy of the measurements, including dispersion, speckle,changing air currents, interference among ultrasound trans-mitters, and part variability. These errors fall into two broadcategories: (1) systematic errors that can be characterizedand mitigated by applying a calibration scheme to the sen-sor measurements, and (2) random errors that cannot beeasily corrected.

Our tests indicate that the largest source of systematic er-ror is due to a limitation of the TOF module sonar detec-tion circuitry, which consists of a fixed-threshold, uni-polarrising-edge discriminator. Ideally this circuit should detectthe sonar signal at some point within the first full cyle ofwhen it arrives at the Pushpin. This places the fundamentallimit on the precision of detecting a sonar signal at roughlyone full cycle of the sonar wave, or 1-cm. In practice, wehave found that the receiving transducer takes several cyclesto “ring up” to the discriminator threshold. This induces adelay that is proportional to the distance between the Pingerand the TOF module. We believe this phenomenon to be theresult of increasing dispersion of the ultrasound ping as thedistance between the Pushpins and the Pinger is increased.Based on a characterization of the error in measurementsmade over a range of distances between the Pinger and asingle Pushpin, we have devised the following linear calibra-tion scheme:

dcorrected = dtof − (0.022 ∗ dtof + 0.13)

This calibration model fairly simplistic. For example, whileit takes the effects of dispersion and systematic delays in thedetection circuitry into account, it accounts for neither theadditional sonar signal attenuation (and corresponding timedelay) that may result at different Pinger angles, nor thevariability of ring-up characteristics across different sonarreceiver parts. Nonetheless, the statistical distribution ofthe remaining TOF measurement error after calibration hasbeen applied is closely compatible with a zero-mean gaussianwith a standard deviation of 0.57-cm, though the plot didshow some evidence for broad tails and small asymmetrythat suggest other un-modeled sources of error.

B. Pre-processing Spurious outliers are caused by inter-ference and multi-path (reflections) of the sonar signal. Badmeasurements can foul the localization results if they are notdetected and rejected. In a sensor network, this must occurin a distributed manner. We have formulated a distributedmethod for rejecting outliers based on exchanging distancemeasurements between nodes in a one-hop communicationneighborhood. Every incoming ping is subjected to outlierrejection after the calibration has been applied. The processproceeds as follows:

After a Pinger event is detected, each node shares its mea-surement with its immediate neighbors. Correspondingly, itlistens and records the distance measurements shared by itsneighbors. Once a short time sufficient for all neighbors torespond has passed, each node compares its own distancemeasurement to the median of its neighbors’ measurements.If a node’s own time-of-flight measurement is more than 1.5standard deviations from this median, the measurement islabeled as an outlier. In essence, a node rejects a measure-

Page 7: Wireless Sensor Node Localization Using Spectral Graph ...web.media.mit.edu/~joep/Outgoing/pushpin-sensys05-last.pdfactuator (an RGB LED). Of these, the phototransistor and ultrasound

ment if it differs substantially from the measurements madeby its neighbors. This technique capitalizes on the implicitnotion that communication range roughly correlates to phys-ical distance in a wireless sensor network. Using this tech-nique, we have found that roughly 10 nodes out of 58 willreject at least one of five measurements during a localizationrun. If a node rejects too many measurements, it may nolonger have enough constraints for localization. If this is thecase, the node will withdraw from the localization process.On an average trial, 2 nodes out of 58 will withdraw for thisreason.

C. Primary localization During primary localization,a small subset of nodes on the network called anchor nodescooperate to estimate their own coordinates as well as thecoordinates of the global events generated by the Pinger. Adistributed, ad hoc election process selects 10 anchor nodesand 1 origin node that have five good (not outlying) rangemeasurements. The origin node is so named because it isarbitrarily assigned the coordinates (0, 0, 0). The origin alsoplays the unique role of collecting and storing the rangemeasurements of all the anchor nodes in a (n + k) × (n +k) diagonal adjacency matrix A, where n is the number ofanchor nodes and k is the number of Pinger events. Theentries in the adjacency matrix, Aij ; i = 1..n, j = n+1..n+k,correspond to the distances measured between the anchornodes and the global ping events. No distances are knownfrom anchor node to anchor node, or from pinger event topinger event, hence the upper left n×n and lower right k×kblocks of the matrix are filled with zeros, indicating thesedata are missing2.

Spectral graph drawing expects nodes closer to each other(more adjacent) to have a larger value in the adjacency ma-trix. Therefore, once all the distances have been collectedfrom the anchor nodes, they must be converted from dis-tances dij to weights wij via wij = −exp(dij) (see Section3.1). The spectral graph drawing algorithm then runs onthe origin node. It produces an approximate, fold-free set ofanchor and ping event coordinates. These are then refinedusing mesh relaxation, which also runs on the origin node.The optimization process just described is fairly efficient fora 15 × 15 adjacency matrix. An 8-bit microcontroller with128-kB of memory (for the adjacency matrix and temporaryvariables) and a 22-MIPS processor would be capable of run-ning both algorithms in under a minute. Hence, althoughthe origin node does the majority of the processing at thisstage, it need not be endowed with more processing powerthan any other sensor node in the network.

D. Secondary localization During primary localiza-tion, most of the nodes are passive; i.e. they collect time-of-flight measurements and reject outliers, but they do notparticipate in the primary localization process. However,when a passive node receives a broadcast from the originthat contains the coordinates of the global Pinger eventsthe second phase of localization begins. Passive nodes local-

2Alternatively, the system can be configured to fill the ad-jacency matrix with node-to-node constraints generated bylogical distance over the network (hop count) in addition toor in lieu of ultrasound time-of-flight measurements. In thiscase, the upper left n× n block of A will be populated withthese distance estimates.

ize with lateration, using the positions of the Pinger eventsas anchor points and the distances they have measured tothese events as constraints.

E. Post-Processing

After both primary and secondary localizations have com-pleted, the nodes must perform a final check to ensure theyhave not been assigned an unreasonable set of coordinates.Coordinate outlier rejection bolsters the measurement out-lier rejection done in the pre-processing phase of Pushpinlocalization. Once again, the implied physical proximity ofnodes that are neighbors on the network is used to detectwhen a node’s assigned coordinates grossly disagree withthe coordinates of its neighbors. The process proceeds intwo phases:

1. Once localization is complete but before a node val-idates its coordinates, it shares its estimated coordi-nates with its neighbors on the network. Correspond-ingly, its neighbors send their coordinate estimates. Asthe neighbors’ coordinates are collected, the node com-putes the distance between its own coordinates and thecoordinates of its neighbor. The median of these dis-tances is stored in a variable called dmedian.

2. Each node shares the value it has computed for dmedian

with its neighbors. As the node receives its neighbors’median distances, it computes the median of its neigh-bors’ dmedian. If this value is more than 1.7 time thenode’s own dmedian, it assumes it is an outlier andwithdraws from the localization process.

To put it more simply, if the dmedian of a node is more than1.7 times the median of its neighbors’ values for dmedian, itwithdrawals. This technique for distributed outlier rejectionrequires only two rounds of neighbor-to-neighbor communi-cation transactions.

5. RESULTSWe now present a characterization of the Pushpin localiza-tion system described in Section 4. The tests described be-low predominantly use real ultrasound time-of-flight mea-surements collected from our hardware testbed. Ultrasoundevents were generated by the Pinger device (Section 2.1.2),which was manually triggered at random locations withina hemisphere above the plane of the Pushpin network. Allpings occurred within 2-m of some Pushpin in the network.We collected 10 data sets, each consisting of five time-of-flight measurements per Pushpin. Data sets were down-loaded through the network to a PC, imported into thePushpin Simulator, and played back for a set of 58 simu-lated Pushpins. In each of the test configurations describedin the sections below, a total of 10 localization trials wererun per data set, yielding 100 sets of estimated coordinates.Before we describe the tests themselves, however, we brieflyestablish our methodology for assessing localization error.

5.1 Aligning Coordinates & Measuring ErrorThe localization system discussed in Section 4 currently hasno global coordinate reference. When Pushpin sensor nodeswork together to create a coordinate system, the result is

Page 8: Wireless Sensor Node Localization Using Spectral Graph ...web.media.mit.edu/~joep/Outgoing/pushpin-sensys05-last.pdfactuator (an RGB LED). Of these, the phototransistor and ultrasound

a relative coordinate system; i.e. a local coordinate systemin the frame of reference of the sensor nodes. In order toassess the accuracy of our localization system, a transfor-mation must be found that aligns the coordinates producedby the localization algorithms with a set of “ground truth”coordinates measured by hand. In our case, ground truth co-ordinates are obtained by photographing the array of Push-pins using a digital camera with a telephoto lens (to reducethe effects of image warping), and digitally extracting thecoordinates with custom image manipulation software. A0.1-m by 0.1-m square is included in the image for scale.

We refer to the coordinates generated by the localization al-gorithm as estimated coordinates while the “ground truth”coordinates are called measured coordinates. We considertwo techniques for aligning measured and estimated coordi-nates: (1) A transform comprised of only a translation, rota-tion, and possible reflection (RTR); and (2) a more generalhomogeneous affine transform that can also include scalingand shearing. When the fit is computed as in (1), we refer toit as an RTR fit. The fit computed as in (2) is referred to asan LLSE fit because the affine transformation can be foundmost easily by computing a linear least squares estimate. Atthe moment, these fits are computed by a PC that processesthe coordinates provided by the localization system.

5.1.1 RTR FitA RTR fit aims to minimize the mean square error betweenthe estimated and measured coordinates by applying sometranslation, rotation, and possible reflection. To simplifythe calculation, the centroid of the estimated coordinatesis translated to the origin. This centers the coordinatesat a point around which they can be easily rotated. Themeasured coordinate system is translated in a similar man-ner, placing its centroid at the origin as well. MATLAB’sfminsearch optimization function is then used to find theproper 3-D Euler rotation sequence that minimizes the meansquare error between the estimated and measured coordi-nates. This optimization is run several times; once for eachof the possible reflection matrices. The trial that achievesthe lowest error is taken as the correct reflection and rota-tion.

5.1.2 LLSE FitFinding the LLSE fit is a straightforward matter of findingthe linear least squares approximation. More explicitly, anaffine transformation A must be found that, given homo-geneous estimated coordinates (x, y, z, 1) in the estimatedcoordinate system, yields a pair of transformed coordinates(x′, y′, z′, 1) in the measured coordinate system. The goalis to minimize the average error between the transformed,estimated coordinates (x′, y′, z′1) and the measured coordi-nates (x, y, z, 1) over every node in the network. This canbe accomplished by solving the following linear system:

A

0BB@x1 x2 xN

y1 y2 ... yN

z1 z2 zN

1 1 1

1CCA =

0BB@x1 x2 xN

y1 y2 ... yN

z1 z2 zN

1 1 1

1CCAAX = B

where X is an array of untransformed, estimated coordi-nates and B is an array of measured coordinates. This over-

Network SGD TOF SGD Mesh RelaxationMean 5.53 3.07 2.12

Median 5.26 2.76 1.83Std Dev 2.84 1.87 1.42

Min 1.73 0.75 0.49Max 10.5 6.47 4.82

Table 1: Localization statistics for anchor nodesonly. These are averages over 100 localization tri-als that span 10 different Pinger configurations. Alldata is fit using the LLSE. Measurements are in cen-timeters.

determined linear system has a linear least squares solutionof the form:

A = BXT (XXT )−1 (3)

5.1.3 Measuring Localization ErrorAfter the estimated coordinates have been fit to the mea-sured coordinates using one of the above methods, the local-ization error can be assessed. The objective is to determinethe average error between the estimated, transformed coor-dinates (x′, y′, z′) and a set of measured coordinates (x, y, z)obtained manually by photographing the array as describedabove. We first define the error for a single node i:

ei =q

(xi − x′i)2 + (yi − y′i)

2 + (zi − z′i)2

The following mean absolute error metric can then be usedto compute localization error for n sensor nodes:

emae =

Pni=1 ei

n(4)

The variance σ2 (the square of standard deviation) of lo-calization error is computed using the following unbiasedestimator:

σ2mae =

1

n− 1

nXi=1

(ei − emae)2 (5)

Other statistics including the median, minimum, and max-imum values are computed in a similar manner using otherstandard statistical formulae.

5.2 Localization AccuracyWe are now ready to present a characterization of the Push-pin localization system. This analysis will be split into twostages. First, the localization accuracy of the anchor nodeswill be presented. This will provide insight into how wellthe spectral graph drawing and mesh relaxation algorithmsperform on their own, since anchor nodes localize exclusivelyusing these techniques. Next, we present localization resultsfor the entire network of 58 sensor nodes. These results willindicate how effective the Pushpin localization system per-forms as a whole.

5.2.1 Accuracy of Anchor Node CoordinatesThis test assesses the accuracy of anchor placement using thespectral graph drawing and mesh relaxation algorithms dur-ing the primary phase of localization. Error due to passive

Page 9: Wireless Sensor Node Localization Using Spectral Graph ...web.media.mit.edu/~joep/Outgoing/pushpin-sensys05-last.pdfactuator (an RGB LED). Of these, the phototransistor and ultrasound

0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 1.10.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

1

Localized Coordinates which have been fit to actual coordinatesusing a least mean squares approximation.Average Absolute Error = 1.14e−02 meters

X Coordinate (meters)

Y C

oord

inat

e (m

eter

s)

Figure 4: Estimated Pushpin coordinates gener-ated using the Pushpin localization system that havebeen aligned with measured coordinates via a LLSEfit. The crosses denote measured (ground truth)coordinates and the circles denote coordinates esti-mated by the localization system. The line connect-ing each cross to a circle indicates the correspon-dence between estimated and measured coordinates.Cyan colored nodes have been rejected as outliers.

nodes that are localized using lateration in the secondaryphase of localization are covered in Section 5.2.2.

Two variants of spectral graph drawing have been consid-ered. One uses only the hop count between anchor nodes onthe network as a distance metric to be used in the adjacencymatrix (we refer to this as network SGD), while the secondvariant uses more precise time-of-flight distance measure-ments (this is TOF SGD). In a third scenario, TOF SGDresults were refined using mesh relaxation. One hundred lo-calization trials (ten for each data set from the hardware testbed) were run for each of the three variants. Localizationstatistics were computed after each localization trial. Theaverage statistics over all trials are shown in Table 1.

One notable result in the table is that TOF SGD on its ownis only one centimeter less accurate than TOF SGD refinedby mesh relaxation. This suggests that spectral graph draw-ing is useful as a stand alone method for localization. Omit-ting mesh relaxation entirely would lead to a simpler, thoughslightly less accurate solution. Furthermore, network SGDachieves an accuracy that is roughly 0.5 times the averageinter-node spacing of the Pushpins – a level that is often suf-ficient since many sensor network applications only requirecoarse localization. Network SGD is particularly alluring be-cause relatively low localization error can be achieved basedon network topology alone.

0 0.005 0.01 0.015 0.02 0.025 0.03 0.0350

0.005

0.01

0.015

0.02

0.025

0.03

0.035

0.04

0.045

0.05

Error (meters)

Pro

babi

lity

Real Pings − PingerSimulated Pings − No ErrorSimulated Pings − Gaussian ErrorSimulated Pings − Gaussian Mixture Error

Figure 5: Statistical distribution of localization er-ror over 100 localization trials. Various sources oftime-of-flight measurements are represented. Theerror distribution observed using real data from thehardware testbed falls in between the distributionsfor simulated pings under a simplistic Gaussian er-ror model and a more representative Gaussian mix-ture error model for time-of-flight measurement er-ror.

5.2.2 Accuracy of Coordinates over all NodesThe anchor accuracy tests assessed how well spectral graphdrawing and mesh relaxation work to localize a small subsetof nodes on the network. The overall accuracy tests assessthe accuracy of the overall localization system described inSection 4. We begin by presenting Figure 4, which shows theresults of a typical localization trial on the Pushpin localiza-tion system that has been fit to the measured coordinatesusing the LLSE. The plot shows that the majority of nodesachieve very high localization accuracy, though five nodeswere not able to localize at all. Taken on its own, however,this plot does not give much insight into how consistent lo-calization results are from trial to trial.

Let us turn our attention to further tests. Two types of time-of-flight range measurement are considered here: (1) realpings recorded by the Pushpin hardware testbed, and (2)simulated pings generated by the simulator. Three differenterror models are used to generate simulated pings in thePushpin Simulator.

• No Error - Distance measurements are exact.

• Gaussian Error - Gaussian error with a variance of0.57-cm is added to all distance measurements.

• Gaussian Mixture (GM) Error - Random error with adistribution that is the combination of marginal gaus-sian distributions with different means and prior prob-ability is added to all distance measurements.

Using time-of-flight measurements with no error producesthe baseline accuracy of the localization system in the ideal

Page 10: Wireless Sensor Node Localization Using Spectral Graph ...web.media.mit.edu/~joep/Outgoing/pushpin-sensys05-last.pdfactuator (an RGB LED). Of these, the phototransistor and ultrasound

Real Pings Simulated PingsPinger No Error Gaussian Error GM Error

Mean 2.30 0.06 1.26 3.65Median 1.69 0.04 1.08 2.66Std Dev 2.36 0.07 0.82 2.99

Min 0.20 0.01 0.11 0.30Max 13.5 0.47 4.39 13.1

% Unlocalized 10% 0% 5% 3%

Table 2: Localization statistics for all nodes (anchors and passive nodes) averaged over 100 trial runs of thecomplete Pushpin localization system. All data is fit using the LLSE. Measurements are in centimeters.

case. The Gaussian error model is based on the charac-terization of the time-of-flight sonar measurements that wasbriefly discussed in Section 4. In these tests, the distributionof the random error that remained after calibration had acentral peak that was compatible with a zero-mean Guassianthat had a variance of 0.57-cm. However, this distributionalso showed evidence of heavy tails and a slight asymmetry.A mixture of gaussians was fit to this overall distribution inan attempt to better represent these tails. This mixture isthe basis for the GM error model.

Figure 5 shows the error distribution for various measure-ment sources over 100 localization trials. Outlier rejectionwas active throughout these tests. Table 2 shows variousstatistics averaged over the trials. It is interesting to notethat the median node error is lower than the mean node er-ror in every case. Figure 5 shows that this is because thedistribution of the error is asymmetric: the localization er-ror for most nodes is very low, but the average is inflatedby a few nodes that have unusually high error. In general,these are minor outliers that are missed by the outlier de-tection mechanisms. These outliers produce the heavy tailsin the distributions shown in Figure 5. In some cases, thetail extends out to several tens of centimeters (the tails weretruncated for better viewing of the distributions’ peaks).

It is instructive to compare the localization error using sim-ulated and real pings. First, it is reassuring that simulatedpings with no error lead to extremely low localization er-ror (0.06-cm)3. This ensures us that the mesh relaxationand lateration algorithms do indeed yield essentially exactresults when distance measurements are also exact. Next,it is reassuring to see that the error for localization usingreal pings is generally higher than it is under the simulatedpings with Gaussian error. This is to be expected, since theGaussian error model is a simplification of the actual mea-surement error. Furthermore, the difference in these valuesis less that one standard deviation. Also, the standard devi-ations of the real pings and the GM model pings (which moreaccurately model the true time-of-flight error) are similar.

5.3 Outlier RejectionIn this section we attempt to quantify the effectiveness of theoutlier rejection techniques introduced in Section 4. Outlierrejection allows the Pushpins to maintain high localizationaccuracy in the face of spurious errors in sensor measure-

3We believe that the unusual shape of the error distributionfor the “no error” error model may be due to instability inthe mesh relaxation process that occurs when the solutionis very near convergence.

ments. We separately consider two types of outlier rejectionused in the Pushpin localization system: (1) Rejection ofoutlying time-of-flight measurements prior to localization,and (2) rejection of outlying coordinate estimates after local-ization. However, we emphasize that both of these schemesshould be used in concert for best results.

5.3.1 Rejecting outlying time-of-flight measurementsLet us first consider the effectiveness of a preprocessing stepthat attempts to identify and reject bad time-of-flight mea-surements. Nodes reject measurements that grossly disagreewith the measurements made by their neighbors on the net-work. The threshold for rejection is the number of standarddeviations from the median of neighboring nodes’ measure-ments for a given global ultrasound event. In our test, wetried 10 different threshold values that varied between 0.5and 3.2. Ten localization trials were run for each thresholdvalue. The threshold for coordinate outlier rejection (thepost-processing step) was set to 10, which essentially turnsit off. The results for various threshold values is plotted inFigure 6.

Frame (a) in the figure shows the localization error for theanchors nodes only. The plot indicates that mean localiza-tion error can be halved if the rejection threshold is suffi-ciently low. The standard deviation of localization error isalso dramatically reduced when outlier rejection is active.Frame (b) shows a similar but less pronounced trend whenerror is considered over all 58 nodes. However, frame (c) ofFigure 6 shows that there is a trade-off to be made betweenthe desired localization accuracy and the number of nodesthat cannot localize because they have too many outlyingmeasurements. For thresholds less than 1.5, a significantnumber of nodes are barred from participating in localiza-tion.

5.3.2 Rejecting outlying coordinatesThe goal of coordinate outlier rejection is to remove nodesthat have been assigned coordinates that grossly disagreewith the coordinates of their neighbors. This test assesseshow localization accuracy and the number of un-localizedsensor nodes varies as a function of the coordinate outlierrejection threshold. The threshold was varied from 0.5 to 2.9in increments of 0.3 standard deviations. Ten localizationtrials were run for each threshold value. Figure 7 shows theresults. An increase in localization error and decrease in thepercentage of unlocalized nodes can once again be seen asthe threshold is increased.

5.4 Convergence of Mesh Relaxation

Page 11: Wireless Sensor Node Localization Using Spectral Graph ...web.media.mit.edu/~joep/Outgoing/pushpin-sensys05-last.pdfactuator (an RGB LED). Of these, the phototransistor and ultrasound

1 2 3

0

0.05

0.1

0.15

(a) Error for anchor nodes

Threshold

Mea

n A

bsol

ute

Err

or (

met

ers)

1 2 3

0

0.05

0.1

0.15

0.2

0.25

(b) Error for all localized nodes

Threshold

Mea

n A

bsol

ute

Err

or (

met

ers)

0.5 1 1.5 2 2.5 3 3.50

5

10

15

20

25

30

35(c) Percentage of nodes with too many outliers to localize

Threshold

% u

nloc

aliz

eabl

e no

des

Figure 6: The effects of a preprocessing step thatrejects outlying time-of-flight measurements. Thethreshold for rejection is the number of standarddeviations from the norm of a node’s neighobors’measurements. In Frames (a) and (b), the x marksthe mean for the ten trials, and the error bars showone standard deviation.

Our original motivation for employing spectral graph draw-ing in the Pushpin localization implementation was to avoidfalse mesh relaxation solutions that correspond to local min-ima in the optimization landscape. Throughout our tests,we have found that spectral graph drawing is extremely ef-fective in this regard. We did not observe a single instancewhere it was clear that mesh relaxation primed by spectralgraph drawing converged to a folded or malformed layout.However, we were quite surprised to learn that mesh relax-ation actually performed very well when initially with ran-dom coordinates as an initial guess. In trials where nodeswere placed randomly in a 1-m2 area, mesh relaxation con-verged to the correct solution for 48/50 trials, or 96% of thetime.

This result was unexpected, since it ran counter to ourintuition and the findings of other researchers [25]. Ourearly tests had also indicated that folding and false solu-tions would be a problem; in these tests, mesh relaxationconverged to a folded layout more than 50% of the time.However, these early tests constrained the nodes to relax ina plane, whereas our final implementation allows them tomove freely in 3-space. We postulate that this extra degreeof freedom considerably simplifies the optimization land-scape for mesh relaxation. Therefore, while spectral graphdrawing may not have been necessary to generate an initialguess in our final setup, it may still be useful in this regardin a more tightly constrained localization scenario. Inciden-tally, although spectral graph drawing has not turned out tobe critical for avoiding local minima in our setup, the results

0.5 1 1.5 2 2.5 3−0.02

0

0.02

0.04

0.06

0.08

0.1

0.12

0.14

(a) Error for localized nodes

Threshold

Mea

n A

bsol

ute

Err

or (

met

ers)

0.5 1 1.5 2 2.5 30

10

20

30

40

50

60

70

80

90(b) Percentage of rejected nodes

Threshold

% R

ejec

ted

Figure 7: The effects of a post-processing step thatrejects nodes with outlying coordinates. The thresh-old for rejection is the number of standard devia-tions from the median of a node’s neighbors’ coor-dinates. In figure (a), the x denotes the mean andthe error bars show one standard deviation.

in Section 5.2.1 suggest that SGD is accurate enough to beconsidered as a stand-alone localization technique.

5.5 Shearing and Scaling of theCoordinate System

The astute reader may have noticed that we have omittedthe localization error computed using the RTR fit in all ofthe results presented above. The reason for this is that thiserror is unusually high, often in the tens of centimeters.

This result is surprising and significant, especially consider-ing that error is consistently low when computed under theLLSE fit. The discrepancy between the LLSE and RTR re-sults indicate that there is a uniform scaling and shearing ofthe coordinate systems generated by the Pushpin localiza-tion system. This is corrected automatically by the LLSE fit,which computes a more general affine transformation thatcan correct for a uniform scaling and shearing in addition tothe usual translation, rotation, and reflection. The scalingand shearing of the coordinate system can be readily seenin Figure 9. The figure shows a localization trial that usedsimulated pings with no error. The final LLSE fit localiza-tion error for this trial was 0.09-cm, however the RTR fitlocalization error is 32.38-cm.

We were initially concerned that this shearing and scalingwas the result of a bug in our implementation. However,we have verified that the distance constraints imposed bythe time-of-flight measurements to Pinger events are satis-fied by these coordinates. For the trial depicted in the fig-ure, the largest disagreement between the measured time-of-flight distance to a Pinger event and the estimated distanceto the Pinger (that is, the norm of the difference between theestimated coordinates of a node and a Pinger event) is 0.01-cm. We currently believe that this implies that there is norigid, unique set of coordinates that satisfies the constraintsin the problem we have proposed.

This has significant implications. For example, the useful-ness of the coordinates generated by Pushpin localizationsystem is reduced. In particular, the sensor network cannotrun any in-network application that relies on the use of adistance metric that reflects physical distances in the real

Page 12: Wireless Sensor Node Localization Using Spectral Graph ...web.media.mit.edu/~joep/Outgoing/pushpin-sensys05-last.pdfactuator (an RGB LED). Of these, the phototransistor and ultrasound

world; a distance metric in our coordinate system would bedistorted since distances are not preserved under a skew-ing transformation. Fortunately, this is not necessarily asevere problem so long as the LLSE fit can be computed totransform the estimated coordinate system to coordinates insome global frame of reference that is free of skewing. Thisis possible if a the coordinates of a small subset of nodes isknown in both coordinate systems. This is not ideal, how-ever, since we would like our approach to work well withoutprior knowledge of a node’s position in any coordinate sys-tem.

Despite the difficulties it may cause, shearing and scalingof the localized coordinates is an important results of ourcharacterization. It suggests that a better understandingof the problem domain will be necessary in order to finda rigid set of coordinates. For example, it is possible thatthe a stricter set of constraints may come from a betterunderstanding of the theory of the rigidity of a graph. Anintroduction to rigidity theory as it applies to sensor networklocalization can be found in [28].

5.6 Comparison to previous researchThe Pushpin localization system presented in this paper isbased on an earlier lateration-only system implemented andtested exclusively on the Pushpin hardware testbed [33].As in the current work, the old system did not require an-chors to exist a priori, and range measurements were madebetween the Pinger and the Pushpin time-of-flight expan-sion modules. However, the old system assumed global pingevents were restricted to being triggered directly above somenode (any node) in the network. The node immediately be-low the Pinger then became an anchor node. With thisassumption, it was possible to pick a set of anchor nodes,determine their coordinates, and determine the range fromeach node to the anchor nodes using right triangle trigonom-etry. At that point, the lateration algorithm can be directlyapplied to localize the non-anchor nodes. The right angleconstraint was chosen because it is easily justified for a densesensor network: if the pinger is held at a random locationabove the Pushpin network, the inter-node spacing is smallenough that the pinger is not likely to be more than a fewcentimeters away from being directly above some node.

Using the lateration system, we achieved localization errorof 5-cm and an error standard deviation of 3-cm on thePushpin hardware platform. Furthermore, we demonstrateda simple localization-enabled application on our hardwaretestbed. Once all nodes had localized themselves, by refer-encing a common time-base, they individually simulated avisual “wipe” effect by animating a line that starts at x=-1meter and moves toward x=+1 meter parallel to the Y-axis.Once the line passed the position a node had localized to,the node changed color from green to red. The results of thisdemonstration visually verified that the nodes had been spa-tially localized. In essence, the localized sensor network wasbeing used as a simple display. Figure 8 shows a time lapseof the wipe demonstration.

Despite the fact that the ranging technology, calibration,and outlier rejection methods are all identical between theold and new localization systems, the localization error usingour new system is considerably lower than in the earlier

0 0.5 1 1.50.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

X Coordinate (meters)

Y C

oord

inat

e (m

eter

s)

(b) Coordinates after LLSE Fit

−0.5 0 0.5 1 1.5

0

0.5

1

1.5

X Coordinate (meters)

Y C

oord

inat

e (m

eter

s)

(a) Original (unfit) coordinates

Figure 9: The Pushpin localization system producescoordinates with a moderate but uniform amountof shearing and scaling, however the distance con-straints imposed by the Pinger events are not vio-lated. The shearing and scaling is completely cor-rected in the LLSE fit.

system. Furthermore, our new system places no restrictionon the location of the Pinger events.

6. FUTURE WORKThere are obvious avenues for improving our localizationresults. First, the ability to make use of more than fivePinger events could improve overall localization accuracy.This would be a simple extension, since the algorithms wehave used readily incorporate additional pings by increas-ing the size of the adjacency matrix. Utilizing extra pings,it should be possible to reduce average localization errorto roughly 1-cm, which is the theoretical limit on the ac-curacy for detecting an ultrasound signal using a unipolarrising-edge discriminator with a fixed threshold. While meshrelaxation has worked well in our tests, it is rarely chosenfor generic optimization problems because it converges rel-atively slowly compared to other methods. In our tests, ittook an average of 5,000 iterations of relaxation before themesh converged. Several more efficient approaches are wellknown in the field of optimization, and some of these haverecently been applied to the problem of localizing sensornodes. Some work in this area includes semi-definite pro-gramming [8], non-linear least squares [19], and distributedKalman filters [26]. A new version of the Pushpin localiza-tion system would likely utilize one of these methods.

A logical extension of our current approach of basing local-ization constraints on the distances to global sensor phe-nomenon might be called “ambient localization.” The keyidea here is that the localization system should rely as littleas possible on the mechanism for generating global stimuliand instead treat such stimuli as parts of the environmentrather than additional infrastructure. This work at leastshows progress toward this goal by obviating the need forprior knowledge of the absolute position of the source ofa pair of global stimuli. However, we would like to gener-alize our approach further by instead measuring the timeof arrival of a global signal. In this scenario, the absolutetime origin of the signal becomes another parameter to beestimated. The solution to this higher dimensional searchproblem requires additional constraints and more computa-tion, but these are readily available either from additionalparticipating nodes, or from additional global events. Thespectral graph drawing, mesh relaxation, and lateration al-

Page 13: Wireless Sensor Node Localization Using Spectral Graph ...web.media.mit.edu/~joep/Outgoing/pushpin-sensys05-last.pdfactuator (an RGB LED). Of these, the phototransistor and ultrasound

Figure 8: Although the localization system presented in this paper has only been implemented in the PushpinSimulator, an earlier localization system ran entirely online in the Pushpin hardware testbed. To test thissystem, which relied solely on lateration, we devised a simple visual demonstration meant to show that eachnode knows its spatial coordinates. In this sequence of images, a diagonal wipe can be seen entering fromthe -X direction propagating in the +X direction. The diagonal wipe effect is not a result of communicationamong nodes, but rather the result of all nodes sharing a global time base and coordinate system and usingthese to individually simulate the same moving wipe boundary.

gorithms all readily generalize to higher dimensional searchspaces.

Finally, having demonstrated a basic ability to localize nodesin our hardware testbed, several avenues for work on location-enabled sensor network applications now lay open to us.An obvious application of the Pushpin Computing platformwould be to create a compelling and visually complex displayapplication. As we mentioned in Section 5.6, we previouslyimplemented a distributed display application on our hard-ware platform using an early prototype of the localizationsystem that is presented in this paper. A more complexapplication might use the Pushpins for both simple shaperecognition and display. This line of research might eventu-ally culminate in the use of the Pushpin sensor network asdistributed retinal processor [21]. It has also been proposedthat location-aware, tightly synchronized nodes with weakradio transmitters may collaborate to beamform a strongerradio signal [16]. Such a network would be able to trans-mit information over a great distance to a remote receiver.Furthermore, highly accurate synchronization would makeit possible to employ the microphone-equipped nodes as anacoustic phased array [7, 10]. Such a system would demon-strate the ability to first localize itself, and then to furtherlocalize events in its environment, in this case audio sources.

7. CONCLUSIONWe have demonstrated that these algorithms work well to-gether in a unified system for localization that produces con-sistent results and low localization error, even when usingnoisy real-world sensor data. Our technique employs twonon-linear localization techniques, namely spectral graphdrawing and mesh relaxation, as well as the linear laterationalgorithm. Overall, the Pushpin localization system achievesa mean absolute error of 2.3-cm and an error standard devi-

ation of 2.36-cm when using ultrasound time-of-flight mea-surements with a simple rising-edge detector. Supplementaltechniques for outlier rejection have been shown to be veryeffective at decreasing localization error when constraintsare generated using data from real sensors.

8. ACKNOWLEDGMENTSOmitted for review purposes.

9. REFERENCES[1] Silicon Laboratories. http://www.silabs.com, 2003.

[2] Amorphous computing website.http://www.swiss.ai.mit.edu/projects/amorphous/,2005.

[3] The network simulator – ns-2.http://www.isi.edu/nsnam/ns/, 2005.

[4] Swarm. http://www.swarm.org/intro.html, 2005.

[5] U. Author. Efficient Processing of Data for LocatingLightning Strikes. Technical Brief KSC-12064/71,NASA Kennedy Space Flight Center, Unknown Year.

[6] J. Bachrach. Position determination in sensornetworks. to appear in Stojmenovic I (Ed), Mobile adhoc networking, John Wiley and Sons, 2004.

[7] S. Basu, S. Schwartz, and A. Pentland. WearablePhased Arrays for Sound Localization andEnhancement. In Fourth International Symposium onWearable Computers (ISWC’00), page 103, 2000.

[8] P. Biswas and Y. Ye. Semidefinite programming for adhoc wireless sensor network localization. InProceedings of the 2nd ACM international conference

Page 14: Wireless Sensor Node Localization Using Spectral Graph ...web.media.mit.edu/~joep/Outgoing/pushpin-sensys05-last.pdfactuator (an RGB LED). Of these, the phototransistor and ultrasound

on wireless sensor networks and applications, pages 46– 54, 2004.

[9] N. Bulusu, V. Bychkovskiy, D. Estrin, andJ. Heidemann. Scalable, ad hoc deployable rf-basedlocalization. In Grace Hopper Celebration of Womenin Computing Conference 2002, Vancouver, BritishColumbia, Canada., October 2002.

[10] J. Chen, L. Yip, J. Elson, H. Wang, D. Maniezzo,R. Hudson, K. Yao, and D. Estrin. Coherent AcousticArray Processing and Localization on Wireless SensorNetwork. Proceedings of the IEEE, 98(8), August 2003.

[11] J. W. Demmel. Applied Numerical Linear Algebra.SIAM, 1997.

[12] C. Gotsman and Y. Koren. Distributed graph layoutfor sensor networks. In Proceedings of theInternational Symposium on Graph Drawing, 2004.

[13] K. M. Hall. An r-dimensional quadratic placementalgorithm. Management Science, 17:219 – 229, 1970.

[14] T. He, C. Huang, B. Blum, J. Stankovic, andT. Abdelzaher. Range-Free Localization Schemes inLarge Scale Sensor Networks. In Proceedings of the 9thannual international conference on Mobile computingand networking, pages 81–95, 2003.

[15] A. Howard, M. J. Mataric, and G. Sukhatme.Relaxation on a Mesh: a Formalism for GeneralizedLocalization. In IEEE/RSJ International Conferenceon Intelligent Robots and Systems, Oct 2001.

[16] A. Hu and S. D. Servetto. dfsk: Distributed frequencyshift keying modulation in dense sensor networks. InProceedings of the IEEE International Conference onCommunications (ICC), 2004.

[17] Y. Koren. On spectral graph drawing. In Proceedingsof the 9th International Computing and CombinatoricsConference (COCOON’03), 2003.

[18] K. Langendoen and N. Reijers. Distributedlocalization in wireless sensor networks: a quantitativecomparison. The International Journal of Computerand Telecommunication Networking, 43(4):499 – 518,November 2003.

[19] R. L. Moses, D. Krishnamurthy, and R. M. Patterson.A Self-Localization Method for Wireless SensorNetworks. EURASIP Journal on Applied SignalProcessing, pages 348 – 358, 2003.

[20] R. Nagpal, H. Shrobe, and J. Bachrach. Organizing aGlobal Coordinate System from Local Information onan Ad Hoc Sensor Network. 2nd InternationalWorkshop on Information Processing in SensorNetworks (IPSN ’03), April 2002.

[21] F. Paillet, D. Mercier, and T. Bernard. SecondGeneration Programmable Artificial Retina. InProceedings of the IEEE ASIC/SOC Conference,pages 304–309, 1999.

[22] N. Patwari and A. O. H. III. Using Proximity andQuantized RSS for Sensor Localization in WirelessNetworks. In Proceedings of the 2nd ACMinternational conference on Wireless sensor networksand applications, pages 20 – 29, 2003.

[23] N. Patwari and A. O. H. III. Manifold learningalgorithms for localization in wireless sensor networks.In Proceedings of the 2004 IEEE Int. Conf. onAcoustics, Speech, and Signal Processing (ICASSP),May 2004.

[24] N. Patwari, A. O. H. III, M. Perkins, N. Correal, andR. O’Dea. Relative location estimation in wirelesssensor networks. IEEE Transactions on SignalProcessing, Special Issue on Signal Processing inNetworks, 51(8):2137 – 2148, August 2003.

[25] N. B. Priyantha, H. Balakrishnan, E. Demaine, andS. Teller. Anchor-Free Distributed Localization inSensor Networks. Tech Report 892, MIT Laboratoryfor Computer Science, 2003.

[26] A. Savvides, H. Park, and M. Srivastava. The Bits andFlops of the N-Hop Multilateration Primitive for NodeLocalization Problems. In Proceedings of the 1st ACMinternational workshop on Wireless sensor networksand applications, pages 112–121, 2002.

[27] Y. Shang, W. Ruml, Y. Zhang, and M. P. J. Fromherz.Localization from Mere Connectivity. In Proceedingsof the 4th ACM international symposium on mobile adhoc networking and computing, pages 201 – 212, 2003.

[28] A. So and Y. Ye. Theory of Semidefinite Programmingfor Sensor Network Localization. To appear in SODA2005, 2005.

[29] B. L. Titzer, D. K. Lee, and J. Palsberg. Avrora:Scalable sensor network simulation with precisetiming. In To appear in the proceedings of IPSN 2005,Fourth International Conference on InformationProcessing in Sensor Networks, 2005.

[30] UNDER-REVIEW. Pushpin Computing SystemOverview: a Platform for Distributed, Embedded,Ubiquitous Sensor Networks. In Proceedings of theInternational Conference on Pervasive Computing,2002.

[31] UNDER-REVIEW. Experiences and direction inpushpin computing. In Information Processing inSensor Networks, 2005. Special track on PlatformTools and Design Methods for Network EmbeddedSensors (SPOTS), 2005.

[32] UNDER-REVIEW. Localization and sensingapplications in the pushpin computing network.Master’s thesis, Massachusetts Institute ofTechnology, 2005.

[33] UNDER-REVIEW. Localizing a Sensor Network viaCollaborative Processing of Global Stimuli. InProceedings of the European Conference on WirelessSensor Networks 2005, 2005.