The 4th Industrial Revolution (4IR), also known as Industry 4.0, is the use of technology to improve operational efficiency, increase throughput, minimise downtime, improve quality and lower costs. We have an article that explains how beacons are part of 4IR.
There’s a lot more to 4IR than tracking items and analysing data. It also includes areas such as automation, robotics, cyber security and 3D printing. There’s a free online Industry 4.0 Magazine that can help you get up to speed.
This is part 3 of a 3 part series that explains what’s inside a beacon. In this part we take a look at the System on a Chip (SoC) software and programming for the Nordic nRF range found in the majority of beacons.
Despite the small size and memory, a typical beacon contains lots of code written in the c programming language. The code required to implement Bluetooth, called the Bluetooth stack, is very complex. It also has to pass tests by the Bluetooth SIG, called qualification. To prevent every product vendor using the SoC having to write the Bluetooth part themselves, Nordic supply what’s called a SoftDevice. A SoftDevice is a precompiled and linked binary library implementing a wireless protocol, Bluetooth in our case.
For the nRF52, the S132 SoftDevice provides a qualified Bluetooth® 5 low energy (BLE) Central and Peripheral protocol stack solution. It provides eight connections with an Observer and a Broadcaster role all running concurrently. Use of a softdevice allows developers to concentrate on their own high level product functionality rather than lower level complexities.
Beacon manufacturers or 3rd party developers such as ourselves create a program using either SEGGER Embedded Studio (SES), MDK-ARM Keil µVision, GNU/GCC or IAR Workbench. Most development now uses SEGGER Embedded Studio because Nordic have licensed it to allow Nordic developers to use free of charge. Most Nordic code examples in the nRF52 SDK now include a SEGGER Embedded Studio project file.
There are two ways of programming, either pre-programming the SoC with production code before mounting using socket programming or programming the SoC after mounting in the circuit. The PCB holes mentioned in part 1 are used to program the beacon in the circuit. A jig with pogo pins (pins with springs) can be used to help programming larger number of devices:
Jig in use at BeaconZone
The other end plugs into a nRF52 DK that has a debug out header at the top right:
If you keep the pins connected to your beacon, you can run and debug the code, in situ, via the SEGGER IDE. However, debugging is not that capable because it’s not possible to continue from breakpoints. You have to re-run or rely on lots of logging to the console.
The nRF52 DK also contains a nRF52 which means it can be used in the initial stages of product development prior to moving to actual hardware.
This is part 2 of a 3 part series that explains what’s inside a beacon. In this part we take a look at the System on a Chip (SoC), in particular the Nordic nRF range, found in many beacons.
In part 1 we identified the Nordic nRF52832 SoC. The nRF52 is a newer version of the Nordic nRF51 that has been used in millions of beacons. The new version has more memory, uses less power and includes NFC. The extra memory is useful for applications such as Bluetooth Mesh.
nRF52832
The Nordic nRF52832 SoC wasn’t created just for beacons. It’s a general purpose device for any electronics that needs to have 2.4GHz wireless communications and software processing. The nRF51 and nRF52 series can be found in many fitness trackers and wearables. For example, the BBC micro:bit, the Polar GPS multisport watch and Garmin’s child activity monitor.
The SoC is a stand alone computer having an ARM® Cortex™-M4 CPU with a floating point unit. The NFC-A Tag can be used in pairing and payment solutions which makes it suited for use with smartphone apps. The SoC also has digital peripherals and interfaces such as PDM and I2S for digital microphones and audio.
nRF52832 Block Diagram
It has very low power consumption via an on-chip adaptive power management system. It uses between 0.3 μA and 1.9 μA, depending on the mode, and can still respond to events. For beacons, it periodically wakes up for about 1ms, during which it uses about 5.3 mA (at 0 dBm power output).
Power use during iBeacon advertising
The SoC supports ANT™, IEEE 802.15.4, Thread, and proprietary protocols operating in the 2.4 GHz bandwidth as well as Bluetooth®.
The marking on the chip denotes the variant with different RAM and flash combinations:
The image in part 1 shows the i7 beacon has the QFAA variant with 64 kB RAM 512 kB Flash. As with SSDs, the flash can only be erased and written so many times. For the nRF52832 this is 10,000 erase/write cycles. This is irrelevant for most beacons as they save very little data, irregularly, usually only when settings are changed. However, for applications such as mesh, the number of erase/write cycles needs to be minimised to prevent the device wearing out in a short period of time.
Prognostics is the determination of health of assets to diagnose anomalous behaviour and predict the remaining useful life. It’s used to:
Prevent catastrophic failures
Increase asset availability through less downtime and less time wasted through ‘no fault found’ tests
Extend maintenance cycles
Execute timely repair
The overall aim is to lower lifecycle costs via fewer inspections, repairs and manual inspections. It can be applied to all types of assets across all sectors but is particularly applicable to manufacturing, industry and infrastructure. Infrastructure includes roads and ports as well as utility industries such as water, power and gas.
Prognostics and in-situ testing isn’t new. However, what is new is substantially improved viability and economics. New sensors, such as beacons, are easier to use, can be attached to legacy equipment and have much lower costs. The cost of connectivity and cloud storage is also decreasing. This means more assets can be retro-actively connected and the sharing of data across assets and platforms enables a more complete operating picture. This opens up new business opportunities.
The paper explains the four main types of prognostic management strategies: corrective, fixed-interval preventative, failure-finding, and condition-based maintenance (CBM). It also explains a new fusion approach to prognostics:
The paper gives examples of use of prognostics in the manufacturing, heavy industry, energy generation, transport & logistics, infrastructure assets, automobile, medical, warranty and robotic industries.
It ends with the mention that, in the future, current research and work on energy harvesting will benefit sensors used for prognostics.
Beacons are small computers with a complete System on a Chip (SoC). There are four main companies that manufacturer SoCs: TI, Dialog, NXP and Nordic. Nordic is the most popular SoC for use in beacons, mainly because of the lower (tool) license cost and ease for beacon manufacturers developing the software (actually called firmware) that runs in the beacons.
Nordic has a new free Wireless Quarter Magazine that showcases uses of Nordic SoCs in many types of device, not just beacons.
Learn about:
Gartner research showing sensor innovation fosters IoT growth
Beacons help U.S. shoppers find way
Bluetooth LE in Amazon FreeRTOS
Bluetooth LE smart textiles on the rise
Article combining Bluetooth Low Energy and LPWANs
Firmwave’s use of Bluetooth Low Energy beacons to build an inexpensive satellite broadcast system
The demise of Google Nearby prompted some commentators to declare the death of beacons. However, here at BeaconZone we are actually seeing a resurgence of the use of beacons in retail.
Gone are the unsolicited notifications and gone are the ‘get rich quick’ marketers. The scenarios that remain tend to use beacons as an adjunct to something else rather than being the main solution itself. For example, they are used to provide triggering in CloseComm‘s WiFi onboarding app used by Subway, McDonalds, BurgerKing and CircleK and NCR.
Beacons are being rolled out to many food retailers, particularly in the USA. They are also taking new physical forms as witnessed by Mr Beacon:
If you are looking for more innovative uses of beacons in retail, take a look at Alibaba’s Fashion AI concept store as mentioned in the latest Wired (UK):
RFID and Beacons are used to detect items picked up during shopping so that customers can collect what they have looked at, have accessories automatically selected and view what’s in stock. Once they are home, a virtual wardrobe allows customers to buy anything they saw in store.
Beacons can also be used to enable audit compliance. Eric West, Head of Strategy at IMS has a useful free pdf on takeaways from GroceryShop, the retail industry conference. The pdf also mentions the use of beacons in lighting to drive location-based messages and wayfinding. Also:
“Amazon’s 2017 acquisition of WholeFoods was a “tipping point” that ensured all grocery players were speeding up their digital plans.”
We mentioned Wiliot last March and since then their R&D team has created early engineering samples that prove it’s possible to create a battery-less Bluetooth LE beacon harvesting energy from radio frequencies (RF).
The Wiliot device looks more like a RFID tag than a traditional beacon in that it’s supplied as a very thin PVC inlay sheet containing the chip and wire antenna together. The thin form factor, no battery and the relatively low cost will allow it to be manufactured into or stuck onto clothing and packaging that will provide for many new usecases.
Producing such a device isn’t easy as it can’t use existing System On a Chip (SoC) devices as produced by Nordic, Dialog and Texas Instruments (TI) because they are too large and use too much power. Wiliot has had to create their own SoC from the ground up, including software tools to develop and program the devices. We have been told it will be a year before Wilot has all the components in place for commercial rollout. Meanwhile, selected organisations can join the Early Advantage Program (EAP). There’s a new a product overview (PDF below) that explains the EAP and the main usecases, connected packaging, connected apparel, logistics and asset tracking:
Wiliot already have Early Advantage Program (EAP) agreements in place with over a dozen brands including top fashion brands, a telco, appliance companies, a furniture brand and packaging companies.
AI machine learning is a great partner for sensor beacon data because it allows you to make sense of data that’s often complex and contains noise. Instead of difficult traditional filtering and algorithmic analysis of the data you train a model using existing data. The model is then used to detect, classify and predict. When training the model, machine learning can pick up on nuances of the data that a human programmer wouldn’t see by analysing the data.
One of the problems with the AI machine learning approach is that you use the resultant model but can’t look inside to see how it works. You can’t say why the model has classified something some way or why it has predicted something. This can make it difficult for us humans to trust the output or understand what the model was ‘thinking’ when the classifications or predictions end up being incorrect. It also makes it impossible to provide rationales in situations such as ‘right to know’ legislation or causation auditing.
A new way to solve this problem is use of what are known as counterfactuals. Every model has inputs, in our case sensor beacon data and perhaps additional contextual data. It’s possible to apply different values to inputs to find tipping points in the model. A simple example from acceleration xyz sensor data might be that a ‘falling’ indicator is based on z going over a certain value. Counterfactuals are generic statements that explain not how the model works but how it behaves. Recently, Google announced their What-If tool that can be used to derive such insights from TensorFlow models.
We see some companies only after they have gone a long way down a particular road only to discover they made a big mistake early on. It might be, for example, they have heavily committed to the wrong beacon, wrong platform or have assumed something on one of the mobile platforms. They didn’t do their research. Often we can help them get on the right track but sometimes not.
At the other end of the research scale we have other companies who ask us “Will beacons work in an xyz environment?” where xyz has ranged, for example, from underground on the tube for the police to inside cars for a car retailer. Taking this further, we also get many, what we call, “armchair entrepreneurs” who want to work everything out before even looking at a beacon.
While we have a lot of expertise and provide advice through consultancy, it’s often the case that there are some aspects that are unknown until things are tried for real in the actual environment. Wireless solutions can be very fickle.
A lot can be learned about beacons, Bluetooth and the environment by buying one inexpensive beacon and trying things out. In the case of software, try implementing a thin slice through the proposed system touching on the perceived risky or unknown areas. Experiment before committing. Don’t go all in buying thousands of beacons and commissioning full custom software until you are confident things will work.
In our previous article iBeacon Microlocation Accuracy, we wrote about ways of using beacon RSSI to determine location. However, what if you were to use and combine beacon RSSI with other ways of locating to create a hybrid method? This is the topic of a new research Unsupervised Indoor Localization Based on Smartphone Sensors, iBeacon and Wi-Fi by Jing Chen Yi Zhang and Wei Xue of Jiangnan University, School of Internet of Thing Engineering, China.
The paper describes UILoc a system combining dead reckoning, iBeacons and Wi-Fi to achieve an average localisation error is about 1.1 m.
The paper also compares the trajectories obtained using different localisation schemes: