Beacons are emerging devices that let us change the way we interact with users. I will show you what they are, how they work and what we can do with them. Once you see the options, you will understand how a beacon can change our relationship with our apps. Follow me down the rabbit hole.
Beacon devices are compact (some the size of a coin), with a small battery that allows them to operate for over a year with no problems, broadcasting a low intensity Bluetooth signal.
HOW IT WORKS
Beacons broadcast a signal every fraction of second, like a transmitter (the transmitter could be an beacon device available on the market, a USB Bluetooth dongle, a computer with Bluetooth Low Energy-compatible adapter, an iPad , an iPhone or and Bluetooth Low Energy-compatible Android device). The receiver could be an app listening for beacons.
BUT WHAT IS BEACON?
iBeacon is usually used to refer to any device that uses Bluetooth Low Energy (BLE) technology. Despite being the trademark for Apple’s beacon system (introduced in iOS 7). BLE’s history starts in 2007 with its precursor Wibree, developed by Nokia. BLE works under the Bluetooth 4.0 protocol but does not mean that every device working with Bluetooth 4.0 uses BLE technology.
Beacons are like lighthouses, broadcasting a constant signal. As it is using BLE, only a small amount of energy is required to either broadcast or detect a transmission by the device, without the need to link to other devices. This information that the beacon can broadcast or receive is also at a minimum, the reach for the communication is also limited to between 160-230 feet. The concept of beacon and the implementation of BLE technology that Apple have made popular, has now been extended to other platforms like Android smartphones, smartwatches and smart bracelets.
Some are very economical, and allow them to be installed in any place or establishment easily.
WHAT KIND OF DATA IS BROADCASTED?
The communication process is quite simple, beacons are based on a proximity UUID (universally unique identifier), a global ID that identifies a company for example. The Minor and Major values let us create different areas or sections:
- Proximity – as the relative distance to the beacon (Immediate, Near, Far, Unknown).
- Accuracy – as the distance to the beacon but not the exact position.
- Rssi – which show the strength of the signal in Db.
This data is enough to develop several useful and very interesting apps. One major example (and possibly the most referenced sample) is to identify different commerce brands within different shops. The UUID will identify the business, the major value will identify the shop and the minor one can identify a determined section of the shop. With that we can navigate the user to different offers or ads depending on the kind of shop or section where they are located. Later I will show more examples where beacons could be used. iPhone or Android devices can be used either as a transmitter or as a receiver, so we can work in three different modes with our device:
- Advertising: The device will work as a beacon device simply broadcasting the signal, the beacon will get also an UUID and Minor and Major values. To use our smartphone also as a transmitter, which opens up new fields to beacons.
- Monitoring: Our device will be listening for beacons and will receive a notification when the device enters the region of signal from the beacon.
- Ranging: In this mode we can locate the distance more precisely where the beacon is regarding our device. (treasure hunting)
WHERE TO BUY BEACONS
If you have a computer with Bluetooth Low Energy-compatible adapter, such as an iPad , an iPhone or other Bluetooth Low Energy-compatible Android device you can make it work as a beacon, if not you can check out the different options on market:
- Estimote: Possibly the most popular ones, you can buy the developer kit with 3 beacons for $99 or pre-order the developer kit with 10 sticker beacons for $99.
- MacBeacon: With this SDK you can turn any Macintosh running OSX 10.9 and is equipped with built-in or third party Bluetooth 4.0 into your own, fully-configurable proximity beacon for $10.
- StickNFind: With the size of a coin and inside a sticker that you can attach in almost anything, you can set an iBeacon where you want for $50.
- Gimbal: Qualcomm provides the hardware and a great backend to manage your beacons. You can get the Gimbal proximity beacon for $5.
- RadBeacon: A Bluetooth dongle that can turns your computer in an iBeacon for $21.
- Kontact: Kontakt.io provides also hardware and backend to manage your beacons for $28.
- GeoHopper: Another Bluetooth dongle with a power adapter for $30.
- RedBearLab: provides a plugin board for Arduino.
GREAT, BUT WHAT CAN I DO WITH BEACONS?
Well let me show you a few examples of what you can do with beacons and how they can change our concept of services.
- Commerce retail: Imagine when you enter in a clothes shop, an app can detect the beacons and differentiate between different sections, each will show different offers and direct you to the correct section for pants, t-shirts or underwear, depending your location. The app could also let you directly buy only the products for the store / section where you are located.
- Proximity marketing: In the above example, the user device works as a receiver and the beacons on the shop works as transmitters, what if we do it the other way around? If the users device works as transmitter (as a beacon) and in the shop we install receivers. The company can show ads depending of the data from the beacon. Well we get only three values to filter the preferences from the user, but… it could be enough.
- Indoor guidance: This could be used for museums, expositions or visits. Replacing the traditional audio guides or the paper support with smart apps that can show information depending the nearest beacon they find.
- Indoor location: With lots of beacons we can play with the intensity of signal for each one and try to calculate the position for the user with triangulation and trilateration algorithms. These methods are complicated but is an interesting use.
- Home automation: Our smartphone acting as a beacon could open doors, turn on or turn off lights depending if we enter or leave a room or the house, open and lock doors as we approach and pass through them.
- Child care: A smart bracelet working as beacon could alert parents when the distance between the child and the parent’s smartphone exceeds a maximum distance. It can then also be used as a locator once the child is back in range.
REAL WORLD EXAMPLES?
Is that all? No, beacons are already being used in some real world environments, let’s take a look to some of them:
- CitifieldMetsstadium:Wasoneofthefirsttolauncha project based on ibeacons technology to guide the public to their seats, show attractions, offers and promotions, etc.
- Odeon Cinemas: Are working on an implementation of ibeacons in their cinemas to send information, trailers, before the beginning of the film and monitor the path of viewers to improve facilities.
- Tzukuri glasses: Already have an embedded beacon so you can find and locate them, never lose your glasses ever again.
- Be here: An app to control class attendance in schools and universities through beacons.
Beacons use the native Bluetooth capabilities of devices, so if you are an expert, you can try to develop your own plugin to use them. However, there are a couple of readymade plugins already on the Asset Store, which are::
- iBeacon from Rich Boy for $50
- iBeacon from Kaasa Solution for $25.
In this article I will work with the second one. As I have said before, there are a lot of options to use as beacon transmitter, but I will use Gimbal beacons and explain how to set them up.
ACTIVATION AND SETUP
First of all will start registering a Gimbal account here!
The Gimbal manager has a lot of features but for our goal we will concentrate on the activation and setup of our beacons. Once the account has been created we must go to the Beacon menu (figure 6). Here we can activate and setup our beacons.
For now we’ll use only one beacon, we can activate it by clicking on Activate Beacon.
In this window we must set the beacon name (just an identifier for us, this will not influence in the beacon) and the Factory ID, this value serves to identify the beacon, however, in order to find this value we must open the beacon where we will find the Factory ID inside.
Once the beacon is activated we need to create a configuration for the beacon in order to assign the UUID, Major and Minor values. Access the Beacon Configuration menu where in the Beacon Configuration, we will set the configuration name, the UUID (as I have explained before this value will group all our beacons), the major value (this value will group different sections of beacons) and the minor value (to identify a particular beacon) .
With the configuration created, we now return to the beacon menu and assign the configuration to the beacon we just created.
Finally, to apply the configuration to our beacon we will need an iOS device, install the Gimbal Manager app then we can update the info for the beacon and activate it using the configuration that we setup earlier.
SETUP FOR THE UNITY SCENE
I will make only a superficial explanation on this point as I will assume you have some knowledge about Unity. I will create a scene for a game with a steampunk style. The scene will simulate a treasure hunter device.
For the first part will be create a UI for our scene with a nice frame and two images simulating our sensors. The sensor will increase its speed according to how close we get to the beacon.
The next step is to import the iBeacon plugin from the asset store.
CODING THE BEACON INTERACTION
The last step is create a script to define what to do when the beacon is found. The first thing we will do on the script, is to set the events for the start and remove on destroy.
Then we can create the functions for the events:
- One for the BluetoothStateChange which will allow us to enable Bluetooth or initialize the iBeaconReceiver
- One for the BeaconRangeChange which will add or remove the found beacons.
The second part of the script will modify the sensor velocity according the proximity parameter.
Now we can test the result. You can download the full source for the project here.
as iBeacon plugin is not free, the source code does not include the files from the plugin, but you can get an idea of how the app works.
As we have seen, beacons give us new types of applications and ideas for very different environments, like commerce, education, services, games, etc. BLE doesn’t consume as much battery as the normal Bluetooth can do, this makes the technology even more useful. The integration in a platform with Unity is really easy but could do with a few extra functions to ease our development.
Finally let me close with the joke you all are thinking, bacon? not beacon!!!