Case Study: Bluetooth Smart Beacon Presence Detection

The Limmat board is an Internet-connected Bluetooth Smart to Web gateway. This blog post is about a case study for a presence detection system. It is based on a project done by Oberon microsystems, Inc. for Lomali Solutions GmbH, a company developing a Web based CRM/ERP for SMEs. In this case, the system is used to manage cleaning personnel. Note that Oberon is also the company behind the Limmat board reference design.

Bluetooth Smart (or Low Energy) has been quickly adopted as the technology of choice for connecting accessories to apps, using the smartphone as a gateway to the Web. It's also now common to see Bluetooth Smart beacons in scenarios where someone entering the room with a smartphone can detect and use beacons mounted there, e.g. for in-house location.

Today we turn the scenario on its head. We will use a fixed Bluetooth Smart gateway, the Limmat board, detecting beacons entering or leaving the room. An application where such a setup might be preferred, is the presence detection of cleaners in an apartment.

Let's have a look at the status quo: cleaners go to an apartment, open the door with a key they got from their manager, start cleaning, and leave again right after finishing their work. They write down the start and end time or the number of hours spent cleaning each apartment. Sometimes a cleaner forgets to take notes. Others do it at home, off the head. This can result in too many or too few hours accounted for, which is bad for both the cleaners and their manager.

If a Bluetooth Smart beacon is attached to the key, and the Limmat board is mounted in the apartment as a reader, you can detect when a key is present and for how long. The system is touch-less, so there is no "forgetting" to check-in. A potential downside of this approach is that people might not want to be tracked, or fear loosing the freedom of "semi-accurate" time-tracking. On the upside, their life becomes a bit easier as the chore of taking notes goes away.

As the Limmat board is also connected to the Internet, integrating the reader with an existing Web app is straightforward. Whenever a registered Bluetooth Smart beacon is detected, the reader uses a simple algorithm to decide if the beacon just arrived or departed. A short grace period is used to prevent false positives, e.g. when a beacon gets out of reach for a short time during work. The reader then calls a Webhook for each event. This means that there's an outgoing HTTP call to the Web app. The call parameters contain the reader ID, the beacon ID, the event (arrived or departed) and a timestamp.

Note that using HTTP nicely decouples the Bluetooth Smart reader from the Web app. From the Web developer's perspective, all the Web app needs to do is handle an incoming request with some parameters, e.g. "/hook?reader=42&beacon=23&event=arrived&time=13:37:00". There is no need to learn about programming embedded hardware or talking to a Bluetooth Smart module. By connecting it to the Web, the Bluetooth Smart reader becomes a simple Web client.

What else do we need? In order to call the Web app, the reader has to know the base URI of the Web app. A simple way to configure the reader is via text messages. Just send it an SMS with the new configuration, e.g. "WebhookBaseUri=http://acme.com/hook". Debugging a setup gets a lot easier, too. To test the Web app, just use your browser or cURL. And to make sure the reader works, configure the Webhook call to use "http://requestb.in/".

Of course, cleaning is not the only use case. A similar setup could be used to track the presence of workers in a factory or caretakers in a hospital (if Bluetooth is an option there, at all). Given the ease of setting up and integrating a prototype based on the Limmat board, a first trial can be implemented with minimal cost and resources.

Want to get started today with Bluetooth Smart? Please drop me a line to

pfister@oberon.ch.

View Cuno Pfister's profile on LinkedIn