Building an iBeacon + Eddystone Bluetooth Beacon using IN100

Introduction

Most available Bluetooth beacon platforms today involve at least some firmware development work to get it working and deployed as an end product solution.

The IN100, on the other hand, does not require any programming and can be configured as a Bluetooth beacon in a matter of minutes!

In this article, we'll be setting up an IN100 to broadcast iBeacon and Eddystone packets, including telemetry data (battery voltage reading, temperature, timestamps, etc.), all without using any external peripherals or sensors.

All you need is the IN100 development board!

Background

In this article, we'll review all the steps necessary to configure the IN100 development board to behave as an iBeacon (Apple's Bluetooth beacon format) and Eddystone (Google's Bluetooth beacon format) simultaneously.

The ability to configure the device to broadcast both packet formats provides more flexibility in discoverability by the Bluetooth scanners used in the system. The best example is an asset tracking application.

The way this works on the IN100 is by configuring multiple "advertising sets":

  • One advertising set is configured for iBeacon format.

  • One or more advertising sets are configured for Eddystone frames (UID, EID, TLM).

Within the configuration of each advertising set, we have quite a few settings that we can adjust: Advertising Data, Advertising Parameters, Advanced Advertising Parameters, and Advertising Mode.

Let's go over each of these.

Advertising Data

We can configure the advertising data for the iBeacon or Eddystone format. This includes the following for iBeacon:

  • UUID: represents a unique 16-byte Beacon ID. You can use this site to generate a UUID for your application.

  • Major: used to define a sub-region within the larger region defined by the UUID.

  • Minor: allows further subdivision of the region specified by the UUID + Major number.

  • Measured Tx Power: represents the measured transmit power at a 1 m distance from the device. It is recommended to take multiple measurements at the 1 m radius around the device and use the average measurement.

And the following for Eddystone:

  • UID Frame: represents a unique Beacon ID which consists of a 10-byte namespace + 5-byte instance.

  • EID Frame: Ephemeral ID frame using the selected 16-byte encryption key (keys can be set from the Global → Keys settings screen).

  • TLMFrame: broadcasts telemetry information about the beacon itself, such as battery voltage, device temperature, and broadcast packet count.

  • Measured Tx Power: represents the measured transmit power at a 0 m distance from the device.

For more details on the Eddystone standard format, refer to the Eddystone specification here.

Advertising Parameters

In addition to the specific data settings for each advertising format, we have some advanced settings when it comes to the parameters for each advertising set.

Here's a look at the available parameters:

  • Advertising Interval: this is the rate at which the advertising packets are broadcast by the beacon. The higher the interval, the lower the power consumption.

  • PHY Selection: multiple PHY (radio configuration) options are available within the Bluetooth Low Energy protocol. The IN100 supports two of them: the standard 1M PHY (most common) and the long-range LE Coded PHY (s=8, at 125 Kbps).

  • CTE: Constant Tone Extension. This is used for Angle of Arrival (AoA) measurements to support the Direction Finding feature of Bluetooth Low Energy.

  • Advertising Random Delay: this allows you to introduce a randomized delay in sending out the advertising packets, which helps reduce interference and enhance the reception and discovery of the advertising packets.

  • Advertising Channels: there are three primary advertising channels available in Bluetooth Low Energy (channels 37, 38, and 39). This option allows you to choose which channels are used when sending out the advertising packets.

  • Bluetooth Device Address: every Bluetooth Low Energy device has a unique address (similar to a MAC address). All four types of addresses are supported by the IN100 and can be configured here.

We also have some advanced advertising settings:

  • Exclude Bluetooth Address From Advertising

  • Enable Custom Access Address

  • Enable Custom PDU Header

Advertising Mode

The final group of settings is available under the AdvertisingMode tab. These are for setting the advertising mode, which defines whether the advertising packets are:

  • continuously sent out

  • or sent out only when specific user-defined conditions are met

We'll cover Triggered Advertising Mode in detail in an upcoming article. For this article, we'll use the Continuous Advertising Mode.

Beacon Configuration

We'll be configuring the IN100 to advertise the following:

  • iBeacon packets with a specific UUID, Major, and Minor numbers

  • Eddystone UID packets with a specific 10-byte namespace and 6-byte instance

  • Eddystone TLM packets, which include the battery voltage reading, internal temperature, advertising count, and time since bootup.

To do this, we'll configure three independent advertising sets, one for each of the above packet types.

We'll also want to use two different addresses: one for the iBeacon advertising set and then another address that gets used for both the Eddystone UID and TLM advertising sets. Since the UID and TLM Eddystone frames are expected to come from the same device, we'll configure them with the same Bluetooth address.

iBeacon Configuration (Advertising Set #1)

For iBeacon configuration, we need to define the UUID, Major, Minor, and Tx Power values.

In some cases, you may want to choose the UUID manually, but for our article, we'll be using an online generator to create a random one:

The UUID is 529DCAB1CB914352AAF53F62CCE2F9EA.

For Major (2 bytes), we'll be using 0x0001, and for Minor, we'll be using 0x0002.

Finally, for the measured Tx power value (measured at 1m from the device), we'll be using -50 dBm.

We also need to set the Bluetooth device address. We're going to choose an arbitrary address (this will help us identify the device on the mobile app):

Finally, we're going to adjust the advertising interval to 100 ms. Keep in mind that the higher the interval, the lower the power consumption. Typically you would not be advertising at 100 ms or even 1 second, maybe 5-10 seconds or even more.

With interval values higher than 10 seconds, you can easily achieve a battery life of 10 years or more!

Eddystone UID Configuration (Advertising Set #2)

For our Eddystone UID configuration, all we need are the 10-byte namespace, 6-byte instance, and measured Tx power (at 0 meters). We'll be choosing the following arbitrary values:

  • 10-byte namespace: 00010203040506070809

  • 6-byte instance: 001122334455

  • Measured Tx power: -40 dBm

For this advertising set's advertising interval, we'll also use 100 ms.

For the Bluetooth Device Address, we'll set it to the following:

Eddystone TLM Configuration (Advertising Set #3)

For the Eddystone TLM frames, all we need to do is choose the TLM frame type for the Advertising Data Type within the Eddystone configuration:

For TLM frames, usually, we don't need to send them out as often as the UID frames. So, we'll be setting the advertising interval to 1 second (1,000 ms):

Finally, we'll set the Bluetooth Device Address to match the one we set for the UID frame:

That's all we need to do in terms of configuration and settings!

Testing

The first step we need to take is to flash our configuration to the IN100 development board. Ensure you have the development board connected to the programmer board and the PC.

Then you can probe the connected device, connect to it, and then flash it using the "Run in RAM" button:

Capturing Beacon Packets on a Smartphone

For testing, we'll be using the Beacon Scanner Android application. You can find the application here. It supports scanning for both iBeacon and Eddystone beacons.

Once you launch the application, you can start scanning for beacon devices. Here's an example of capturing both the iBeacon and Eddystone packets sent out by the IN100:

Obviously, in an end-product or finalized system, you'll want to build your own app or implement the scanner functionality into some other type of device, like a gateway.

But this article, at least, gives you all the necessary steps you need to perform to configure the IN100 to send out iBeacon and Eddystone packets and be able to capture them on a smartphone for proof of concept!

Previous
Previous

Real-time tracking made easy with active RFID tags and BLE technology

Next
Next

Building a wireless Temperature/Humidity Sensor using the InPlay IN100