.st0{fill:#FFFFFF;}

Electronics

BLE Beacons: What, why and how (with an example) 

 February 2, 2024

By  Peter

Join Our Mailing List

We publish fresh content each week. Read how-to's on Arduino, ESP32, KiCad, Node-RED, drones and more. Listen to interviews. Learn about new tech with our comprehensive reviews. Get discount offers for our courses and books. Interact with our community.

One email per week, no spam, unsubscribe at any time.

A BLE beacon is a Bluetooth device that broadcasts small amounts of data at regular intervals using low-energy Bluetooth technology. In this post, I explain some of the fundamentals of this technology and show how it works through a simple project.

The BLE beacon broadcasting feature is leveraged in various applications, such as indoor positioning systems, where beacons can help navigate inside buildings by sending signals to smartphones. They are also used in proximity marketing to push notifications or advertisements to nearby mobile devices in stores or events. Additionally, BLE beacons can enhance customer experiences in museums or galleries by directly providing information about nearby exhibits to visitors’ phones.

BLE Beacon technology was first introduced by Apple in 2013 under the name “iBeacon.” This launch began adopting and developing beacon technology across various industries, leveraging Bluetooth Low Energy for proximity-based information and services.

Popular commercial products based on BLE Beacon technology include Estimote Beacons and Navigine, which are used for retail and indoor navigation. Beacons from companies like Kontakt.io and Gimbal also offer solutions for asset tracking and proximity marketing. These products utilize BLE for energy-efficient communication with smartphones and other devices to enable various retail and personal applications.

Popular commercial products for personal or home use based on BLE Beacon technology include Tile trackers for locating keys, wallets, and other personal items; Philips Hue smart lighting systems that use BLE for control and automation; and August smart locks, which use BLE for keyless home entry and remote access. These products leverage BLE for energy-efficient communication and easy integration with smartphones and smart home systems.

The development and evolution of the BLE beacon standard is primarily overseen by the Bluetooth Special Interest Group (SIG), an organization responsible for developing Bluetooth standards and licensing Bluetooth technologies and trademarks to manufacturers.

Now that you know what you can do with BLE Beacons, let’s dig into the details.

What is a BLE Beacon?

As you already know from the introduction of this post, a BLE Beacon is a Bluetooth device specifically designed to be nimble in power consumption and perfectly suitable for short-range, low-data size and rate applications. BLE beacons can run on a coin battery for months.

BLE beacons transmit unique identifiers in a periodic manner using Bluetooth Low Energy. These identifiers are picked up by compatible devices like smartphones, triggering specific actions such as notifications or location-based information. The operation hinges on low energy usage, making beacons ideal for long-term deployments without frequent battery changes. They are used in proximity marketing, indoor navigation, and asset tracking, leveraging their ability to communicate passive signals to nearby devices.

In the introduction of this article, I provided some examples of products that have been built with the help of BLE Beacons. But this technology is low-cost and simple enough to be useful in the context of makers (like you!) and in low-volume applications. For example, you can utilise a beacon module connected to a suitable environmental sensor to periodically report temperature data to your mobile phone or to an Arduino with a compatible BLE module.

BLE vs BLE Beacon

BLE beacons and regular BLE devices differ mainly in their functions and usage. BLE beacons are designed for broadcasting information over short distances, typically repeatedly sending out a simple signal. They are often used for location-based services like indoor navigation or proximity marketing. On the other hand, regular BLE devices are designed for two-way communication and can engage in complex interactions with other Bluetooth devices, like data transfer or control commands. This difference in functionality leads to varied applications and capabilities for each type of device.

The typical range of a BLE beacon varies based on its design and environmental factors but generally falls between a few meters and around 100 meters. Higher-powered beacons can reach the upper end of this range, while those designed for shorter distances or constrained by physical barriers may have a more limited range.

In my experimentation with the Fermion BLE Sensor Beacon v1.0 from DFRobot, the range was around 15 m (in line of sight between the beacon and my phone) and much shorter if walls were in the way. More about this later in this article.

BLE Beacon DIY applications and challenges

In Arduino and similar projects, BLE beacons can be used for indoor positioning systems to guide robots or drones, sensor and environmental measurement, for proximity-based control to activate devices when a user is near, and in interactive installations where the presence of a person can trigger specific actions or effects.

BLE beacons in Arduino projects offer precise indoor positioning by emitting signals that microcontrollers with BLE capability can detect to determine their location within a structure. They enable proximity-based control, activating devices when a user or object comes close, ideal for smart home applications.

In interactive installations, BLE beacons trigger actions based on user presence, enhancing engagement. Compared to other technologies, BLE beacons are low-cost, consume less power, and provide easier deployment, making them suitable for various innovative Arduino projects.

I have been playing with the Fermion BLE Sensor Beacon v1.0 from DFRobot with a couple of low-power sensors (an analog light sensor and a digital SHT40 sensor. I could set up a solo beacon (i.e., without needing a microcontroller) to take readings from the sensors and capture the reading on my phone or an ESP32/Arduino device with a BLE module.

A Fermion BLE Sensor Beacon connected to an analog light sensor sends data to my phone.

The main technical challenges of using BLE beacon modules in projects include managing power consumption for battery-operated devices, ensuring reliable data transmission within the BLE range, and handling the complexity of BLE programming and integration with Arduino or other platforms. Additionally, ensuring compatibility and interoperability between different devices and beacon standards can be challenging.

Because the coin-cell battery in the Fermion BLE Sensor Beacon can only provide up to 1.5 V power and only in a relatively tiny amount of current, you must find sensors that can work at such low power levels. Your typical Arduino 5V sensor will not work.

BLE Beacon example: Fermion BLE sensor beacon

The DFRobot Fermion BLE Sensor Beacon is designed to broadcast sensor data via Bluetooth wireless. It includes features like an 11-bit ADC for data acquisition, I2C functionality, and connecting to digital and analog sensors. This beacon is enhanced from previous versions by allowing power from a CR2032 coin cell battery, adding two independent I2C interfaces for sensor data acquisition, and providing 6 configurable GPIOs. It operates between 1.1 to 3.6V DC and has a low standby current, making it suitable for IoT applications in smart farms, offices, factories, and warehouses. For more detailed information, visit the DFRobot Wiki page on the Fermion BLE Sensor Beacon.

The Fermion beacon’s “brain” is the IN100 SoC (System on a Chip). The IN100 SoC is part of InPlay’s NanoBeacon™ series, designed to innovate in the field of Bluetooth beacons, active RFID, and wireless sensor applications. It stands out for its ultra-low power consumption and cost-efficiency, making it particularly suitable for various Industrial Internet of Things (IIoT) applications. One of the key features of the IN100 is its programming-free design, which allows for easy configuration through a desktop application, eliminating the need for traditional firmware development. This feature significantly simplifies the setup process, enabling faster deployment of applications such as asset management, smart labels, and smart healthcare solutions.

The IN100 incorporates Bluetooth 5.3 technology and is designed with a firmware-less approach, facilitating the focus on building and scaling wireless applications. It supports many sensor interface protocols and can easily connect to analog or digital sensors for real-time wireless data transmission. The device offers enhanced security features, including beacon ID authentication and privacy for advertising payloads. The IN100 is recognized for its long transmission range, operating on a very low power budget that allows for multi-year operation on a small battery, and it operates within a wide voltage range, supporting even single 1.5V coin batteries.

For developers and engineers looking to experiment with the IN100, InPlay provides an evaluation kit that includes development boards and a programmer board. The setup is designed to be straightforward, with the programmer board facilitating the interface between the NanoBeacon Config Tool and the development board. This setup allows for creating applications such as BLE advertisements without needing external sensors or peripherals, and the configuration process is made simple through the desktop application.

For more information and a detailed overview of the IN100 SoC, including its features and applications, you can visit the official InPlay website and DigiKey’s product page.

A simple experiment with the Fermion BLE Sensor Beacon

I was curious to try out BLE Beacons, so when DFRobot asked me if I wanted to look at their Fermion BLE Sensor Beacon device, I jumped on the opportunity. I reviewed the wiki and decided to try out the simplest possible experiment: attach a light sensor to the beacon and have it broadcast the raw value from the beacon’s analog input pin.

As I mentioned in the previous segment of this post, the Fermion beacon device is based on the IN100 SoC, which is tiny yet full of features. Regarding communications with peripherals, it provides an 11-bit Analog to Digital Converter (which I used in this experiment), two I2C interfaces (which I will use in a later post), and six GPIOs.

I decided to try out the ADC with the analog light sensor first because I could test the configuration in RAM. According to the documentation, to utilise the I2C interfaces, I would need to burn the configuration to the module, which is a permanent and non-reversible action. Once a configuration is burned, you can’t re-configure the device. For details, see pages 47-50 of the InPlay NanoBeacon IN100 Config Tool application notes (PDF).

I will not use a microcontroller in this experiment to keep things very simple. Just the beacon, the sensor, my phone, and the configuration tool running on my computer.

The plan

Here’s what I’m going to do:

  1. I will set up a BLE beacon, connected to an analog light sensor, to broadcast raw light intensity values.
  2. I will use my phone and a BLE scanner application to receive the broadcast from the beacon.

The end result is my phone showing the raw data from the analog light sensor. You can see a view below. The arrow points to the raw value from the beacon’s ADC pin, piggy-backing in the manufacturer data field:

The number in the yellow box contains two bytes.

Sounds simple!

The experiment ingredients

To implement this plan, I will need some hardware and software. Here’s my list of ingredients:

  1. The Fermion BLE Sensor Beacon device, powered by a coin cell battery.
  2. An analog ambient light sensor to provide data.
  3. A USB to TTL interface to configure the beacon. I’m using the 6-in-1 USB to Serial Converter from DFRobot.
  4. The NanoBeacon™ IN100 Config Tool. This is a free software tool provided by InPlay, the manufacturer of the IN100 SoC. It runs on Windows, Mac OS and Linux.
  5. A smartphone with BLE capability and the NanoBeacon Scanner app, also from InPlay. This app is available for Android and iOS phones.

The process

Here are the steps for this experiment:

  1. Connect the beacon to the USB to TTL interface.
  2. Connect the light sensor to the beacon (you should insert a coin battery).
  3. Plug the USB to the TTL interface into the computer.
  4. Use the IN100 Config Tool to configure the beacon and write the configuration to its RAM (do not “burn” it!). Detach the beacon from the USB to TTL interface and allow it to operate autonomously.
  5. Use the NanoBeacon Scanner app on the phone to verify that the beacon is broadcasting.

Let’s do it!

Steps 1 and 2: Wiring

Let’s connect the three hardware modules. Remember that I am using a 6-in-1 USB to TTL interface, which offers a variety of functions through its 2×6 header. I have configured this device as a simple USB to TTL interface using the information on its documentation page. The wiring only requires four pins: GND, 3V3, RXD and TXD. You can ignore all other pins.

Here is the wiring schematic:

Remember to insert a coin cell battery into the beacon to operate independently after you write the configuration to RAM. Here is my beacon, sensor, and USB-TTL interface connected to my computer:

Steps 3 and 4: Configuration

Connect the USB to TTL interface to your computer and start the NanoBeacon Config Tool. At start, the tool will look something like this (the view will depend on which tab you have selected from the left pane):

The NanoBeacon Config Tool

Click on the Probe button in the top-right of the tool window to refresh the ports list (1), then select the port from the list (2). Click Connect (3) and then “OK” to dismiss the pop-up (4).

Connect the Beacon to the config tool via the USB-to-TTL interface.

The beacon can utilise up to three advertising sets to communicate with its environment. I will use Set #1 in this experiment. Notice that this set is enabled by default. Inside this set, I will append the data from the light sensor (connected to the ADC) to the advertising data. Here’s how to do this:

Select the Advertising tab from the left pane (1), and click Edit in the Advertising Set #1 box (2). In the Advertising Data tab, select “Custom” for the data format (3), and click “Settings” (4). In the Custom Advertising Settings, give your beacon a name (I called it “Fermion Beacon”) in the Device Name field (5). This is the name that your beacon will appear under in the scanner app. In the Manufacturer Specific Data field, leave the ID as it is (though you can change it if you wish) and click Edit (6). In the Manufacturer Specific Data form, expand the drop-down menu (7) and select “ADC CH2” (8). Then, click “Append to Data” (9). With this, you have configured the beacon to read the ADC channel 2 and append the value to the beacon ID, which is broadcast periodically. The space available for custom data is only a few bytes, and you have just consumed two. Click “OK” to commit these changes (10).

In the Advertising tab, it is worth checking the Advertising Parameters and the Advertising Mode tabs (both under “Advertising”). The default values should be acceptable, especially the advertising interval. I have set mine for 1000ms (1 second). You can also change the public address if you wish (I mine unchanged).

In the Advertising Mode tab, I have selected Continuous Advertising. This will use the advertising interval of 1000 ms I set in the Advertising Parameters to broadcast once per second. As you can see, other trigger modes allow the beacon to advertise when a defined event occurs, such as when a sensor goes high or low.

It is time to configure the ADC, which reads the voltage from the analog light sensor. I configured the custom advertising data to append the value from ADC CH2, which corresponds to GPIO 6. You can find a table to detail ADC channel and pin allocation on page 32 of the IN100 application notes (PDF).

Click on ADC from the left pane (1) to select it and the Edit button in the ADC Channel 2 box (2). This will bring up the ADC Channel 2 configuration form. In the Power Switch Select box, select None (3). The beacon has the ability to power a peripheral on and off to preserve power, but in this example, I will not use this feature.

In the Unit Mapping fields, I will make some changes to consider the maximum sampling voltage of the ADC in the IN100 SoC, which is 1.6V. The details are on page 23 of the IN100 datasheet (PDF). The configuration tool provides the option to set up a linear conversion between the voltage that a sensor outputs to the ADC and the ADC’s min and max voltages. To do this, the Unit Mapping form for each ADC channel configuration offers mapping values for the 1.4V and 0.4V points and the unit. If we left the defaults for these points (i.e. 1.4V and 0.4V), then the broadcasted values from the 3.3V analog sensor would be within that limit. However, if we remap, we can expand the value to encapsulate the sensor’s actual range. Roughly, for a sensor that outputs from 0V to 3.3V, the 1.4V point of the ADC corresponds to 2.887, and the 0.4V point is roughly 0.825. We can also change the Unit (i.e. the advertised value of the least significant bit) to 0.001.

Here is how to do all this: In the ADC Channel 2 form, click “None” in the Power Swirch Select box (3) and fill the unit mapping fields with 0.001, 2.887, and 0.825 for Unit, “Value of 1.4V” and “Value of 0.4V” (4), as you can see below:

The IN100 SoC allows setup conditions to turn off peripherals. I’m keeping things simple in this experiment, so I have chosen the “None” option.

Click OK to commit the configuration (5).

Because GPIO6 is a multiple-purpose pin, I must set its role as “analog”. To do this, click on the GPIO tab (1), and then select “analog” from the Digital IO dropdown under MGPIO (2).

At this point, I have completed creating the configuration. You can preview this work at the bottom of the config tool window. Confirm that the configuration is correct (1), and then write it to the RAM so you can test it (2). Do not click “Burn/Program” because this is a one-time action and cannot be reversed!

The config tool will show you the upload progress in a pop-up (this only lasts for a second or so):

Click OK to continue.

The configuration is now configured to the beacon’s RAM. If you have inserted a coin cell battery, you can safely disconnect the USB to TTL interface from your computer. You can also disconnect the interface from the beacon; the beacon will continue to operate independently thanks to its battery.

Here’s my beacon and sensor, free from other connections:

Step 5: NanoBeacon Scanner app

It might not seem that the beacon is operating because there’s no visible queue that it is. So, let’s take out the scanner app on a smartphone and see what we can find. Start the app, and click on the Configuration icon (1). Since I have named my beacon “Fermion Beacon”, I’ll use the string “Fermion” to set up a filter (2). Without this, the scanner will display all Bluetooth and BLE devices in my lab. Close the filter by tapping on the configuration icon again.

Within a few seconds, a result should appear for a device with the name “Fermion Beacon”. Tap on the device to expand it.

Look at the Manufacturer ID field; it shows “0505”.

And now, look at the Manufacturer Data field; it shows “05050978”.

And there’s your sensor data: “0978”, two bytes, appended to the manufacturer ID.

Isn’t this neat? With a simple computer or microcontroller program, you can break down the manufacturer data bytes and retrieve the data from the sensor. It’s not much, but as you can see, for any application that requires small amounts of data and extremely tiny power consumption, BLE beacons provide an excellent solution.

Conclusion

This post has demystified BLE beacons and opened your appetite for learning and related projects. This was my first beacon-related project and has helped me understand some of the basic features of this technology. I will be spending more time with the Fermion BLE Sensor Beacon. In particular, I will be playing with I2C sensors, which are more challenging than analog sensors because they don’t allow testing in RAM. I will report my findings very soon.

What do you think about BLE beacons? What kind of projects would you like to see? Please leave your comments and questions below.


Tags

Beacon, BLE, Bluetooth


You may also like

{"email":"Email address invalid","url":"Website address invalid","required":"Required field missing"}

I’m thrilled to announce that my upcoming course, Introduction to Electronics, is just a few weeks away from being released on both Udemy and Tech Explorations. This course was designed with the absolute beginner in

Read More
New Course Coming soon: Introduction to Electronics

Robotics is one of the most engaging and effective ways to teach programming, problem-solving, and critical thinking. Today, we’re diving into the CrowBot Bolt, a programmable robot car explicitly designed for STEAM (Science, Technology, Engineering,

Read More
Exploring the CrowBot Bolt: A Hands-On Robotics Kit for STEAM Education