'Beacons' are based on Bluetooth Low Energy (part of the new Bluetooth 4.0 standard), and at it's heart is a way to advertise location specific data one-way, or provide basic indoor navigation via individual Beacon nodes.

The way it works is actually very simple. Any BLE device typically advertises a certain amount of data to let other devices (like your phone) know that they exist and they're available. The advertising packet that these devices send out might include information like key services offered by the device, a human-readable short devices name, etc.

Beacons take this short advertising frame, and appends a custom payload in the "Manufacturer Specific Data" field which includes a unique 128-bit UUID to identify companies or unique entities, as well as two 16-bit values ('Major' and 'Minor', or whatever you'd like to call them) that allow you to differentiate specific stores/premises (Major) and individual Beacon nodes (Minor).

That's basically it. All the rest of the magic is on the app side where your phone listens for these advertising frames, and when it detect something it estimates the distance to the node and displays some sort of alert.

It's terribly simple, but that's probably what makes it so interesting and also so inexpensive to implement!

How Does it Work in Pratice?

Essentially, all you need to do is insert a specific set of bytes into the optional Manufacturer Specific Data field of the advertising packet on your Bluetooth Low Energy device.

Inside this field, you need the following values:
  • ID (uint8_t) - This will always be 0x02
  • Data Length (uint8_t) - The number of bytes in the rest of the payload = 0x15 (21 in dec)
  • 128-bit UUID (uint8_t[16]) - The 128-bit ID indentifying your company/store/etc
  • Major (uint16_t) - The major value (to differentiate individual stores, etc.)
  • Minor (uint16_t) - The minor value (to differentiate nodes withing one location, etc.)
  • TX Power (uint8_t) - This value is used to try to estimate distance based on the RSSI value
For example, the following is a valid iBeacon payload (separators added for clarity sake):
02 | 15 | E2 0A 39 F4 73 F5 4B C4 A1 2F 17 D1 AD 07 A9 61 | 00 00 | 00 00 | C8

The only other missing piece is that, following the Bluetooth standard, the Manufacturer Specific Data needs to be preceded by the Company Identifier. The company identifier for Apple, for example, is 0x004C, which we'll use for the example above.

This guide was first published on Dec 04, 2013. It was last updated on Dec 04, 2013.

This page (What is a 'Beacon'?) was last updated on Dec 02, 2013.

Text editor powered by tinymce.