The humble NRF24L01+ costs less than a dollar and, although not being a Bluetooth device, can be cleverly programmed to work as a BLE beacon.
A cheap device that uses standard Bluetooth services to continually broadcast its own unique ID (and relevant data) to whoever might be listening: that's a simple definition of a BLE Beacon, for which many mobile apps are being developed and marketed to be able to get these unique IDs, send them to a central database and do whatever needs to be done, based on the response that tells them where the beacon with that specific ID is located – for example, in front of a Spitfire exhibit at a museum, or aproaching some designated row of seats at a theater.
BLE Beacons are able to fulfill the technological dream of precise, low cost and fully location-aware applications popping up at your mobile at the relevant moment: viewing the bus schedule when you arrive at the bus stop, playing a movie with the description of the painting in front of you at the art museum, describing the items available on a vending machine, etc.
You walk, and the app acts when it gets in range of the low energy beacons. No fiddling with cameras and qr codes, no need to be in range of GPS satellites, no additional proprietary cards or sensors, much more accuracy than what you can get triangulating cell phone towers. And the beacon can include additional information, like the status of some variable, or the last reading of some sensor.
Conversely, by way of the apps running on the user's smartphone or tablet, the beacon or app owner can track the customer, send him ads as he gets near specific corners of a store, or even automate some of her transactions. The app can even act differently based on distance, like starting to download the information when the user gets near his interest, and showing the richly formatted information when he really gets in front of the place.
These beacons are already supported on iOS, Android 4.3+, OS X (Mavericks and up) and Windows Phone (Lumia Cyan and up), and other systems where there is some Bluetooth 4.0 hardware available.
Almost as simple as any developer could want. Simpler, even, than many makers seem to like their tools to be ;-)
As they use standard Bluetooth 4.0 services, it's easy to implement BLE Beacons using common hardware: the relevant Wikipedia article even describes commands to send and receive beacons using common utilities available in Linux distributions. The same goes for developing BLE Beacons enabled apps: they use standard APIs to read the data, and then use it as they need.
Which takes us to the object of today's post: to implement a BLE beacon on your project, you can skip even the specialized and costier Bluetooth 4.0 hardware, and use the low-cost (~US$ 0.80 on AliExpress today!) and maker-frindly NRF24L01+ module.
This ability of the humble radio module, which shares the same packet preamble format with the BLE standard, may or may not have something to do with Nordic Semiconductor reusing part of their research that went into the NRF24L line of chips when it participated intensely in the Bluetooth LE proposal. ;-)
As you know, the NRF24L01+ is a general purpose radio device, and has no internal Bluetooth support. But some clever software developed by the community, and now available as a library, enables the specific functionality to broadcast messages (including beacons) using – or faking – BLE.
Just to be clear: this ability of the humble NRF24L01+ applies specifically to BLE (Bluetooth 4.0 Low Energy), not to Bluetooth in general. Even when talking about BLE, the NRF24L01+ can't go much farther than broadcasting small beacon packets, so curb your enthusiasm.
Technically, to send a small (single 64 bytes packet) BLE beacon, the program controlling the NRF24L01+ must ensure a lot of conditions: the bit order must be reversed, specific forms of CRC and data whitening must be applied, and the right bytes must be transmitted to channels 37, 38 and 39.
This is not new: in 2013, Dmitry Grinberg posted an explanation and example code (for an ATtiny) capable of using an NRF24L01+ to advertise itself (it means using meager 14 bytes of payload to broadcast its name and custom data, or 16 bytes if you want just data and can leave your beacon without a name) in BLE, and be recognized by iPad apps as a BLE device.
Last year, lijun.li posted full working code of a BLE Beacon on Arduino with an NRF24L01+, based on Grinberg's work and explaining how it could be easily modified to broadcast the values read from some sensor. His project uses nothing but the Arduino, some wires, the NRF24L01+ module and a phone running an BLE-capable app.
The result is similar to what you can get using iBeacon or other commercial packagings of BLE beacons, but there are some limits: the packet size you can get out of an NRF24L01+ operating as a beacon is very restricted (5 bytes below what's needed to transmit a bona fide iBeacon, IIRC), and the communication is strictly unidirectional, with no way for the smartphone to answer or query the beacon directly.
Floe's BTLE Arduino library was developed based on the research and original code by Dmitry Grinberg, and is able to send and receive BTLE packets on the advertising channels using nothing but an NRF24L01+ module. Yes, that's where you should be heading now1. Happy hacking!