Artificial Intelligence & Data Science is coming soon

We're still writing and reviewing the notes for every subject, and we'll open it when every subject is ready. Meanwhile you can practise aptitude, ask Aria about any subject, or see the branches that are ready.

Location discovery

Location discovery in wireless sensor networks: how nodes find their positions using range-based (RSSI, ToA, TDoA, AoA) and range-free (centroid, DV‑Hop, APIT) methods, with equations, derivations, examples and common exam pitfalls.

Drafted with Aria, reviewed by the AiCanCode.org team · Updated . How we write and check our notes. Spotted an error? Use Give Feedback at the bottom of the page.

Why it matters

Location discovery (also called localization) tells each sensor node its physical coordinates. Engineers use it to tag sensed data with places (for monitoring, navigation, target tracking) and to enable position-dependent protocols (geographic routing, power control). Accurate, low-energy localization is central to many Wireless Sensor Network (WSN) applications and constraints.

Key ideas

  • Range-based localization — methods that use measured physical quantities that are a function of distance or angle (examples: RSSI, ToA, TDoA, AoA). These require hardware (timing, angle) or calibration (RSSI). Assumption: measurements are related to geometric distance/angle, subject to noise.
  • Range-free localization — methods that use connectivity, hop counts, or coarse information rather than explicit distances (examples: centroid, DV‑Hop, APIT). They trade accuracy for lower cost and simpler hardware.

Measurement techniques (definitions and short notes):

  • RSSI (Received Signal Strength Indicator) — measures received power; converted to distance via a path-loss model (requires knowledge of transmit power, antenna gains, and path-loss exponent). Strongly affected by multipath and shadowing.
  • ToA (Time of Arrival) — measures absolute time-of-flight of a signal between transmitter and receiver; distance = speed × time. Requires tight clock synchronization between transmitter and receiver (or two-way ranging to avoid global sync).
  • TDoA (Time Difference of Arrival) — measures difference in arrival times of two different signals at the same receiver (hybrid RF/ultrasound) or of the same signal from two anchors; eliminates need for absolute Tx–Rx sync in the hybrid case, but multi-anchor RF TDoA requires the anchors to be mutually synchronized. Requires known emission timing and known/contrasting propagation speeds (e.g., RF and ultrasound).
  • AoA (Angle of Arrival) — measures the incoming angle of a signal at an antenna array; requires directional antennas or antenna arrays and gives lines (angles) that intersect at the node.

Localization algorithms and geometry:

  • Trilateration — uses distances to three non-collinear anchors in 2D to compute unique position (intersection of three circles). In 3D, four non-coplanar anchors are required. If distances have noise, use least squares (multilateration).
    • Derivation commonly requested: subtract pairwise circle equations to obtain linear equations in x and y, then solve linear system (shown step-by-step below).
  • Multilateration (least squares) — more than the minimum number of ranges; formulate as overdetermined system and solve by least squares or maximum likelihood estimation assuming noise model.
  • Triangulation — uses angles (AoA) from two or more anchors; intersection of rays gives position.
  • Centroid (range-free) — node computes average of coordinates of all heard anchors (simple, coarse).
  • DV‑Hop (range-free) — anchors flood hop-counts; anchors compute average hop distance using known inter-anchor Euclidean distances and hop counts; unknown node multiplies its hop-count to anchors by average hop size to get estimated ranges, then uses trilateration.
  • APIT (Approximate Point-In-Triangle) — uses anchor triangles and tests whether a node lies inside; intersection of many triangle membership tests restricts location area.

Assumptions and error sources:

  • Models: log-distance path loss for RSSI; speed of light/propagation for ToA/TDoA; perfect angle estimation for AoA. Each model has parameters (path-loss exponent n, reference loss PL(d0), antenna gains) that may vary with environment.
  • Major error sources: multipath, non-line-of-sight (NLoS) bias, clock errors (for ToA/TDoA), coarse hop-count granularity (for DV‑Hop), antenna calibration (AoA), measurement noise.
  • Anchor placement: anchors should not be collinear (in 2D) and should surround the deployment region for good dilution of precision. Anchor density and geometry crucially affect accuracy.

What to draw for exam diagrams (describe exactly):

  • Trilateration diagram: draw 2D Cartesian axes, three circles centered at anchor positions A(x1,y1), B(x2,y2), C(x3,y3) with radii r1,r2,r3. Mark intersection point P(x,y). Label centers and radii.
  • AoA diagram: draw two anchors with rays (angles θ1, θ2) converging to node; label measured angles and intersection.
  • DV‑Hop flow: show anchors exchanging hop-counts, compute average hop size using distances between anchors, then node estimating ranges from hop counts.

Derivation (trilateration algebra, step-by-step):

  1. Circle equations: (x - x1)^2 + (y - y1)^2 = r1^2, (x - x2)^2 + (y - y2)^2 = r2^2.
  2. Subtract the second from the first to eliminate x^2+y^2 terms and get a linear equation: -2(x1 - x2)x - 2(y1 - y2)y = r1^2 - r2^2 - x1^2 + x2^2 - y1^2 + y2^2.
  3. Repeat with pairs (1,3) to get another linear equation.
  4. Solve the 2×2 linear system for x and y (Cramer's rule or matrix inverse). If more than three ranges exist, stack linear equations and solve with least squares.

Formulas

distance (ToA) = c * t — where c is speed of propagation (m/s), t is one-way time-of-flight (s). Applies when clocks are synchronized or two-way ranging is used. For two-way ranging with measured round-trip time tau and known turnaround delay delta, distance = c · (tau - delta) / 2. SI: meters, seconds. Δd = c · Δt — for single-signal TDoA across synchronized anchors (hyperbolic localization), where Δd is the difference of ranges to two anchors. For two different signals emitted simultaneously from the same transmitter with speeds v1 and v2 and measured at one receiver (hybrid TDoA), d = Δt / (1/v1 - 1/v2) (≈ v2 · Δt when v1 >> v2, e.g., RF vs ultrasound). SI units: m, s. Pr(d) (dBm) = Pt(dBm) - PL(d0) - 10·n·log10(d/d0) - Xσ — log-distance path-loss model; Pr = received power at distance d, Pt = transmit power, PL(d0) = path loss at reference distance d0, n = path-loss exponent (unitless), Xσ = zero-mean Gaussian shadowing term (dB). Applies for RSSI-distance conversion. (x - x1)^2 + (y - y1)^2 = r1^2 — circle equation: (x,y) unknown position, (x1,y1) anchor, r1 measured distance (m). A·p = b — linear system after subtracting circle equations, where A is 2×2 (or m×2) matrix, p = [x y]^T, b vector from radius and anchor coordinates. Solve p = (A^T A)^{-1} A^T b for least squares when overdetermined. avg_hop_size(ai) = (Σ_{j≠i} distance(ai,aj)) / (Σ_{j≠i} hops(ai,aj)) — in DV‑Hop each anchor ai estimates its own average hop distance using known inter-anchor Euclidean distances and hop counts; unknown nodes multiply their hop-count to anchor ai by this value and then use trilateration.

For each symbol: x,y coordinates in metres (m); xi, yi anchor coordinates (m); ri distance estimates (m); c ≈ 3.00×10^8 m/s for radio in air; exact c0 = 299,792,458 m/s (vacuum); t in seconds (s); Pt,Pr in dBm; PL(d0) in dB; n dimensionless; Xσ in dB; hops unitless.

Worked examples

  1. Trilateration (exam-style numeric, step-by-step) Given anchors A(0,0), B(6,0), C(3,8). A node has measured distances rA = 5.0 m, rB = 5.0 m, rC = 4.0 m. Find node position. Steps:
  1. Write circle equations: (x - 0)^2 + (y - 0)^2 = 5^2 => x^2 + y^2 = 25 (1) (x - 6)^2 + (y - 0)^2 = 5^2 => (x^2 -12x +36) + y^2 = 25 => x^2 + y^2 -12x +36 =25 (2)
  2. Subtract (1) from (2): (-12x +36) = 0 => x = 3.0 m.
  3. Use x in (1): (3)^2 + y^2 = 25 => 9 + y^2 = 25 => y^2 = 16 => y = ±4. Both signs possible from two circles; use third circle to disambiguate.
  4. Use third circle: (x -3)^2 + (y -8)^2 = 4^2 => (3 -3)^2 + (y -8)^2 =16 => (y -8)^2 =16 => y -8 = ±4 => y = 12 or y = 4.
  5. Intersection consistent gives y = 4. So node position is (3.0, 4.0) m. Final answer: (3.0 m, 4.0 m).
  1. ToA distance calculation (simple numeric) A node measures one-way time-of-flight t = 50 ns (50×10^-9 s) from a synchronized anchor. Using c = 3.0×10^8 m/s, compute distance. Formula: distance = c·t = 3.0×10^8 m/s × 50×10^-9 s = 15.0 m. Final answer: 15.0 m. (Notes: if clocks are not synchronized, two-way ranging or TDoA must be used.)

Optional short DV‑Hop numeric (steps omitted in exam unless asked): anchors compute avg_hop_size from pairwise distances and hop counts, unknown multiplies hop-counts by avg_hop_size to get estimated ranges and then runs trilateration (least squares) to find position.

Common mistakes

  • Using RSSI without environment calibration — path-loss exponent n and reference PL(d0) must be measured or assumed, otherwise distance estimates are poor.
  • Forgetting synchronization requirements for ToA (requires synced clocks) and TDoA implementation details.
  • Using only two anchors for 2D position; two ranges give two possible mirror points unless additional info is used.
  • Treating hop count as equal to Euclidean distance in DV‑Hop without estimating average hop size.

For your exam

Question types likely:

  • Definitions and differences (range-based vs range-free, list pros/cons).
  • Derivations (derive linear equations for trilateration by subtracting circle equations; show least-squares multilateration setup).
  • Numericals (compute position from three ranges; convert ToA to distance; estimate distance from RSSI using log-distance model — give parameters).
  • Short notes (explain DV‑Hop, centroid, APIT; discuss error sources and anchor placement). What full-mark answers include:
  • Clear definitions of terms used (anchor, trilateration, RSSI, ToA, TDoA, AoA).
  • Assumptions stated (synchronization, propagation speed, noise model where needed).
  • Step-by-step derivation with algebra (for trilateration show subtraction step and solving linear system).
  • Units on computed quantities and final numeric answers with correct significant figures.
  • Discussion of limitations and practical error sources.

Quick check

  1. What is the minimum number of non-collinear anchors needed for unique 2D trilateration?
  2. Which measurement does ToA provide directly: distance or angle?
  3. In DV‑Hop, what quantity do anchors compute and flood to nodes after getting pairwise hop counts? Answers: 1) Three. 2) Distance (via time-of-flight). 3) Average hop size (meters per hop).

Finished this topic? Mark it so your progress, study plan and readiness keep up.

Stuck on something here?