Inside a Beacon – Part 3 – Programming the SoC

Part 1 Part2

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.

Inside a Beacon – Part 2 – The System on a Chip (SoC)

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:

nRF52832-QFAA 64 kB 512 kB
nRF52832-QFAB 32 kB 256 kB
nRF52832-CIAA 64 kB 512 kB

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.

Part 3

Inside a Beacon – Part 1 – The Physical Beacon

This is part 1 of a 3 part series that explains what’s inside a beacon. In this part we take a look at the physical beacon.

All beacons are similar inside because they are based on standard circuit designs from Nordic Semiconductor, Dialog Semiconductor or Texas Instruments. These semiconductor manufacturers produce a complete system on a chip (SoC) that requires minimal external components. The SoC is a small computer with memory that runs software created by the manufacturer of the beacon. We will take a deeper look at the SoC in part 2 and the software in part 3.

For this series of articles we going to take a deeper look at Minew’s i7 beacon. It’s based on Nordic Semiconductor’s nRF52832 SoC.

Minew i7

Inside the case is a PCB with a CR2477 slide in battery at the rear.

Inside the i7

The main chip you can see is the mRF52832. At the top you can also see the antenna that’s created using a track in the printed circuit board. The holes at the bottom right are connections used to program the beacon.

To understand more, we need to look at the printed circuit board design and circuit schematic:

i7 design
Circuit diagram – click to see larger in new window

It can be seen that there aren’t many external components. Y1, the metal component at the top is the crystal used to maintain timing. The SoC has a number of programmable input/output (PIO) pins that are multi-purpose. In a beacon some are usually connected to LEDs and a switch as shown at the left hand side of the circuit diagram. There are also capacitors that need to be external to the SoC.

U2, U3 and U4 are optional for this beacon and missing from this variant of the i7. U2 is the KX022-1020 accelerometer. U3 is the SHT31 temperature/humidity sensor. U4 is the BH1721 light sensor.

In part 2 we take a closer look at the nRF52 SoC.

Latest Nordic WirelessQ Magazine Available

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
  • Article on Getting started with Bluetooth mesh

Read more

New Waterproof S1 Sensor Beacon in Stock

We have the new Minew S1 in stock. It’s a sensor beacon with accelerometer, temperature and humidity as well as iBeacon/Eddystone. Unusually for a temperature/humidity beacon it is waterproof to IP65 making it suitable for use outdoors. Sensor beacons like this usually have the sensor on the PCB and a hole in the case to pass through ambient temperature and humidity. Instead, the sensor is outside the beacon:

This beacon takes 2 AAA batteries and uses a newer, more efficient Nordic nRF52 System on a Chip (SoC) for a long 3 year battery life.

Standard vs Proprietary Technology

There’s a thought provoking article, by Lorenzo Amicucci, on the Nordic Semiconductor blog on End-User Factors Impacting Industrial IoT Connectivity. Nordic is the manufacturer of the System-on-a Chip (SoC) in most beacons and Lorenzo is one of their Business Development Managers. While the article talks about Industrial IoT Connectivity and by implication Bluetooth Mesh, the insights are applicable to any project that has to choose between standard or proprietary technology.

The main conclusion is that the best solution from a technical perspective is not always best for the customer. Instead, the best solution should depend on the longer-term business strategy. While a proprietary technology can have the advantage of differentiating your offering it can suffer from future limited supplier availability and possibly shorter lifetime of the technology. Large rollouts:

“…want the confidence that a huge capital spend won’t be wasted on a technology that will be left obsolete in a couple of years.”

More specfically, new and second sourced products from other vendors need to guarantee interoperability for the lifetime of your project.

Read about Generic Beacons

Nordic nRF5 SDK for Mesh v2.0.0 Released

Nordic, who provide the System on a Chip (SoC) in many beacons, have released v2 of their Mesh SDK that implements standard Bluetooth Mesh.

The main improvements are around support for Bluetooth GATT. It’s now possible for devices such as commercial beacons or smartphones to participate in the mesh via the GATT Proxy mechanism. It’s also possible for devices such as smartphones to provision new devices via GATT through Provisioning Bearer GATT (PB_GATT) rather than via firmware API or the serial API. Unfortunately, there are currently no app examples so there’s a large learning curve and development mountain to overcome to implement products based on these mechanisms.

Martin Woolley, who works for the Bluetooth organisation as an evangelist, has new slides (PDF – needs login at Google for some reason) from a Bluetooth Mesh talk at DroidConIT. The slides explain many of the mesh concepts. Here’s the slide showing the GATT proxy mechanism:

The documentation for Mesh v2 is on the Nordic web site.

Diversity in Uses of Beacons

The latest Spring 2018 WirelessQ Magazine (pdf) from Nordic demonstrates some diverse uses of beacons. For example, it mentions the use of Beacons to open doors for the visually-impaired:

A later article in the magazine explains how Bluetooth Low Energy is rapidly
expanding into industrial markets:

“Bluetooth LE technology is growing far beyond its consumer roots by underpinning innovative solutions for the Industrial Internet of Things”

 

Bluetooth 5 Simultaneous Multiple PHY

If you have been following our posts on Bluetooth 5, you might be wondering how one Bluetooth device can communicate to many devices, some of which might be legancy Bluetooth 4.

There’s a new video from Nordic Semiconductor (who produce the System on a Chip – SoC – inside most beacons) where the new long range mode is used while connecting to up to 20 devices. These can be different PHYs meaning that different capabilities, for example high speed vs long range vs legacy) can be connected at the same time.

Latest Nordic Wireless Quarter Magazine Available

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.

The magazine also has articles on how Nordic is the first to launch a Bluetooth mesh Software Development Kit, how Mesh strengthens Bluetooth wireless’ IoT credentials and explains Bluetooth 5’s advertising extensions. The article says of Bluetooth 5’s advertising extensions:

“Advertising extensions, periodic advertisements, and connectionless broadcast will have a major impact on beacons”

However, the article says:

“This won’t happen overnight because few current smartphones incorporate Bluetooth 5, but expect beacons to proliferate over the next several years as new smartphones are rolled out”