Indoor Positioning Using iBeacon and ESP32

Bluetooth beacons advertising iBeacon can be used to perform indoor locating using trilateration. Trilateration is where three receivers are used to measure signal strength (RSSI) to calculate the position.

It’s possible to use ESP32 single board computers as Bluetooth receivers. The GitHub project iBeacon-indoor-positioning-demo has an example open source implementation. There’s also an accompanying blog post.

The implementation uses MQTT to send the data to a React app on a server where it’s displayed on a floorplan.

In practice, you might want to consider creating a more robust solution that uses Bluetooth gateways rather than ESP32 devices. There’s also the Bluetooth AoA Direction Finding standard that’s more accurate than using RSSI.

Using Multi Bluetooth iBeacon Trilateration For Increased Accuracy

There’s a new paper from the journal Telkomnika Telecommunication, Computing, Electronics and Control on Smartphone indoor positioning based on enhanced BLE beacon multi-lateration (pdf). The paper by Ngoc-Son Duong of Vietnam National University describes a relatively simple method to improve location accuracy.

The paper starts by describing trilateration and the author voices the opinion that another method, fingerprinting, requires a lot of effort and isn’t feasible for practical implementation.

The new method makes use of the fact that accuracy is usually good when the received signal strength (RSSI) is -70 dBm or better. The use of more beacons and basing calculations on ‘reliable circles’ of higher signal strength, when available, provides for more accuracy.

The data is also filtered using a Kalman filter to reduce signal noise by about 37%.

Read about Determining Location Using Bluetooth Beacons

Indoor Navigation Using Bluetooth LE

There’s a new article from the Icontech International Journal of Surveys, Engineering, Technology on Indoor Position Routing (IPR) and Data Monitor Using Bluetooth Low Energy Technology by researchers at the Hasan Kalyoncu University, Institute of Science, Electrical & Electronics Engineering, Gaziantep, Turkey.

This article is different because it considers navigation as opposed to just locating. It explains the advantages of Bluetooth LE over WiFi and also compares with RFID:

Trilateration, Received Signal Strength Indicator (RSSI) and Decibel-milliwatts (dBmW) are explained and how these fit into locating position.

The article describes a system created for navigation that uses iBeacon sensor nodes, an Android device and app.

Read Determining Location Using Bluetooth Beacons

Read Using Beacons, iBeacons for Real-time Locating Systems (RTLS)

Learn About Indoor Positioning

There’s a recent paper Review of Indoor Positioning: Radio Wave Technology that provides a great overview of indoor positioning technologies.

From a hardware perspective it covers, RFID, UWB, Bluetooth, ZigBee, IR, WiFi, ultrasonic and hybrid systems. There’s a useful comparison table of the various technologies:

The paper describes methods of using radio signals to determine position such as RSSI ranging, trilateration, angle of arrival (AOA), round trip time of flight (RTOF), phase of arrival (POA) and time of arrival (TOA).


It also describes methods such as fingerprint localization.

A Comparison of Beacon Locating Methods in a Retail Store

There’s a recent paper by researchers at the Department of Management Science and Technology, Athens University of Economics and Business on An Ensemble Filter for Indoor Positioning in a Retail Store Using Bluetooth Low Energy Beacons.

The paper starts with an overview of indoor positioning techniques including trilateration, fingerprinting, dead reckoning and AI machine learning. It also provides a synposis of different technologies such as RFID, WiFi and Bluetooth.

The paper explains that while fingerprinting is widely used, it faces limitations when used in dynamically changing environments. Fingerprinting requires ongoing maintenance and updating of the reference fingerprinting map that’s manually intensive and time-consuming. Fingerprinting also requires a large number of beacon reference points to perform accurate locating.

The researchers looked into positioning within a two floor (grocery) retail store. Retail stores are of of the more challenging environments as there are shoppers moving about that can affect indoor localisation

Several indoor positioning techniques were considered including fingerprinting and trilateration. The researchers implemented fingerprinting and compared it to seven established classifiers. The random forest algorithm worked the best and inspired the authors to build an ensemble classification filter with lower absolute mean and root mean squared errors.

iBeacon Deployment Performance Evaluation

There’s recent work by researchers at Hong Kong Polytechnic University on Performance Evaluation of iBeacon Deployment for Location-Based Services in Physical Learning Spaces.

The paper examines signal availability, signal stability and position accuracy under different environmental conditions. The aim was to provide recommendations for iBeacon deployment location, density, transmission interval and fingerprint space interval. While the research considered beacons in teaching and learning environments, the conclusions are also applicable to other situations.

The paper describes positioning using the trilateration and fingerprinting methods. Experiments were performed in a 3.44m to 1.80m classroom to determine optimum beacon placement density.

The main conclusion was that greatest signal attenuation and variation was caused by pedestrian traffic blocking the line of sight between iBeacon and receiver. High temperature and strong winds also caused minor discrepancies to the signals. Trees and nearby vehicle traffic didn’t have any negative effects on the signals.

Deployments should consider the line of sight as the first priority. For the above mentioned room size, positional accuracy increased when the number of beacons was increased from three to eight. Using more beacons didn’t improve accuracy. An average spacing of 4.4m is recommended for iBeacon deployment. A settings of 417ms transmission interval is advised as a compromise between battery life and positional accuracy.

Read Determining Location Using Bluetooth Beacons

Improving iBeacon Location Accuracy

There are lots of ways of processing Bluetooth signal strength (RSSI) to determine location. Being based on radio, RSSI suffers from fluctuations, over time, even when the sender and receiver don’t move.

The College of Surveying and GeoInformatics, Tongji University, Shanghai , China has new research on iBeacon-based method by integrating a trilateration algorithm with a specific fingerprinting method to resist RSS fluctuations.

Trilateration and fingerprinting are common techniques to improve location accuracy based on RSSI. The paper improves on these by using analysis based on Kalman filtering of segments delimited by turns. This is used to derive locations based on pedestrian dead reckoning.

The researchers achieved a positioning accuracy of 2.75m.

Read about Determining Location Using Bluetooth Beacons

Read about Using Beacons, iBeacons for Real-time Locating Systems (RTLS)

Using iBeacons for Locating Robots

Beacons are great for use with robots for use in determining extra contextual information. There’s recent research on Autonomous Navigation of an Indoor Mecanum-Wheeled Omnidirectional Robot Using Segnet (pdf) that uses iBeacons to determine a rough location of the robot.

The locating uses Kalman filtering and trilateration to get a fix for the robot.

If you want to learn more about using RSSI to determine robot location there’s also a presentation video Robot Localization using Bluetooth Low Energy Beacons RSSI Measures by David Obregón Castellanos.

Read about Using Beacons, iBeacons for Real-time Locating Systems (RTLS)

Trust Range Method of Improving Location Accuracy

A mentioned in our post on location accuracy, two methods of improving accuracy are calibration and trilateration. There’s a recent research paper on iBeacon indoor localization using trusted-ranges model, that explores an alternative ‘trusted-ranges’ method. The method is still based on the RSSI measurements between the beacon and detector. It builds up a trusted-range model to describe how the RSSI varies over time and distance.

The model supplies reliable ranges of received signal strength values from nearest neighbours classifying received signal strength values into various levels of range. It performs better than calibration, especially at shorter ranges, while having a low complexity and hence computationally fast speed.

iBeacon Microlocation Accuracy

Customers often ask us the accuracy when locating beacons. In order to get the answer, its necessary to understand different ways of locating and the tradeoffs that are needed to get the different levels of accuracy.

There are two types of locating, received signal strength (RSSI) based and angle of arrival direction finding (AoA).

Locating using RSSI

There are two main scenarios. The first is a where the detector, usually a phone or gateway, is at a known location and the beacon moves. The second is where the beacons are fixed and the detector moves. Either way, the detector receives a unique beacon id and the receiving electronic circuitry provides the strength of the received signal.

The value of the RSSI can be used to infer the distance from the detector to the beacon. The main problem with RSSI is that it varies too much, over time, to be used to accurately calculate distance. The direction also isn’t known when there’s only one beacon and one detector. The varying RSSI, even when nothing is moving, is caused by the Bluetooth radio signals that are reflected, deflected by physical obstacles and interfered with by other devices using similar radio frequencies. Physical factors such as the room, the beacon not uniformly emitting across a range of 360 degrees, walls, other items or even people can affect the received signal strength. How the user holds a detecting phone can affect the effectiveness of the antenna which in turn affects the signal strength.

The varying RSSI can be smoothed by averaging or signal processing, such as Kalman filtering, to process multiple RSSI values over time. The direction not being known can be solved by using trilateration where three gateways (or beacons depending on the above mentioned scenario) are used to determine the distance from three directions and hence determine the 2D location.


The aforementioned physical factors that affect RSSI can be reduced by measuring the actual RSSI at specific locations and hence calibrating the system.

The change of RSSI with distance is greater when the beacon is near the detector. At the outer reaches of the beacon signal, the RSSI varies very little with distance and it’s difficult to know whether the variance is due to a change of distance or radio noise. Hence for systems that use signal processing, trilateration and calibration tend to achieve accuracies of about 1.5m within a shorter range confined space and 5m at the longer distances.

However, such systems have problems. The multiple RSSI values needed for averaging or signal processing mean that you either have to wait a while to get a location fix or have the beacons transmit more often (with a shorter period) that flattens their batteries much sooner. Trilateration requires at least three devices per zone so can be costly and require significant time to setup and maintain. Using calibration is like tuning a performance car. It works well until something small changes and it needs re-tuning. If someone adds a room partition, desk or even something as simple as lots of people in the room, the calibration values become invaid. Re-calibration takes human effort and, pertinently, it’s not always easy to know when it needs re-tuning.

An alternative to trilateration is zoning. This involves putting a detector (or beacon depending on the above mentioned scenario) in each room or zone. The system works out the nearest detector or beacon and can work on just one RSSI value to get a fix quickly. The nearest zone is often all that’s required of most implementations. With zoning, if you need more accuracy in a particular zone you add more detectors in the area to get up to the 1.5m accuracy of other methods. This will obviously be impractical if you need 1.5m accuracy everywhere over a large area.

BeaconRTLS™ area zones

Angle of Arrival Locating

An alternative to trilateration and zoning is more expensive Bluetooth hardware and more complex software that makes use of Angle of Arrival (AoA). Locator hardware with multiple antennas uses Bluetooth Direction Finding to find assets to better than 1m accuracy. Location engine software uses the difference in the time of receiving the signals at multiple antennas to calculate the position. Multiple locators can also be used to cover larger areas and/or improve the accuracy using triangulation.

Unlike RSSI systems where any beacons can be used, locators tend to be tied to using the same manufacturers’ beacons. The complex hardware and software has less throughput and supports fewer beacons. The computing hardware needs to be more powerful. Systems need careful, accurate site measurements to achieve good accuracy.


Choosing a solution just because it is more accurate, rather than needed, will cost significantly more not just in hardware but in software cost, setup effort and maintenance. Work out what accuracy you need and then seek out an appropriate solution.