New Technologies

Prototyping an Indoor Tracking System

We ordered several ESP32 microcontrollers to explore using Bluetooth/BLE for indoor tracking applications in a dynamic environment.

Eric Zhang
September 21, 2018

A couple of weeks ago, I ordered several ESP32 microcontrollers at Leverege HQ to explore using Bluetooth/BLE for indoor tracking applications. The goal was to get a sense of how well (or poorly) these systems would perform in a dynamic environment.

Rapid Prototyping

I started out by flashing the ESP32s with example firmware in Arduino, to simulate iBeacons sending advertising packets from different locations around the office. A location engine needs to pull data from at least three sources to determine approximate location. This technique is called trilateration and is how GPS receivers pinpoint your location from satellites.

Image Credit:

I decided to run some experiments on this set-up with a Bluetooth scanner app on my smartphone since it would have most of the core functionality for indoor tracking and be much quicker to build than a custom app. With the app, I could see how Received Signal Strength Indicator (RSSi) values from the ESP32 boards changed as a function of distance.

Mobile app view of nRF Scanner (Image Credit: Leverege)

While the spatial resolution wasn’t superb, the RSSi values from these microcontrollers was good enough for determining near (1-3m), medium (3-5m), far (5-10m+) in relative terms. While walking around the three ESP32 boards set up in the office—nearer to and farther from each—these RSSi values adjusted enough that I could get a pretty good idea of where I was just from looking at my scanner app.

Current System Development

After enlisting the help of some other engineers and designers, we began working on an in-house demo of a Bluetooth powered indoor tracking system that would more closely match a real-world use case. We collaborated with Pure Engineering to send data from the hardware in our office to Google Cloud Platform, where we then analyzed the data to obtain the approximate BLE tag location. The next step was to project that approximate location onto a floor plan of our office to see what moving around looked like in real time.

System diagram of Indoor Tracking System Prototype (Image Credit: Leverege)

In our current prototypical system, BLE tags send out advertising packets once per second containing a unique MAC address to anything that's listening. The ESP32 boards listen for any and every Bluetooth signal in range and push those messages to the cloud alongside additional details including the RSSi value of any tags that we're tracking. From there, we can filter out Bluetooth devices that aren’t demo-related (e.g. Tiles or wireless headphones) and begin to process demo-related data by taking into account RSSi values with respect to each ESP32 board and the physical locations of the ESP32 boards. Using nearest RSSi as a metric, we're able to determine relative location and process it to reduce positioning error before being sent to a web app for display.

System diagram of Indoor Tracking System Prototype (Image Credit: Leverege)

Future System Development

While the current indoor tracking system works fairly well as a tech demo, we plan to continue tweaking and adjusting our location engine in the future. There are two ways that we can make significant improvements: first, by incorporating other technologies (e.g. WiFi, RFID, and ultra-wideband signals); second, by augmenting our technology-agnostic location engine to apply advanced machine learning and data fusion techniques to provide highly accurate indoor positioning data. The location engine will combine all the signals and determine the location based on the surrounding environment. For example, ultra-wideband, which covers a wide area, can be incorporated to provide more precise live location & movement history within a building, while RFID can log assets more precisely into “checkpoints.” This both complements location engine accuracy and enables location confirmation from an asset management perspective.

Eric Zhang

Director of Data Science

Eric enjoys experimenting with all sorts of development hardware. As a former teaching assistant, workshop coordinator, and Microsoft Student Partner, he is constantly searching for better ways to deliver educational tech content to the masses.

View Profile

Explore More from the Publication