Evaluation of acquisition of vibration data over in harsh environments

William Eriksson

Computer Science and Engineering, master's level 2018

Luleå University of Technology Department of Computer Science, Electrical and Space Engineering Evaluation of wireless acquisition of vibration data over Bluetooth in harsh environments

William Eriksson

Lule˚aUniversity of Technology Dept. of Computer Science, Electrical and Space Engineering Div. of Computer Science

May, 2018

ABSTRACT

Bluetooth is a standard for short-range communication and is already used in a wide range of applications. Transferring vibration data in industrial environments for performing machine health monitoring is an application that Bluetooth potentially is suitable for. In this thesis the energy requirements and the performance of a system featuring an accelerometer and a flash memory device in conjunction with a microcontroller with capabilities is evaluated. Literature, the Bluetooth Low Energy specification, and datasheets of the selected hardware are reviewed in order to theoretically estimate the expected energy consump- tion according to selected user scenarios. The energy consumption is then evaluated in practical tests on real hardware. The performance of Bluetooth Low Energy is evaluated by testing throughput and received signal strength in different environments including industrial environments. The results show that the evaluated hardware can be operated with low energy con- sumption. The required energy for the most demanding of the selected user scenarios which involves actively using the hardware for about 8 hours requires 1.1 ·10−2 Wh. In- cluding potential losses of a voltage regulator, a Li-ion battery with a capacity of only roughly 5.5 mAh can supply the system for the whole user scenario. The results also show that Bluetooth can operate with a reasonable throughput in environments where many other devices are communicating on the same frequency band as Bluetooth. By choosing a connection interval that is between 25 ms to 100 ms the Bluetooth link becomes robust while still maintaining a high throughput. The equipment could communicate over a dis- tance of up to 148 meters with a throughput between 177 kbps and 72 kbps, depending on the configurations. The results show that the Bluetooth communication performed better in the industrial environments in which the system was evaluated in compared to the also evaluated office environments. The reason for this outcome is likely that there were fewer interfering devices in the industrial environments compared to in the office environments.

iii

ACKNOWLEDGEMENTS

I would first of all like to thank everyone at Rubico Consulting AB for giving me the opportunity to make my master’s thesis in your field of work and aimed at one of yours products and also for providing me with an office and all equipment I needed in my thesis work. Within Rubico I would like to especially thank my supervisors Patrik P¨a¨aj¨arvi and Anders Larsson for putting a lot of time and effort into providing valuable guidance and input. I would also like to thank my supervisor Ulf Bodin at Lule˚aUniversity of Technology for providing helpful material and documents for me to review and for, along with Patrik and Anders, guiding me through my thesis work. Finally I would like to thank Ulf Ohlund¨ and Stefan Lundqvist at Smurfit Kappa Pite˚afor arranging access to the kraftliner mill for conducting tests in industrial envi- ronments.

William Eriksson

v

CONTENTS

Chapter 1 – Introduction 5 1.1 Background ...... 5 1.2 Motivation ...... 6 1.3 Problem definition ...... 6 1.3.1 Research questions ...... 7 1.4 Delimitations ...... 7 1.5 Thesis structure ...... 7

Chapter 2 – Related work 9 2.1 BLE energy consumption ...... 9 2.2 Wireless communication in industrial environments ...... 9

Chapter 3 – Method 11 3.1 Research process ...... 12

Chapter 4 – Theory 13 4.1 Bluetooth ...... 13 4.1.1 BLE architecture ...... 13 4.1.2 BLE topologies ...... 18 4.1.3 BLE air interface protocol ...... 21 4.1.4 Synchronization over BLE ...... 21 4.2 Hardware and software specifications ...... 22 4.2.1 System on a chip ...... 22 4.2.2 BLE stack ...... 25 4.2.3 Accelerometer ...... 25 4.2.4 Flash memory device ...... 25 4.3 Measurement modes, procedures and scenarios ...... 26 4.3.1 Measurement modes ...... 26 4.3.2 User scenarios ...... 30 4.4 Energy consumption ...... 32 4.5 phenomena ...... 34 4.5.1 Path loss ...... 34 4.5.2 Interference ...... 34 4.5.3 Multipath propagation ...... 35 4.6 Batteries ...... 35 4.6.1 Primary batteries ...... 35 4.6.2 Secondary batteries ...... 36

Chapter 5 – Theoretical calculations 37 5.1 Energy consumption estimations ...... 37 5.1.1 Energy estimation of the high mode procedure ...... 38 5.1.2 Energy estimation of the normal mode procedure ...... 41 5.1.3 Energy estimation of the low mode procedure ...... 44 5.1.4 Energy estimation of the user scenarios ...... 46

Chapter 6 – Implementation and evaluation 49 6.1 Evaluation hardware ...... 49 6.1.1 BLE development kit ...... 49 6.1.2 Accelerometer evaluation board ...... 49 6.1.3 Flash memory device evaluation board ...... 49 6.1.4 Energy analysis tool ...... 49 6.1.5 Battery ...... 50 6.1.6 Voltage regulator ...... 50 6.2 Throughput, RSS and range ...... 50 6.2.1 Office corridor ...... 50 6.2.2 Dining hall ...... 51 6.2.3 Industrial environments ...... 52 6.2.4 Outdoors ...... 52 6.2.5 Comparison ...... 55 6.2.6 Transmission power ...... 57 6.2.7 Connection intervals ...... 58 6.3 Energy consumption ...... 63 6.3.1 Current measurement preparations ...... 63 6.3.2 Measurement results ...... 63 6.3.3 Battery test ...... 75 6.3.4 Required battery capacity ...... 76

Chapter 7 – Discussion 79 7.1 BLE Connection types ...... 79 7.2 Energy consumption ...... 80 7.3 Synchronization over BLE ...... 80 7.4 BLE Range ...... 81

viii 7.5 Batteries ...... 81 7.6 BLE in industrial environments ...... 82

Chapter 8 – Conclusions 83

ix

Abbreviations & Acronyms

ADC ...... Analog-to-digital converter

ATT ...... Attribute protocol

BLE ...... Bluetooth Low Energy

BR/EDR .... Basic Rate / Enhanced Data Rate

CRC ...... Cyclic redundancy check

DC ...... Direct current

DMA ...... Direct memory access

EMI ...... Electromagnetic interference

FHSS ...... Frequency hopping

FIFO ...... First-in-first-out

FTSP ...... Flooding Time Synchronization Protocol

GAP ...... Generic access profile

GATT ...... Generic attribute profile

GPIO ...... General purpose input/output

HCI ...... Host controller interface

HFXO ...... High frequency oscillator

IC ...... Integrated circuit

IFS ...... Inter Frame Space

ISM ...... Industrial, Scientific, and Medical

IP code ...... International Protection Marking

LDO ...... Low-dropout (regulator)

LOS ...... Line-of-sight

LPCOMP .... Low power comparator

L2CAP ...... Logical link controller and adaptation protocol

1 MCU ...... Microcontroller unit

MD ...... More Data

MEMS ...... Microelectromechanical system

MHM ...... Machinery health monitoring

MIC ...... Message Integrity Check

MTU ...... Maximum transmission unit

NFC ...... Near field communication

ODR ...... Output data rate

PCB ...... Printed circuit board

PDU ...... Protocol data unit

PHY ...... Physical (layer)

PPI ...... Programmable Peripheral Interconnect

RAM ...... Random access memory

RMS ...... Root mean square

RSS ...... Received signal strength

RSSI ...... Received Signal Strength Indicator

RTC ...... Real-time counter

RX ...... Receive

SB ...... Solder bridge

SIG ...... Special Interest Group

SIR ...... Signal-to-interference ratio

SM ...... Security manager

SNR ...... Signal-to-noise ratio

SoC ...... System on a chip

SPI ...... Serial Peripheral Interface

2 SPIM ...... Serial Peripheral Interface Master

SMD ...... Surface-mount device

TX ...... Transmit

UUID ...... Universally Unique Identifier

UWB ...... Ultra-wideband

WFE ...... Wait for event

WFI ...... Wait for interrupt

3

CHAPTER 1 Introduction

1.1 Background

Bluetooth is a global standard for short-range communications and is included in almost every single , , and tablet on the market. There are two major modes of operation in the Bluetooth standard, the Bluetooth Basic Rate / Enhanced Data Rate (BR/EDR) mode and the Bluetooth Low Energy (BLE) mode. BLE is, as the name suggests, mainly aimed at applications where long battery life is important [1]. BLE is already used in a wide range of applications and machine health monitoring (MHM) is an application that BLE potentially also can be suitable for. Both machine failures and machine maintenance can be expensive. If machines are left unmaintained until they break it may result in costly reparations and production down time, if on the other hand machines are maintained in a preventive purpose more often than necessary it might also result in high costs. MHM is thus a procedure where the health of a machine is diagnosed mainly in order to be able to perform predictive maintenance, i.e. only perform maintenance when it is needed but before the machine fails. There are several methods for performing MHM, measuring motor current, analyzing lubricants, ultrasound testing, and vibration analysis are a few examples where vibration analysis is the most common method [2]. Rubico Consulting AB1, referred to as only Rubico from now on, is a consulting company specialized in embedded systems and signal processing that also offer in-house developed products to customers. One of the products that Rubico offer is a tool for performing MHM by vibration analysis to classify the health of rolling bearings, motor shafts, gears, and other machine components. The tool consists of two devices, a sensor device and a hand-held central device. The sensor device includes a microcontroller and an accelerometer. The central device is and looks similar to a mobile phone but in a rugged format in order to endure harsh industrial environments. The two devices are connected by a cable and the data is streamed to the central device during a

1www.rubico.com

5 6 Introduction measurement.

1.2 Motivation

Rubico’s vibration analysis tools are frequently used in harsh industrial environments that pose a major strain on the cable connectors and the cable itself. Physical strain, corrosive chemicals, dust, and dirt are some of the challenging attributes of these environ- ments. A wireless design would be physically more robust to the environments because of the absence of a cable and it would potentially also be easier to meet the International Protection Marking (IP code) requirements. A wireless solution would also broaden the possibilities of the product usage, an operator could potentially start several mea- surements with the same central device. The possibility to create sensor networks with minimal cabling is another benefit of a wireless solution. Designing a wireless solution does, however, pose a different set of challenges to overcome. Wireless vibration sensors that are suitable for use in industrial environment already exists. PCB Piezotronics2 offers sensors that can transmit a number of vibration classification values such as vibra- tion peak values and vibration root mean square (RMS) values [3]. SKF3 similarly offers wireless vibration sensors that calculate vibration peak and RMS values [4]. Peak and RMS values can sometimes be used to detect the general health of machines but they are not sufficient for the vibration classification algorithms that Rubico has developed which demands unprocessed vibration data and thus larger data sets has to be transferred than in case with peak or RMS values. Rubico’s algorithms can, with the vibration data, not only determine that a machine is vibrating but also what specific part of a machine that is causing the vibrations. The motivation of this thesis is thus to aid Rubico in their quest to find out if it is practically feasible and financially suitable to develop a wireless vibration analysis tool based on their existing tool, given their current market position and their set of customers.

1.3 Problem definition

There are many aspects to consider when designing a battery-powered device that com- municates over Bluetooth Low Energy (BLE) that is supposed to be used in harsh in- dustrial environments. Aspects to take into account reaches from the choice of battery type to the functionality of BLE. The main objective of this thesis is thus to evaluate the architecture and the performance of BLE and also the energy requirements of such a system. To achieve the objective, it is divided into sub-objectives expressed as questions to be answered by measurable quantities. The questions to be answered in this thesis are listed in section 1.3.1. 2www.pcb.com/industrial_accelerometers/echo_wireless 3http://www.skf.com/group/index.html 1.4. Delimitations 7

1.3.1 Research questions 1. What different connection types are possible to use to transfer vibration data from a sensor unit to another unit over BLE and which type is most suitable in terms of the performance metrics throughput, delay, and energy consumption?

2. How much energy does the given equipment consume according to selected user scenarios? What system components consumes the majority of the energy?

3. Is it possible to perform synchronized vibration measurements over BLE? What different methods exists in that case and to what degree can the measurements be synchronized in each method?

4. What factors may affect the wireless range of the BLE link and how long range can be achieved with BLE?

5. What battery capacity is required to meet the requirements of selected user scenar- ios and what battery type of the required capacity may fit into the current product design and can operate in the temperature range of the user scenarios?

6. How does BLE work in harsh industrial environments that are characterized by large areas, metallic surfaces, and lots of motors and machines? Are there any performance impacts compared to operation in an office environment?

1.4 Delimitations

This study focuses solely on the application of vibration data acquisition over BLE. In case a result may depend on the hardware, the research revolves only around the selected hardware, thus the results may in some cases be specific to this hardware. How interference specifically affects the performance of BLE is not evaluated. Instead, the BLE performance is evaluated in various environments that feature different (but not determined) levels of interference.

1.5 Thesis structure

In chapter 2 research performed by other people that can be related to this research are presented. Chapter 3 concerns the method of this thesis, i.e. how the research is carried out. In chapter 4 relevant theory on which the research is built upon is presented. Theoretical calculations and estimations are presented in chapter 5. Chapter 6 presents the practical tests and the results acquired, here the theoretical results are also compared to the practical results. A discussion of interesting aspects of the research with respect to the problem definition is held in chapter 7 and finally the work is summarized and concluded in chapter 8.

CHAPTER 2 Related work

2.1 BLE energy consumption

The energy consumption of BLE is estimated in [5]. A simplified estimation method, derived from the specifications of BLE, is used in conjunction with electrical current specification data from typical BLE devices in the market. The results implies that BLE can be used in applications that has high demands on low energy consumption. The research is missing extensive practical experiments that verifies the theoretical estimation method. In [6] the energy consumption is evaluated for the advertising mode of BLE only. The energy consumption is predicted with an energy consumption model according to different BLE advertising parameters and a practical evaluation is then performed on the same type of BLE chip (presented in section 4.2.1) that is used in this thesis. The experimental results indicates that the derived model is accurate to a certain level and that the energy consumption in advertising mode is highly dependent on the advertising intervals.

2.2 Wireless communication in industrial environments

In [7] a wide range of different industrial environments and their potential impact on wireless communication are reviewed. The research revolves around the physical effects in the channel when signals are transmitted, the research does thus not concretely study effects on communication in terms of metrics such as data throughput, delay etc. How- ever, the research concludes that different types of difficulties may arise when conducting wireless communication in industrial environments. A performance evaluation of a bluetooth based real-time actuator system is performed in [8]. Measurements on the implies that the only possible source of interference in the industrial environment of the evaluation are other wireless commu- nication systems. The research concludes that bluetooth is extremely reliable and that

9 10 Related work neither machines or other communication can impair the transmission. This conclusion is contradicted by [9] and [10] where the research implies that bluetooth can be interfered by both other communication systems but also by machines. CHAPTER 3 Method

This research revolves around examining specific hardware and its capabilities for a spe- cific application. The research is divided into theoretical and experimental methodologies. The theoretical part of the research involves finding information of the research subjects, reviewing different options to achieve the objectives of the research, and establishing theories for how the results of the practical experiments is likely to turn out based on the chosen technology, configuration, and other relevant factors. The theories enforces that the experiments are carried out in a correct way as the results of the experiments are pre- dicted. As part of the theoretical methodology, documentation of the involved hardware, specifications of BLE, and related work are reviewed which is considered to be necessary in this research because the subjects of the research are existing technology which has a set of alternative configurations. If the available alternatives are not reviewed, the research is first of all hard to carry out and also the results of the research will not be worth as much as if all the possibilities of the technology are taken into consideration. Based on the theoretical part, the most promising methods and configurations for the intended application are selected and evaluated in the experimental part of the research. In order to be able to relate results to real life situations, the theoretical calculations and the experiments are in some cases performed according to user scenarios which are defined based on how Rubico’s current vibration analysis product is used and how a wire- less product potentially can be used in the future. The BLE performance is evaluated by measuring the average throughput and the average received signal power over a set of distances between two transceivers in various environments. The energy consumption of the hardware is measured with energy analysis equipment as the microcontrollers are programmed to match the user scenarios. Simulating the BLE communications, the selected hardware, and the effects of different environments is also a possible approach to the problems. The benefit of simulations is that many variables may be changed and tested against other variables in a large amount of simulations, thus giving much information and variable dependencies of the simulation model. The drawback of the simulation approach is that a simulation model rarely takes

11 12 Method all variables and aspects into account and does thus not fully reflect the reality. The simulation models may also be complex and time consuming to derive and implement [11]. The combination of the general research, the theoretical and the practical approaches is therefore considered to be the most suitable way to achieve the objectives of the research.

3.1 Research process

The concrete research process starts by gathering information about the system com- ponents, both general information and specific information in order to get a better un- derstanding of the research area. The problems to be solved are then defined with a foundation in the intended application and the intended environment of operation. With the problem definition in mind, further information that is more specific to the problems is gathered. The problems are then addressed in a theoretical manner where formulas and assumptions are stated. The theories are then practically tested in the cases it is feasible to perform the practical experiments within the scope of this research. To make it feasible to perform some of the practical experiments, they are performed based on pre-defined user scenarios. The research results are then evaluated and compared to the theories and the prediction of the results. If the experimental results and the prediction of the results differentiates in an unexpected way, the theory and the experimental pro- cedure are re-evaluated and another iteration of the process is performed until probable conclusions can be established. CHAPTER 4 Theory

This chapter aims to present theory and material relevant to this research and to derive theoretical models that can be verified by practical experiments in order to answer the research questions.

4.1 Bluetooth

The development of the Bluetooth technology started at Ericsson labs in Sweden 1994 and since 1998 the Bluetooth Special Interest Group (SIG)1 has been releasing Bluetooth specifications. In the Bluetooth 4.0 specification, BLE was added as an alternative to the existing BR/EDR mode [1]. As of the time of writing, the latest specification is Bluetooth 5 [12] where the main differences are in the BLE part of the specification [13], this section revolves around Bluetooth 5 and BLE in particular.

4.1.1 BLE architecture The architecture of BLE is divided into three main layers, the uppermost Application layer, the middle Host layer, and the Controller layer in the bottom. Each main layer is in turn divided into a number of sublayers as illustrated in fig. 4.1 (adapted from [14]).

1www.bluetooth.com

13 14 Theory

Application Application

Generic Access Profile Generic Attribute Profile Host Attribute Protocol Security Manager Logical Link Controller And Adaptation Protocol Host Controller Interface Link Layer Controller Physical Layer

Figure 4.1: BLE layers.

The application layer is where the application itself resides. The application layer and the host layers belongs to a logical host entity that typically executes on a PC, a microcontroller, or similar. The Link Layer and the Physical layer (PHY) belongs to another logical entity often called the controller entity which typically is embedded in a Bluetooth chip. The Host Controller Interface (HCI) is an interface between the Host and the Controller entities. The HCI can be of different kinds and can even be omitted depending on the implementation. If the host entity executes on a PC and the controller entity executes on a separate dongle, then a HCI between the entities can be a USB-cable for instance. In the case of the nRF52832 (presented in section 4.2.1), the host and the controller entities are executing on the same microcontroller chip and are thus tightly coupled, the HCI can therefore be omitted [1]. The Controller layers performs low level operations such as discovering and connecting devices, exchanging data packets, security, etc. The lowest layer in the controller entity is the PHY layer (the radio) which uses the globally unlicensed Industrial, Scientific, and Medical (ISM) radio band for conducting communications. Since the ISM band is unlicensed, other technologies (e.g. WiFi) also uses the same frequencies as Bluetooth, which may cause interference. To mitigate interference the PHY layer implements a Frequency Hopping Spread Spectrum (FHSS) mechanism which means that the frequency for communication quickly hops between a set of frequencies in a pseudo random pattern. The frequency band (2.400 to 2.4835 GHz) is divided into 40 channels, spaced 2 MHz apart where three of those channels are used solely for advertising [1]. BLE 5 specifies three PHY connection types [12]:

• LE 1M – PHY expects a data rate of 1 Mbps of uncoded data, this mode is defined already in the BLE 4.x specifications [13] (mandatory to implement in the BLE 5 specification). 4.1. Bluetooth 15

• LE 2M – The same as LE 1M but with twice the data rate, 2 Mbps of uncoded data (optional to implement in the BLE 5 specification).

• LE Coded – Mainly used for achieving longer transmission range without increasing the transmission power. This is done by improving the sensitivity of the receiver and by error correction coding the data with either 2 symbols per bit or 8 symbols per bit resulting in a data rate of 500 kbps and 125 kbps respectively at 1 M symbols per second (optional to implement in the BLE 5 specification). In this mode Texas Instruments2 achieved a line-of-sight (LOS) connected range of 1.6 km [14]. The link layer controls, negotiates, establishes links, and supports various ways of exchanging data. The operation of the link layer can be considered as a simple state machine with the states: • Standby – The link layer does nothing. • Advertising – The link layer sends advertising packets with optional payload data and information of the own device and may at the same time listen for responses from other devices which may request more information or want to establish a connection. The advertisement packets are transmitted at regular intervals which are slightly modified by a pseudo-random delay (0 - 10 ms) in order to mitigate interference.

• Scanning – The device listens for other devices that are in the advertising state. • Initiating – If a device want to establish a connection to an advertising device, it does so in the initiating state.

• Connected – When two devices are connected they are considered to be in the connected state where the master transitioned from the initiating state and the slave transitioned from advertising state. The link layer also provides cyclic redundancy checks (CRCs) to find out if a packet gets corrupted, in that case the link layer handles the retransmission [1]. The uncoded link layer packet format consists of 1 octet preamble if PHY 1M is used and 2 octets if PHY 2M is used, 4 octets access address, 2 to 257 octets protocol data unit (PDU) and 3 octets CRC. The packet format is illustrated in fig. 4.2 (adapted from [12]).

LSB MSB Preamble Access Address PDU CRC (1 – 2 octets) (4 octets) (2 - 257 octets) (3 octets)

Figure 4.2: Link layer packet format.

2https://training.ti.com/long-range-cc2640r2f 16 Theory

The link layer PDU can be either an advertising channel PDU or a data channel PDU. A data channel PDU has a 2 octets header, a variable size payload of up to 251 octets and a 4 octets message integrity check (MIC) if the link is encrypted. The data channel PDU is illustrated in fig. 4.3 (adapted from [12]).

LSB MSB Header Payload MIC (2 octets) (0 - 251 octets) (4 octets)

Figure 4.3: Data channel PDU format.

The host layers are responsible of making use of the functionalities provided by the lower layers to provide more complex functionality. Examples of such functionalities are serial port emulation and transferring big chunks of data by splitting them into smaller chunks to then reassemble them. The protocol on the lowest level of the host layers is the Logical Link Controller And Adaptation Protocol (L2CAP). The L2CAP is based on a concept of channels and is responsible for further fragmentation and defragmentation of data, multiplexing and demultiplexing of channels over a shared logical link and basic flow control. The flow control is implemented by a credit system where the receiver provides the transmitter with a number of credits. As long as the transmitter has credits it may transmit data but in the case the credits goes down to zero the transmitter has to wait until it receives more credits in order to continue the transmission [1]. The basic L2CAP layer header uses 4 octets of the link layer payload [12]. Above the L2CAP is the Security Manager (SM), as the name suggests it is responsible for handling the security of the connections. The SM implements functionality that protects against different security breaches for example, active eavesdropping (man-in- the-middle), passive eavesdropping and tracking of devices [1]. The Attribute Protocol (ATT) is also just above L2CAP in the layer stack. ATT provides a mechanism for discovering, reading and writing attributes and follows a client server model when the server exposes a set of attributes to the client. The client can discover, read and write the exposed attributes and the server can notify or indicate the client of the attributes. An attribute represents data and the ATT is designed to push or pull to or from a remote device. Besides from holding data an attribute has three properties associated with it:

• Attribute type – The attribute type tells what kind of data the attribute represents and is represented by an Universally Unique Identifier (UUID) which is 16 bit long if it is a standard attribute type defined by SIG, else if it is a custom attribute the UUID is 128 bit long. 4.1. Bluetooth 17

• Attribute Handle – The attribute handle is a value that identifies the attribute and is used by the client in all operations with the server.

• Access Permissions – The access permissions are set to determine what level of access a client has to the attribute (i.e. read, write, encryption required).

The ATT supports PDUs of six different method types [1]:

• Request – Sent by the client to the server and the server responds with a response.

• Response – Sent by the server as response to a client request.

• Command – Sent by the client to the server, no response is sent by the server.

• Notification – Sent by the server to the client, the client does not send anything back.

• Indication – Sent by the server to the client, the client responds with a confirmation.

• Confirmation – Sent by the client to confirm the reception of an indication.

An important thing to note here is the difference between notifications and indications. Indications must be acknowledged by the application while the notifications are not acknowledged by the application. Thus for achieving a high throughput notifications shall be used which are still indirectly acknowledged and retransmitted by the link layer in case of packet loss. The ATT layer header uses 3 octets of the link layer payload [12]. Profiles in the Bluetooth architecture defines how the different layers comes together. The two mentioned profiles Generic Access Profile (GAP) and Generic Attribute Profile (GATT) are in fig. 4.1 drawn in the horizontal way but they can also be thought of vertical slices going through all the layers since they define the settings of the other layers in order to implement a specific usage model. The GATT defines a framework of services and characteristics using the attributes of ATT as building blocks. It also implements definitions of how a device discovers, reads, writes, notifies, and indicates the characteristics. In BLE it is mandatory to implement GATT and ATT since they together provide the capability to discover services of a remote device. Most of the complexity is implemented in the GATT, profiles on top of GATT are simpler. The structure of a simple custom MHM GATT could look like fig. 4.4 illustrates (adapted from [1]). 18 Theory

MHM Profile

Device Information MHM Service Service

Vibration Manufacturer Data Name Characteristic Characteristic

Temperature Model Data Number Characteristic Characteristic

Serial Number Characteristic

Figure 4.4: An example of a MHM GATT.

The GAP is a mandatory profile to implement for all Bluetooth devices (not only for BLE devices) since it defines the base functionality common to all Bluetooth devices. In a BLE device, GAP must include the basic requirements for at least all the host and controller layers present in fig. 4.1. GAP defines four roles for a BLE device [1]:

• Broadcaster – Device in this role transmits advertising events periodically.

• Observer – Device in this role receives advertising events.

• Peripheral – A device that has accepted a connection request from another device. This device is a slave device.

• Central – A device that initiated the establishment of a connection. This device is a master device and may connect to more than one slave.

4.1.2 BLE topologies In the early specifications of BLE, the topologies were quite restricted. In BLE 5 there are many possible configurations which builds upon combinations of broadcasting, point- to-point and mesh topologies [12], [15]. 4.1. Bluetooth 19

Broadcasting The broadcasting topology consists of a broadcaster and any number of observers, a one to many (1:m) topology [12]. The broadcast topology is illustrated in fig. 4.5.

Broadcaster Observer

Figure 4.5: The broadcasting topology.

Point-to-Point The point-to-point (1:1) topology consists of a central device and a peripheral device. Devices that are connected via the point-to-point topology are part of a Piconet. The number of peripherals that may be participating in a piconet is only limited by the resources of the master device. Two or more piconets can form a Scatternet by devices acting peripheral in one piconet and central in another piconet [12]. A simple piconet is illustrated in fig. 4.6 and two piconets forming a scatternet is illustrated in fig. 4.7.

Central Peripheral

Figure 4.6: A piconet. 20 Theory

Central Peripheral Peripheral/Central

Figure 4.7: Two piconets forming a scatternet.

Mesh The mesh topology is not part of the core specification of Bluetooth 5 [12] but is defined in a separate mesh profile specification [15]. The mesh topology enables many-to-many (m:m) communications. Participants in a mesh network are called nodes and messages are relayed through the network according to a managed flood approach. This topology is designed for creating large scale networks which can be adopted in building automation for example [15]. A mesh network is illustrated in fig. 4.8.

Node

Figure 4.8: The mesh topology. 4.1. Bluetooth 21

4.1.3 BLE air interface protocol In connection oriented BLE communications the master (central device) and the slave (peripheral device) communicates at decided connection intervals that may be between 7.5 ms and 4 s in multiples of 1.25 ms. At the beginning of a connection interval the master opens a connection event by transmitting a packet (possibly empty) to the slave. The slave shall always respond by transmitting a packet (possibly empty) back to the central upon receiving a packet. The connection event is open as long as the master and the slave are exchanging packets. A master or a slave signal that they have more data to send by setting the More Data (MD) bit in the data channel PDU header. The master may continue or close the connection event regardless of the MD bit of the slave. The slave shall on the other hand listen for packets from the master if the master’s MD bit is set. A connection event is closed by either the master choosing to close the connection event or if the MD bit of both the master and the slave is set to zero. A connection event is also closed if no response to a packet is received or if two consecutive packets within a connection event has an invalid CRC match. Because of clock inaccuracies, the slave is required to re-synchronize its clock at each connection event which is initiated by the master. The time between the last bit of a packet and the first bit of a packet is called Inter Frame Space (IFS) and shall be 150 µs. It is up to the master to ensure that a connection event is closed a time that corresponds to at least one IFS before the next connection event. A supervision timer is used to detect link loss by checking if a supervision timeout limit is reached which may be between 100 ms and 32 s in multiples of 10 ms. The supervision timeout is defined as the maximum allowed time between two valid received data packets. A connection is considered lost if a supervision timeout occurs or if the supervision timer reaches a value that corresponds to six connection intervals before the link has been properly established [12].

4.1.4 Synchronization over BLE Clock synchronization is a problem that applies to almost all distributed systems in one way or another. Some systems only require a notion of order (chronology) of events while other systems might require accurate timing synchronization down to nanoseconds. In the case of vibration data collection and analysis, there are different potential benefits of being able to perform synchronized measurements of different degrees. Starting several measurements approximately at the same time can be a matter of user convenience while data acquired in highly synchronized measurements potentially can be fused in order to gain a deeper insight of the machine health. Cheepsync [16] is a synchronization method which builds upon BLE broadcasting mes- sages. Cheepsync supports Many-Tx-to-One-Rx synchronization and Many-Tx-to-Many- Rx synchronizations. A Tx device is in this case a broadcasting device (typically a sensor device) and a Rx device is a controller device (typically a phone). Data from experiments conducted in [16] shows that Cheepsync can achieve an average synchronization error of 22 Theory

8 µs and a 95% percent error probability of less than 40 µs in the case of Many-Tx-to- One-Rx when eight Tx devices are used. Bluesync is a protocol proposed in [17] which, like Cheepsync, also builds upon broad- casting messages. A master device broadcasts timestamps to slave devices, the times- tamps can be collected through interrupt handlers associated with the radio or by radio events and Programmable Peripheral Interconnect (PPI) which enables direct linking between peripherals. The latter is generally much more accurate because there is no software involvement when capturing the timestamps. In [17] an evaluation is performed on the same type of BLE chip (nRF52) as is subject of this research (presented in the chapter 4.2.1). The results of the evaluation shows that the synchronization error can be as low as 6.22 µs after 10 minutes without any re-synchronization with a 95% cumulative probability. The Flooding Time Synchronization Protocol (FTSP) [18] is a synchronization proto- col designed for achieving relatively high precision synchronization on resource limited wireless platforms. The protocol builds upon time-stamping at the lowest layers of a communication stack and comprehensive error compensation including clock skew esti- mation. The approach of FTSP is to periodically flood the network with synchronization messages. An implementation of the FTSP on 60 Mica/Mica23 platforms was used in [18] to evaluate the performance of FTSP. The results shows that the maximum error was 14 µs over 6 hops or 2.3 µs per hop while the network was stable and a maximum error of 67 µs when the root was switched off.

4.2 Hardware and software specifications

This section presents the hardware and the BLE software implementation of the host and the controller layers that is subject of the research.

4.2.1 System on a chip The system on a chip (SoC) that is subject of the research is the nRF52832 SoC developed by Nordic Semiconductor4. The information and the data presented are collected from [19]. This SoC is a multiproctocol SoC which has hardware support for Bluetooth 5 and BLE and is built around a Cortex-M4F microcontroller unit (MCU) with 512 kB flash memory and 64 kB random access memory (RAM). The current consumptions, depending on configuration, of the MCU are presented in table 4.1 when the MCU is running CoreMarkTM5 benchmark with a clock speed of 64 MHz (without radio communications).

3https://www.eol.ucar.edu/isf/facilities/isa/internal/CrossBow/DataSheets/mica2.pdf 4www.nordicsemi.com 5https://www.eembc.org/coremark//index.php 4.2. Hardware and software specifications 23

Table 4.1: Specified MCU current consumptions and efficiency when MCU is running CoreMarkTM benchmark in different configurations.

Symbol Description Typ. Unit IFCL Running from flash, cache enabled, LDO 7.4 mA IFCD Running from flash, cache enabled, DCDC 3V 3.7 mA IFL Running from flash, cache disabled, LDO 8.0 mA IFD Running from flash, cache disabled, DCDC 3V 3.9 mA IRL Running from RAM, LDO 6.7 mA IRD Running from RAM, DCDC 3V 3.3 mA µA/ I Efficiency, running from flash, cache enabled, LDO 125 F CL/MHz MHz µA/ I Efficiency, running from flash, cache enabled, DCDC 3V 58 F CD/MHz MHz LDO, Low-dropout; DC, Direct current; RAM, Random access memory.

In [19] two different system modes are specified, the SYSTEM OFF mode and the SYSTEM ON mode. The SYSTEM OFF mode is the deepest power saving mode and the MCU is reset when woken from this mode but offers RAM retention. The SYSTEM ON mode is the default mode when the device is powered on. The MCU and its peripherals can here be in IDLE or RUN mode. Unless other conditions are stated the conditions presented in table 4.2 are valid for the scenarios presented in table 4.3, 4.4 and 4.5 which presents specified current consumptions when radio communications are active, current consumptions in different sleep modes and current consumptions of MCU peripherals relevant to the research respectively.

Table 4.2: Common conditions

Condition Value Unit VDD 3 V Temperature 25 °C MCU WFI/WFE sleep - Peripherals All idle - Clock Not running - Regulator DCDC - VDD; Power supply voltage; WFI, Wait for inter- rupt; WFE, Wait for event; DC, Direct current. 24 Theory

Table 4.3: Specified current consumptions in scenarios involving radio communica- tion.

Symbol Description Typ. Unit IRADIO TX0 0 dBm TX @ 1 Mb/s BLE mode, Clock = HFXO 7.1 mA IRADIO TX1 -40 dBm TX @ 1 Mb/s BLE mode, Clock = HFXO 4.1 mA IRADIO RX0 Radio RX @ 1 Mb/s BLE mode, Clock = HFXO 6.5 mA MCU running CoreMark from Flash, IS0 Radio 0 dBm TX @ 1 Mb/s BLE mode, 9.2 mA Clock = HFXO, Cache enabled MCU running CoreMark from Flash, IS1 Radio RX @ 1 Mb/s BLE mode, 9.2 mA Clock = HFXO, Cache enabled BLE, Bluetooth Low Energy; TX, Transmit; HFXO, High frequency crystal oscillator; RX, Receive.

Table 4.4: Specified current consumptions when MCU is in different sleep states.

Symbol Description Typ. Unit ION EVENT System ON, No RAM retention, Wake on any event 1.2 µA ION R EVENT System ON, Full RAM retention, Wake on any event 1.5 µA ION RTC System ON, No RAM retention, Wake on RTC 1.9 µA IOFF RESET System OFF, No RAM retention, Wake on reset 0.3 µA IOFF GP IO System OFF, No RAM retention, Wake on GPIO 0.3 µA IOFF LP COMP System OFF, No RAM retention, Wake on LPCOMP 1.9 µA IOFF NFC System OFF, No RAM retention, Wake on NFC field 0.7 µA IOFF R RESET System OFF, Full 64 kB RAM retention, Wake on reset 0.7 µA RAM, Random access memory; RTC, Real-time counter; GPIO, General purpose input/output; LPCOMP, Low power comparator; NFC, Near field communication.

Table 4.5: Specified current consumptions of MCU peripherals.

Symbol Description Typ. Unit ISPIM 2Mbps Run current for SPIM, 2 Mbps 50 µA ISPIM 4Mbps Run current for SPIM, 4 Mbps 50 µA ISPIM 8Mbps Run current for SPIM, 8 Mbps 50 µA ISPIM Idle Idle current for SPIM 1 µA SPIM, Serial Peripheral Interface Master. 4.2. Hardware and software specifications 25

4.2.2 BLE stack The implementation of the BLE host and controller layers running on the nRF52832 SoC, also called BLE stack or by Nordic Semiconductor called Softdevice, is the Softdevice S132 which Nordic Semiconductor provides. The highest throughput is achieved when the ATT maximum transmission unit (MTU) is 247 Bytes, the link layer payload size is 251 Bytes, the connection interval is set to 400 ms, and the connection event length is set to be allowed to consume the whole connection interval. The maximum throughput is in this setup 771.1 kbps and 1376.2 kbps in PHY 1M and PHY 2M respectively [20].

4.2.3 Accelerometer The microelectromechanical system (MEMS) accelerometer that is subject of the research is the ADXL355 3-axis accelerometer developed by Analog Devices6. The information and data presented are collected from [21]. ADXL355 has a built-in 20-bit analog-to- digital converter (ADC) and has a configurable output data rate (ODR) from 4 Hz to 4 kHz. The specified current consumptions under conditions stated in table 4.6 are 200 µA and 21 µA in active mode and standby mode respectively.

Table 4.6: Conditions for specified current con- sumption.

Condition Value Unit

VSUP P LY 3.3 V Regulator Internal LDO - Temperature 25 °C X-axis acceleration 0 g Y-axis acceleration 0 g Z-axis acceleration 1 g ODR 500 Hz LDO, Low-dropout; ODR, Output data rate.

4.2.4 Flash memory device The flash memory device that is subject of the research is the SST26VF032B flash mem- ory device developed by Microchip7. The information and data presented are collected from [22]. This device has a storage capacity of 32 Mbit and the specified current con- sumptions at 3.6 V are 15 mA and 15 µA in active mode (40 MHz) and standby mode respectively.

6www.analog.com 7http://www.microchip.com 26 Theory

4.3 Measurement modes, procedures and scenarios

This section defines user scenarios and describes the different measurement modes and measurement procedures that may be present in the user scenarios. The scenarios, pro- cedures and modes are based on the current product and how it is used by various customers.

4.3.1 Measurement modes Different measurement modes are used depending on the characteristics of the measure- ment points on the machine that is subject of the measurement. The amount of data generated DS in number of bits by each mode is calculated by

DS = Sf StAbdNa, (4.1) where Sf is the sampling frequency in Hz, St is the sampling time in seconds, Abd is the bit depth in number of bits of one sensor axis and Na is the number of sensor axes. The time TT in seconds it takes to transfer the data from the sensor device to the central device is calculated by

DS TT = , (4.2) TP where TP is the throughput of the BLE link in bps.

High The high measurement mode is used only to gather information of a measurement point that has never been measured on before. Since in this case the characteristics (vibration intensity etc.) of the measurement point are unknown, it is beneficial if the user can get direct feedback from the equipment (to be able to see if the accelerometer is suitable for the measurement point or if the vibrations are out-of-bounds for the accelerometer and therefore another accelerometer has to be used). In order to provide the user with immediate feedback, the accelerometer data is streamed to the central device where it is displayed as the measurement is on-going. The sampling frequency is set to 20,000 Hz8 and the total measurement time is 30 seconds equally divided on the three sensor axes. The reason to dividing the measurement into measuring one sensor axis at a time is that streaming all three axes simultaneously at this sampling frequency requires higher throughput that can be achieved with BLE 1 Mbps bitrate. When the high measurement mode is performed by a user, it is considered to be in following procedure: The user powers on the sensor device and it starts advertising and establishes a connection to the central device. The user then initialize the measurement 820 kHz is used as an evaluation frequency of this mode even though that frequency is not practically supported by the ADXL355 (max 4 kHz). 4.3. Measurement modes, procedures and scenarios 27 from the central device. The vibration measurement begins and the resulting data is streamed to the central device one axis at a time. When the measurement is completed the user verifies the measurement and powers off the device. This procedure is summarized in table 4.7 and visualized by the timeline presented in figure 4.9. The system states during each activity are stated in table 4.8.

0 5 25 55 75 s

Adv. User activity Measure & stream User activity

Figure 4.9: Timeline of a measurement procedure with a high measurement mode.

Table 4.7: Activity descriptions of a measurement procedure with a high measurement mode.

ID Period [s] Activity description Duration [s] H1 0 - 5 BLE advertisement, establishing BLE connection 5 H2 5 - 25 User starts the measurement from the central device 20 H3 25 - 55 Measuring vibrations and streaming the data 30 H4 55 - 75 User verifies the measurement and powers off the device 20

Table 4.8: System states during activities in a measurement procedure with a high measurement mode.

ID State description MCU = WFI, Accelerometer = Idle, Flash device = Idle, H1 Radio = BLE advertising state 400 ms interval. MCU = WFI, Accelerometer = Idle, Flash device = Idle, H2 Radio = Keep alive. MCU = WFI, Accelerometer = Active, Flash device = Idle, H3 Radio = 0 dBm TX @ 1 Mbit/s. MCU = WFI, Accelerometer = Idle, Flash device = Idle, H4 Radio = Keep alive. 28 Theory

Normal The normal measurement mode is used on measurements points with known character- istics and that are related to a shaft with moderate rotational speed, typically the shaft of an electric motor. The sampling frequency is set to 5000 Hz9 and the measurement time is 25 seconds. A measurement in normal mode of all three sensor axes with a bit depth of 20 bit each does thus according to eq. (4.1) generate DSN = 5000 Hz · 25 s · 20 bit · 3 axes = 7,500,000 bit = 937,500 byte data. With a throughput of 771,000 bps 7,500,000 bit the data transmission will according to eq. 4.2 take TTN = 771,000 bps = 9.727 s ≈ 10 s. When the normal measurement mode is performed by a user, it is considered to be in the following procedure: The user powers on the sensor device and it starts advertising and establishes a connection to the central device. The user then initialize the measurement from the central device. The vibration measurement begins and the resulting data is buffered in the flash memory device. When the measurement is completed the user initialize the data transmission to the central device. When the data has been transferred the user verifies the measurement and powers off the device. This procedure is summarized in table 4.9 and visualized by the timeline presented in figure 4.10. The system states during each activity are stated in table 4.10.

0 5 25 50 70 80 99 s

Adv. User activity Measure User activity Data transm. User activity

Figure 4.10: Timeline of a measurement procedure with a normal measurement mode.

Table 4.9: Activity descriptions of a measurement procedure with a normal measurement mode.

ID Period [s] Activity description Duration [s] N1 0 - 5 BLE advertisement, establishing BLE connection 5 N2 5 - 25 User starts the measurement from the central device 20 N3 25 - 50 Measuring vibrations and buffring the data 25 N4 50 - 70 User initializes the data transmission from the central device 20 N5 70 - 80 The buffered data is transmitted to the central device 10 N6 80 - 99 User verifies the measurement and powers off the device 20

95 kHz is used as an evaluation frequency of this mode even though that frequency is not practically supported by the ADXL355 (max 4 kHz). 4.3. Measurement modes, procedures and scenarios 29

Table 4.10: System states during activities in a measurement procedure with a normal measure- ment mode.

ID State description MCU = WFI, Accelerometer = Idle, Flash device = Idle, N1 Radio = BLE advertising state 400 ms interval. MCU = WFI, Accelerometer = Idle, Flash device = Idle, N2 Radio = Keep alive. MCU = WFI, Accelerometer = Active, Flash device = Semi-active, N3 Radio = Keep alive. MCU = WFI, Accelerometer = Idle, Flash device = Idle, N4 Radio = Keep alive. MCU = WFI, Accelerometer = Idle, Flash device = Semi-active, N5 Radio = 0 dBm TX @ 1 Mbit/s. MCU = WFI, Accelerometer = Idle, Flash device = Idle, N6 Radio = Keep alive.

Low The low measurement mode is used on measurements points with known characteristics and that typically are related to an axis with low rotational speed. The sampling fre- quency is set to 80 Hz and the measurement time is 160 seconds. A measurement in low mode of all three sensor axes with a bit depth of 20 bit each does thus according to eq.

(4.1) generate DSL = 80 Hz · 160 s · 20 bit · 3 axes = 768,000 bit = 96,000 byte data. With a throughput of 771,000 bps the data transmission will according to eq. 4.2 take 768,000 bit TTL = 771,000 bps = 0.996 s ≈ 1 s. When the low measurement mode is performed by a user, it is considered to be in the same procedure as described in the normal mode procedure with the only difference being the time spent in the measure activity and data transmission activity. The procedure is summarized in table 4.11 and visualized by the timeline presented in figure 4.11. The system states during each activity are stated in table 4.12.

0 5 25 185 205 206 225 s

Adv. Measure User activity User activity User activity Data transm.

Figure 4.11: Timeline of a measurement procedure with a low measurement mode. 30 Theory

Table 4.11: Activity descriptions of a measurement procedure with a low measurement mode.

ID Period [s] Activity description Duration [s] L1 0 - 5 BLE advertisement, establishing BLE connection 5 L2 5 - 25 User starts the measurement from the central device 20 L3 25 - 185 Measuring vibrations and buffring the data 160 L4 185 - 205 User initializes the data transmission from the central device 20 L5 205 - 206 The buffered data is transmitted to the central device 1 L6 206 - 225 User verifies the measurement and powers off the device 20

Table 4.12: System state during activities.

ID State description MCU = WFI, Accelerometer = Idle, Flash device = Idle, L1 Radio = BLE advertising state 400 ms interval. MCU = WFI, Accelerometer = Idle, Flash device = Idle, L2 Radio = Keep alive. MCU = WFI, Accelerometer = Active, Flash device = Semi-active, L3 Radio = Keep alive. MCU = WFI, Accelerometer = Idle, Flash device = Idle, L4 Radio = Keep alive. MCU = WFI, Accelerometer = Idle, Flash device = Semi-active, L5 Radio = 0 dBm TX @ 1 Mbit/s. MCU = WFI, Accelerometer = Idle, Flash device = Idle, L6 Radio = Keep alive.

4.3.2 User scenarios The user scenarios presented in this section consists of a combination of measurement procedures defined in section 4.3.1. The purpose of the user scenarios is to reflect how much the system currently is used at the customers and how much it might be used in the future as a basis for determining the demands on the system.

Scenario A A normal scenario where an operator does a routine check of a plant by performing 40 normal mode measurements and 20 low mode measurements yielding a total amount of 60 measurements. Scenario A is summarized in table 4.13. 4.3. Measurement modes, procedures and scenarios 31

Table 4.13: Scenario A

Scenario components Value Unit High mode measurements 0 - Normal mode measurements 40 - Low mode measurements 20 - Total amount 60 - Total duration 2.35 h

Scenario B Scenario B is similar to scenario A but the check is performed on a bigger plant and is considered to be an upper limit normal scenario. Scenario B consists of 80 normal mode measurements and 45 low mode measurements yielding a total amount of 125 measure- ments. Scenario B is summarized in table 4.14.

Table 4.14: Scenario B

Scenario components Value Unit High mode measurements 0 - Normal mode measurements 80 - Low mode measurements 45 - Total amount 125 - Total duration 5.01 h

Scenario C Scenario C is also similar to scenario A and B but is considered to be an extreme scenario. Scenario C consists of 125 normal mode measurements and 75 low mode measurements yielding a total amount of 200 measurements. Scenario C is summarized in table 4.15.

Table 4.15: Scenario C

Scenario components Value Unit High mode measurements 0 - Normal mode measurements 125 - Low mode measurements 75 - Total amount 200 - Total duration 8.13 h 32 Theory

Scenario D Scenario D reflects a scenario where a plant is measured on for the first time with a total amount of 60 new measurement points. Since it is the first time the plant is measured on the characteristics of the measurements points are unknown and thus the high measurement mode must be used. Scenario D is summarized in table 4.16.

Table 4.16: Scenario D

Scenario components Value Unit High mode measurements 60 - Normal mode measurements 0 - Low mode measurements 0 - Total amount 60 - Total duration 1.25 h

4.4 Energy consumption

The average current consumption and thus also the average energy consumption is, ac- cording to the hardware electrical specifications [19], [21], [22], highly dependent on the power mode of the accelerometer, flash memory device and the MCU and its peripherals. How energy efficient the system is does thus depend on how the code is written and how the peripherals are utilized. When the MCU enters a low power state there are generally tasks to be performed before the MCU can enter the low power mode. Depending on which low power mode the tasks to be performed varies but they typically consists of storing the software state by writing the hardware registers to the stack. When the MCU wakes up (typically from an interrupt) there are also tasks to be performed, first of all any required clocks needs to be started and then the software state must be restored. These tasks can be considered to be overhead when entering and exiting a low power mode [23]. Assuming a total amount

Cycw of clock cycles, divided into a number Np of work periods, has to be executed the total energy consumption can be expressed as a function of the required energy Ew to perform the work consisting of Cycw clock cycles and the overhead energy Eo of waking the MCU and returning it to the low power mode. During each work period an amount of, Ew Ep = + Eo, Ns 4.4. Energy consumption 33

energy is consumed. The total energy Et for performing all Np work periods is thus,

Et = NpEp

Ew = Np( + Eo) (4.3) Np

= Ew + NpEo, where Eo can be divided into pre work energy Eprw and post work energy Epow. Fig. 4.12 and fig. 4.13 illustrates the energy consumption when the work is divided into three work periods and one work period respectively.

Active mode current

Eprw Ew Epow Eprw Ew Epow Eprw Ew Epow 3 3 3 Low power current

Figure 4.12: Work divided into three work periods

Active mode current

Eprw Ew Epow

Low power current

Figure 4.13: All work during one work period

To minimize the energy consumption, the amount of clock cycles needed to perform the work should be as few as possible and the work should be performed during as few work periods as possible. This can be done by for example writing efficient code [23], combining different work tasks in the same work period and also by redistributing work. A redistribution of the work could in this case be moving processing tasks from the sensor device to the central device. If the system is purely interrupt driven some cortex- m4 microcontrollers offers a Sleep-on-exit feature which removes the need of stacking and unstacking, effectively reduces the overhead of entering and exiting sleep mode [23]. However, the nRF52832 does not offer a Sleep-on-exit feature according to the manual [19]. 34 Theory

To estimate how much current the MCU core or a single peripheral consumes depending on the level of utilization of the MCU core or the peripheral, a linear approximation can be derived from the specified current consumption of each mode. Assuming the idle current Ii, the active current Ia and the utilization U in percent the average current Iavg is calculated by,

I − I I = a i U + I . (4.4) avg 100 i 4.5 Radio phenomena

In this section three different phenomena are presented that relates to radio communica- tions in general.

4.5.1 Path loss Path loss is defined as the difference between transmitted power and received power and represents the signal attenuation as a positive quantity measured in dB. A common model for calculating path loss on is the free space model by,

G G λ2 PL = −10log t r , (4.5) (4π)2d2 where Gt is the gain of the transmitter antenna, Gr is the gain of the receiver antenna, λ is the wavelength of the signal, and d is the distance between the antennas. Eq. 4.5 implies that the magnitude of the path loss increases the lower the gain of the antennas c and the greater the distance. As λ can be substituted by f , where c is the speed of light and f is the signal frequency, the magnitude of the path loss is also greater with increased signal frequency [24].

4.5.2 Interference Interference may drastically limit the performance of radio systems. Possible sources of interference in the are other radio systems and also non-radio systems that inadvertently leaks energy into the frequency band of the radio systems. The interference is generally more severe in radio crowded areas because of the number of transmitters and the higher (RF) noise floor. The signal-to-noise ratio (SNR) is a ratio that can be used to describe the level of a desired signal and the level of the background noise. A high SNR is preferable and in case much background noise is encountered in an environment the SNR can be increased by increasing the transmission power of the transmitter. When devices in the same area share the same set of frequencies for communication it may cause interference. Similarly to SNR the desired signal level and the interference level can be described by a signal-to-interference ratio (SIR). A low SIR 4.6. Batteries 35 can generally not be improved by increasing the transmission power as it will cause further interference for the other devices. Physical separation and radio resource management are possible methods for improving the SIR [24].

4.5.3 Multipath propagation Multipath propagation is a phenomenon where a signal bounces against surrounding objects and the ground which causes different versions of the original signal to arrive at the receiver at slightly different times. Multipath propagation may cause fluctuations in signal strength and signal distortion [24].

4.6 Batteries

Batteries exists in a broad variety, some are single-use since they cannot be recharged (primary batteries) while other are rechargeable (secondary batteries) [25]. Battery ca- pacity is usually specified in mAh but the capacity may depend on the discharge rate, temperature, and degradation from cycles of charging and discharging [26]. In this section selected battery types are briefly presented.

4.6.1 Primary batteries Lithium Lithium batteries are primary batteries that have lithium as an anode. Lithium batteries exist with many different cathodes, some common types are:

• Lithium Thionyl Chloride (Li-SOCl2) – Nominal cell voltage of 3.6 V primarily used in low current applications, wide operational temperature range of about -60°C– +150°C depending on the product [27], [28], [29].

• Lithium Sulfur Dioxide (Li-SO2) – Similar to Li-SOCl2 but has a nominal cell voltage of 2.9 – 3.0 V. Li-SO2 batteries are commonly used in military applications and has an operational temperature range of about -55°C – +70°C depending on the product [30], [28], [29].

• Lithium Manganese Dioxide (Li-MnO2) – Has a nominal cell voltage of 3.0 V and operational temperature range of about -40°C – +85°C depending on the product [31], [28], [29]. 36 Theory

4.6.2 Secondary batteries Lithium-ion Lithium-ion (Li-ion) batteries are a family of batteries that all are based on a reversible intercalation of lithium ions in the anode and cathode. The nominal voltage of Li-ion batteries is usually 3.7 V and the operational temperature range is usually about -20°C – +60°C depending on the product [26].

Nickel-metal hydride The nickel-metal hydride (Ni-MH) battery is replacing the highly toxic secondary nickel- cadmium (Ni-Cd) battery and the primary alkaline battery since they share the same nominal voltage of 1.2 V but the Ni-MH battery has higher energy density and similar operational temperature range to Li-ion batteries [32]. CHAPTER 5 Theoretical calculations

5.1 Energy consumption estimations

The energy consumption in each activity in the three different measurement procedures are estimated and then added together to get an estimate of the energy consumption in each procedure. With the energy consumption of each procedure the estimated en- ergy consumption of each user scenario can be calculated by summing the number of procedures times the estimated energy of a procedure. Since the current consumptions of the MCU, the accelerometer and the flash memory device are specified at different voltages they are all converted to 3 V before being included in the calculations. 3 V is chosen mainly because of convenience since most of the values are specified at 3 V (the MCU currents). To calculate the current consumptions at a different voltage, the MEMS accelerometer and the flash memory device are approximated as resistors and Ohm’s law,

V = RI ⇔ V R = ⇔ I (5.1) V I = , R is applied. With the current consumptions at 3.3 V specified in section 4.2.3 the MEMS 3.3 V accelerometer has according to eq. 5.1 an average resistance of 200 µA = 16, 500 Ω and 3.3 V 21 µA = 157, 143 Ω in active mode and idle mode respectively. The approximated average current consumptions at 3 V are thus according to eq. 5.1, 3 V I = = 182 µA, ACCEL Active 16, 500 Ω in active mode and, 3 V I = = 19.1 µA, ACCEL Idle 157, 143 Ω

37 38 Theoretical calculations in idle mode. With the current consumptions at 3.6 V specified in section 4.2.4 the flash memory 3.6 V 3.6 V device has according to eq. 5.1 an average resistance of 15 mA = 240 Ω and 15 µA = 240, 000 Ω in active mode and idle mode respectively. The approximated average current consumptions at 3 V are thus according to eq. 5.1, 3 V I = = 12.5 mA, F LASH Active 240 Ω in active mode and, 3 V I = = 12.5 µA, F LASH Idle 240, 000 Ω in idle mode. The current consumptions of the MCU are of course not specified for all possible combinations and states in the datasheet, however, Nordic semiconductor has derived an energy model related to the level of radio communication of the nrf52832 SoC. The model is available as an online tool1 and is used in the cases where the current consumptions for the configurations are not specified in the data sheet and the configuration can be applied in the tool. To calculate the energy consumption the electric power P is first calculated with Joule’s power law, P = VI, (5.2) where V is voltage and I is electric current. The energy consumption is then calculated by, E = P t, (5.3) where t is time of the event.

5.1.1 Energy estimation of the high mode procedure In the high mode procedure there are four activities. The average current consumption in each activity is here estimated. In activity H1 the system is only advertising to establish the connection to the central device with a 400 ms interval. When advertising mode with 400 ms intervals at 3 V supply voltage and 0 byte payload is selected, the online tool estimates the average current consumption to IMCU Adv = 25 µA. With the idle currents of the accelerometer IACCEL Idle = 19.1 µA and the flash memory device IF LASH Idle = 12.5 µA the total average current consumption in activity H1 is estimated to,

IH1 = IMCU Adv + IACCEL Idle + IF LASH Idle = 25 + 19.1 + 12.5

= 56.6 µA

1https://devzone.nordicsemi.com/power/ 5.1. Energy consumption estimations 39 at 3 V. The electric power of activity H1 is thus according to eq. 5.2,

PH1 = VsIH1 = 3 · 56.6 · 10−6

= 1.698 · 10−4 W.

Since activity H1 lasts for tH1 = 5 seconds the electric energy is according to eq. 5.3,

EH1 = PH1tH1 5 = 1.698 · 10−4 3600 = 2.36 · 10−7 W h.

In activity H2 the system is in a connected idle state while waiting for the user to initiate the measurement. With the same configurations as chosen for activity H1 except for the connection mode that here is ”Peripheral connection”, the tool estimates the average current consumption to IMCU Keep Alive = 12 µA. With the idle current of the accelerometer and the flash memory device the total average current consumption of activity H2 is estimated to,

IH2 = IMCU Keep Alive + IACCEL Idle + IF LASH Idle = 12 + 19.1 + 12.5

= 43.6 µA at 3 V. The electric power of activity H2 is thus according to eq. 5.2,

PH2 = VsIH2 = 3 · 43.6 · 10−6

= 1.308 · 10−4 W.

Since activity H2 lasts for tH2 = 20 seconds the electric energy is according to eq. 5.3,

EH2 = PH2tH2 20 = 1.308 · 10−4 3600 = 7.27 · 10−7 W h.

In activity H3 the system is measuring vibrations and is streaming the data to the central device. In table 4.3 the specified average current consumption when transmitting 40 Theoretical calculations

with a bit rate of 1 Mbps is IRADIO TX0 = 7.1 mA at 3 V. The approximated active current of the accelerometer is IACCEL Active = 182 µA at 3 V. With the idle current of the flash memory device the total average current consumption of activity H3 is estimated to,

IH3 = IRADIO TX0 + IACCEL Active + IF LASH Idle = 7.1 + 0.182 + 0.0125

= 7.2945 mA at 3 V. The electric power of activity H3 is thus according to eq. 5.2,

PH3 = VsIH3 = 3 · 7.2945 · 10−3

= 2.18835 · 10−2 W.

Since activity H3 lasts for tH3 = 30 seconds the electric energy is according to eq. 5.3,

EH3 = PH3tH3 30 = 2.18835 · 10−2 3600 = 1.82363 · 10−4 W h. Activity H4 is equivalent to activity H2 in this energy consumption estimation, thus −4 −7 IH4 = IH2 = 43.6 µA at 3 V, PH4 = PH2 = 1.308 · 10 W , EH4 = EH2 = 7.27 · 10 W h. The total energy consumption for the high mode procedure EH is thus,

EH = EH1 + EH2 + EH3 + EH4 = 2.36 · 10−7 + 7.27 · 10−7 + 1.82363 · 10−4 + 7.27 · 10−7

= 1.84053 · 10−4 W h. The estimations are summarized in table 5.1.

Table 5.1: Current, power and energy consumptions for the high mode procedure

Activity Avg. Current [mA] Avg. Power [W] Energy [Wh] Percent H1 0.0566 1.698 · 10−4 2.36 · 10−7 ∼0.13 H2 0.0436 1.308 · 10−4 7.27 · 10−7 ∼0.40 H3 7.2945 2.189 · 10−2 1.82 · 10−4 ∼98.9 H4 0.0436 1.308 · 10−4 7.27 · 10−7 ∼0.40 Total - - 1.84 · 10−4 100 5.1. Energy consumption estimations 41

5.1.2 Energy estimation of the normal mode procedure Activity N1 is equivalent to activity H1 in this energy consumption estimation, thus −4 −7 IN1 = IH1 = 56.6 µA at 3 V, PN1 = PH1 = 1.698 · 10 W , EN1 = EH1 = 2.36 · 10 W h. Activity N2 is equivalent to activity H2 in this energy consumption estimation, thus −4 −7 IN2 = IH2 = 43.6 µA at 3 V, PN2 = PH2 = 1.308 · 10 W , EN2 = EH2 = 7.27 · 10 W h. In activity N3 the system is measuring vibrations and is buffering the results to the flash memory device. The energy consumption is in this activity highly dependent on the utilization of the peripherals. If it is possible to continuously transfer the vibration data from the accelerometer to the flash memory device with DMA without waking the MCU core during the transmission, the energy consumption should be less than if it periodically has to be woken to initiate a new DMA transfer. Assuming this is possible, the MCU core will only be woken to handle the radio events and the MCU core consumption is the same as in H2, IMCU Keep Alive = 12 µA. The SPI peripheral current consumption is ISPIM Idle = 1 µA when idle and ISPIM 4Mbps = 50 µA when active according to table 4.5. The sampling frequency in the normal mode is 5000 Hz, the sampling is performed on all three sensor axes and the bit depth of each axis is 20 bit but 24 bits must be transferred over the SPI interface since a 20 bit value is stored in three separate 8 bit registers in the accelerometer. The accelerometer First-In-First-Out (FIFO) buffer can hold 96 values before the buffer-full interrupt is triggered and the buffer has to be emptied in order not to overwrite data. Each SPI transaction does thus consist of at most 96 values and each transaction requires an overhead byte to address the FIFO buffer register. The 5000·3·8 addressing of the register generates 96 = 1250 bps to be transferred. With the overhead bits to address the FIFO register in the beginning of the transac- tions, the total number of bits that are transferred from the accelerometer to the MCU

RAM each second is thus BRacc data = 1250 + 5000 · 24 · 3 = 361, 250 bps. Assuming the BRacc data 361,250 SPI bit rate BRSPI = 4 Mbps, the SPI utilization is UN SPI = = = BRSPI 4,000,000 0.0903125 = 9.03125%. The average current consumption of the SPI peripheral is thus according to eq. 4.4, I − I I = SPIM 4Mbps SPIM Idle U + I N SPI 100 N SPI SPIM Idle 50 − 1 = 9.03125 + 1 100 = 5.425 µA.

Assuming the same overhead for writing to the flash memory device (by a second SPI peripheral) the total average current for performing the SPI communications is 2·IN SPI = 2 · 5.425 = 10.85 µA. The approximated current consumptions of the flash memory device at 3 V are IF LASHIdle = 12.5 µA and IF LASHActive = 12.5 mA in idle and active mode respectively. The average current consumption of the flash memory device is thus according to eq. 4.4, 42 Theoretical calculations

I − I I = F LASH Active F LASH Idle U + I N F LASH 100 N SPI F LASH Idle 12500 − 12.5 = 9.03125 + 12.5 100 = 1140.27734375 µA.

Thus with the approximated active current of the accelerometer IACCEL Active = 182 µA at 3 V, the total average current consumption of activity N3 is estimated to,

IN3 = IMCU Keep Alive + 2 · IN SPI + IN F LASH + IACCEL Active = 12 + 2 · 5.425 + 1140.27734375 + 182

= 1345.12734375 µA

≈ 1.345 mA at 3 V. The electric power of activity N3 is thus according to eq. 5.2,

PN3 = VsIN3 = 3 · 1.34512734375 · 10−3

= 4.035382 · 10−3 W.

Since activity N3 lasts for tN3 = 25 seconds the electric energy is according to eq. 5.3,

EN3 = PN3tN3 25 = 4.035382 · 10−3 3600 = 2.8023 · 10−5 W h. Activity N4 is equivalent to activity H2 in this energy consumption estimation, thus −4 −7 IN4 = IH2 = 43.6 µA at 3 V, PN4 = PH2 = 1.308 · 10 W , EN4 = EH2 = 7.27 · 10 W h. In activity N5 the data has to be read back from the flash memory device to the MCU RAM to then be transmitted to the central device. Assuming the MCU core and radio current IRADIO TX0 = 7.1 mA as specified in table 4.3, the same SPI load (9.03 %) as in activity N3 but only on one SPI peripheral (since the accelerometer is inactive) and thus also the same flash memory device load as in activity N3. Since the same loads are assumed on the SPI peripheral and the flash memory device, the same average current consumptions IN SPI = 5.425 µA and IN F LASH ≈ 1140.3 µA for the SPI peripheral and the flash memory device respectively are assumed. The total average current consumption of activity N5 is thus estimated to, 5.1. Energy consumption estimations 43

IN5 = IRADIO TX0 + IN SPI + IN F LASH + IACCEL Idle = 7100 + 5.425 + 1140.27734375 + 19.1

= 8264.80234375 µA

≈ 8.2648 mA at 3 V. The electric power of activity N5 is thus according to eq. 5.2,

PN5 = VsIN5 = 3 · 8.2648 · 10−3

= 2.47944 · 10−2 W

Since activity N5 lasts for tN5 = 9.727 seconds the electric energy is according to eq. 5.3,

EN5 = PN5tN5 9.727 = 2.47944 · 10−2 3600 = 6.6993 · 10−5 W h. Activity N6 is equivalent to activity H2 in this energy consumption estimation, thus −4 −7 IN6 = IH2 = 43.6 µA at 3 V, PN6 = PH2 = 1.308 · 10 W , EN6 = EH2 = 7.27 · 10 W h. The total energy consumption for the normal mode procedure EN is thus,

EN = EN1 + EN2 + ... + EN6 = 2.36 · 10−7 + 7.27 · 10−7 + 2.8023 · 10−5 + 7.27 · 10−7 + 6.6993 · 10−5 + 7.27 · 10−7

= 9.7433 · 10−5 W h. The estimations are summarized in table 5.2.

Table 5.2: Current, power and energy consumptions for the normal mode procedure

Activity Avg. Current [mA] Avg. Power [W] Energy [Wh] Percent N1 0.0566 1.698 · 10−4 2.36 · 10−7 ∼0.24 N2 0.0436 1.308 · 10−4 7.27 · 10−7 ∼0.75 N3 1.3451 4.035 · 10−3 2.80 · 10−5 ∼28.7 N4 0.0436 1.308 · 10−4 7.27 · 10−7 ∼0.75 N5 8.2648 2.479 · 10−2 6.70 · 10−5 ∼68.8 N6 0.0436 1.308 · 10−4 7.27 · 10−7 ∼0.75 Total - - 9.74 · 10−5 100 44 Theoretical calculations

5.1.3 Energy estimation of the low mode procedure Activity L1 is equivalent to activity H1 in this energy consumption estimation, thus −4 −7 IL1 = IH1 = 56.6 µA at 3 V, PL1 = PH1 = 1.698 · 10 W , EL1 = EH1 = 2.36 · 10 W h. Activity L2 is equivalent to activity H2 in this energy consumption estimation, thus −4 −7 IL2 = IH2 = 43.6 µA at 3 V, PL2 = PH2 = 1.308 · 10 W , EL2 = EH2 = 7.27 · 10 W h. Activity L3 is similar to activity N3 since the only differences are the sampling fre- quency and the duration of the activity. The MCU core and radio current is assumed to be the same as in activity N3, IMCU Keep Alive = 12 µA. With the same reasoning as in activity N3 but with the sampling frequency of 80 Hz the number of register addressing 80·3·8 overhead bits to be transferred is 96 = 20 bps. The total amount of bits to transfer are thus BRL accdata = 20+80·24·3 = 5780 bps. Assuming the SPI bit rate BRSPI = 4 Mbps BRL accdata the SPI utilization UL SPI is UL SPI = = 0.001445 = 0.1445 %. The average BRSPI current consumption of the SPI peripheral is thus according to eq. 4.4, I − I I = SPIM 4Mbps SPIM Idle U + I L SPI 100 L SPI SPIM Idle 50 − 1 = 0.1445 + 1 100 = 1.070805 µA.

Assuming the same overhead for writing to the flash memory device (by a second SPI peripheral) the total average current for performing the SPI communications is 2·IN SPI = 2 · 5.425 = 10.85 µA. The approximated current consumptions of the flash memory device at 3 V are IF LASHI dle = 12.5 µA and IF LASHActive = 12.5 mA in idle and active mode respectively. The average current consumption of the flash memory device is thus according to eq. 4.4,

I − I I = F LASH Active F LASH Idle U + I L F LASH 100 L SPI F LASH Idle 12500 − 12.5 = 0.1445 + 12.5 100 = 30.5444375 µA.

Thus with the approximated active current of the accelerometer IACCEL Active = 182 µA at 3 V, the total average current consumption of activity L3 is estimated to,

IL3 = IMCU Keep Alive + 2 · IL SPI + IL F LASH + IACCEL Active = 12 + 2 · 1.070805 + 30.5444375 + 182

= 226.6860475 µA 5.1. Energy consumption estimations 45 at 3 V. The electric power of activity L3 is thus according to eq. 5.2,

PL3 = VsIL3 = 3 · 226.6860475 · 10−6

= 6.80058 · 10−4 W.

Since activity L3 lasts for tL3 = 160 seconds the electric energy is according to eq. 5.3,

EL3 = PL3tL3 160 = 6.80058 · 10−4 3600 = 3.0225 · 10−5 W h. Activity L4 is equivalent to activity H2 in this energy consumption estimation, thus −4 −7 IL4 = IH2 = 43.6 µA at 3 V, PL4 = PH2 = 1.308 · 10 W , EL4 = EH2 = 7.27 · 10 W h. Activity L5 is similar to activity N5 and thus with the same reasoning as in activity N5 the total average current consumption of activity L5 is estimated to,

IL5 = IRADIO TX0 + IL SPI + IL F LASH + IACCEL Idle = 7100 + 1.070805 + 30.5444375 + 19.1

= 7150.7152425 µA

≈ 7.1507 mA at 3 V. The electric power of activity L5 is thus according to eq. 5.2,

PL5 = VsIL5 = 3 · 7.1507 · 10−3

= 2.1452146 · 10−2 W

Since activity L5 lasts for tL5 = 0.996 seconds the electric energy is according to eq. 5.3,

EL5 = PL5tL5 0.996 = 2.1452146 · 10−2 3600 = 5.935 · 10−6 W h. Activity L6 is equivalent to activity H2 in this energy consumption estimation, thus −4 −7 IL6 = IH2 = 43.6 µA at 3 V, PL6 = PH2 = 1.308 · 10 W , EL6 = EH2 = 7.27 · 10 W h. 46 Theoretical calculations

The total energy consumption for the normal mode procedure EN is thus,

EL = EL1 + EL2 + ... + EL6 = 2.36 · 10−7 + 7.27 · 10−7 + 3.0225 · 10−5 + 7.27 · 10−7 + 5.935 · 10−6 + 7.27 · 10−7

= 3.8577 · 10−5 W h. The estimations are summarized in table 5.3.

Table 5.3: Current, power and energy consumptions for the low mode procedure

Activity Avg. Current [mA] Avg. Power [W] Energy [Wh] Percent L1 0.0566 1.698 · 10−4 2.36 · 10−7 ∼0.61 L2 0.0436 1.308 · 10−4 7.27 · 10−7 ∼1.89 L3 0.2267 6.801 · 10−4 3.02 · 10−5 ∼78.3 L4 0.0436 1.308 · 10−4 7.27 · 10−7 ∼1.89 L5 7.1507 2.145 · 10−2 5.89 · 10−6 ∼15.3 L6 0.0436 1.308 · 10−4 7.27 · 10−7 ∼1.89 Total - - 3.86 · 10−5 100

5.1.4 Energy estimation of the user scenarios With the energy consumption estimations of the different procedures, the estimated energy consumption of the different user scenarios are here calculated.

Scenario A has NN SA = 40 normal mode measurement procedures and NL SA = 20 low mode measurement procedures. The estimated energy consumption of user scenario A is thus,

ESA = NN SAEN + NL SAEL = 40 · 9.7433 · 10−5 + 20 · 3.8577 · 10−5

= 4.66886 · 10−3 W h.

Scenario B has NN SB = 80 normal mode measurement procedures and NL SB = 45 low mode measurement procedures. The estimated energy consumption of user scenario B is thus,

ESB = NN SBEN + NL SBEL = 80 · 9.7433 · 10−5 + 45 · 3.8577 · 10−5

= 9.530605 · 10−3 W h. 5.1. Energy consumption estimations 47

Scenario C has NN SC = 125 normal mode measurement procedures and NL SC = 75 low mode measurement procedures. The estimated energy consumption of user scenario C is thus,

ESC = NN SC EN + NL SC EL = 125 · 9.7433 · 10−5 + 75 · 3.8577 · 10−5

= 1.50724 · 10−2 W h.

Scenario D has NH SD = 60 high mode measurement procedures. The estimated energy consumption of user scenario D is thus,

ESD = NH SDEH = 60 · 1.84053 · 10−4

= 1.104318 · 10−2 W h.

CHAPTER 6 Implementation and evaluation

6.1 Evaluation hardware

6.1.1 BLE development kit The nRF52DK1 is a printed circuit board (PCB) development kit which has a nRF52832 SoC and a separate MCU for programming and debugging. Two development kits are used for the various practical tests, one acting central device and the other acting sensor device.

6.1.2 Accelerometer evaluation board An evaluation board EVAL-ADXL355Z which features the MEMS accelerometer ADXL355 is used for the evaluation.

6.1.3 Flash memory device evaluation board An evaluation board AC243005-22 which features the flash memory device SST26VF032B is used for the evaluation.

6.1.4 Energy analysis tool To measure current and energy consumptions of the system components the energy anal- ysis tool Otii Arc by Qoitech3 is used. The Otii Arc has a voltage resolution of 2.5 µV and an accuracy of ±(0.1% + 10 µV) in ADC differential mode [33].

1https://www.nordicsemi.com/eng/Products/Bluetooth-low-energy/nRF52-DK 2http://www.microchip.com/DevelopmentTools/ProductDetails.aspx?PartNO=ac243005-2 3https://www.qoitech.com/

49 50 Implementation and evaluation

6.1.5 Battery A polymer Li-ion secondary (rechargeable) battery DTP502535 with 3.7 V nominal volt- age and 400 mAh rated capacity is used when portable power supply is required [34].

6.1.6 Voltage regulator An adjustable voltage regulator module from Luxorparts which features a LM2596 reg- ulator is used along with the battery when portable power supply is required. LM2596 has a specified typical efficiency of 73% [35].

6.2 Throughput, RSS and range

The throughput and the received signal strength (RSS) reported by the Received Signal Strength Indicator (RSSI) of the BLE link is tested at different distances between the peripheral device and the central device. Tests are carried out in different environments including an office corridor, a dining hall, outdoors, and in a number of industrial en- vironments. The peripheral device sends accelerometer data to the central device by notifications over PHY 1M. In order to reach as high throughput as possible at short distances the settings of the link is at first configured as described in section 4.2.2. The transmission buffer is filled until the softdevice signals that the buffer is full, when the softdevice (the BLE stack) signals that a transmission is completed, the buffer is filled again. The number of bytes received on the central device at the application layer are stored as the transmission is on-going and a long term average is calculated by dividing the total amount of payload bytes by the total amount of time of the transmission. The outdoors environment is evaluated with both 0 dBm and 4 dBm transmission power in order to determine how the transmission power affects the throughput and RSS. The most challenging environments for the BLE link are then evaluated with other connec- tion intervals in order to determine how the connection interval affects the robustness of the link and what the trade-offs for achieving a more robust link are.

6.2.1 Office corridor The central is hung from a wooden chair in the end of the corridor and is thus surrounded by walls, the floor, or the ceiling in all directions but one. The peripheral is hung on another wooden chair and the distance between the central and the peripheral are measured with a tape measure. The top-sides of the PCBs (the sides where most of the components are mounted) are facing each other. Each distance is tested five times for a duration of one minute, yielding a total time of 5 minutes at every distance. The first five tests are performed at a distance of 10 cm between the peripheral and the receiver, the distance is then doubled for each fifth test until 640 cm is reached where after the 6.2. Throughput, RSS and range 51 next distance is just 940 cm (not 1280 cm) since the corridor ends at that distance. The results are presented in table 6.1.

Table 6.1: Throughput and RSS at different distances between the central and the peripheral in an office corridor.

Distance [cm] Avg. TP [kbps] Std. dev. [kbps] Avg. RSS [dBm] Std. dev. [dBm] 10 769.2 3.929 -30.57 1.255 20 771.1 2.927 -32.92 1.001 40 773.2 4.417 -37.91 1.678 80 750.7 9.771 -49.09 1.967 160 622.5 75.98 -52.80 2.713 320 448.9 128.6 -55.88 2.834 640 279.4 94.61 -58.77 3.894 940 121.6 63.79 -60.56 3.057 Avg., Average; TP, Throughput; Std. dev., Sample standard deviation; RSS, Received signal strength.

6.2.2 Dining hall The dining hall is a large room with a very high ceiling (∼10 m), lots of soft materials such as sofas, pillows, and a wall-to-wall carpet. There are many wireless devices nearby, bluetooth devices, wifi devices and ultra-wideband (UWB) devices. The test is carried out as described in the corridor case (section 6.2.1) and the results are presented in table 6.2.

Table 6.2: Throughput and RSS at different distances between the central and the peripheral in a dining hall.

Distance [cm] Avg. TP [kbps] Std. dev. [kbps] Avg. RSS [dBm] Std. dev. [dBm] 10 774.9 4.505 -24.31 0.4646 20 776.0 3.223 -29.51 1.114 40 773.9 2.215 -36.16 1.057 80 706.9 54.87 -43.22 1.334 160 170.3 56.80 -51.59 1.605 320 76.81 17.22 -57.32 3.589 640 6.207 2.060 -65.02 2.575 Avg., Average; TP, Throughput; Std. dev., Sample standard deviation; RSS, Received signal strength. 52 Implementation and evaluation

6.2.3 Industrial environments Tests are performed at different areas of Smurfit Kappa Pite˚awhich is the biggest kraft- liner4 mill in Europe [36].

Paper machine Paper machine5 1 (PM 1) is one of Smurfit Kappa Pite˚a’stwo paper machines. The paper machine features a countless number of motors, sensors and actuators. A test is performed at the backside of PM 1 near two big motors and some smaller motors. The floor is made of concrete and the ceiling is covered with cable ladder and cables of different sizes. The results are presented in table 6.3.

Table 6.3: Throughput and RSS at different distances between the central and the peripheral at the backside of PM 1.

Distance [cm] Avg. TP [kbps] Std. dev. [kbps] Avg. RSS [dBm] Std. dev. [dBm] 10 774.4 4.767 -36.09 5.820 20 772.9 3.367 -38.23 4.131 40 773.5 5.743 -38.62 2.648 80 763.1 9.844 -44.90 4.459 160 746.8 26.96 -55.11 4.822 320 735.2 47.93 -56.64 5.809 640 744.9 14.40 -60.33 3.808 940 712.6 124.0 -61.04 4.832 1540 419.0 144.4 -67.84 5.766 1840 289.3 122.0 -70.99 4.709 Avg., Average; TP, Throughput; Std. dev., Sample standard deviation; RSS, Received signal strength.

6.2.4 Outdoors An outdoors test is performed at a path that goes between two buildings with a distance of approximately 20 meters to each building. The test is started at what is considered to be the longest distance (37 m) for achieving at least some communication where after the distance is halved for each measurement until about 2 meters is reached. The results are presented in table 6.4.

4https://en.wikipedia.org/wiki/Containerboard 5https://en.wikipedia.org/wiki/Paper_machine 6.2. Throughput, RSS and range 53

Table 6.4: Throughput and RSS at different distances between the central and the peripheral outdoors.

Distance [m] Avg. TP [kbps] Std. dev. [kbps] Avg. RSS [dBm] Std. dev. [dBm] 2.3 760.3 13.26 -49.75 4.638 4.6 655.3 111.6 -59.54 2.398 9.3 554.9 22.35 -62.56 3.020 18.5 22.8 14.34 -74.32 2.260 37 44.6 15.45 -71.62 1.414 Avg., Average; TP, Throughput; Std. dev., Sample standard deviation; RSS, Received signal strength.

Transportation route The transportation route is a straight route of a couple of hundred meters going through a big portion of the mill. The floor, the ceiling and the walls are mostly of concrete and metal. The achievable range is surprisingly long and the maximum range for where the equipment is considered to be operable is 50 m, the test is therefore started at 50 m and the distance is then halved until around 6.25 m is reached. The results are presented in table 6.5.

Table 6.5: Throughput and RSS at different distances between the central and the peripheral in a transportation route.

Distance [m] Avg. TP [kbps] Std. dev. [kbps] Avg. RSS [dBm] Std. dev. [dBm] 6.25 741.5 18.98 -59.28 4.419 12.5 734.8 9.443 -62.88 4.458 25 645.3 15.66 -65.46 3.256 50 54.55 64.13 -80.69 4.677 Avg., Average; TP, Throughput; Std. dev., Sample standard deviation; RSS, Received signal strength.

Small switchgear A test is performed in a small switchgear6. The switchgear floor is made of a hard rubber mat, the walls are covered with switchgear panels (metallic surfaces) and in the middle of the room there are stands with a lot of control circuitry and cables. The results are presented in table 6.6.

6https://en.wikipedia.org/wiki/Switchgear 54 Implementation and evaluation

Table 6.6: Throughput and RSS at different distances between the central and the peripheral in a small switchgear.

Distance [cm] Avg. TP [kbps] Std. dev. [kbps] Avg. RSS [dBm] Std. dev. [dBm] 10 771.7 1.829 -23.16 0.6286 20 773.4 3.607 -31.00 2.625 40 769.4 5.755 -39.54 3.888 80 772.8 6.334 -43.37 5.688 160 771.0 1.971 -50.41 3.886 320 717.7 29.58 -57.93 6.168 640 764.2 9.554 -55.71 4.186 940 731.7 8.964 -62.76 5.848 1240 760.5 11.72 -64.45 4.902 Avg., Average; TP, Throughput; Std. dev., Sample standard deviation; RSS, Received signal strength.

Big switchgear The big switchgear is similar to the small one but the floor is of solid material and the middle of the room has switchgear panels instead of stands. The results are presented in table 6.7.

Table 6.7: Throughput and RSS at different distances between the central and the peripheral in a big switchgear.

Distance [m] Avg. TP [kbps] Std. dev. [kbps] Avg. RSS [dBm] Std. dev. [dBm] 3.125 766.8 4.707 -58.13 3.455 6.25 772.2 4.175 -53.84 2.815 12.5 744.4 10.44 -63.70 4.428 25 698.2 18.31 -72.65 5.655 Avg., Average; TP, Throughput; Std. dev., Sample standard deviation; RSS, Received signal strength.

Typical industry floor A test is performed in an area that can be thought of a typical industry floor, featuring a lot of motors of different sizes, a lot of pipes, containers of different types etc. The longest distance that physically can be tested in this area is 25 meters, the test is therefore started at 25 meters and thereafter halved until about 3 meters is reached. The results are presented in table 6.8. 6.2. Throughput, RSS and range 55

Table 6.8: Throughput and RSS at different distances between the central and the peripheral at a typical industry floor.

Distance [m] Avg. TP [kbps] Std. dev. [kbps] Avg. RSS [dBm] Std. dev. [dBm] 3.125 774.4 5.322 -53.86 3.509 6.25 692.5 129.0 -60.89 6.768 12.5 768.0 6.096 -61.98 4.074 25 760.6 1.610 -67.04 3.572 Avg., Average; TP, Throughput; Std. dev., Sample standard deviation; RSS, Received signal strength.

6.2.5 Comparison Comparisons between the throughput and the RSS achieved in the different test envi- ronments are presented in fig. 6.1 and in fig. 6.2 respectively.

800

700

600

500

400 Corridor Dining hall

300 Paper machine Transport. route

200 Small switchgear Avg. Throughput [kbps] Big switchgear

100 Industry floor Outdoors

0 10 100 1,000 Distance [cm]

Figure 6.1: Average throughput at different distances between the central and the peripheral in various environments with 0 dBm TX power. 56 Implementation and evaluation

−20

−30

−40

−50 Corridor Dining hall −60 Paper machine

Avg. RSS [dBm] Transport. route Small switchgear −70 Big switchgear Industry floor −80 Outdoors

10 100 1,000 Distance [cm]

Figure 6.2: Average RSS at different distances between the central and the peripheral in various environments with 0 dBm TX power.

As can be seen in fig. 6.1, the throughput of the link (with these specific link settings) at distances longer than 1 meter is highly dependent on the environment in which the communication is carried out in. In the dining hall a reasonable link performance can be maintained up to only about 1 meter while at the industry floor there is almost no difference between the throughput at 3 meters and 25 meters. As can be seen in fig. 6.2, the RSS reported by the RSSI deviates significantly at close distances in the different environments. At short distances one can expect that the RSS shall be quite similar regardless of the environment. An explanation for the deviation can be that the RSSI likely is temperature dependent (even though not stated in the specification) and thus reports a lower RSS at the paper machine where the environment temperature is higher than in the corridor or the dining hall. The RSS results should therefore mainly be used for comparison to the corresponding throughput results in each environment separately. The RSS is expected to decrease as the distance increases according to the free space path loss model and the throughput is expected to generally decrease as the RSS decreases because of noise and interference in the RF spectrum. The results implies that the throughput is correlated with the RSS, even at small scale RSS differences. In the outdoors test the link had both a higher throughput and RSS at 37 meters than at 18.5 meters. The reason for achieving better performance at a longer distance is likely 6.2. Throughput, RSS and range 57 multipath propagation that either cause constructive interference at the longer distance or destructive interference at the shorter distance or possibly both simultaneously.

6.2.6 Transmission power The outdoors environment is evaluated with 0 dBm and 4 dBm transmission power in order to determine how the transmission power affects the throughput and RSS. The transmission power is configured on both the central device and the peripheral device since link layer packets are sent in both directions. The throughput results and the RSS results are presented in fig. 6.3 and in fig. 6.4 respectively.

800 0 dBm 700 4 dBm

600

500

400

300

200 Avg. Throughput [kbps]

100

0 10 100 Distance [m]

Figure 6.3: Average throughput at different distances between the central and the peripheral in outdoor environment with 0 dBm and 4 dBm TX power. 58 Implementation and evaluation

−40 0 dBm

−45 4 dBm

−50

−55

−60 Avg. RSS [dBm] −65

−70

−75 10 100 Distance [m]

Figure 6.4: Average RSS at different distances between the central and the peripheral in outdoor environment with 0 dBm and 4 dBm TX power.

As can be seen in fig. 6.3 and in fig. 6.4, both the throughput and the RSS are higher with 4 dBm TX power compared to 0 dBm TX power at each tested distance, which is what can be expected. The maximum distance for which some communication could be maintained was 37 meters with 0 dBm TX power and 70 meters with 4 dBm TX power. As noted in the previous section the BLE link had poor performance at 18.5 meters with 0 dBm TX power. As can be seen here, that was the case with 4 dBm TX power as well.

6.2.7 Connection intervals The link with the link settings yielding the highest possible throughput at short dis- tances has proven to have widely deviating robustness depending on the environment, therefore an evaluation of how the connection interval affects the robustness of the link is performed. The short distance throughput at each connection interval, where zero or negligible packet loss can be achieved, is first evaluated in order to determine what can be expected under ideal conditions for each connection interval setting. Here the link settings are the same as in the previous tests (as described in section 4.2.2) except for the connection interval. The results are presented in fig. 6.5. 6.2. Throughput, RSS and range 59

700

600

500

400 Avg. Throughput [kbps]

300

200 10 20 30 40 50 60 70 80 90 100 Conn. interval [ms]

Figure 6.5: Average throughput at close distance with connection intervals from 7.5 ms to 100 ms in steps of 1.25 ms up to 60 ms and then in steps of 10 ms up to 100 ms.

As can be seen in fig. 6.5, the throughput gain from increased connection interval starts to level out at a connection interval of about 40 ms. The alternating shape of the graph can be explained by how the link layer packets are transmitted, a master packet, an IFS, a slave packet, and a second IFS is what is required to deliver an ATT payload to the master. The BLE stack shall schedule the packets so that the connection events do not overlap, leaving at least IFS in between them. Therefore radio time is sometimes wasted being idle since the master side stack believes that more packets cannot be scheduled in what is remaining of the connection event. At higher connection intervals a smaller portion of the radio time is thus wasted. In the following three sections the impact of the connection interval in the dining hall, the office corridor, and outdoors is evaluated for four connection intervals: 100 ms, 50 ms, 25 ms, and 12.5 ms.

Dining hall The dining hall is revisited and the tests are performed in the same way, at the same location, and at the same distances as in the previous dining hall tests where a connection interval of 400 ms was used. The radio environment seems to be even worse than when the previous test was performed in the dining hall, an initial test with 400 ms connection 60 Implementation and evaluation interval shows that the link is barely operable at all except at very close distance (about 20 cm). The results of the tests with shorter connection intervals are presented in fig. 6.6.

700

600

500

400

300 100 ms Avg. Throughput [kbps] 50 ms 200 25 ms 12.5 ms

100 100 1,000 Distance [cm]

Figure 6.6: Average throughput at different distances with 100 ms, 50 ms, 25 ms, and 12.5 ms connection intervals in the dining hall with 0 dBm TX power.

The results presented in fig. 6.6 implies that the throughput becomes more stable and predictable with shorter connection intervals. As the connection intervals gets shorter, the magnitude of the standard deviation at each distance becomes less and the throughput varies less over the tested distance.

Office corridor The office corridor is revisited and the tests are performed in the same way and at the same distances as in the previous corridor tests where a connection interval of 400 ms was used. The results are presented in fig. 6.7. 6.2. Throughput, RSS and range 61

700

600

500

100 ms Avg. Throughput [kbps] 400 50 ms 25 ms 12.5 ms

300 100 1,000 Distance [cm]

Figure 6.7: Average throughput at different distances with 100 ms, 50 ms, 25 ms, and 12.5 ms connection intervals in the corridor with 0 dBm TX power.

The results presented in fig. 6.7 implies, like in the office corridor tests, that a shorter connection interval yields a more stable and predictable link performance. However, the throughput was noticeable lower with a 25 ms connection interval and significantly lower with a 12.5 ms connection interval, compared to the throughput with 100 ms and 50 ms connection intervals, at distances less than 7 meters.

Outdoors The same outdoors location as previously tested is revisited, the results are presented together without standard deviations and separately including standard deviations in fig. 6.8. 62 Implementation and evaluation

700

600

500

400

300

200 100 ms Avg. Throughput [kbps] 50 ms 100 25 ms 12.5 ms

0 10 100 Distance [m]

100 ms 50 ms

700 700

600 600

500 500

400 400

300 300

200 200 Avg. Throughput [kbps] Avg. Throughput [kbps]

100 100

0 0 10 100 10 100 Distance [m] Distance [m] 25 ms 12.5 ms

700 700

600 600

500 500

400 400

300 300

200 200 Avg. Throughput [kbps] Avg. Throughput [kbps]

100 100

0 0 10 100 10 100 Distance [m] Distance [m]

Figure 6.8: Average throughput at different distances with 100 ms, 50 ms, 25 ms, and 12.5 ms connection intervals outdoors with 0 dBm TX power. 6.3. Energy consumption 63

The results presented in fig. 6.8 implies, like in the dining hall and office corridor tests, that a lower connection interval generally leads to a more robust and predictable connection. As in the tests performed with 400 ms connection interval, the conditions at 18.5 meters were challenging but manageable. The equipment managed, for all four connection interval settings, to maintain communication at the longest tested distance of 148 meters.

6.3 Energy consumption

The energy consumption of each part of the system (the accelerometer, the flash mem- ory device, and the MCU) is in this section evaluated according to hardware settings and hardware states. The results are used in determining total energy consumption for the complete system according to the select measurement modes and the selected user scenarios.

6.3.1 Current measurement preparations To make sure that the current measurements only includes the relevant components of the development kit (since it features a programmer MCU etc.), the kit acting sensor device is prepared for current measurements according to the development kit user guide [37]. The preparatory steps are:

1. The factory shorted solder bridge (SB) 9 is cut with a knife to put the current measurement connector P22 in series with the load.

2. A 10 Ω surface-mount device (SMD) resistor is soldered to the prepared R6 foot print, the load does now pass through this resistor instead of being in series with P22.

3. The factory open SB12 is short soldered to bypass the reverse voltage protection diode that otherwise would cause a voltage drop.

The power supplies to the accelerometer module and the flash memory device are also connected in series with a 10 Ω resistor each.

6.3.2 Measurement results Measurements performed with the Otii Arc are presented in this section. All measure- ments are performed in room temperature and with a supply voltage of 3 V to the com- ponents. The voltage is supplied from the Otii Arc and no external voltage regulators are used. The Otii software displays current consumptions and energy consumptions. The Otii software calculates the current consumptions and energy consumptions by measur- ing the voltage drop by ADC over a resistor that is in series with the load. As mentioned 64 Implementation and evaluation above, the MCU, the accelerometer, and the flash memory device are each prepared with a 10 Ω resistor. The value of the resistors is applied to the Otii software so that it can perform the current and the energy calculations. To minimize the number of manual calculations and to achieve the most accurate results, the measured energy consumptions are used directly when possible. In the cases that radio communication are carried out, the TX power is set to 0 dBm. Repetitions of measurements shows that the results are consistent to the degree that the Otii Arc cannot detect any differences between the measurements. The variance of the results are thus zero to the accuracy of the Otii Arc.

Accelerometer measurements The ODR does not make any difference on the energy consumption for the accelerometer, it samples with the same frequency internally independent of the ODR. The measured active mode energy consumption of the accelerometer is EM ACCEL Active 1s = 149 nW h for each second it is active. The measured idle mode energy consumption of the ac- celerometer is EM ACCEL Idle 1s = 14.3 nW h for each second it is idle.

Flash memory device measurements

The measured idle mode energy consumption of the flash memory device is EM F LASH Idle 1s = 33.3 nW h for each second it is idle. The current consumptions (at 3 V supply voltage) of the flash memory device when the MCU gathers accelerometer data and transfers the data in DMA chunks of 252 bytes to the flash memory device over SPI at 4 MHz and 8 MHz are presented in fig. 6.9. 6.3. Energy consumption 65

90.1 4 MHz SPI 8 MHz SPI A] µ

67.3

63.3

56.5

Current consumption [ 54.1

51

48.4

45.8 62.5 250 500 1,000 2,000 4,000 Accelerometer ODR [Hz]

Figure 6.9: Current consumptions of the flash memory device when transferring accelerometer data with SPI operating at 4 MHz and 8 MHz.

As fig. 6.9 illustrates, the current consumption of the flash memory device is less at all tested accelerometer ODRs when operating at 8 MHz than when operating at 4 MHz. A current test is also performed on the flash memory device where DMA chunks of 252 bytes are read as fast as possible from the device. Here a new DMA transaction is started by the interrupt handler as soon as a transaction is completed. The measured average current consumption in this case is 687 µA at 4 MHz and 596 µA at 8 MHz. However, the peak current consumption is 1.14 mA at 4 MHz and 1.36 mA at 8 MHz. Here one might draw the conclusion that the device consumes less current when continuously operating at a higher frequency. The reason to this behavior is likely that it takes some time for the MCU to process the interrupt triggered when a transaction is completed and start a new transaction. The clock signal of the SPI is measured with an oscilloscope which shows that the SPI communication is active 94.8 % of the time with 4 MHz SPI and 90.1 % of the time with 8 MHz SPI. Since the device has a lower utilization factor at 8 MHz the average current consumption becomes less since it has more time to sleep in between the transactions. In the intended use case, the results implies that it is better in terms of energy consumption of the flash memory device to run the SPI interface at as high frequency as possible since it here consumes less average current and because of higher transmission speed, it also has to be active less time. The measured current and energy consumptions of the flash memory device when 66 Implementation and evaluation active are overall far less than expected in the theory section. The probable cause to this outcome is that the current consumption is, in the data sheet, specified at much higher frequencies than can be achieved with the nRF52832 SPI peripheral which can be configured to 8 MHz at most. The specified current consumption in the datasheet are probably quite accurate in continuous operation at higher frequencies but in this research it is not really relevant to investigate higher read/write frequencies than 8 MHz since the selected MCU does not support it.

High mode measurements

In activity H1 the MCU is measured on when it is advertising for tH1 = 5 seconds with 400 ms intervals. The measured energy consumption for the MCU is EM MCU Adv = 136.166 nW h for the duration, adding the energy consumption for the accelerometer and flash memory device in idle mode for the same duration yields,

EM H1 = EM MCU Adv + tH1EM ACCEL Idle 1s + tH1EM F LASH Idle 1s = 1.36166 · 10−7 + 5 · 1.43 · 10−8 + 5 · 3.33 · 10−8

= 3.74 · 10−7 W h.

In activity H2 the MCU is measured on when it is maintaining the radio communi- cation to the central device for tH2 = 20 seconds with 400 ms connection intervals. The measured energy consumption for the MCU is EM MCU Keep alive = 143.188 nW h for the duration, adding the energy consumption for the accelerometer and flash memory device in idle mode for the same duration yields,

EM H2 = EM MCU Keep alive + tH2EM ACCEL Idle 1s + tH2EM F LASH Idle 1s = 1.43188 · 10−7 + 20 · 1.43 · 10−8 + 20 · 3.33 · 10−8

= 1.095 · 10−6 W h.

In activity H3 the defined sampling frequency is 20,000 Hz on one sensor axis, how- ever, the ADXL355 accelerometer can only sample with a frequency of at most 4000 Hz but on all three axes. The measured energy consumptions when collecting (with DMA transactions of 253 bytes each) and streaming accelerometer data at different sampling frequencies for tH3 = 30 seconds are presented in fig. 6.3.2. 6.3. Energy consumption 67

55.98 Wh] µ

29.1 Energy consumption [ 16.2

10.26

500 1,000 2,000 4,000 Sampling frequency [Hz]

Figure 6.10: Energy consumption of nRF52832 when streaming accelerometer data for 30 sec- onds.

As can be seen in fig. 6.3.2 the relationship between the sampling frequency and the energy consumption is approximately linear between 500 Hz and 4000 Hz. Assuming that the linearity holds also for slightly higher sampling frequencies, the relationship can be expressed as a linear function Ef = kSf + m where,

E − E k = 2 1 Sf2 − Sf1 55.98 − 10.26 (6.1) = 4000 − 500 = 0.013062857 and,

m = Ef − kSf = 10.26 − 0.013062857 · 500 (6.2)

= 3.728571429, thus, −6 Ef = (0.013062857Sf + 3.728571429)10 W h. (6.3) 68 Implementation and evaluation

20,000 It terms of data rate, 20,000 Hz on one axis is equivalent to 3 ≈ 6666.667 Hz on three axes. The estimated energy consumption when collecting and streaming accelerometer data in 6666.667 Hz for 30 seconds is thus according to eq. 6.3,

−6 EMCU H3 = (0.013062857 · 6666.667 + 3.728571429)10 = 9.0814285715 · 10−7 W h, adding the energy consumptions for the accelerometer in active mode and the flash mem- ory device in idle mode for the same duration yields,

EM H3 = EMCU H3 + tH3EM ACCEL Active 1s + tH2EM F LASH Idle 1s = 9.0814285715 · 10−5 + 30 · 1.49 · 10−7 + 30 · 3.33 · 10−8

= 9.6283 · 10−5 W h.

−6 Activity H4 is equivalent to activity H2 thus, EM H4 = EM H2 = 1.095 · 10 W h. The total measured energy consumption for the high mode procedure EM H is thus,

EM H = EM H1 + EM H2 + EM H3 + EM H4 = 3.74 · 10−7 + 1.095 · 10−6 + 9.6283 · 10−5 + 1.095 · 10−6

= 9.8847 · 10−5 W h. The measurements are summarized in table 6.9.

Table 6.9: Measured energy consumptions for the high mode procedure

Activity Energy [Wh] Percent H1 3.74 · 10−7 ∼0.38 H2 1.10 · 10−6 ∼1.11 H3 9.63 · 10−5 ∼97.4 H4 1.10 · 10−6 ∼1.11 Total 9.88 · 10−5 100

Normal mode measurements

−7 Activity N1 is equivalent to activity H1 thus, EM N1 = EM H1 = 3.74 · 10 W h. −6 Activity N2 is equivalent to activity H2 thus, EM N2 = EM H2 = 1.095 · 10 W h. Activity N3 defines, like activity H3, a higher sampling frequency (5000 Hz) than can be achieved with the ADXL355. The measured energy consumptions of the MCU when 6.3. Energy consumption 69 collecting accelerometer data for 25 seconds at different frequencies are presented in fig. 6.11.

13.58 4 MHz SPI 8 MHz SPI Wh] µ

8.54

7.16

4.71

3.9

Energy consumption [ 2.7 2.32

1.54 0.91

62.5 250 500 1,000 2,000 4,000 Sampling frequency [Hz]

Figure 6.11: Energy consumption of nRF52832 when collecting accelerometer data and trans- ferring the data to the flash memory device for 25 seconds.

As mentioned in section 6.3.2, the flash memory device consumes less energy when operating at 8 MHz than when operating at 4 MHz for this particular use case. If the opposite would have been true on the MCU side, an evaluation of which SPI frequency consumes the least energy totally would have been necessary. However, as the graphs in fig. 6.11 illustrates, it is more energy efficient to run the SPI interface at 8 MHz than at 4 MHz on the MCU side too. Therefore the 8 MHz results are used when calculating the total energy consumption. By the same reasoning and the same method as in activity H3, the energy consumption of the MCU can be expressed as a linear function between 62.5 Hz and 4000 Hz by, 70 Implementation and evaluation

EMCU N3 = kSf + m 8540 − 824 = Sf + m 4000 − 62.5 (6.4)

= 1.959619048Sf + (824 − 1.959619048 · 62.5)

−9 = (1.959619048Sf + 701, 523809524)10 W h. Thus at 5000 Hz the energy consumption of the MCU is according to eq. 6.4,

EMCU N3 = E5000 = (1.959619048 · 5000 + 701, 523809524)10−9

= 1.0499619 · 10−5 W h. The energy consumption of the flash memory device at 5000 Hz is acquired by performing a linear approximation between 62.5 Hz ODR and 4000 Hz ODR in the 8 MHz SPI case where it consumed 857 nWh and 1160 nWh respectively over 25 seconds by,

EM F LASH N3 = kSf + m 1160 − 857 = Sf + m 4000 − 62.5 (6.5)

= 0.076952381Sf + (857 − 0.076952381 · 62.5)

−9 = (0.076952381Sf + 852.19047619)10 W h. Thus at 5000 Hz accelerometer ODR the energy consumption of the flash memory device is according to eq. 6.5,

EM F LASH N3 = E5000 = (0.076952381 · 5000 + 852.19047619)10−9

= 1.23695 · 10−6 W h. adding the energy consumption for the accelerometer in active mode for the same duration yields,

EM N3 = EMCU N3 + tN3EM ACCEL Active 1s + EM F LASH N3 = 1.0499619 · 10−5 + 25 · 1.49 · 10−7 + 1.23695 · 10−6

= 1.5462 · 10−5 W h. 6.3. Energy consumption 71

−6 Activity N4 is equivalent to activity H2 thus, EM N4 = EM H2 = 1.095 · 10 W h. In activity N5 the buffered data in the flash memory device is transferred to the MCU and then to the central device. The transmission takes TTN = tN5 = 9.727 seconds and the measured energy consumption of the MCU while transmitting as fast as possible (bit −5 rate 1 Mbps, throughput 771 kbps) for this duration is EMCU N5 = 4.68·10 W h. Adding the energy consumption for the accelerometer in idle mode for the same duration and the measured energy consumption of the flash memory device EM F LASH N5 = 479 nW h yields,

EM N5 = EMCU N5 + tN5EM ACCEL Idle 1s + EM F LASH N5 = 4.68 · 10−5 + 9.727 · 1.43 · 10−8 + 4.79 · 10−7

= 4.7418 · 10−5 W h.

−6 Activity N6 is equivalent to activity H2 thus, EM N6 = EM H2 = 1.095 · 10 W h. The total measured energy consumption for the normal mode procedure EM N is thus,

EM N = EM N1 + EM N2 + ... + EM N6 = 3.74 · 10−7 + 1.095 · 10−6 + 1.0499619 · 10−5 + 1.095 · 10−6 + 4.7418 · 10−5

+ 1.095 · 10−6

= 6.1576619 · 10−5 W h.

The measurements are summarized in table 6.10.

Table 6.10: Measured energy consumptions for the normal mode procedure

Activity Energy [Wh] Percent N1 3.74 · 10−7 ∼0.61 N2 1.10 · 10−6 ∼1.78 N3 1.05 · 10−5 ∼17.1 N4 1.10 · 10−6 ∼1.78 N5 4.74 · 10−5 ∼77.0 N6 1.10 · 10−6 ∼1.78 Total 6.16 · 10−5 100

Low mode measurements

−7 Activity L1 is equivalent to activity H2 thus, EM L1 = EM H1 = 3.74 · 10 W h. 72 Implementation and evaluation

−6 Activity L2 is equivalent to activity H2 thus, EM L2 = EM H2 = 1.095 · 10 W h. The sampling frequency in activity L3 is 80 Hz and the sampling time is tL3 = 160 seconds. The ADXL355 cannot be configured to match exactly 80 Hz and since 80 Hz is close to 125 Hz, 125 Hz is chosen as evaluation frequency for activity L3 as it will give an upper limit. The measured energy consumption when collecting accelerometer data at 125 Hz for 160 seconds and storing the data in the flash memory device is

EMCU L3 = 5.9392 µW h. Adding the energy consumption for the accelerometer in active mode for the same duration and the measured energy consumption of the flash memory device EM F LASH L3 = 5.3888 µW h yields,

EM L3 = EMCU L3 + tL3EM ACCEL Active 1s + EM F LASH L3 = 5.9392 · 10−6 + 160 · 1.49 · 10−7 + 5.3888 · 10−6

= 3.5168 · 10−5 W h.

−6 Activity L4 is equivalent to activity H2 thus, EM L4 = EM H2 = 1.095 · 10 W h. In activity L5 the buffered data in the flash memory device is transferred to the MCU and then to the central device. The transmission takes TTL = tL5 = 0.996 seconds and the measured energy consumption of the MCU while transmitting as fast as possible (bit rate −6 1 Mbps, throughput 771 kbps) for this duration is EMCU L5 = 4.789 · 10 W h. Adding the energy consumption for the accelerometer in idle mode for the same duration and the measured energy consumption of the flash memory device EM F LASH L5 = 89 nW h yields,

EM L5 = EMCU L5 + tL5EM ACCEL Idle 1s + EM F LASH L5 = 4.789 · 10−6 + 0.996 · 1.43 · 10−8 + 8.90 · 10−8

= 4.892 · 10−6 W h.

−6 Activity L6 is equivalent to activity H2 thus, EM L6 = EM H2 = 1.095 · 10 W h. The total measured energy consumption for the low mode procedure EM L is thus,

EM L = EM L1 + EM L2 + ... + EM L6 = 3.74 · 10−7 + 1.095 · 10−6 + 3.5168 · 10−5 + 1.095 · 10−6 + 4.892 · 10−6

+ 1.095 · 10−6

= 4.3719 · 10−5 W h.

The measurements are summarized in table 6.11. 6.3. Energy consumption 73

Table 6.11: Measured energy consumptions for the low mode procedure

Activity Energy [Wh] Percent L1 3.74 · 10−7 ∼0.86 L2 1.10 · 10−6 ∼2.50 L3 3.52 · 10−5 ∼80.4 L4 1.10 · 10−6 ∼2.50 L5 4.89 · 10−6 ∼11.2 L6 1.10 · 10−6 ∼2.50 Total 4.37 · 10−5 100

Scenario evaluations The measurement results of the different procedures are here used to determine the actual energy consumption of the user scenarios defined in section 4.3.2.

The normal case Scenario A has NN SA = 40 normal mode measurements and NL SA = 20 low mode measurements, the measured energy consumption for scenario A is thus,

EM SA = NN SAEM N + NL SAEM L = 40 · 6.1576619 · 10−5 + 20 · 4.3719 · 10−5

= 3.3374 · 10−3 W h.

The upper limit Scenario B has NN SB = 80 normal mode measurements and NL SB = 45 low mode measurements, the measured energy consumption for scenario B is thus,

EM SB = NN SBEM N + NL SBEM L = 80 · 6.1576619 · 10−5 + 45 · 4.3719 · 10−5

= 6.8935 · 10−3 W h.

The extreme case Scenario C has NN SC = 125 normal mode measurements and NL SC = 75 low mode measurements, the measured energy consumption for scenario C is thus,

EM SC = NN SC EM N + NL SC EM L = 125 · 6.1576619 · 10−5 + 75 · 4.3719 · 10−5

= 1.0976 · 10−2 W h. 74 Implementation and evaluation

The new plant case Scenario D has NH SD = 60 high mode measurements, the measured energy consumption for scenario D is thus,

EM SD = NH SDEM H = 60 · 9.8847 · 10−5

= 5.9308 · 10−3 W h.

Comparison of the theoretical calculations and the practical results The point of the theoretical energy calculations is to enforce that the practical experi- ments are carried out correctly. A comparison (in terms of the energy portion consumed in each activity) of the theoretical calculations and practical results is presented in table 6.12.

Table 6.12: Comparison of the theoretical calculations and the practical results in the measurement procedures

Activity Tp Pp Activity Tp Pp Activity Tp Pp H1 0.13 0.38 N1 0.24 0.61 L1 0.61 0.86 H2 0.40 1.11 N2 0.75 1.78 L2 1.89 2.50 H3 98.9 97.4 N3 28.7 17.1 L3 78.3 80.4 H4 0.40 1.11 N4 0.75 1.78 L4 1.89 2.50 N5 68.8 77.0 L5 15.3 11.2 N6 0.75 1.78 L6 1.89 2.50

Tp, Theoretical energy consumption in percent; Pp, Practical energy consump- tion in percent.

The corresponding user scenario energy consumption comparison is presented in table 6.13. 6.3. Energy consumption 75

Table 6.13: Comparison of the theoretical cal- culations and the practical results in the user scenarios

User scenario Te [Wh] Pe [Wh] A 4.6689 · 10−3 3.3374 · 10−3 B 9.5306 · 10−3 6.8935 · 10−3 C 1.5072 · 10−2 1.0976 · 10−2 D 1.1043 · 10−2 5.9308 · 10−3

Te, Theoretical energy consumption; Pe, Practical energy consumption.

As can be seen in table 6.12 and in table 6.13, the theoretical calculations coincide well with the practical results.

6.3.3 Battery test In order to get an idea of what can be expected of a cheap Li-ion battery (compared to the specifications), a simple performance test of the DTP502535 battery is carried out by programming a nRF52DK to continuously collect acceleration data from the EVAL- ADXL355Z evaluation board, read data from the AC243005-2 flash memory evaluation board, and transmit the data to another nRF52DK. The battery is fully charged and connected to the LM2596 voltage regulator board (set to output 3 V) which in turn is connected to the equipment. The battery voltage is measured with a multimeter as the test goes on. The average current flowing from the battery is in the beginning of the test measured to 8.19 mA at 4.182 V and at room temperature. The test results are presented in fig. 6.12. 76 Implementation and evaluation

4.2

4

3.8

3.6

3.4 Battery voltage [V]

3.2

3

0 2 4 6 8 10 12 14 16 18 20 22 24 26 28 Time [h]

Figure 6.12: Battery performance test of the DTP502535 battery.

As can be seen in fig. 6.12 the battery could supply the circuit for approximately 27 hours before the voltage dropped too low. The battery should according to the 400 mAh specified capacity and a simplified calculation be able to supply the circuit for 8.19 mA ≈ 27 h 48.8 hours. The actual supply duration is thus just 48.8 h ≈ 55 % of the expected duration. The difference between the expected supply duration and the actual supply duration can be explained by battery imperfections, current fluctuations during the test, and that not all available energy in the battery was used up since the regulator output voltage dropped too low for the circuit at 3 V regulator input voltage.

6.3.4 Required battery capacity It can be difficult to accurately perform battery capacity calculations. The battery capac- ity is usually specified in mAh but the voltage of a battery usually drops as the remain- ing capacity decreases (as seen in the previous section) which for most loads changes the current flowing through the load and the battery. Battery imperfections, battery degradation, and other losses further complicates the required capacity calculations. If the battery has to last for the most energy demanding scenario, it must be able to deliver −2 at least EM SC ≈ 1.1 · 10 Wh since scenario C (defined in section 4.3.2) has the high- est energy consumption of the evaluated scenarios. The scenario energy consumption is specified in Wh, in order to obtain the required battery capacity in mAh, a manipulation 6.3. Energy consumption 77 of Joule’s law can be used,

P = VI

P t = V It (6.6) P t It = , V where P is power in units of watt, V is voltage in units of volt, I is current in units of ampere t is time in units of hours. Assuming a DTP502535 Li-ion battery with nominal voltage Vbatt = 3.7 V and an efficiency of 55 % (as found in the previos section) an additional capacity of Bloss = 100 − 55 = 45 % has to be taken into account. The required capacity in mAh is thus according to eq. 6.6 with an added loss factor of (1 +

Bloss),

(1 + Bloss)EM SC RC = Vbatt (1 + 0.45) · 1.1 · 10−2 W h = 3.7 V ≈ 0, 00431 Ah

= 4.31 mAh.

The hardware can however only handle up to 3.6 V external supply voltage and since Li-ion batteries can have an output voltage of as high as 4.2 V when fully charged some kind of external regulator has to be used (in addition to the regulator that exists on the MCU). Assuming the LM2596 with a typical efficiency of 73% the required battery capacity is RC R = RC + (1 − 0.73)RC ≈ 5.5 mAh assuming scenario C when taking battery loss and regulator loss into account.

CHAPTER 7 Discussion

In this chapter a discussion is held around the theoretical material and the acquired results in order to answer the research questions.

7.1 BLE Connection types

The question is ”What different connection types are possible to use to transfer vibration data from a sensor unit to another unit over BLE and which type is most suitable in terms of the performance metrics throughput, delay, and energy consumption?”. The research shows that the connection types consists of settings in the different layers in the BLE stack. At the PHY layer Bluetooth 5 specifies three physical connection types: LE 1M, LE 2M and LE Coded. The nRF52832 implements support for LE 1M and LE 2M. The choice of the physical connection type affects the bit rate and the range. The highest bitrate can be achieved with LE 2M but generally has shorter range, the LE 1M has slightly longer range but half the bitrate that of LE 2M. The LE Coded can achieve a long range but at the price of reduced throughput. At the link layer there are two states that a server can be in in order to transmit vibration data to a client: Advertising or Connected. In the Advertising state there is no confirmation on that data is received while all communication carried out in the connected state has link layer CRCs and retransmissions. Thus, for reliable and fast transmission of vibration data the link layer connected state should be used. The ATT layer supports PDUs of different types, the interesting PDUs to discuss is the Notification and the Indication PDUs. The central does not return any confirmation to Notification PDUs while it replies with a confirmation (acknowledgement) to Indication PDUs to the notifying peripheral. The main effect is that acknowledgements can be delivered to the application layer with Indications. Since the link layer already handles retransmissions, this can be considered to be rather redundant as the link layer will keep retransmitting until all data is delivered correctly or until the connections is lost.

79 80 Discussion

7.2 Energy consumption

The question is ”How much energy does the given equipment consume according to selected user scenarios? What system components consumes the majority of the energy?”. The theoretical calculations coincide well with the results acquired in the practical ex- periments. The hardware has proven to have low energy consumption in the intended application. In a high mode measurement procedure (defined in section 4.3.1) the major- ity of the energy is as expected consumed in activity H3 where the equipment is collecting data and simultaneously stream the data to the central device. In a normal mode mea- surement procedure the majority of the energy is consumed in activity N5 where the buffered data is transferred. In contrary to the energy consumption of a normal mode procedure, the majority of the energy in a low mode measurement procedure is con- sumed when data is collected from the accelerometer (activity L3) and not when the data is transferred to the central device. The reason to why the normal and the low mode procedures differ is that the amount of information collected in the low mode is very limited compared to the normal mode because of the differences in accelerometer ODR. The accelerometer current consumption is the same regardless of the ODR setting but the transmission time becomes shorter and therefore less radio activity is necessary. The results also show that it is more energy efficient to use SPI with a frequency of 8 MHz instead of 4 MHz when conducting communication with the flash memory device for transferring data.

7.3 Synchronization over BLE

The question is ”Is it possible to perform synchronized vibration measurements over BLE? What different methods exists in that case and to what degree can the measurements be synchronized in each method?”. There are many different synchronization approaches requiring different degrees of im- plementation effort. Synchronization is according to the material presented in the theory chapter possible to perform down to a few microseconds. The FTSP is rather complex to implement but good results can be achieved if it is implemented. Bluesync is espe- cially interesting since it is a relatively simple approach and has been implemented and evaluated on nRF52 SoCs with promising results. The Cheepsync approach is a third alternative but it can also be considered to be more complex than the Bluesync approach and according to the material presented in the theory, does not yield any better syn- chronization results. Both a broadcasting (advertising) approach and connected mode approach are potential ways to build synchronization upon. The BLE stack performs clock synchronization in the connected mode in order for the communication to work, this can be (and is in some implementations) exploited to perform synchronization that can be useful at the application level. The results depends on the degree of access to the underlying hardware peripherals and how they are used. Synchronization was not the 7.4. BLE Range 81 main focus of this thesis and thus no synchronization efforts were attempted practically.

7.4 BLE Range

The question is ”What factors may affect the wireless range of the BLE link and how long range can be achieved with BLE?”. The results show that many factors may affect the wireless range of a BLE link. The main factors are the transmission power, the PHY mode, the antennas, the surrounding environment, the BLE link settings, and the level of radio interference. The definite cause to why for example the dining hall (see section 6.2.2) is so challenging for the equipment has not been determined but it is likely caused by interference from other wireless devices transmitting on the ISM band, such as Bluetooth and WiFi devices. In more or less the whole office building there are devices with vendor UUID 0xFE09 advertising. When scanning for devices in the dining hall there are many of them, the UUID belongs to Google but what kind of device that advertise has not been investigated. The connection interval of the BLE link has shown to affect the robustness of the communication. A shorter connection interval generally leads to a more robust link but at the cost of reduced throughput at close distance and sometimes also at medium to long distances in some environments. A shorter connection interval could also improve the user experience since the system becomes more responsive. Even further link robustness can likely be achieved by decreasing the link layer payload size to minimum. This way the over-the-air packets takes shorter time to transmit and thus the probability of bit errors are decreased per packet. The downside of decreasing the link layer payload size is that the throughput generally will decrease as the overhead from headers takes up a bigger portion of the total packet size. The explanation to why the BLE communication performs better in some environments and worse in other environments is likely the SNR, the SIR, and multipath propagation. In this thesis a documented range of at least 148 meters could be achieved in outdoors environment with the nRF52 development kits at 0 dBm TX power without any external antennas. Since the range depends on many variables, it is difficult to specify an absolute maximum range of BLE. As previously seen, ranges of at least 1.6 km is possible to achieve with BLE Coded PHY and that is probably not the hard limit either. In the intended application of MHM by vibration analysis that this thesis has revolved around, it should be safe to claim that BLE can offer sufficient range.

7.5 Batteries

The question is ”What battery capacity is required to meet the requirements of selected user scenarios and what battery type of the required capacity may fit into the current product design and can operate in the temperature range of the user scenarios?”. 82 Discussion

Since the hardware has proven to require relatively low energy in the application of collecting, storing, and transmitting vibration data the required battery capacity is low. Scenario C is the most energy demanding user scenario of the specified scenarios and a capacity of only roughly 5.5 mAh is required to supply a whole scenario C when losses of an extra voltage regulator and the ratio between specified battery capacity and real capacity are taken into account. The calculations are to some degree simplified and assumes that an end-user will use the product exactly as specified in the scenarios which potentially can turn out a little bit different in reality. By considering battery degradation over time, in addition to the potential variations of usage, a battery with higher capacity than 5.5 mAh should preferably be used in a finished product. Since 5.5 mAh is a low capacity compared to the capacity a battery of the sizes that are possible to fit in the current product design can feature, it is reasonable to go with a battery of higher capacity. Both primary and secondary batteries are candidates to be used in a finished product. The primary batteries generally has wider operational temperature ranges (typically - 40° C – +70° C) than the operational temperature ranges of most secondary batteries (typically -20°C – +60°C).

7.6 BLE in industrial environments

The question is ”How does BLE work in harsh industrial environments that are charac- terized by large areas, metallic surfaces, and lots of motors and machines? Are there any performance impacts compared to operation in an office environment?”. As it turns out BLE works well in the tested harsh industrial environments at Smurfit Kappa Pite˚a. Ranges of up to 50 meters could be achieved with 400 ms connection intervals while the equipment only managed to maintain a reasonable throughput at a few meters in the dining hall with the same configuration. The thick concrete walls, floor, and ceiling provide some isolation against RF signals coming from outside the factory, the factory is big and there is usually not very crowded in the production areas and thus the background noise and the interference from e.g. cellphones is low. I.e. the SNR and the SIR of the communication were likely quite high for the during the tests. However, industrial tests were in this thesis only conducted at parts of a single mill. There might be areas in the mill or at other industrial sites where plenty of wireless systems operate or other types of motors and machines exist that leak energy into the 2.4 – 2.5 GHz frequency band which might interfere with the BLE system. CHAPTER 8 Conclusions

For the specific evaluated hardware in the application of vibration data acquisition and transmission over BLE the BLE layer settings PHY 1M, link layer payload size 251 B, ATT MTU size 247 B, connection interval of 100 ms or less, and connection event length equal to the connection interval provides a robust link with a throughput that is close to the maximum achievable. The system has proven to require little energy to operate where the most demanding of the selected user scenarios requires 1.1 ·10−2 Wh which corresponds to a Li-ion battery capacity of about 5.5 mAh when losses from an external voltage regulator has been accounted for. The research shows that BLE is a suitable communication standard to use in the tested industrial environments in the intended application of MHM by vibration analysis. The BLE hardware in conjunction with the BLE stack that was subject of the research per- formed overall better in the industrial environments than in typical office environments. Moreover the research concludes that it is possible to perform synchronization over BLE down to a few microseconds and that relatively long wireless ranges can achieved, in this thesis communication over a distance of 148 meters was carried out while maintaining between 177 kbps and 72 kbps depending on the configured connection interval. The research did not practically cover how the PHY 2M and the LE Coded physical layer modes affects the BLE performance. The literature study does, however, conclude that higher throughput can be achieved if PHY 2M is used but at the cost of slightly shorter range and that a longer range can be achieved with the LE Coded PHY mode at the cost of reduced throughput. The mesh configuration and the BR/EDR part of the Bluetooth specification were just briefly over-looked in this research. These topics can be interesting for future work but the research has provided the necessary information and results for reassuring that the selected hardware along with BLE are promising to use in a MHM vibration analysis system.

83

REFERENCES

[1] N. K. Gupta, Inside Bluetooth Low Energy, Second Edition., vol. 2nd ed. Artech House, 2016.

[2] W. Tustin, “Machinery health monitoring.” https://reliabilityweb.com/ articles/entry/machinery_health_monitoring2 [Accessed 17-March-2018].

[3] PCB Piezotronics, Echo® Wireless Vibration Monitoring System. http://www. pcb.com/contentstore/mktgContent/IMI_Downloads/IMI-Echo_LowRes.pdf [Accessed 11-April-2018].

[4] SKF, SKF Wireless Machine Condition Sensor. http://www.skf.com/binary/ 21-157553/CM-P8-10243-4-EN-SKF-Wireless-Machine-Condition-Sensor_ data-sheet.pdf [Accessed 11-April-2018].

[5] R. Tei, H. Yamazawa, and T. Shimizu, “Ble power consumption estimation and its applications to smart manufacturing,” in 2015 54th Annual Conference of the Society of Instrument and Control Engineers of Japan (SICE), pp. 148–153, July 2015.

[6] R. Schrader, T. Ax, C. R¨ohrig, and C. F¨uhner,“Advertising power consumption of bluetooth low energy systems,” in 2016 3rd International Symposium on Wire- less Systems within the Conferences on Intelligent Data Acquisition and Advanced Computing Systems (IDAACS-SWS), pp. 62–68, Sept 2016.

[7] J. F. Coll, Channel Characterization and Wireless Communication Performance in Industrial Environments. PhD thesis, KTH Royal Institute of Technology, 2014.

[8] U. Meier, S. Witte, K. Helmig, M. Hoing, M. Schnuckel, and H. Krause, “Per- formance evaluation and prediction of a bluetooth based real-time sensor actuator system in harsh industrial environments,” in 2007 IEEE Conference on Emerging Technologies and Factory Automation (EFTA 2007), pp. 33–37, Sept 2007.

85 86

[9] P. Stenumgaard, J. Chilo, J. Ferrer-Coll, and P. Angskog, “Challenges and conditions for wireless machine-to-machine communications in industrial environments,” IEEE Communications Magazine, vol. 51, pp. 187–192, June 2013.

[10] L. Sydanheimo, M. Keskilammi, and M. Kivikoski, “Performance issues on the wire- less 2.4 ghz ism band in a multisystem environment,” IEEE Transactions on Con- sumer Electronics, vol. 48, pp. 638–643, Aug 2002.

[11] O. Ulgen,¨ B. Johnsonbaugh, and R. Klungle, “Simulation methodology – a practi- tioner’s perspective,”

[12] Bluetooth SIG, Bluetooth Core Specification v5.0. https://www.bluetooth.com/ specifications/bluetooth-core-specification [Accessed 05-February-2018].

[13] M. Collotta, G. Pau, T. Talty, and O. K. Tonguz, “Bluetooth 5: a concrete step forward towards the iot,” CoRR, vol. abs/1711.00257, Oct 2017.

[14] M. Bhargava, IoT Projects with Bluetooth Low Energy., vol. Third edition. Packt Publishing, Sept 2017.

[15] Bluetooth SIG, Mesh Profile Specification v1.0. https://www.bluetooth.com/ specifications/mesh-specifications [Accessed 14-March-2018].

[16] S. Sridhar, P. Misra, G. S. Gill, and J. Warrior, “Cheepsync: a time synchronization service for resource constrained bluetooth le advertisers,” IEEE Communications Magazine, vol. 54, pp. 136–143, January 2016.

[17] F. Asgarian and K. Najafi, “Time synchronization in a network of bluetooth low energy beacons,” in Proceedings of the SIGCOMM Posters and Demos, SIGCOMM Posters and Demos ’17, (New York, NY, USA), pp. 119–120, ACM, 2017.

[18] M. Mar´oti,B. Kusy, G. Simon, and A. L´edeczi,“The flooding time synchroniza- tion protocol,” in Proceedings of the 2Nd International Conference on Embedded Networked Sensor Systems, SenSys ’04, (New York, NY, USA), pp. 39–49, ACM, 2004.

[19] Nordic Semiconductor, nRF52832 Product Specification v1.4. http://infocenter. nordicsemi.com/pdf/nRF52832_PS_v1.4.pdf [Accessed 05-February-2018].

[20] Nordic Semiconductor, S132 SoftDevice Specification v5.1. http://infocenter. nordicsemi.com/pdf/S132_SDS_v5.1.pdf [Accessed 17-March-2018].

[21] Analog devices, Datasheet ADXL354/355. http://www.analog.com/media/ en/technical-documentation/data-sheets/ADXL354_355.pdf [Accessed 06- February-2018]. 87

[22] Microchip, SST26VF032B / SST26VF032BA Datasheet. http://ww1.microchip. com/downloads/en/DeviceDoc/20005218E.pdf [Accessed 22-February-2018]. [23] J. Yiu, The Definitive Guide to ARM® Cortex®-M3 and Cortex®-M4 Processors., vol. Third edition. Newnes, 2013.

[24] T. Rappaport, Wireless Communications: Principles and Practice. Upper Saddle River, NJ, USA: Prentice Hall PTR, 2nd ed., 2001.

[25] OpenStax, OpenStax, Chemistry. OpenStax CNX, Jun 2016. http://cnx.org/ contents/[email protected] [Accessed 05-April- 2018].

[26] G. Pistoia, Lithium-Ion Batteries: Advances and Applications. Elsevier Science, 2013.

[27] Saft Li-SOCl2 Batteries. https://www.saftbatteries.com/ products-solutions/products/ls-lsh?text=&tech=84&market=&sort=newest& submit=Search [Accessed 25-January-2018].

[28] EEMB Batteries. http://www.eemb.com/battery/primary-battery.html [Ac- cessed 26-January-2018].

[29] Tadiran. http://www.tadiranbat.com/compare-lithium-cells.html [Accessed 26-January-2018].

[30] Saft Li-SO2 Batteries. https://www.saftbatteries.com/products-solutions/ products/lo-g?text=&tech=83&market=&sort=newest&submit=Search [Ac- cessed 25-January-2018].

[31] Saft Li-MnO2 Batteries. https://www.saftbatteries.com/products-solutions/ products/lm-m?text=&tech=82&market=&sort=newest&submit=Search [Ac- cessed 25-January-2018].

[32] K.-H. Young, Research in Nickel/Metal Hydride Batteries 2016. Batteries (ISSN 2313-0105), Dec 2016.

[33] Qoitech, Otii Technical Specification. https://www.qoitech.com/docs/Otii_ Tech_Spec.pdf [Accessed 23-March-2018].

[34] DATA POWER TECHNOLOGY, Product Specifications DTP502535. https: //cdn.sparkfun.com/datasheets/Prototyping/spe-00-502535-400mah-en-1. 0ver.pdf [Accessed 03-April-2018]. [35] Texas Instruments, LM2596 SIMPLE SWITCHER® Power Converter 150-kHz 3-A Step-Down Voltage Regulator. http://www.ti.com/lit/ds/symlink/lm2596.pdf [Accessed 03-April-2018]. 88

[36] Smurfit Kappa Pite˚a. https://www.smurfitkappa.com/vHome/se/Kraftliner [Accessed 19-April-2018].

[37] Nordic Semiconductor, nRF52832 Development Kit v1.1.x User Guide v1.2. http: //infocenter.nordicsemi.com/pdf/nRF52_DK_User_Guide_v1.2.pdf [Accessed 14-February-2018].