Skip to content

feat: Add BLE trilateration indoor positioning example. #413

@nedseb

Description

@nedseb

Target repository

This example should be created in micropython-steami-sample, not in micropython-steami-lib. BLE examples are not tied to a specific driver and belong in the sample repo.

What

Create an example that estimates the position of a mobile STeaMi board in a room using RSSI trilateration from 3 fixed beacon boards.

Why

Core of the indoor localization project. Applies the log-distance path loss model to convert RSSI to distance, then uses trilateration to compute a 2D position. This is the real-world application that ties together all previous BLE examples.

Suggested approach

  1. 3 beacon boards at known positions (e.g. corners of a triangle, coordinates hardcoded)
  2. Mobile board scans all 3 beacons simultaneously, reads RSSI for each
  3. Convert RSSI to distance using the log-distance path loss model:
    `d = 10 ^ ((RSSI_ref - RSSI) / (10 * n))`
    where `RSSI_ref` is the RSSI at 1 meter (calibrated) and `n` is the path loss exponent (~2-3 indoors)
  4. Trilaterate: solve the intersection of 3 circles to estimate (x, y)
  5. Display the estimated position on the OLED as a dot on a simple 2D map
  6. Show the 3 beacon positions as fixed markers

Learning goals

  • Path loss model and its parameters
  • Trilateration algorithm (least-squares or geometric)
  • Calibration procedure (measure RSSI_ref at 1 meter for each beacon)
  • Error analysis (why is indoor positioning imprecise?)

Hardware

  • 4 STeaMi boards (3 beacons + 1 mobile)
  • SSD1327 OLED on mobile board
  • Meter stick / tape measure for calibration

Depends on

Documentation

Write a pedagogical activity sheet for the STeaMi wiki covering:

  • Learning objectives (propagation model, trilateration, calibration, error sources)
  • Calibration procedure (measure RSSI at 1m for each beacon pair)
  • Mathematical background (path loss formula, trilateration equations)
  • Expected accuracy and discussion of limitations (multipath, obstacles, antenna orientation)
  • Extension ideas (fingerprinting, Kalman filtering, adding a 4th beacon)

Metadata

Metadata

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions