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.

Fixing Poor Bluetooth Beacon Radio Signals

In most cases beacons ‘just work’ but it’s sometimes the case that beacon detection is erratic. A beacon might be detected but not all the time. Problems can be due to the strength and/or quality of the received signal. The first step is to quantify the signal strength so you can measure it at various distances and beacon positions. The post on Testing if a Beacon is Working explains how to use an app such as nRF Connect to measure signal strength (RSSI) using a smartphone.

nRFConnect detecting beacons

If you are not getting a large enough signal at longer distances then try increasing the transmit power. This is labelled ‘Tx power’ in most setup apps. Make sure it is at least 0dBm and increase it to +4dBm for a longer range. Note that changing from 0dBM to +4dBm will reduce battery life by over a half. Another option is to use a beacon with a longer range.

Minew setup tx power

Another reason for poor detection is blocking of the line of sight. The degree of blocking depends on the blocking material. The post on What Can Block Beacon Signals? provides more information.

If beacon detection is erratic irrespective of the distance you need to look into the relationship between how often the beacon is advertising vs how often the receiver is listening. The post on Why Bluetooth LE Scanning Doesn’t Always See Devices (the First Time) provides a detailed explanation. This kind of problem can often be solved by decreasing the advertising period. This is sometimes labelled ‘Advertising interval’ as in the above example screenshot. Again, reducing this by, for example, a half will halve the battery life. It needs to be 600ms or less if iOS is to reliably detect beacons.

It’s rare but there’s also the possibility of too many Bluetooth signals advertising at the same time. You can learn more in the articles on Managing Bluetooth LE Advertising Congestion and The Affect of the Number of Beacons on the Detection Time.

Beacons and Driving

We are seeing more and more customers using beacons in driving-related scenarios. Most are using beacons to trigger when the user gets into or out of a vehicle. For example, driversnote tracks your trips ready for your mileage claim. However, apps such as this are for personal use and there’s a larger market and opportunity in company/fleet management. For example, mileagecount has an automated mileage capture system based on beacons.

The key thing here is that beacons are being used to trigger something, mileage capture in this case. It’s automated, unobtrusive and doesn’t necessarily produce app notifications. There’s a very large number of similar usecases in other industries waiting to be explored.

Aventri Event Apps Use iBeacon

Aventri is an all-in-one event platform that allows enterprise companies to run engaging in-person, virtual and hybrid events.

Their mobile event app can detect beacons placed at strategic locations across the event, for example, at each booth. The iBeacon can cause the app to show an automated message when a visitor is in range of a booth. It also allows you to silently measure foot traffic at the event.

Read about Beacons in Events and Visitor Spaces

View iBeacons

Rechargeable Bluetooth Beacons

Bluetooth beacons can last a long time on battery power, up to 5 years in some cases. However, long battery lifetimes require larger batteries that are more bulky and result in devices that are less suitable to wear.

The smallest beacons, most suitable for wearing, have small CR2032 coin cell batteries that can only typically last of the order of a few months. The solution is to use rechargeable beacons. They all charge via some sort of USB, either plugin, via a clip or magnetic connector.

The iB001W, supporting iBeacon and Eddystone, comes with a small charging cradle that plugs into the beacon.

The H1 Wristband is waterproof and has an acceleration sensor that supports motion triggered broadcast to save battery life. It charges via a clip.

The F1 is waterproof and has an acceleration sensor for motion triggered broadcast and also has a SOS button. It charges via a magnetic connection cable.

The B10 has an acceleration sensor but additionally makes this information available via advertising. It also has an SOS button and charges via a magnetic connector.

The waterproof W2-P5202D3 is a fitness tracker style device that advertises iBeacon, Eddystone and acceleration.

View Rechargeable Beacons

INGICS iGS03W in Stock

We have limited quantities of the new INGICS iGS03W Bluetooth WiFi gateway in stock.

The iGS03W listens for beacons, gets their advertising data and forwards it on to your server or an IoT server via TCP, HTTP(S) or MQTT including AWS IoT, Google Cloud IoT and Azure IoT Hub.

It differs from the iGS01S in that it supports greater throughput, Bluetooth 5 Long Range mode (LE Coded PHY) and also includes a wall holder.

View all Bluetooth gateways

New Bluetooth Location Services Infographic

The Bluetooth SIG, who manage the Bluetooth standards, have a new infographic on location services based on figures from ABI Research.

Some insights:

  • The leading location services category is Retail and Services at 62%.
  • Smartphones are helping drive adoption.
  • There will be 35% compound annual growth in Bluetooth location devices from 2022 to 2026.
  • There will be 547,000 Bluetooth RTLS implementations by 2026.

Learn about BeaconRTLS™

View Bluetooth Beacons

Bluetooth AoA Direction Finding Tradeoffs

Direction finding hardware is limited by how many Bluetooth packets can be processed per second. For example, the Minew G2/AR1 supports up to 1000 packets per second. However, this depends on the actual situation as the locator can sometimes receive packets from devices that are not tracked assets such as fitness trackers, cars and smartphones that will use up processing power.

There are two common misconceptions. The first is that it’s possible to add more hardware to support more beacons. Hardware can be added sidewise, into extra areas having extra beacons, but it’s not possible to support more beacons by adding hardware to the same area. The beacons will still be seen by all hardware. The second misconception is the use of filtering or throttling settings in the gateway to support more beacons. Again, the packets have to be processed and you are only affecting what’s being output.

How many beacons are supported by 1000 packets per second? For a beacon advertising at default 100ms, it’s advertising 10 times every second. For the Minew scenario, with 4 locators, each locator will see the beacon so the gateway works four times as hard.

1000 / 10 / 4 = 25 beacons. Only 25 beacons.

AoA Direction Finding involves a trade off between accuracy, latency and the maximum number of beacons:

The number of beacons can be increased by increasing the beacon advertising period. The Minew MWL01 beacon automatically adjusts the advertising period from 100ms to 250ms to 4 seconds based on movement detected by an accelerometer. This makes the maximum number of beacons dependent on a tricky calculation based on how often the beacons move. At the other extreme, when none of the beacons are moving, 1000 beacons can be supported in one area of 4 locators.

The beacons’ advertising period can be extended, as necessary, to increase the maximum number of beacons. When the advertising period is increased, the latency increases which is the delay after which you know the new location. Furthermore, location engines need multiple measurements, over time, to get an accurate location. This can usually be configured to trade off accuracy with latency.

If a gateway doesn’t see a beacon during scanning, it’s possible it will instead see it on a subsequent scan. Overloaded systems still produce locations but have much less deterministic latency.

When designing a new system many people say they want high accuracy, low latency and support an unlimited number of beacons. This isn’t possible. Instead, rank accuracy, latency and the maximum number of beacons in order of importance and design the system accordingly.

Read about PrecisionRTLS™

Beacons and Innovation

We receive many enquiries for complete solutions that don’t yet exist. While we have a solutions directory, most current solutions tend to require solving a particular problem in a particular industry. In most cases the people enquiring don’t have the budget for a one-off custom solution.

There’s plenty of scope for new innovative solutions based on beacons for re-selling to others. However, creating new systems based predominantly on beacons is costly and risky. Instead, it’s often better to beacon-enable existing systems that have been tried and tested.

The systems we are finding doing this at the moment are mainly security related. However, there’s a large number of enterprise systems that could benefit from extra features provided by beacons. Doing so is less risky and more likely to be successful as it builds on something that’s already being used. Another observation is that when companies do this, they sometimes realise they have actually implemented their first IoT system.

Beacons with Accelerometers

When choosing a beacon with an accelerometer, care needs to be taken that it supports the anticipated use. In some cases the accelerometer can control the functionality within the beacon while in other’s it provides raw data that can be used by other Bluetooth devices such as smartphones, gateways and single board computers such as the Raspberry Pi.

The most common use of an accelerometer is to provide for motion triggered broadcast. This is when the beacon only advertises when the beacon is moving so as to improve battery life and lessen the redundant processing needed by observing devices. Beacons supporting motion triggering include the M52-SA Plus, F1, K15, and the H1 Wristband.

iBeacon
M52-SA Plus provides motion triggered advertising

A few beacons such as the iBS01G and iBS03G interpret the movement as starting, stopping and falling with a consequent change in Bluetooth advertising.

Raw acceleration data is provided by beacons such as the iBS01RG , iBS03RG, e8, K15 and B10.

View Sensor Beacons