Our latest creation is the addition of indoor location service to our platform using the Bluetooth Low Energy (BLE) beacons for positioning the user’s smartphone or tablet indoors. The first project we implemented using indoor location was for a museum with an audio guide and venue information.
We learned quite a bit in this project about how to accomplish this using our own platform and public SDKs. This article highlight the development challenges we faced in order to make a state-of-the art platform for indoor location with smartphones using BLE.
Choosing technology for indoor location with smarthones
First we had to choose technology to use in order to locate the user indoor; WiFi, BLE, and magnetic measurements were the options.
Using WiFi antennas to position the user is the traditional way of doing this. It requires many antennas for accurate positioning, most +- 3 meters accuracy, but there are complications; WiFi positioning is not that accurate, there is expensive hardware to install, power source needed for all antennas, and iOS does not give the developer full control of the WiFi hardware which makes locating an iOS possible but harder to use technically.
The Bluetooth Low Energy (BLE) is the technology we decided to go with because it requires relatively inexpensive battery powered beacons that can be placed on almost any surface and mostly hidden from view. The BLE is an industry standard and supported by all manufactures or smartphone or tablet devices manufactured since end of 2011. How they work is explained quite well in this blog.
There is another interesting technology worth mentioning from a company called IndoorAtlas, but did not fit our purpose quite. It does not need any hardware installations on the premisses, but measures the magnetic fields inside using the compass to position the user. The developer can calibrate the phone with the environment and “fingerprint” every location for positioning. If there are any structural changes on the venue, the magnetic field changes and then the app would need to be calibrated again. We found this technology not to be feasible for us or the museum structure, but it would fit well in an environment like a supermarket with aisles.
The BLE SDK:
iOS has a good SDK for measuring distance from beacons and filters out bad data quite well. It also has an easy to implement framework for specifying regions with beacons and getting programmatic notification when within a region.
Android has also an SDK for beacons with distance data, but you have to write your own filters and location detection using the SDK. A bit more work but well doable.
The region monitoring is nice from Apple’s SDK but we did not use it as we needed accurate user positioning. The filtering provided by Apple was really handy but that is basically the only benefit of the iOS SDKs beyond what the Android SDK had to offer
Selecting the right beacons vendor
There are many different kinds of BLE beacons out there and packages by various vendors. We looked at 8 different vendors and tried hardware from three of them and ended up with using beacons from Kontakt.io. The quality of the beacons did vary between vendors in terms of signal strength, signal consistency, battery life and administrative functions. Kontakt.io came on top in terms of packing, signal quality and 3 years battery (we will find out).
Platform for managing the venues and guides
Some beacon vendors offer a platform to setup indoor venues and content with platform SDK and such. But we found the platform licensing and feature set too limited so we decided to write our own platform using the SDK’s. It is actually not that hard to do and would pay off in the long term instead of having to pay annual subscription fees to keep the indoor location service running.
Locating user position indoor
The first prototype we made detected what beacon the user is nearest and the distance approximated in meters. A nice example code is the AirLocate app from Apple. That was not enough for us because we wanted to position the user in 2D space on the venue using distance data from many beacons. Many more beacons were needed for the venue and calculation of user position we had to do ourselves using distance measurements of beacons nearby to do the math.
So Jack went on a research mission and came up with code using “non-linear least square algorithm” on a set of filtered beacon data to estimate the user’s location and project that on the venue’s map.
The Ceres Solver math library from GoogleCode is the library we use for running the algorithm. The Android version was easy to build and well documented, but it took some effort to build it for the iOS platform.
We needed a lot of beacons and decided to filter out good beacons that were more than 8 meters away. This was because reading distance more than 9 meters became very inaccurate.
Smartphone and tablet BLE receivers
In general, all iOS and Android smartphones manufactured since end of 2011 have BLE receivers. Apple has their own receiver chipset with are very good, but the Android BLE receivers all use QualComm chipsets.
The QualComm chipsets are fine except the cheapest Snapdragon 400 chip shares the same antenna with WiFi and Bluetooth. This means the 400 series chipsets cannot handle BLE and WiFi communication at the same time.
We solved this limitation of the 400 series chipset in our software by turning off Bluetooth and turning on WiFi and vice versa where needed.
Placing the beacons in the venue
First we setup beacons in our office environment while we were developing the first versions. When the museum venue was ready, we installed the beacons in the actual venue.
We estimated it would take us two days and about 30 beacons, but we ended up spending 4 days setting it up and using 45 beacons to complete the installation. All beacons locations had to be carefully chosen and the exact location of each beacon recorded. Make sure you bring an good measuring device when plotting the location of each beacon.
We learned from this experience how to place beacons. Next time it can be done quicker, but an engineer still needs to visit the venue to install the beacons and measure their exact location in 2D.
– The beacon signal does not go through water so when a user turns around the signal of the beacons behind him is lost so we need to have at least three if not four beacons visible at all times within 8 meters distance.
– The beacons are also directional and sometimes if a beacon was at the end of a hallway facing front, we had to change the angle to point down by about 45 degree angle or else the signal was to strong down the hallway. Also avoid grounded wires that suck up the signal.
– Installing the beacons requires: 1) be on location, 2) place beacons, 3) measure beacons, 4) place more beacons, 5) make change and adjust beacons, 6) fix the beacons in place in their final location and maybe paint over them.
Using the app as a museum guide
Some of the venue guests will not have their own smartphones or the knowledge to download the museum app into their phone without assistance. It is therefore necessary to have some devices available for the guests as well that they can return. We found good-enough low-end smartphones the guests can use.
For people using their own devices, the reception should be equipped with an industrial WiFi router so many guests can login and download the app and content into their own smartphones or pads. It is also good to have the content download service local to reduce bandwidth dependency to the Internet Service Provider.
The BLU technology makes it possible to use people’s own smartphones with a relatively cheap infrastructure (beacons) to provide indoor location for museums and similar venues. We would have considered the magnetic solution if we were doing a project for a supermarket.
The beacons differ in quality and packaging so make sure to test a few vendors to find which suits you. If you have some programming resources you don’t need to purchase a platform SDK to implement such an app. It can all be done with the Android 4 and iOS 7 SDKs if you have a few programming weeks to spare.
We belive the next big killer-apps in mobile software will be in the era of indoor location services. This is because BLE is now an industry standard and most smartphones support it. It’s a broad space for a variety of new apps and services to flourish in.
For more information or comments please email me.
-The Locatify Dev Team