• No results found

of wireless RPM sensor

N/A
N/A
Protected

Academic year: 2021

Share "of wireless RPM sensor"

Copied!
47
0
0

Loading.... (view fulltext now)

Full text

(1)

of wireless RPM sensor

Yang Song

PDF - Master’s Thesis

Main field of study: Department of Electronics Design (EKS) Credits: 30

Semester/Year: VT, 2020 Supervisor: Bengt Oelmann Examiner: Göran Thungström

Course code/registration number: D3808

(2)

Abstract

Energy-saving wireless sensors are increasingly used in the industry. Users can remotely monitor the status of the measured device and do not need to frequently replace the battery of the device. In this thesis, we studied a low-cost energy-independent wireless speed sensor system that can power itself by the rotation of the host. The BMG250 MEMS gyroscope is responsible for temperature and angular velocity measurement, and the nRF52832 SoC sends data to the remote monitoring terminal through BLE communication. This study aims to discover the energy consumption and energy saving methods of the entire process of data collection, data transfer, and data transmission. Finally, in order to meet the various test requirements, an energy consumption standard will be summed up to calculate the energy consumption of the entire system.

Key words: low-cost energy-independent wireless speed sensor system, gyroscope, BLE, energy consumption standard

(3)

Acknowledgments

First of all, I wish to express my deepest gratitude to my supervisor, professor Oelmann Bengt. Thanks to him for providing me the thesis topic that I am so interested in. And without his guidance and correction of the research direction of my thesis, my thesis could not be completed smoothly.

And then, I would like to pay my special regards to PhD student Ye Xu. He is the provider of all project equipment and also give me lots of effective suggestion like a lighthouse.

In the end I want to acknowledge the support and encourage of my family.

And there are also friends who colorful my daily life, give me the motivation to live alone and support me to complete the project.

Yang Song Sundsvall, Sweden June 2020

(4)

Table of Contents

Abstract... ii

Acknowledgments...iii

1 Introduction...1

1.1 Background and problem motivation...1

1.2 Overall aim...1

1.3 Problem statement...2

1.4 Outline... 2

2 Theory... 3

2.1 Hardware...3

2.1.1 BMG250 MEMS Gyroscope... 3

2.1.2 nRF52832 BLE SoC... 4

2.1.3 PCA63511 PPK Board... 6

2.2 BLE...6

2.2.1 BLE Overview... 6

2.2.2 BLE Advantage...7

2.2.3 BLE Protocol...8

2.3 BLE Beacon... 13

2.4 SPI Protocol... 13

3 Design...15

3.1 System Overview... 15

3.2 The Energy Consumption of BLE...16

3.2.1 Aim... 16

3.2.2 Requirement Specification...16

3.2.3 Simulation... 17

3.2.4 Advertising Type Analyzation... 20

3.2.5 BLE Final Energy Consumption... 24

3.3 The Energy Consumption of SPI...26

3.3.1 Aim... 26

3.3.2 Working Mode...26

4 Result...28

4.1 BLE Unit Energy Consumption...28

4.1.1 limitation...28

4.1.2 Measurement Result... 28

4.2 SPI Activities Energy Consumption...30

4.2.1 BLE Idle Current...30

4.2.2 Distortion Problem...30

(5)

4.2.3 The Unit Measurement Result of Gyroscope Always-on Mode...31

4.2.4 Measurement Result of Gyroscope wakeup-sleep Mode...32

4.3 Energy Consumption Calculation Standard...35

4.3.1 System Energy Consumption Overview...35

4.3.2 Part One... 36

4.3.3 Part two... 37

4.3.4 Part three...37

5 Conclusion...39

5.1 Thesis Conclusions...39

5.2 Future work... 39

Reference... 41

(6)

1 Introduction

1.1 Background and problem motivation

The rise of the current Internet of Things (IOT) technology has made the public's demand for various functions. More and more sensors,therefore, are added continuously to them. Especially for industrial, as long as the devices have a certain level of digital intelligence, people can monitor and track them, share their status data, and communicate with other devices. And then, users can improve the efficiency of the business process by collecting and analyzing those data.

The study on power supply for sensor devices and wireless sensor networks has become the most significant challenge. Battery power solves this problem and is popular in many applications. However, it can not extend the life of a system, and also bring the cost of regular battery replacement.

This thesis work is based on a wireless RPM sensor system. The system is particularly designed for applications with low rotational speeds of large-diameter shafts. The system uses a BMG250 MEMS (Micro Electro-Mechanical Systems) gyroscope to measure the rotor’s angular velocity and temperature, and then reports the acquired data by BLE SoC (nRF52832). The different RPM sensor system working mode corresponding to the different application scenario.

Due to the system need a small volume to be placed between bearing, the utilization of standard electromagnetic generators is infeasible. So the sensor system is powered by a variable reluctance energy harvester (VREH), exploiting the relative motion between the rotor and a stator based on electromagnetic [1].

1.2 Overall aim

In this thesis work, the main goal is to analyze the energy consumption of the entire system and propose energy-saving methods. The energy consumption of the system is divided into two parts for separate research. One research is the BLE data transmission part. Due to with each reading of the gyroscope data, the read data will be sent to the RF2832 through the SPI protocol, the

(7)

other research is the energy consumption on data reading of BMG250 gyroscope plus data transmission via SPI protocol.

1.3 Problem statement

For the energy consumption of the BLE communication process, the transmission power, advertising types and the payload size of a single package are the influencing factor to be studied in this thesis.

In SPI working process, we focus on realizing the two working modes of BMG250 MEMS gyroscope and analyzing their energy consumption.

Due to the system is particularly designed for applications with low rotational speeds of large-diameter shafts, the energy harvester output can only support the system to do the duty cycle operation which named “Wakeup-sleep mode” in this thesis. Even if the harvester part get the enough energy, the energy mode switching time of the gyroscope also limits this working mode within 15 Hz.

In order to make the system obtain a higher sampling rate, the RPM sensor system will work on the “always-on mode”.

In the end, we will combine the BLE and SPI energy consumption to analyze the energy consumption of the entire system.

1.4 Outline

The structure of this thesis is shown below:

Chapter 2 includes the introduction of the hardware and the communication technology.

Chapter 3 describes the working modes and unit energy consumption measurement of BLE and SPI communication process.

Chapter 4 shows the measurement result in BLE and SPI part. The whole system energy consumption calculation standard is shown in the end of this chapter.

Chapter 5 is the sum of the important result and if this project not limited by time and equipment, how to make the result better

(8)

2 Theory

2.1 Hardware

2.1.1 BMG250 MEMS Gyroscope

Figure 1 BMG250 chip [2]

The angular velocity measurement senor is the BOSCH BMG250 which is shown in Figure 1. It is a low noise, low power three axial (six degree of freedom) gyroscope. Micro-Electro-Mechanical System (MEMS) ensures the volume of the gyroscope we used is smaller enough to stick on the bearings.

Until now, all the successful MEMS gyroscopes are the rate gyroscopes [3].

Figure 2 Axes orientation of BMG250 gyroscope

In short, the principle of MEMS gyroscope uses the Coriolis theorem to convert the angular velocity of a rotating object into a DC voltage signal

(9)

proportional to the angular velocity.

In terms of performance, the important feature of BMG250 is low energy consumption. The gyroscope works in a full operation mode, of which current draw is only 850µA at a working voltage of 1.8V [2].

2.1.2 nRF52832 BLE SoC

The nRF52832 is a Bluetooth5 multiprotocol radio 2.4GHz SoC produced by Nordic Semiconductor. It is supporting Bluetooth low energy (BLE), Nordic's proprietary 2.4GHz ultra-low-power wireless communication, and ANT. It is also a powerful and high flexible SoC with 32 configurable I/O pins, SPI, PWM, I2C, UART, ADC’s, 512kB flash and 64kB RAM all in one [4].

Figure 3 nRF52832 BLE chip

The nRF52 DK is a single-board development kit (DK) for Bluetooth Low Energy communication, and it is the exclusive application board for nRF52810 and nRF52832 SoCs. The following figure shows how the nRF52832 SoC looks like.

(10)

Figure 4 nRF52832 DK [5]

The nRF52 DK acts as a data transfer station in this project so that the data obtained by the gyroscope can be accessed remotely. It also contains a SEGGER J-Link debugger, which allows debugging the external SoCs through the debugger out header. The pin map of nRF52 DK is showing below.

Figure 5 The Pin Map of nRF52 DK

(11)

2.1.3 PCA63511 PPK Board

Figure 6 PCA63511

The PCA63511 is the hardware embodiment of the Power Profiler Kit (PPK) shown in Figure 6. It is an affordable, flexible tool that measures the real-time power consumption of the operation process. It is important that it can be used in conjunction with the nRF52 DK to measure current on the nRF5 DK or on an external board. It measures current from 1 µA up to 70 mA and gives a detailed picture of the current profile with the “nRF Connect-Power Profiler”

application for desktop [6].

2.2 BLE

2.2.1 BLE Overview

Bluetooth Low Energy (Formerly marketed as Bluetooth Smart) is a wireless personal area network technology designed and marketed by the Bluetooth Special Interest Group (Bluetooth SIG) aimed at novel applications in the healthcare, fitness, beacons, security, and home entertainment industries. It is

(12)

targeted towards applications that need to consume less power and may need to run on batteries for more extended periods, months, or even years.

BLE operates in the 2.4GHz ISM Band, which is the same spectrum as Bluetooth Classic. This feature allows Dual-Mode devices can share a single radio antenna but uses a simpler modulation system.

2.2.2 BLE Advantage

Compared to traditional Bluetooth, Bluetooth Low Energy sacrifices coverage range and throughput in exchange for higher connection speed, lower latency, smaller device size, lower manufacturing cost, and the extremely low energy consumption.

Figure 7 shows the comparison between Bluetooth Low Energy and other wireless communication technology.

Figure 7 Comparison for several wireless technology [7]

Bluetooth Low Energy has traditionally focused on low-bandwidth applications that involve infrequent data transmission between devices.

Compared with other communication technologies, BLE energy consumption and module cost of BLE are still low. Bluetooth Low Energy is most popular in health and fitness devices, smart lighting systems, real-time location systems, and indoor navigation applications.

(13)

2.2.3 BLE Protocol

The BLE protocol stack is the code for implementing the Bluetooth low energy protocol. Understanding and mastering the BLE protocol is the prerequisite for the BLE protocol stack. The following figure shows the major layers of the BLE protocol stack.

Figure 8 BLE protocol stack [8]

 Application part represents the functions that customers need BLE to achieve.

 Host part contains various Profiles and Protocols to handle the communication ways between several devices.

Controller part implements the radio frequency related analog and digital signal parts and completes the most basic data transmission and reception.

2.2.3.1 Physical Layer (PHY)

The physical layer uses the 2.4GHz ISM band and 1 Mbps data speed to transmit and receive the data. Figure 9 shows the band width and communication channels in physical layer. The band is divided into 40 channels from 2.4000 GHz to 2.4835 GHz, starting at 2402 MHz, and the space of each channel is 2 MHz. Channels 0-36 are the data channel, and channel 37-39 are the advertising channel. The BLE radio uses Gaussian Frequency-Shift Keying (GFSK) to make the frequency transitions smoother.

(14)

Figure 9 Frequency band [8]

2.2.3.2 Link Layer (LL)

The Link layer is the core of the entire BLE protocol stack. It plays a role in choosing which radio frequency channel to communicate with, data packets identification, time to send the data packets, ensure data integrity, receive ACK, retransmit, and manage control data link, etc. The link layer is only responsible for sending or withdrawing the data, and how to parse the data is given to the above GAP or ATT.

The link layer works in the form of a state machine. The following figure shows the relationship between those five states.

Figure 10 Link Layer working mechanism

 Standby: The initial state of Link Layer, the BLE terminal automatically enters this state after power-on, and it can be triggered by the Host command to enter other states expect "Connected”.

 Advertising: The state of the BLE terminal broadcasting information. In this state, the BLE terminal can also listen to some request messages

(15)

according to the Host command.

 Scanning: The status of BLE terminal receiving broadcast information is divided into Active Scanning and Passive Scanning. The latter only receives, the former can send a request to the BLE terminal that broadcasts information to obtain more information.

 Initialing: BLE terminal receives broadcast information and is ready to establish the “connected” status.

Connected: The BLE terminal that enters this state from “Advertising” is the Slave, and the one that enters from “Initialing” is the Master. The Master is responsible for maintaining connect and actively sending data and related commands to the Slave. The Slave needs to perform corresponding data transmission according to the Master's commands.

2.2.3.3 Logic Link Control & Adaption Protocol (L2CAP)

The L2CAP converts the Logic Channels into several L2CAP Channels that can be multiplexed by the application level. And the L2CAP also provides some functions:

 Protocol/channel multiplexing

 Segmentation and reassembly

 Flow control per L2CAP channel

 Error control and retransmissions

 Support for Streaming

 Fragmentation and Recombination

Quality of Service

2.2.3.4 Security Manager (SMP)

The SMP is used to manage the encryption and security of BLE connections, manage how to ensure the security of the connection and do not affect the user experience at the same time. Communication security is still very important in BLE, but since this experiment does not involve too much in this part of the application, so here is only a brief introduction.

2.2.3.5 Attribute Protocol (ATT)

The ATT is an abstract protocol based on the requirements of the BLE information collection. This protocol abstracts the collected data in the form of “attributes”, enabling users to read and modify the attributes value

(16)

remotely. Each “Attribute” consists of Attribute Type, Attribute Handle, and Attribute Value. There are two roles in ATT, one of which is the server that provides data (nRF52832), and the other is the client that accesses the data (smartphone). The attribute is structured as the following diagram.

Figure 11 ATT structure diagram [9]

 Handle: It is a 16 bit unique identifier for each of the attributes on the server. The handle has a value that ranges between 0x0001-0xFFFF.

 UUID(Attribute Type) : UUID stands for “universally unique identifier”. It is 16 bit in the case of the Bluetooth SIG adopted and 128 bit for the custom UUID defined by the developer.

 Attribute Value: It contains the data that the server wants to spread and without a fixed length.

Permissions: It determines whether an attribute can be read or written to, whether it can be notified or indicated. And it also indicates the level of security in different operations.

2.2.3.6 Generic Attribute Profile (GATT)

ATT as a protocol, only allows the client and server to share information through the form of the attribute but does not specify what kind of information to share. The GATT is a profile framework

 GATT Server: It contains the resources to be monitored, receives requires from the client and sends the reply back. The Link Layer Slave and GAP Peripheral device are the two association roles for GATT Server.

 GATT Client: It inquires about the presence and nature of the attributes on a server, sends requests to a server and receives responses. Contrary to GATT Server, it associated with the Link Layer Master and GAP Central device.

Due to the existence of GATT and various application profiles, the BLE got rid of the compatibility dilemma of wireless protocols such as ZigBee and became the 2.4G wireless communication product with the largest shipment.

(17)

2.2.3.7 Generic Access Profile (GAP)

The GAP used to control device connection and broadcast. It determines whether or how your device can communicate with interactive devices. There are four different roles which divided into two symmetrical pairs.

 Broadcaster: It just broadcast data all the time and does not expect any reply. The typical broadcaster is the Beacon which will used in this thesis.

 Observer: It just played the role of a scanner, continuously scanning out other broadcasts but not connecting to them.

This role pair is applicated in unidirectional, connection-less communications.

Figure 12 Network Topology for Broadcaster&Observer [8]

 Peripheral: It is not only a advertising role but also can enable the devices to connect with the. Central. When the connection is established, it will work as a slave in Link Layer.

 Central: It can establish and managing a connection with Peripheral. After connection, it works like the master role in Link Layer. The Central is capable to connect various devices.

This role pair is applicated in bidirectional, connection-oriented communications.

(18)

Figure 13 Network Topology for Peripheral&Central [8]

2.3 BLE Beacon

Bluetooth beacons are hardware transmitters - a class of Bluetooth low energy (LE) devices that broadcast their identifier to nearby portable electronic. They usually stay in the advertising mode and do not accept connections from other BLE devices. They are advertising nature allows multiple other devices to discover them at any point or time and use primarily for proximity awareness and location tracking applications. There are three popular beacon standards: Apple’s “iBeacon” standards, Radius Networks’

“AltBeacon” standards, and Google’s “Eddystone” standards.

In this thesis work, nRF52832 disseminates data in the form of beacon. The smartphone app only needs to scan the UUID of nRF52832 to access the data, and does not need to establish the connection.

Beacon data packets can only contain up to 31 bytes of data, so designers thus must carefully select the data include.

2.4 SPI Protocol

SPI (Serial Peripheral Interface) is a master-slave architecture synchronous full-duplex communication protocol consisting of three or four wires. SPI is characterized by fewer signal lines, simple protocol, and high relative data rate. And it is the communication protocol between nRF52832 SoC (Master) and BMG250 MEMS gyroscope (Slave) in this project. The SPI bus can operate with a single master device and with one or more slave devices.

(19)

Figure 14 descried the basic SPI bus structure.

Figure 14 SPI Bus structure

 SCLK: Serial clock, controlled and output by the SPI Master.

 MOSI: Master Output Slave Input, data output port.

 MISO: Master Input Slave Output, data input port.

 SS: The short of Slave Select, also written as CS (Chip Select) or STE (Slave Transmit Enable) indifferent devices. Often active low and output from SPI Master.

(20)

3 Design

3.1 System Overview

This section introduces the entire system, of which of all components, measuring devices, and the relationship between them are shown in Figure 15.

Figure 15 System structure diagram

First, a BMG250 MEMS gyroscope is responsible for measuring temperature and angular velocity, and sending the data to a nRF52832 system on chip (SoC) via the SPI protocol. The nRF52832 SoC forward and advertise the data by BLE communication to a Bluetooth receiver. A smart phone as the Bluetooth receiver scans the advertising data and display it by a BLE APP.

PCA63511 PPK board is directly connected to nRF52832 SoC to measure the energy consumption of the entire system.

In order to better access the energy consumption of the transmitted data in the entire system, BLE and SPI will be divided into two parts to study separately. In the end, the energy consumption of the two parts will be integrated to get the final total energy consumption of the system.

(21)

3.2 The Energy Consumption of BLE

3.2.1 Aim

The main goal in this part is to analyze the nRF52832 BLE advertising methods and the least energy consumption one will be used in final combination. And then, give a standard for BLE communication energy consumption, users can select the payload size they need in one package to transmit data and use the standard to calculate energy consumption.

3.2.2 Requirement Specification

3.2.2.1 Transmitting Mode

The nRF52832 operating an advertising mode is used in this study. The advertising mode can operate on either “Connectable&Undirected” or

“Non-connectable&Undirected”. Apart from connectivity, the advertising interval range is the difference we are most concerned about. The minimal advertising interval of “connectable&Undirected” is 20ms, while of

“Non-connectable&Undirected” is 100ms. The smaller advertising interval brings a higher sending frequency, consuming more energy. The type selection will be covered in Result chapter.

3.2.2.2 Power Supply

Due to the minimal power regulator of PCA56311 PPK board is 1.85V, we chose 1.85V as the power supply for the entire system (both the gyroscope and BLE Soc can work under this power supply).

3.2.2.3 Payload Data Format

The angular velocity and temperature are the data we need and each of them will occupy 2bytes to advertise. So for the integrity of the data read each time, we will set 4bytes as a data unit.

3.2.2.4 BLE Communication Package Structure

(22)

Figure 16 shows the BLE communication package structure [10]. Obviously, the only variable is the size of the data part, and other parts can be simplified to a 16bytes long header and tail format. The maximum data package length is 31 bytes.

Figure 16 BLE communication structure [10]

3.2.3 Simulation

In this part, the purpose is to explore the relationship between energy consumption and payload size. The “Online Power Profiler” is a nRF52 chips current consumption simulation software which produced by NORDIC SIMICONDUCTOR. The corresponding parameters will be set in this software to do the simulation testing.

For data transmission, the most important factor that determines energy consumption is the amount of data transferred. It is defined as “payload size”

in the thesis and the unit is byte.

(23)

Figure 17 Online Power Profiler user interface [11]

Figure 17 shows the Online Power Profiler user interface. Select the correct chip (nRF52832) is the first step to success. In order to ensure the rigor of the experiment, although the parameters in the blue box only affect the overall proportionality of the experimental data and will not cause the change of the trend, we still set the appropriate parameters as shown in Figure 17.

 TX payload

The range of payload size for advertising mode is from 0 to 31 bytes. We will simulate and analyze the total charge for each payload size.

 BLE event total charge

= (3-1)

Where “E” is Energy consumption, “q” is the total charge, and “V” is the working voltage of 1.8V.

By knowing the total charge, equation (3-1) is used to calculate the corresponding energy consumption.

(24)

Figure 18 Energy consumption simulation

Here we measured the total energy consumption of different package length in the case of different tx power. It can be clearly seen from the curve 1 that the energy consumption is linear with payload size. The aim to test the energy consumption with different tx power is double check the tx power has no affect on the trends.

In order to clearly see which data package length has the lowest energy consumption. We calculated the unit energy consumption (one byte) of each package length. And the result is showing in Figure 19.

Figure 19 Unit energy consumption simulation

(25)

Table 1 Simulation result

3.2.4 Advertising Type Analyzation

Now we step into the actual measurement part. The main purpose of this part is to program the nRF52832 to advertise the empty packets with the number of payload size units from one to six. And then analyze the advertising situation in Connectable&Undirected type and Non-connectable&Undirected type. In terms of programming software, we used Keil uVision5 (developed by ARMKEIL Microcontroller Tools) to debug and download the code to nRF52832.

3.2.4.1 State Machine

The code of the BLE part is relatively simple, it needs to constantly advertise the generated data packets after the initialization is completed.

We measured all the unit energy consumption of package length from 0 to 31 bytes at a tx power 0dBm. Combining the data in Table 1, when the data sent in a single packet fills the entire packet, BLE has the lowest energy consumption. The lower package length we used, the higher energy consumption we obtained.

(26)

Figure 20 BLE advertising state machine

The difference between each set of tests is the advertising type and the payload size of each sending.

3.2.4.2 Specific Requirement

 Maximum package length in nRF52832 BLE communication

Firstly, nRF52832 broadcasts data in ibeacon standard. It means that there are three bytes in the data package has been occupied.

Byte 0-2 is the Standard BLE Flags Byte 0: Length : 0x02

Byte 1: Type: 0x01 (Flags)

Byte 2: Value: 0x06 (Typical Flags)

Up to now, the available package length is 28 bytes. And then, in order to identify this device, the developer defines the 0059 as the company id in data package which occupied four more package space.

So in this project, the size of an available payload in one advertising package is 24 bytes.

 Advertising type

There are four advertising types defined by the developer in the source file shown in Figure 21.

Figure 21 Advertising type definition

The energy consumption of the two advertising types marked by red rectangles are investigated in this thesis work. The top one is

“Connectable&Undirected” type and the bottom one is

“Non-connectable&Undirected” type.

In order to verify whether the type is successfully configured, we can scan the data broadcast by nRF52832 through the smartphone application. “Bluetooth Smart Scanner” is the fastest app to find all BLE devices around and shows

(27)

detailed information about that advertising.

Figure 22 Advertising monitor interface

The software directly indicates the connection status of the advertising. It is very convenient to confirm whether it is set to the desired type. At the same time, it can also monitor manufacturing data. Therefore, in the subsequent energy consumption measurement, it can also be used to verify whether the desired payload size is transmitted.

3.2.4.3 “Connectable&Undirected” and “Non-connectable&Undirected”

This part is mainly to explore the relationship between these two advertising types. The measured energy consumption will not be used in practical applications. So there is no need to connect the sensor, just use nRF52832 to send in the form of 1 data unit (4 bytes), 2 data units (8bytes), 3 data units (12 bytes), 4 data units (16 bytes), 5 data units (20 bytes) and 6 data units (full of package, 24 bytes) empty package. And then measuring the energy consumption corresponding to those payload sizes in these two advertising types.

An external current measurement PPK board (PCA63511) is required to measure the current and the amount of charge flowing through nRF52832 during each advertising process. The connection schematic diagram is shown

(28)

in Figure 23.

Figure 23 Connect between nRF52832 SoC and PPK board [6]

Then, as same as the simulation part, according to formula (3-1) to get the energy consumption in each nRF52832 broadcast.

Figure 24 energy consumption of two advertising types Payload size(bytes) Unit energy consumption(mJ)

Con&Undirected

Unit energy consumption(mJ) Non-con&Undirected

4 0.6264063 0.615996

8 0.3153288 0.3057606

12 0.209694417 0.206680767

16 0.157564038 0.155946675

20 0.12587548 0.12366214

24 0.104989967 0.103532475

Table 1 Energy consumption comparison between “Con&Undirected” and

“Non-con&Undirected”

(29)

Combining the trend of the line chart and the data in the Table 1, it can be analyzed that for any payload size, the Connectable&Undirected type will indeed consume more energy than the Non-connectable&Undirected type.

But the difference in energy consumption is really small and can be ignored.

So, for higher advertising frequency, we set the advertising type of this experiment as Connectable&Undirected type.

3.2.5 BLE Final Energy Consumption

This section presents the BLE standard energy consumption measurement.

First, enable the SPI part to work in two different modes, which will be introduced in the SPI energy consumption section. In each mode, we still let the nRF52832 to send in the form of 1 data unit (4 bytes), 2 data units (8bytes), 3 data units (12 bytes), 4 data units (16 bytes), 5 data units (20 bytes) and 6 data units (full of package, 24 bytes) package. By this way, we can measure the BLE unit energy consumption in all cases.

 Wireless RPM sensor Print Circuit Board

Figure 25 Practical application board

In order to place the measured hardware part in the bearing, we integrated nRF523832(BMG-350) and BMG250 together on a board with the extremely small volume. The function and configuration are exactly the same as when the respective chips are independent. So in the final measurement, the previous code and test method will be fully applied to this integrated board.

In order to make standard data that users can refer to, the integrated board needs to be connected at the DUT position in the figure 26.

(30)

Figure 26 Final BLE measurement connection [6]

 Power Profiler interface

Power Profiler is the software to measure current for nRF52 DK applications.

Figure 27 is shown the software interface during measurement state.

Figure 27 Power Profiler interface

The first step is to enable the connection with hardware part and set the voltage regulator to 1.85V. When we click the blue button to start the measurement process, there are some information about the visible data comes out. Window ∆ is the processing time contain in the window; Avg is the average current consumption; max is the maximum current consumption;

charge is the total charge in window time.

Notes: Setting up trigger is a good way to intercept the broadcast part more accurately which is showing below. After measurement, the minimum sampling interval of the upper window is about 140µs, and the minimum

(31)

sampling interval of the lower window is about 14µs.

Figure 28 Trigger window function

3.3 The Energy Consumption of SPI

3.3.1 Aim

Similar to the purpose of the previous section, the aim is to get the unit energy consumption of the SPI part. It will be used to role a minimum SPI energy consumption unit to calculate the total energy consumption when transmitting any payload size. In order to combine data and measurement waveform, the specific measurement method will be explained in the Result chapter.

3.3.2 Working Mode

Two power modes of a BMG250 are studied in the experiment, suspend mode and normal mode.

 Suspend power mode: No sampling takes place, all data is retained, and FIFO data readout is not supported in suspend mode. It is equivalent to the sleep mode.

Normal power mode: Full chip operation mode.

Power mode Current consumption (µA)

Suspend 3

Normal 850

Table 2 Energy consumption of suspend mode and normal mode [2]

(32)

The huge difference in current consumption for this two power mode is showing in Table 2. Considering the energy saving, we have designed two working modes.

 Wakeup-sleep mode:

After power on, a BMG250 is in a suspend mode. When it needs to read and send data, BMG250 is switched to normal mode and returns to suspend mode after work completed. This process is controlled by two timers. One is the data reading timer, it controls the BMG250 to read the temperature and angular velocity data and then return to the suspend mode. The other is the main timer, which is responsible for power mode switching. After wakeup the normal power mode, it will trigger the data reading timer, and then update the data that needs to be sent, finally send the data to nRF52832.

This is a energy saving mode, but it requires a waiting time from 55 ms to 80 ms between switching from the suspend mode to the normal mode, which limits the duty cycle operations in a final application such as wireless transmission.

 Always-on mode:

The structure of always-on mode is relatively simple. After initialization, the BMG250 will always work in normal mode and will no longer enter suspend mode. The characteristics are opposite to the wakeup-sleep mode, the energy consumption is relatively high, but the sampling rate is not limited by the code, only depends on the sampling capability of the chip itself.

About the hardware connection, it is as same as the connection method when BLE measures the energy consumption of sending empty packets. We just need to turn off the corresponding function of BLE packet sending in code section. And then we can see the measured temperature and angular velocity on the smart phone app.

(33)

4 Result

This chapter shows the experimental results of unit BLE and SPI process energy consumption. In the end of this chapter, we will combine them together to give a result on the energy consumption of the entire system.

4.1 BLE Unit Energy Consumption

4.1.1 limitation

Since the results of this work will be directly applied to industrial projects, there will be some restrictions on the configuration of the devices.

 Transmission Power

Calculating the total energy consumption of the system in advance is to allow variable reluctance energy harvester (VREH) part to know how much energy will be consumed in data measurement process. In this work, we set the transmission power to 4 dBm, which is the maximum transmission power can be configured by nRF52832. So if energy harvester can support the maximum transmission power to collect data, then the same data can be satisfied with lower transmission power.

 Data Unit

In this work, the data transmission of a single-axle angular velocity is exampled to be read from the BMG250 gyroscope. Therefore, according to the previous introduction of the angular velocity data length, one unit data is two bytes, resulting one adverting packet can hold up to 12 data units.

 Advertising Type

As the analysis in Section 3.2.4.3, in order to get a higher BLE advertising frequency, the advertising type will be set to Connectable&Undirected.

4.1.2 Measurement Result

Here we measured two groups of BLE data under two gyroscope working modes. According to Equation (3-1), multiply the obtained charge by the 1.85V supply voltage to obtain the energy consumption.

(34)

When BMG250 gyroscope is running in always-on mode, the Table 3 shows the measurement result in BLE advertising process.

Payload Size

(byte) Active Time (ms) Active Energy Consumption

2 2.404 40.6556(µJ)

4 2.47 42.62955

6 2.508 44.02075

8 2.549 45.9244

10 2.598 48.08335

12 2.642 48.5958

14 2.690 51.0452

16 2.747 52.88965

18 2.803 53.11535

20 2.835 55.41305

22 2.886 56.20115

24 2.924 58.3675

Table 3 BLE measurement result on SPI always-on mode

When BMG250 gyroscope is working on wakeup-sleep mode, the relevant data of BLE advertising process is presented in the table below.

Payload Size

(byte) Active Time (ms) Active Energy Consumption

2 2.406 38.53365(µJ)

4 2.454 40.50205

6 2.506 42.5278

8 2.535 43.76175

10 2.610 45.6025

12 2.646 46.8975

14 2.704 48.544

16 2.738 50.1683

18 2.795 51.63535

20 2.825 53.73325

22 2.881 54.3123

24 2.938 56.41575

Table 4 BLE measurement result on SPI wakeup-sleep mode

The following curve shows the energy consumption of the BLE part in two gyroscope working modes. As the expectation in the previous chapter, due to the BMG250 gyroscope in always-on working mode is keep working on normal power mode, the energy consumption of BLE advertising will be

(35)

slightly higher than wakeup-sleep working mode.

Curve 4 Energy consumption of two SPI working modes

4.2 SPI Activities Energy Consumption

In this section, we keep the configuration in BLE advertising measurement part and give the results for the SPI active energy consumption and the system sleep current in each working mode.

4.2.1 BLE Idle Current

According to "Online Power Profiler", when the BLE nRF52832 is in a non-working state, the idle current is 2µA (allow 5% deviation).

4.2.2 Distortion Problem

Compared with BLE communication, SPI process has a very short active time.

Due to the low sampling frequency of the current measuring device, some current fluctuation points at the beginning and end of the waveform may be ignored, resulting in incomplete interception of the waveform and inaccurate

(36)

data acquisition. In this project, the maximum sampling frequency of the PPK board is about 72 kHz, and it will occur a distortion problem when intercepting the entire activation process. However, we also find some corresponding solutions to minimize the measurement deviation, which is showing in the results section below.

4.2.3 The Unit Measurement Result of Gyroscope Always-on Mode

Firstly, the data measurement interface and the data obtained result is showing in Figure 29 and Table 5.

Figure 29 SPI always-on mode measurement platform

Active Energy

Consumption (µJ) Active Time (ms) Average Sleep Current

2.34395 0.194402 0.818044(mA)

Table 5 SPI measurement result on always-on mode

We have mentioned in Section 3.3.2, when the BMG250 gyroscope is working in normal mode, the current consumption in the waiting state is 850 µA. And then, add it to the Idle current of BLE to get the whole system average current consumption, which means the test value is correct if it is close to 852µA. For always-on mode, we use the trigger window to intercept the single active part for analysis, which is equivalent to use highest sampling rate of the device to get the most accurate data.

(37)

4.2.4 Measurement Result of Gyroscope wakeup-sleep Mode

In this working mode, we use two trigger methods to switch the normal power mode and the suspend power mode.

 SPI command trigger

“BMG250_set_power_mode(BMG250_GYRO_SUSPEND_MODE);”

“BMG250_set_power_mode(BMG250_GYRO_NORMAL_MODE);”

We put those two trigger commands in timers to switch the gyroscope power mode.

The single wakeup-sleep mode waveform is showing below.

First, if we use the upper window to directly do the data analyze, the distortion effect of the head and tail will be very large. And then, the active time is longer than the maximum trigger window size. Which means the highest sampling frequency cannot be used to analyze the entire process. So, we divide it into three parts to test separately and finally superimpose the three groups of measurement data to reduce the measurement error as much as possible.

Figure 30 SPI command trigger total waveform

There is a peak in the head and tail of the entire waveform, and their time is very short. So that it will be the main impact of waveform distortion. As shown in the figures below, use the trigger window to intercept the head and tail parts waveform for testing.

(38)

Figure 31 Front part

Figure 32 Last part

Comparing the data intercept with upper and lower windows, whether from the shape of the waveform or the measured data, we can see that using a higher sampling rate can effectively reduce the impact of distortion problems.

Figure 33 Middle part

The middle part is a long period waveform without a large current fluctuation curve, so we can use the upper window to intercept this section of data.

(39)

Finally, the result of adding three pieces of data is shown in Table 6.

Active Energy Consumption

(µJ) Active Time (ms) Average Sleep Current

72.75125 59.760354 5.616(µA)

Table 6 SPI wakeup-sleep measurement result under SPI command trigger

External interrupt trigger

In this method, the input interrupt pin INT_1 provides the edge trigger signal for the sensor to every time switch the sensor's power mode.

Figure 34 shows the single wakeup-sleep mode waveform with external interrupt trigger method.

Figure 34 SPI external interrupt trigger total waveform

Obviously, the current waveform triggered in this way is approximately the same as the previous one. So repeat the previous method to measure the three parts of data and superimpose to get the data in the Table 7.

Active Energy Consumption

(µJ) Active Time (ms) Average Sleep Current

72.16665 59.563235 5.233(µA)

Table 7 SPI wakeup-sleep measurement result under external interrupt trigger

Similar to the always-on working mode verification method, the average sleep current of wakeup-sleep working mode is theoretically the sum of the current consumption of BLE idle current and BMG250 gyroscope suspend power mode, which is about 5µA. It can be obtained in two tables that the measured results are basically the same as expected.

An external interrupt triggering can indeed reduce the transition time between normal and suspend power mode, but enabling external interrupt pin will also consume energy. By comparing the two sets of data, we can conclude that external interrupt trigger method can save about 0.6µJ energy in each SPI working time.

(40)

4.3 Energy Consumption Calculation Standard

 Sampling frequency limitation

The BMG250 requires 55 ms to 80 ms to switch the power mode from suspend to normal, so the maximum sampling frequency of wakeup-sleep working mode is about 15 Hz [1]. The minimum advertising interval for nRF52832 BLE SoC is 20 ms which means the maximum sampling frequency for real time transmission mode (one-to-one data collection and data transmission) is 50 Hz. Due to the maximum single data package length is 24 bytes, once the sampling frequency of BMG250 is greater than 600Hz, some extra data acquired by BMG250 gyroscope will be wasted.

4.3.1 System Energy Consumption Overview

Figure 35 System Energy Consumption Overview

The system energy consumption standard is shown in Figure 35. The X axis is the sampling frequency of BMG250 gyroscope and the precision can reach three decimal places. The Y axis represents the system energy consumption in one second, in other word is the power consumption of the entire system.

For the convenience of data search, the entire image is completed by MATLAB [12].

 Energy consumption calculation equation

(41)

ϊ 匐 = ( am ϊi+ 匐a/ ) ∗ + 匐aar∗ (1 − ( am ϊi+ 匐a/ ) ∗ ) ∗ (4-1) Where Etotalis the system energy consumption in one second (J), Esensor is the sensor active energy consumption (J), Ebleis the BLE communication active energy consumption (J), x is the number of data from 1 to 12 in packages, f is the sampling rate (Hz), Isleepis the average sleep current (A), 1 is one second (S), tsensoris the sensor active time (s), tbleis the BLE communication time (s) and 1.85 is the power supply value (V).

According to sampling frequency limitation, this figure will be divided into three parts to explain.

4.3.2 Part One

The BMG250 power mode switch time is the limiting factor in this part, and the range of sampling frequency is from 1 Hz to 15 Hz.

Figure 36 System power consumption from 1 Hz to 15 Hz

The system energy consumption of always-on and the wakeup-sleep working mode is shown in Figure 36. In this part, the system has the highest working mode selectivity. Obviously, the energy consumption of wakeup-sleep mode is much lower than the always-on mode and as the amount of data stored in data packets increases, the energy consumption of individual data decreases.

(42)

4.3.3 Part two

The BLE advertising frequency is the main limitation in the following part, and the range of sampling frequency in part two is from 15 Hz to 50 Hz. When the sampling frequency is greater than 50 Hz, the nRF52832 BLE cannot send data with 2 bytes as the packet length, which means the real time data sending (one-to-one data collection and data transmission) cannot be achieved. The energy consumption curve for this part is showing below.

Figure 37 System power consumption from 15 Hz to 50 Hz

The wakeup-sleep sensor mode can no longer be used in part two. The method of sending with 2bytes as the packet length has the highest timeliness but also has the most energy consuming.

4.3.4 Part three

Storing multiple sets of data before sending becomes the only data sending option for this part.

(43)

Figure 38 System power consumption from 50 Hz to 600 Hz

As the sampling rate increases, the timeliness of data acquisition by the client decreases. When the sampling frequency is greater than 550Hz, the data measured by BMG250 can only be transmitted by nRF52832 in the form of full BLE package.

(44)

5 Conclusion

5.1 Thesis Conclusions

In this thesis, we established the wireless RPM sensor monitor system, measured and analyzed the energy consumption of the whole system. Based on the analysis and results of the previous chapters, we conclude that:

 The energy consumption of BLE communication increases linearly with the increase of package length.

 The minimum BLE energy consumption of a single data transmission is 4.701313 µJ ( full package ).

 The “Connectable&Undirected” BLE advertising type can not only consume less energy but also provide 50Hz advertising frequency.

 Using an external interrupt to trigger the timer to switch the power mode can save 0.6 µJ than SPI command trigger in each SPI working time.

 When the sampling frequency of BMG250 is from 1Hz to 15Hz, the SPI wakeup-sleep working mode is the better choice to save the energy.

 When the sampling frequency of BMG250 is from 15Hz to 600Hz, the system can only run in SPI always-on mode. As the sampling rate of BMG250 increases, the number of data in each BLE transmission process have to increase until the full package state.

 With the increase of data storage in a single BLE transmission packet, the timeliness of data acquisition is decreasing but the energy consumption of a single data is decreasing.

In Section 4.3, the users can randomly combine the BLE communication and SPI transmission method to meet their applications. And then, they can find the corresponding energy consumption in a “Sampling Frequency VS Energy Consumption” MATLAB graph.

5.2 Future work

As mentioned in Section 4.2.4, due to the low sample rate of the current measurement device, it cannot sample more details of the current draw instance change during the wireless sensor works in varies events. A

(45)

high-performance measurement setup thus is required to access a precise current profile for the wireless RPM sensor, contributing to a more accurate results such as the energy consumption.

Using the hardware interrupt instead of software interrupt (SPI instructions) can short the wakeup time, reducing the energy consumption of the gyroscope sensor that switches to the normal power mode from the suspend mode.

(46)

Reference

[1] Ye Xu (2019), “Energy-autonomous On-rotor RPM Sensor Using Variable Reluctance Energy Harvesting”, June 2019

[2] BOSCH (2019), “Data sheet,BMG250,Low noise, low power triaxial gyroscope” October 2019, Technical reference code(s) 0 273 142 064 Available: https://www.bosch-sensortec.com

[3] J. A. Gregory, J.Cho, K. Najafi (2011), “MEMS RATE AND RATE-INTEGRATING GYROSCOPE CONTROL WITH COMMERCIAL SOFTWARE DEFINED RADIO HARDWARE”, June 2011

[4] Nordic Semiconductor, “nRF52832”;

Available: https://www.nordicsemi.com [5] Nordic Semiconductor, “nRF52 DK”;

Available: https://www.nordicsemi.com

[6] Nordic Semiconductor, “Power Profiler kit User Guide”;

Available: https://infocenter.nordicsemi.com\

[7] Mohammad Afaneh (2020) Bluetooth®, “Wireless Connectivity Options for IoT Applications– Technology Comparison”, April 21, 2020

[8] © 2020 Microchip Technology, Inc., “BLE fundamentals”;

Available: https://microchipdeveloper.com

[9] Ellisys (2018), “Ellisys Bluetooth Video 5: Generic Attribute Profile (GATT)”, June 5, 2018;

Available: https://www.youtube.com/watch?v=eHqtiCMe4NA [10] Adam Warski (2014), “How do iBeacons work?”, January 13, 2014;

Available: https://www.warski.org

(47)

[11] Nordic®DevZone, “Online Power Profiler”;

Available: https://devzone.nordicsemi.com/nordic/power/

[12] Yang Song (2020), “System Energy Consumption Standard” MATLAB, June 9, 2020;

Available:

https://github.com/YANGSONG-1997/Investigation-on-the-energy-consumpt ion-of-wireless-RPM-sensor/blob/master/Final_power_consumpton_1_600.m

References

Related documents

Stöden omfattar statliga lån och kreditgarantier; anstånd med skatter och avgifter; tillfälligt sänkta arbetsgivaravgifter under pandemins första fas; ökat statligt ansvar

46 Konkreta exempel skulle kunna vara främjandeinsatser för affärsänglar/affärsängelnätverk, skapa arenor där aktörer från utbuds- och efterfrågesidan kan mötas eller

Both Brazil and Sweden have made bilateral cooperation in areas of technology and innovation a top priority. It has been formalized in a series of agreements and made explicit

För att uppskatta den totala effekten av reformerna måste dock hänsyn tas till såväl samt- liga priseffekter som sammansättningseffekter, till följd av ökad försäljningsandel

The increasing availability of data and attention to services has increased the understanding of the contribution of services to innovation and productivity in

Generella styrmedel kan ha varit mindre verksamma än man har trott De generella styrmedlen, till skillnad från de specifika styrmedlen, har kommit att användas i större

Re-examination of the actual 2 ♀♀ (ZML) revealed that they are Andrena labialis (det.. Andrena jacobi Perkins: Paxton & al. -Species synonymy- Schwarz & al. scotica while

Industrial Emissions Directive, supplemented by horizontal legislation (e.g., Framework Directives on Waste and Water, Emissions Trading System, etc) and guidance on operating