Skip to content

Beacons

Bluetooth Beacon protocols

Beacon protocols are the standards that define how beacons communicate with other devices and services. There are different types of beacon protocols, each with its own features and specifications. Some of the most popular beacon protocols are:

  • iBeacon: This is the first beacon protocol developed by Apple and introduced in 2013. It works with iOS and Android devices and transmits a UUID that can be used to identify the beacon and its associated information or service. It can be used for location awareness, proximity sensing, indoor positioning and more¹.
  • Eddystone: This is a beacon protocol developed by Google and introduced in 2015. It works with iOS and Android devices and can transmit three different frame types: URL, UID and TLM. URL can be used to send a website link without requiring an app, UID can be used to identify the beacon and its associated information or service, and TLM can be used to send sensor and administrative data from the beacon itself. It can be used for location awareness, proximity sensing, indoor positioning and more².
  • AltBeacon: This is an open source beacon protocol developed by Radius Networks and introduced in 2014. It works with various mobile operating platforms and transmits a 16-digit string of characters that can identify the beacon and its associated information or service. It aims to overcome the issue of vendor favoritism and provide more flexibility with a customizable source code³.
  • GeoBeacon: This is an open source beacon protocol developed by Tecno-World and introduced in 2017. It works with various mobile operating platforms and transmits high-resolution coordinates, TLM data and 8 bytes of user data. It is designed for usage in geocaching applications due to its compact data storage.

Source: Conversation with Bing, 5/16/2023 (1) Types of beacons - Wikipedia. https://en.wikipedia.org/wiki/Types_of_beacons. (2) An inside look at beacon technology, manufacturers and use cases. https://www.techtarget.com/iotagenda/feature/An-inside-look-at-beacon-technology-manufacturers-and-use-cases. (3) Encorafenib Plus Cetuximab as a New Standard of Care for … - PubMed. https://pubmed.ncbi.nlm.nih.gov/33503393/.

Calculating the receiver location

Bluetooth beacons can be used for measuring distance by using the received signal strength indicator (RSSI) value, which is a measure of how strong the signal is at the receiver. The RSSI value can be converted to distance by using a signal propagation model, which takes into account factors such as the transmission power, the frequency, and the environment.

One way to measure distance using Bluetooth beacons is to use trilateration, which is a method of finding the position of an object by using the distances from three known points. The object’s position can be calculated by solving a system of equations based on the Pythagorean theorem. There is a library for that. This requires accurate measurements which can be difficult to get through beacons due to obstacles that affect the signal strength.

Use node-trilateration to perform the calculation on the backend: https://github.com/mberberoglu/node-trilateration

Creating a ibeacon using an esp32

To create a beacon using the esp32, download the “ESP32 BLE Arduino” library. In the examples select the BLE_iBeacon example sketch and enter the UUID. Optionally adjust the measured_power and tx_power values depending on the device. Then the beacon can be uploaded and run on an esp32.

Calculating the distance to a beacon

The following function can be used to calculate the distance of a beacon. The accuracy depends the number and type of obstacles between the beacon and the receiver.

txPower is the power that the bluetooth beacon is transmitting at. RSSI is the received signal strength indicator and it is the strength of the beacon signal on the side of the receiver.

Knowing these two values the distance can be calculated.

From: https://gist.github.com/JoostKiens/d834d8acd3a6c78324c9

// Based on http://stackoverflow.com/a/20434019

function calculateAccuracy(txPower, rssi) {
  if (rssi === 0) {
    return -1; // if we cannot determine accuracy, return -1.
  }

  var ratio = rssi * 1 / txPower;
  if (ratio < 1.0) {
    return Math.pow(ratio, 10);
  } else {
    return (0.89976) * Math.pow(ratio, 7.7095) + 0.111;
  }
}


Last update: May 16, 2023