Bluetooth Beacons: Shining a Blue Light into the Darkness
By Pete Rembiszewski, Principal Prod Dev Engineer
Ever find yourself walking through the mall looking for a store you are trying to find? Yes, you finally located it on that giant colored mall map near the front door, but you are not sure if you walked past the location or not. You cannot pull out your phone to help figure out where you are because you can’t get enough accuracy on your GPS while indoors. So what to do? You notice that your local mall actually has a QR code for a new mall map application. You download the application and start it. A map shows you are near the food court. You are notified with a coupon for “two for one cinnamon buns.” Distracted from the original intent of finding a store, you head over to the nearby vendor anticipating all the sugary goodness.
Bluetooth Beacons Get You Back On Track
The ability to find indoor locations will be possible with the use of Bluetooth beacons. These little Bluetooth devices utilize Bluetooth Low Energy (BLE) proximity sensing to help identify location. They can also trigger an action within an application such as sending a notification containing a coupon or personalized greeting. A Beacon is a very simple Bluetooth device that continuously sends out a unique identifier many times a second.
Mechanically, the beacon has few parts. It consists of a CPU, possibly some sensors (such as temperature or accelerometer), a Bluetooth 4.0 radio, and a battery. The beacon transmits on the 2.4GHz spectrum (the same spectrum utilized by Wi-Fi, cordless phones, game controllers, and Classic Bluetooth. The beacon can be placed in a location, sometimes right in the open and transits its information over and over again. Most beacons can be set to broadcast at different intervals, typically 1 to 10 times a second. The number of times a second the beacon transmits paired with the size of the battery will affect the duration of the charge. The lifespan for a beacon, even on a coincell battery, can be anywhere from thee months to over a year without having to be plugged into any power source.
The proximity profile also can also figure out how far away a device is from the beacon using the received signal strength or RSSI. The information is approximate, as there are three supported ranges: “Immediate” – within a few centimeters, “Near” – within a couple of meters, and “Far” – more than 10 meters away. Beacons typically have a range of 70 meters, about ¾ the size of a football field. The distance will vary given factors like angle and obstructions.
How Beacons Work
The beacon repeatedly sends its ID as well as some other parameters, but this information is similar to a MAC address that can uniquely identify the beacon. On Android and iOS devices, once Bluetooth is activated, the device will listen for any broadcasting beacons. An application can subscribe to receive a notification for a specific beacon very similar to Geofencing. The application can start up or run in the background and decide what to do with that ID and range information. For instance, an application can open up a notification window telling the user they are near a location, or hit the network and download some information such as listing of store sales. The device can also get an alert if it is moving away from a beacon.
The beacon will repeatedly send out a unique identifier. Every ID is 20 bytes long and is divided into three parts, a proximity UUID 16 bytes long, a major number 2 bytes long, and a minor number 2 bytes long. This unique alphanumeric string will identify the beacon, or group of beacons. A group of beacons may have the same proximity UUID and/or a major or minor number. For example, one may want to have the entry to a particular store location have the same id, so that once a device enters that boundary it knows it is clearly within that store’s area. A store may choose the same UUID and major number for all of its locations and vary the minor number for the different departments.
There are many choices on where to get started with beacons. You can go to Estimote or Gimbal and get a beacon for as little as $5. You can also set up your devices as beacons, as well. A Linux device with Bluetooth 4.0, such as a Raspberry Pi, can be set up to act as beacon. Also, iOS 7 and Android (4.3+) support Bluetooth 4.0, but versions prior to Android “L” can’t act as a beacon, they can only listen for beacons.
A great SDK to get started with is the open source Estimote SDK from Github. You may also use one of many open source and proprietary SDKs to put the right hooks in your Android or iOS 7 application to start using Beacons.
Good luck, and happy hacking!
Estimote SDKs: https://github.com/Estimote
Gimbal Beacons: http://gimbal.com/gimbal-proximity-beacons