Demonstrator Development for Phone as a Key Based on ...1117152/FULLTEXT01.pdf · PaaK is a feature...

61
Department of Science and Technology Institutionen för teknik och naturvetenskap Linköping University Linköpings universitet g n i p ö k r r o N 4 7 1 0 6 n e d e w S , g n i p ö k r r o N 4 7 1 0 6 - E S LiU-ITN-TEK-A--17/023--SE Demonstrator Development for Phone as a Key Based on Bluetooth Low Energy Eric Karlsson Alexander Lagerbielke 2017-06-08

Transcript of Demonstrator Development for Phone as a Key Based on ...1117152/FULLTEXT01.pdf · PaaK is a feature...

Page 1: Demonstrator Development for Phone as a Key Based on ...1117152/FULLTEXT01.pdf · PaaK is a feature that enables a car user to gain the functionality currently offered in the PEPS

Department of Science and Technology Institutionen för teknik och naturvetenskap Linköping University Linköpings universitet

gnipökrroN 47 106 nedewS ,gnipökrroN 47 106-ES

LiU-ITN-TEK-A--17/023--SE

Demonstrator Development forPhone as a Key Based on Bluetooth

Low EnergyEric Karlsson

Alexander Lagerbielke

2017-06-08

Page 2: Demonstrator Development for Phone as a Key Based on ...1117152/FULLTEXT01.pdf · PaaK is a feature that enables a car user to gain the functionality currently offered in the PEPS

LiU-ITN-TEK-A--17/023--SE

Demonstrator Development forPhone as a Key Based on Bluetooth

Low EnergyExamensarbete utfört i Elektroteknik

vid Tekniska högskolan vidLinköpings universitet

Eric KarlssonAlexander Lagerbielke

Handledare Qin-Zhong YeExaminator Adriana Serban

Norrköping 2017-06-08

Page 3: Demonstrator Development for Phone as a Key Based on ...1117152/FULLTEXT01.pdf · PaaK is a feature that enables a car user to gain the functionality currently offered in the PEPS

Upphovsrätt

Detta dokument hålls tillgängligt på Internet – eller dess framtida ersättare –under en längre tid från publiceringsdatum under förutsättning att inga extra-ordinära omständigheter uppstår.

Tillgång till dokumentet innebär tillstånd för var och en att läsa, ladda ner,skriva ut enstaka kopior för enskilt bruk och att använda det oförändrat förickekommersiell forskning och för undervisning. Överföring av upphovsrättenvid en senare tidpunkt kan inte upphäva detta tillstånd. All annan användning avdokumentet kräver upphovsmannens medgivande. För att garantera äktheten,säkerheten och tillgängligheten finns det lösningar av teknisk och administrativart.

Upphovsmannens ideella rätt innefattar rätt att bli nämnd som upphovsman iden omfattning som god sed kräver vid användning av dokumentet på ovanbeskrivna sätt samt skydd mot att dokumentet ändras eller presenteras i sådanform eller i sådant sammanhang som är kränkande för upphovsmannens litteräraeller konstnärliga anseende eller egenart.

För ytterligare information om Linköping University Electronic Press seförlagets hemsida http://www.ep.liu.se/

Copyright

The publishers will keep this document online on the Internet - or its possiblereplacement - for a considerable time from the date of publication barringexceptional circumstances.

The online availability of the document implies a permanent permission foranyone to read, to download, to print out single copies for your own use and touse it unchanged for any non-commercial research and educational purpose.Subsequent transfers of copyright cannot revoke this permission. All other usesof the document are conditional on the consent of the copyright owner. Thepublisher has taken technical and administrative measures to assure authenticity,security and accessibility.

According to intellectual property law the author has the right to bementioned when his/her work is accessed as described above and to be protectedagainst infringement.

For additional information about the Linköping University Electronic Pressand its procedures for publication and for assurance of document integrity,please refer to its WWW home page: http://www.ep.liu.se/

© Eric Karlsson, Alexander Lagerbielke

Page 4: Demonstrator Development for Phone as a Key Based on ...1117152/FULLTEXT01.pdf · PaaK is a feature that enables a car user to gain the functionality currently offered in the PEPS

Abstract

In this work a demonstrator for phone as a key has been developed. This demonstrator estimatesthe position of a mobile device in and around a test vehicle.

Trilateration, ROCRSSI and fingerprinting with neural networks have been investigated for thelocalization of the mobile device. To filter the input data Kalman filter and average mean filterhave been investigated. The best performing technique was determined to be the use of neuralnetworks with a Kalman filter.

The resulting demonstrator can determine if the mobile device is within the ranges of three prede-fined zones for the technology and three zones defined in the thesis. The demonstrator can estimatethe location of the mobile device in real-time for these zones.

i

Page 5: Demonstrator Development for Phone as a Key Based on ...1117152/FULLTEXT01.pdf · PaaK is a feature that enables a car user to gain the functionality currently offered in the PEPS

Acknowledgment

From the university, we would like to thank our supervisor Qin-Zhong Ye and our examiner AdrianaSerban.

We would like to express great appreciation to ACTIA for the opportunity and for an interestingtask, thanks to Oscar Holm, Lennart Strandberg and Inge Wallin at ACTIA for their supportand guidance during the thesis work. Finally, we would like to express a special thanks to HenrikCarlgren at ACTIA for his guidance and technical expertise.

ii

Page 6: Demonstrator Development for Phone as a Key Based on ...1117152/FULLTEXT01.pdf · PaaK is a feature that enables a car user to gain the functionality currently offered in the PEPS

Contents

1 Introduction 1

1.1 Background . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1

1.2 Purpose . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1

1.3 Aim . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1

1.4 Research Questions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1

1.5 Limitations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1

1.6 Outline . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2

2 Theoretical Background 3

2.1 Passive Entry and Start Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

2.2 Phone as a Key . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

2.3 Bluetooth Low Energy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

2.3.1 Introduction to BLE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4

2.3.2 BLE Protocol Stack . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4

2.4 Received Signal Strength Indicator . . . . . . . . . . . . . . . . . . . . . . . . . . . 6

2.5 Filtering Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7

2.5.1 Discrete Kalman Filter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7

2.5.2 Moving Average Filter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8

2.6 Localization Techniques . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9

2.6.1 Ring Overlapping based on Comparison of Received Signal Strength Indicator 9

2.6.2 Trilateration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10

2.6.3 Fingerprinting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12

2.7 Artificial Neural Network . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12

3 RSSI Characteristics 13

3.1 Relationship between RSSI value and distance . . . . . . . . . . . . . . . . . . . . . 13

3.2 Environmental influence on RSSI . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15

3.3 Different Smartphone Brands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17

4 Demonstrator Design 19

4.1 Hardware Setup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19

4.2 Software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19

4.3 Data Collection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19

4.4 Input Filter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23

4.5 Ring Overlapping based on Comparison of Received Signal Strength Indicator . . . 25

4.6 Trilateration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26

4.7 Neural Network . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27

4.8 Graphical User Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35

4.9 Real-Time Implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36

iii

Page 7: Demonstrator Development for Phone as a Key Based on ...1117152/FULLTEXT01.pdf · PaaK is a feature that enables a car user to gain the functionality currently offered in the PEPS

5 Number of Antennas and Placement 37

6 Analysis and Discussion 41

6.1 RSSI Characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41

6.2 Demonstrator Design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41

6.3 Antenna placement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42

7 Conclusion 45

8 Future Work 47

References 48

iv

Page 8: Demonstrator Development for Phone as a Key Based on ...1117152/FULLTEXT01.pdf · PaaK is a feature that enables a car user to gain the functionality currently offered in the PEPS

List of Figures

1 Overview of the BLE protocol stack. . . . . . . . . . . . . . . . . . . . . . . . . . . 4

2 State machine of a BLE device. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5

3 Master device and slave devices connected in a star topology. . . . . . . . . . . . . 6

4 Example of one ROCRSSI ring, Phone must be located at a radius longer than Band shorter than C. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10

5 Example of ROCRSSI with several rings overlapping. . . . . . . . . . . . . . . . . . 10

6 Trilateration example, intersection of three circles. . . . . . . . . . . . . . . . . . . 11

7 Cartesian plane with positions and radius vectors. . . . . . . . . . . . . . . . . . . 11

8 Comparison between mean and median value. . . . . . . . . . . . . . . . . . . . . . 13

9 Measured relationship between RSSI value and distance for the ASUS BLE module. 14

10 Measured relationship between RSSI value and distance for the CC2650 BLE module. 14

11 Measured RSSI values and calculated RSSI values for the Texas Instruments CC2650BLE module. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15

12 Difference of RSSI values for line of sight and through a human body. . . . . . . . 16

13 Reading text rows on the USB-port using PuTTY. . . . . . . . . . . . . . . . . . . 20

14 A map over the locations where data was collected. . . . . . . . . . . . . . . . . . . 21

15 Picture of data collection. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21

16 Entry zones. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22

17 Welcome zone. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22

18 Kalman filter with Process noise of 0.1. . . . . . . . . . . . . . . . . . . . . . . . . 23

19 Kalman filter with Process noise of 1. . . . . . . . . . . . . . . . . . . . . . . . . . 24

20 Average mean filter with 10 samples. . . . . . . . . . . . . . . . . . . . . . . . . . . 24

21 Average mean filter with 6 samples. . . . . . . . . . . . . . . . . . . . . . . . . . . . 25

22 Areas for the ROCRSSI method. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26

23 Classification hierarchy for the Neural Networks. . . . . . . . . . . . . . . . . . . . 27

24 Before and after normalization. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29

25 Flowchart of the data in the Neural Network. . . . . . . . . . . . . . . . . . . . . . 30

26 first output from the neural networks. . . . . . . . . . . . . . . . . . . . . . . . . . 31

27 Output from the neural networks with improved input filter. . . . . . . . . . . . . 31

28 Output from the neural networks with final input filter and normalization. . . . . . 32

29 Output from the neural networks with the output filter. . . . . . . . . . . . . . . . 32

30 Output from the neural networks with five entry points. . . . . . . . . . . . . . . . 33

31 Output from the neural networks with three entry points. . . . . . . . . . . . . . . 34

32 Graphical User Interface v1.0. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35

33 Graphical User Interface v2.0. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36

34 First antenna setup. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37

35 Second antenna setup. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38

36 Third antenna setup. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39

37 Output from the neural networks with five antennas as input. . . . . . . . . . . . . 40

v

Page 9: Demonstrator Development for Phone as a Key Based on ...1117152/FULLTEXT01.pdf · PaaK is a feature that enables a car user to gain the functionality currently offered in the PEPS

38 Top point of view of two antennas antennas with 1 meter to the advertising device,the blue dot is the advertising device and the white dots are the antennas. . . . . . 43

39 Two antennas antennas with difference height relative to the advertising device, theblue dot is the advertising device and the white dots are the antennas. . . . . . . . 43

vi

Page 10: Demonstrator Development for Phone as a Key Based on ...1117152/FULLTEXT01.pdf · PaaK is a feature that enables a car user to gain the functionality currently offered in the PEPS

List of Tables

1 Difference in RSSI between line of sight and through a human body . . . . . . . . 15

2 Difference between smartphone brands . . . . . . . . . . . . . . . . . . . . . . . . . 17

3 Variables index and description for the classification of the neural network . . . . . 28

4 The events in the test walk, recorded for validation of the neural network . . . . . 30

5 Percentage of correct estimations from each neural network . . . . . . . . . . . . . 34

6 Antenna names and placement for the first setup . . . . . . . . . . . . . . . . . . . 37

7 Antenna names and placement for the second setup . . . . . . . . . . . . . . . . . . 38

8 Antenna names and placements for the third antenna setup . . . . . . . . . . . . . 39

vii

Page 11: Demonstrator Development for Phone as a Key Based on ...1117152/FULLTEXT01.pdf · PaaK is a feature that enables a car user to gain the functionality currently offered in the PEPS

Abbreviations

ATT Attribute protocol

BLE Bluetooth Low Energy

GAP Generic Access Profile

GATT Generic Attribute Profile

GFSK Gaussian Frequency Shift Keying

HCI Host Controller Interface

html Hyper Text Markup Language

IoT Internet of Things

L2CAP Logical Link Control and Application Protocol

LF Low Frequency

PaaK Phone as a Key

ROCRSSI Ring Overlapping based on Comparison of Received Signal Strength Indicator

RSSI Received Signal Strength Indicator

SMP Security Manager Protocol

SoC System on Chip

SSH Secure Shell

GUI Graphical User Interface

viii

Page 12: Demonstrator Development for Phone as a Key Based on ...1117152/FULLTEXT01.pdf · PaaK is a feature that enables a car user to gain the functionality currently offered in the PEPS

ix

Page 13: Demonstrator Development for Phone as a Key Based on ...1117152/FULLTEXT01.pdf · PaaK is a feature that enables a car user to gain the functionality currently offered in the PEPS

1 Introduction

This chapter presents a introduction to the work and the problem formulation.

1.1 Background

ACTIA Nordic AB is a company which develops products for connected vehicles. ACTIA predictsthat the physical car key will soon be redundant and that the future for unlocking cars is with asmartphone. This technique is called PaaK (Phone as a Key).

PaaK is a feature that enables a car user to gain the functionality currently offered in the PEPS(Passive Entry and Passive Start) feature, using their registered and authorized connected mobiledevice.

PaaK technology is delivered via detection of a customer’s mobile device within predefined zones,using BLE (Bluetooth Low Energy) technology.

1.2 Purpose

The purpose is to investigate if RSSI (Received Signal Strength Indication) is a useful positioningtechnique for this feature. Furthermore, to investigate how the accuracy is depending on thenumber of antenna modules and how the system can be calibrated for different type of vehicles.Different filters and suitable algorithms for processing the received antenna data will be evaluatedwith scripts developed in Python.

1.3 Aim

The aim of this work is to develop a working prototype for demonstration of the technique and toevaluate tracking methods. The demonstration prototype will demonstrate how the broadcastingdevice moves around and inside the car, from recorded data. This demonstrator could be upgradedto show the position in real-time.

1.4 Research Questions

In the project a demonstration prototype is developed. The technique in this project is that onephone, or other advertising device, is used to broadcast BLE packages which are received by severalantennas in and outside the vehicle.

This leads to the following research questions:

• RSSI characteristics

– How does the RSSI value depend on the distance?

– How does the RSSI characteristics depend on influence of obstacles?

– Are there any difference in the RSSI characteristics for different smartphone brands?

• How many antennas are necessary for the task and how should they be placed?

• Which methods for localization and filtering are suitable for this project?

1.5 Limitations

The work is based on existing Bluetooth modules and no further hardware is developed. Further-more, security aspects will not be investigated. The security aspect is that only an authorizedphone can unlock and start the car. The demonstrator in this thesis will localize any deviceadvertising the right message.

1

Page 14: Demonstrator Development for Phone as a Key Based on ...1117152/FULLTEXT01.pdf · PaaK is a feature that enables a car user to gain the functionality currently offered in the PEPS

The RSSI technique is the main technique to be investigated, other techniques as for example timeof flight is not investigated.

1.6 Outline

The outline of the report is presented in this section. The report is divided into eight chapters andthe bullet list below describes the content of each chapter.

• Chapter 1 - Introduction presents the introduction of the thesis together with the problemformulation and research questions

• Chapter 2 - Theoretical Background provides the necessary background theory for thework, about PEPS, PaaK, BLE, filtering, localization algorithms and Neural Networks

• Chapter 3 - RSSI Characteristics describes the research of RSSI Characteristics done inthis work

• Chapter 4 - Demonstrator Design presents the design of the demonstrator and theresulting implementation

• Chapter 5 - Number of Antennas and Placement describes how the number of antennasand placements were investigated together with the result

• Chapter 6 - Analysis and Discussion presents an analysis and a discussion about theresults in the work

• Chapter 7 - Conclusion conclusion of the work

• Chapter 8 - Future Work presents possible future work

2

Page 15: Demonstrator Development for Phone as a Key Based on ...1117152/FULLTEXT01.pdf · PaaK is a feature that enables a car user to gain the functionality currently offered in the PEPS

2 Theoretical Background

In this chapter, the necessary background theory for this thesis work is presented: The PassiveEntry and Start Systems, Phone as a Key and Bluetooth Low Energy concepts. RSSI descriptionand the theory of Kalman filters, Average mean filters, ROCRSSI, Trilateration and Artificialneural networks.

2.1 Passive Entry and Start Systems

Passive entry and passive start is a technique where the user does not need to actively use its carkey [1]. To unlock the car the driver just needs to touch the car door, this is called a passive entry.In order to start the car, the only requirement is that the key is inside the car. There is no needto insert the key into the keyhole, this creates a passive start.

In current vehicles that support passive entry and passive start the technique demands a specialkey. This key uses LF (Low-Frequency) to communicate with the car. The car sends out a LFsignal to the key, the field strength is measured by the key, which returns the information to thevehicle. Via this measurement the vehicle can determine if the key is close to the car or inside thecar.

A disadvantage with this technique is that the number of car keys limits how many people thathave access to the car.

2.2 Phone as a Key

The purpose of the thesis work is to design a system that works like the Passive Entry and StartSystems. In this case the special key is replaced by a smartphone. The smartphone broadcastBluetooth low energy advertisements to the vehicle continuously. These advertisements are receivedby several antennas placed in and around the car and the RSSI values for each advertisement areused to estimate where the phone is, relative to the vehicle.

The purpose of this method is to ease the user experience. If the smartphone is used to unlockand start the car, there is no need for a car key. With PaaK the idea is that it will be easier toaccess your own car and to share a car between several users.

In the PaaK technology the goal is to estimate if the position of the smartphone belongs to anyof the three predefined zones: Welcome, Inside and Start. The welcome zone is defined as threemeters around the body of the car, if the smartphone is in the Welcome zone, the lights of thecar should be turned on. It should be possible to determine whether the smartphone is close toany of the entry points of the car. If the smartphone is sufficiently close to an entry point (twometers) the entry should be unlocked. This means that there are sub-zones to the welcome zone,one sub-zone for each of the entry points and one sub-zone for outside the entry points.

The inside zone is defined as anywhere inside the car, it has two sub-zones. One of the sub-zones isthe start zone, which is defined as the area from the front seats and forward. The other sub-zoneis defined as the remaining area inside the car.

Some disadvantages of the PaaK technology is that the RSSI values from the Bluetooth trans-mission are exposed to much noise, since other Bluetooth devices can interfere with the signals.Another problem is that Wi-Fi uses the same frequency band as Bluetooth, this means that Wi-Fitraffic in the area can disturb the signal between the smartphone and the vehicle. RSSI is alsoaffected by obstacles in the environment such as walls, other cars and people.

2.3 Bluetooth Low Energy

The demonstrator that will be developed in this thesis work is based on the Bluetooth Low Energytechnology. In this section, some background of the technology and the protocol are presented.

3

Page 16: Demonstrator Development for Phone as a Key Based on ...1117152/FULLTEXT01.pdf · PaaK is a feature that enables a car user to gain the functionality currently offered in the PEPS

2.3.1 Introduction to BLE

Bluetooth Low Energy is a wireless technology developed by the Bluetooth Special Interest Group.The technology was developed for short range, low power communication applications. BLE is alsoknown as Bluetooth smart and is a part of the Bluetooth 4.0 standard. Both BLE and classicalBluetooth is operating on a frequency of 2.4 GHz. Classical Bluetooth has up to seven timeshigher transmission capability compared to BLE [2]. Due to the low transmission capability, BLEdoes not support voice transmission. On the other hand, a BLE device can be connected to anynumber of peripherals, while the classical Bluetooth device is limited to 7 peripherals [3]. Despitethe low transmission capability, the low power consumption makes BLE devices very useful for IoTapplications. Healthcare, security, smart energy and indoor localization systems are some examplesof where the BLE technology can be found. BLE is an emerging technology and within the nearfuture it is expected to be used in billions of devices [4].

2.3.2 BLE Protocol Stack

The BLE protocol stack can be divided into two main parts, the controller and the host. Thecontroller is found in the bottom of the stack and it consist of the physical layer and the link layer.The controller is typically a SoC (System-on-Chip) with an integrated radio which communicateswith the outside world through the antenna and with the host through the standardized HCI(Host Controller Interface). The host comprises three protocols, namely the L2CAP (Logical LinkControl and Application protocol), SMP (Security Manager Protocol), ATT (Attribute Protocol).Furthermore, the host comprises two main profiles, the GATT (Generic Attribute Profile) and theGAP (Generic Access Profile). An overview of the BLE protocol stack can be seen in Figure 1.

Figure 1: Overview of the BLE protocol stack.

The physical layer comprises the physical parameters for the communication protocol. The BLEtechnology operates with a frequency of 2.4 GHz. It consists of 40 physical channels with 2 MHzspacing. There are two types of channels, advertising and data channels. Out of the 40 channels,three are defined as advertising channels and 37 defined as data channels [3]. The advertisingchannels are used for advertising packets, device discovery and connection establishment. The datachannels are used for bidirectional data transmission between two connected devices. The GFSK(Gaussian Frequency Shift Keying) is used as modulation method in all the physical channels,the modulation method allows reduced peak power consumption and smooth transitions betweenlogical zeros and ones. The GFSK modulation method is explained further in [5].

4

Page 17: Demonstrator Development for Phone as a Key Based on ...1117152/FULLTEXT01.pdf · PaaK is a feature that enables a car user to gain the functionality currently offered in the PEPS

The link layer is responsible for advertising, scanning, initiating and maintaining connections withother devices [6]. There are five common operation states defined for a BLE device, the states arescanning, advertising, standby, initiating and connected [6]. In Figure 2, a state machine of a BLEdevice can be seen.

Figure 2: State machine of a BLE device.

In BLE, an advertiser is any device which is transmitting data through the advertising channels.The advertising of packets in the advertising channels takes place in predefined intervals, so calledadvertising events. Devices with the purpose of receiving the advertised data are called scanners.A link for bidirectional data transmission can be established between two devices. For the linkto be established it requires that the advertiser announces through the advertising channels thatit is a connectible device. An initiator is a device which is in the initiating state, the initiator issearching for such advertisements. When the Initiator finds a connectible device, it can send aconnection request to the advertising device and a point-to-point connection can be established [3].The two connected devices can transmit data to each other through the data channels. A devicewill enter the standby state if it stops scanning or if its connection to another device is aborted.

There are two different device roles for a connected device, the master and the slave role. Thedevice for which the previous state was advertising will be the slave and the device for which theprevious state was initiating will become the master [7]. A master device can be connected tomultiple slave devices at the same time while the slave can only be connected to one master at atime. A master device connected to multiple slave devices follows a star topology as can be seenin Figure 3. A master device and its slaves is called a Piconet, a BLE device can only belong toone Piconet at a time.

5

Page 18: Demonstrator Development for Phone as a Key Based on ...1117152/FULLTEXT01.pdf · PaaK is a feature that enables a car user to gain the functionality currently offered in the PEPS

Figure 3: Master device and slave devices connected in a star topology.

In the star topology, the master determines the instants for which the slaves must listen. Further-more, the master provides the slave with a map over which data channels to be used for the datatransmission. The slaves are in sleep mode by default and wake up periodically to see if there areany requests from the master.

L2CAP is the multiplexing layer for BLE, it handles the multiplexing of data for ATT, SMP andthe control signalling for the Link Layer [3]. There are two basic concepts defined; the L2CAPchannel and L2CAP signalling commands. Those concepts are explained further in [6].

The rules for data accessing on a peer device are defined in the ATT. More about how the data isstored on an attribute server for read and write operations can be found in [6].

The SMP is responsible for pairing and for setting up a safe connection between devices. Authen-tication is used in the pairing process for the attempt of trusting another device [6]. Secrets can beshared from a slave to a master to prove their authenticity faster whenever they try to reconnect.The SMP also provides a security tool box for generation of data hashes, confirmation values andshort-term keys which is used during the pairing process.

The GAP defines parameters for the pairing and connection establishment, it also defines whetherthe device should be configured as a central or peripheral device. Peripheral devices mostly sendsBLE packets with a predefined interval while the central device is scanning for advertise BLEpackets. The central device initiates the connection and sets the packet scan duty cycle [4].

The GATT defines a framework which is based on the ATT for exchange of characteristics anddiscovering of services from one device to another.

2.4 Received Signal Strength Indicator

One important feature of the BLE technology is the RSSI. The RSSI is defined as the ratio betweenthe power of the transmitting antenna and the receiving antenna. The RSSI value is defined inthe protocol and can be used without any additional measurements. According to the path lossmodel, the RSSI value decreases as the distance between the antennas increases. The RSSI valueat the receiver is given by (1) [8].

RSSI = −10 ∗ n ∗ log(d) +A [dBm] (1)

6

Page 19: Demonstrator Development for Phone as a Key Based on ...1117152/FULLTEXT01.pdf · PaaK is a feature that enables a car user to gain the functionality currently offered in the PEPS

Where, n is the signal propagation coefficient, d is the distance to the transmitter and A is thereference RSSI value measured at one meter distance.

If the variable d is isolated from (1), an expression for the distance is obtained, see (2).

d = 10−RSSI+A

10·n [m] (2)

In (1) and (2), the variable n is varying depending on the propagation medium. In [8] a calibrationmethod is proposed where the value of the constant can be determined with (3) together with anRSSI measurement from three meters and the reference RSSI value for one meter.

n = −

RSSI3m −RSSI1m

10 · log(3− 1)(3)

The value of n should be a real number between 2 and 4 [8].

2.5 Filtering Methods

The data received from the RSSI measurement is noisy [9] and is therefore in need of filtering. Inthis subsection two suitable filtering methods are presented.

2.5.1 Discrete Kalman Filter

The Kalman filtering model [10] is a model that consists of two steps, prediction and correction.The prediction step is based on previous measurements and the correction step is based on thecurrent measurement.

When creating a Kalman filter a model of the system is described with a set of differential equations.Measurements are taken with the interval (sampling time) Ts and therefore the filter must bediscrete. The differential equations for the Kalman filter can be found in [10] and these equationsare simplified in [11] to (4) to (12).

This Kalman filter is a regular Kalman filter that is linear. This means that the transition fromthe current state to the next state should be a linear transformation. The general form of thetransition model can be seen in (4).

xt = At · xt−1 +Bt · ut + ǫt (4)

Where, xt is a column vector with the states of the system, xt−1 is the previous state, ut is thecontrol input, At is the discrete fundamental matrix of the dynamic model, ǫt is the process noiseand Bt is a transformation matrix.

In [11] it is assumed that the RSSI signal should be constant. This means that it is assumed thatthe device does not move. If the device does not move, the control input ut can be ignored andthe discrete fundamental matrix At can be set to an identity matrix. With these assumptions, (4)can be simplified to (5).

xt ≈ xt−1 + ǫt (5)

The general form of the Kalman-filtering measurement can be seen in (6).

zt = Ct · xt + δt (6)

Where, zt is the measurement vector, Ct is the measurement matrix and δt is the measurementnoise. This equation can be simplified to (7) since the RSSI is modelled directly.

zt ≈ xt + δt (7)

7

Page 20: Demonstrator Development for Phone as a Key Based on ...1117152/FULLTEXT01.pdf · PaaK is a feature that enables a car user to gain the functionality currently offered in the PEPS

Because of the assumption that the RSSI is constant, the prediction should be equal to the previousprediction. The prediction step of the Kalman filter can be seen in (8) and (9).

µ̄t = µt−1 (8)

Where, µ̄t is the prediction, the bar denotes that measurements needs to be incorporated, µt−1 isthe previous prediction.

Σ̄t = Σt−1 +Rt (9)

Where, Σ̄t is the certainty of the prediction, Σt−1 is the previous certainty and Rt is the processnoise. The process noise is a parameter that can be determined by trial and error when designingthe filter. When determining the value, it is a compromise between a fast response and smoothtransition. Larger values of the process noise gives a faster filter.

The prediction estimate is used to calculate the Kalman gain. The Kalman gain is used as aweighting function between the certainty of the prediction and the certainty of the measurement.The equation for the Kalman gain can be seen in (10).

Kt = Σ̄t(Σ̄t +Qt)−1 (10)

Where, Kt is the Kalman gain, Σ̄t is the certainty of the prediction and Qt is the measurementnoise. This measurement noise is chosen to be the variance of the RSSI signal.

To update the filter, and to filter the next measurements an update step is needed. (11) showshow the prediction is updated and (12) shows how the certainty of the prediction is updated.

µt = µ̄t +Kt(zt − µ̄t) (11)

Where, µt is the prediction, µ̄t is the prediction that need measurements incorporated, Kt is theKalman gain and zt is the measurement.

Σt = Σ̄t − (Kt · Σ̄t) (12)

Where, Σt is the certainty of the prediction, Σ̄t is the certainty of the prediction that need mea-surements incorporated and Kt is the Kalman gain.

The steps in (8) to (12) are then iterated for every sample, in order to filter the values. For furtherexplanation of the filter and its parameters see [10].

2.5.2 Moving Average Filter

A moving average filter computes averages by sliding a window along the data. The general movingaverage filter is defined by (13) [12].

y[n] =1

M1 +M2 + 1

M2∑

k=−M1

x[n− k] (13)

Where, y[n] is the nth output, M1 is the index of the first sample in the window, M2 is the indexof last sample in the window and x[n− k] is the sample.

This filter operates at every sample to smoothen out the differences between the samples. Thewindow size decides how many samples that must be available to do the filtering, this means thatif M1 is zero and M2 is five the filter will calculate the average value for six samples. If the filteris implemented to filter the samples in real-time there will be a time delay, in the case with M1 iszero and M2 is five the delay will be six samples.

8

Page 21: Demonstrator Development for Phone as a Key Based on ...1117152/FULLTEXT01.pdf · PaaK is a feature that enables a car user to gain the functionality currently offered in the PEPS

To affect the moving average filter so that it, for example gives earlier samples more importance,weights can be introduced. The filter’s name is then changed to weighted moving average filter. In[13] the weighted moving average filter is implemented and compared to the Kalman filter.

The conclusion in [13] is that compared to the moving average filter the Kalman filter needs tobuild more before it can start filtering and need more time.

(14) shows a simple type of weighted moving average filter and (15) shows a more complex typeof weighted moving average filter, both filters are taken from [13].

y[n] = a · x[n− 1] + (1− a)x[n] (14)

Where, y[n] is the nth output, x[n− 1] is the previous sample, x[n] is the current sample and a isconstant between 0 and 1. It is a parameter that is used to define that relationship between theprevious and current sample.

y[n] = a3x[n− 3] + a2x[n− 2] + a(1− a)x[n− 1] + (1− a)x[n] (15)

Where, y[n] is the nth output, x[n− 3] is the third previous sample, x[n− 2] is the second previoussample, x[n− 1] is the previous sample, x[n] is the current sample and a is a constant with valueless than one.

In (15) the variable a must be less than 1. Hence, the condition in (16) must be fulfilled.

a2(1− a) < a(1− a) < 1− a (16)

2.6 Localization Techniques

To localize where the phone is, in relation to the car, a localization technique is required. Localiza-tion techniques via signal strength are mainly categorized into two cases. The first one is to gatherinformation offline before the system operation and the second one uses mathematical methods todetermine the device’s location during the system operation [14].

2.6.1 Ring Overlapping based on Comparison of Received Signal Strength Indicator

ROCRSSI (Ring Overlapping Based on Comparison of Received Signal Strength Indicator) is arange free mathematical localization method, which means that the method does not try to estimatethe point-to-point distance between the receiver and sender [15]. The method does not require thereceiver nodes to send control messages. However, it gives an accurate location estimation and itis robust under disturbance in the propagation pattern.

The ROCRSSI method compares RSSI values and generates rings dependent on the RSSI values.For example, four devices called A, B, C and Phone are considered. The device A sends out amessage and the other devices receives this message.

If the signal strength between the Phone and A is stronger than the signal strength between Aand C, and at the same time less than the signal strength between A and B (see the condition in17). The Phone device can then be estimated to have a distance to the device A that is longerthan between A and B and shorter than the distance between A and C.

This is illustrated in Figure 4. The Phone device must then be located within the grey area in thefigure.

RSSIAC < RSSIAPhone < RSSIAB (17)

9

Page 22: Demonstrator Development for Phone as a Key Based on ...1117152/FULLTEXT01.pdf · PaaK is a feature that enables a car user to gain the functionality currently offered in the PEPS

Figure 4: Example of one ROCRSSI ring, Phone must be located at a radius longer than B andshorter than C.

If more senders are introduced, more rings will appear and the localization accuracy increases.When two rings are used there are two possible locations where the device can be located in. Seethe two grey areas in Figure 5a. If a third ring is added, the location of the device is estimatedwith a single area see the grey area in Figure 5b.

(a) Two rings overlapping. (b) Three rings overlapping.

Figure 5: Example of ROCRSSI with several rings overlapping.

When using three rings or more the location of the device can be determined, since there is onlyone possible area of where the device can be located.

2.6.2 Trilateration

Trilateration is a range based mathematical localization method, which needs at least three fixedanchor nodes with known positions to locate an advertising device. The method uses the intersec-tion point of three circles to determine the exact position of the advertising device [8]. The radiusof each circle is calculated from the RSSI values of the anchor nodes. The principle of the methodcan be seen in Figure 6. In Figure 6, P1, P2 and P3 are the positions of the three anchor nodes,r1, r2, r3 are the estimated radius for each of the circles.

10

Page 23: Demonstrator Development for Phone as a Key Based on ...1117152/FULLTEXT01.pdf · PaaK is a feature that enables a car user to gain the functionality currently offered in the PEPS

Figure 6: Trilateration example, intersection of three circles.

According to [8] a Cartesian plane can be used to simplify the calculations of the intersection point.The positions (P1, P2 and P3) and radius vectors with new directions (r1, r2 and r3) from Figure6 placed in a Cartesian plane can be seen in Figure 7.

Figure 7: Cartesian plane with positions and radius vectors.

The equation for each circle can be seen in (18) [8].

(x− xi)2 + (y − yi)

2 = r2i (18)

Where, x, y is the x- and y-coordinates for the position of the intersection point, xi, yi is the x- andy-coordinate for the position of the anchor node with index i. Furthermore, ri is the radius vectorbetween the position of the intersection point and the position of the anchor node with index i.

The system for the radius vectors in Figure 7 can be seen in (19).

11

Page 24: Demonstrator Development for Phone as a Key Based on ...1117152/FULLTEXT01.pdf · PaaK is a feature that enables a car user to gain the functionality currently offered in the PEPS

(x− x1)2 + (y − y1)

2 = r21

(x− x2)2 + (y − y2)

2 = r22

(x− x3)2 + (y − y3)

2 = r23

(19)

In order to obtain the position of the intersection point, the linear system in (19) has to be solved.

2.6.3 Fingerprinting

The fingerprinting method starts with a calibration step [14] to collect RSSI values for differentknown positions, to create what is called a radio map. This calibration step is done offline beforethe system operates. The radio map is basically a list of combinations of the RSSI values from allnodes at different locations. A mobile device can be localized by comparing its RSSI values withthe radio map.

The calibration can be done in two other methods as well. These methods are unsupervisedfingerprinting and partial fingerprinting [16]. For unsupervised fingerprinting the radio map iscreated via propagation models for the radio wave. The model predicts the RSSI values and needto know the location and material of walls and floor etc. The partial fingerprinting is a combinationof manually collected data and prediction via calculations.

When the data to the radio map is collected it is processed, with for example a neural network [17].The neural network is trained with the collected data, in order to recognize the pattern betweenthe RSSI values from different nodes and the location of the mobile device.

2.7 Artificial Neural Network

An artificial Neural Network mimics the learning process of the neurons in the human brain. Ittransfers input data to output data via interconnected neurons [16]. The neural network can beused to recognize patterns. In this work it will be used to process the fingerprinting data to locatethe advertising device.

The neural network consists of several nodes and layers, the nodes take the input data, from theprevious layer, multiplies the data with a vector of weights, and adds a scalar bias. These stepscreate the activation function.

There are three types of layers: input layer, hidden layer and output layer. All nodes of the samelayer share the same activation function but have different weights and biases.

In order to use the neural network, it must first be trained. The purpose of the training is todecide the values of the weights and biases, while the activation function and number of layersare fixed. In [16], backward error propagation is used, which means that the training is done tofind weights and biases that minimize the error between the target and the output. The trainingprocess is repeated until certain conditions are fulfilled and can therefore be time consuming. If aneural network is used for classification between zero and one, at least two sets of training data areneeded. One negative training set for when the output should be zero and one positive trainingset for when the output should be one.

12

Page 25: Demonstrator Development for Phone as a Key Based on ...1117152/FULLTEXT01.pdf · PaaK is a feature that enables a car user to gain the functionality currently offered in the PEPS

3 RSSI Characteristics

Since RSSI is the technique used for all localization methods in this work, the characteristics ofthe RSSI were interesting to be examined. This chapter describes the investigation of the RSSIcharacteristics together with the result. Three characteristics were examined, a) how the RSSIchanges with distance, b) how the RSSI is affected by the surroundings and c) if there are anydifferences between smartphone brands.

Since the RSSI is noisy, a single sample of the RSSI value is misleading, therefore several sampleswere collected and the mean and median values were calculated and compared.

Figure 8 shows RSSI values from a measurement with a distance of one meter between the trans-mitter and the receiver. The transmitted power was set to -56 dBm, this means that the receivedpower from one meter should be -56 dBm.

Figure 8: Comparison between mean and median value.

From Figure 8, it can be seen that most of the data is gathered around -57.5 dBm which is arealistic value, but there is some data in the range -72.5 dBm to -75 dBm which is lower thanexpected. The data from this measurement was used to compare whether the mean value or themedian value was the most representative for the data collection.

The calculated median and mean values of the measured RSSI was therefore plotted in the samegraph as the raw RSSI values. In Figure 8 the red line is the median value and the blue line is themean value of the RSSI values. From the plot it was determined that the median value was thebest representation of the collected data, since it is not affected by a few high or low values.

3.1 Relationship between RSSI value and distance

From the theory section, it is known that the relationship between the RSSI value and the distanceis non-linear. To verify the behaviour of the RSSI, measurements were done with different distancesbetween the transmitter and the receiver. The expected behaviour is described by (1).

Data was collected with a ASUS USB-BT400 Bluetooth 4.0 USB Adapter and a CC2650 LaunchpadBLE module from Texas Instruments. The data was collected in ACTIA’s garage and 600 sampleswere collected for each distance. Two different BLE modules were used for data collection toinvestigate if there was any difference in the RSSI value, between the modules.

13

Page 26: Demonstrator Development for Phone as a Key Based on ...1117152/FULLTEXT01.pdf · PaaK is a feature that enables a car user to gain the functionality currently offered in the PEPS

The relationship between the distance and RSSI value for the ASUS BLE module can be seen inFigure 9.

Figure 9: Measured relationship between RSSI value and distance for the ASUS BLE module.

It can be seen in Figure 9 that the measured RSSI values from the ASUS BLE modules does notfollow the nonlinear (1).

The relationship between the distance and RSSI value for the Texas Instruments CC2650 BLEmodule can be seen in Figure 10.

Figure 10: Measured relationship between RSSI value and distance for the CC2650 BLE module.

In Figure 10 it can be seen that neither does the Texas Instruments CC2650 follows (1).

The result from the measurements with the Texas Instruments CC2650 module was comparedwith the expected behaviour. To calculate the expected behaviour, the variable n in (1) had to be

14

Page 27: Demonstrator Development for Phone as a Key Based on ...1117152/FULLTEXT01.pdf · PaaK is a feature that enables a car user to gain the functionality currently offered in the PEPS

calculated.

Data was collected for two distances between the transmitter and the receiver, these distances wereone and three meters. 80 samples of the RSSI were collected, the median for each collection wasused to calculate n with (3).

When n was calculated for the Texas Instruments CC2650 BLE module, the expected RSSI valueswere calculated and plotted together with the measured RSSI values, which can be seen in Figure11.

Figure 11: Measured RSSI values and calculated RSSI values for the Texas Instruments CC2650BLE module.

It can be seen in Figure 11 that there are irregularities between the calculated and the measuredRSSI values. It is therefore hard to determine the distance between the transmitter and the receiverbased on the RSSI value.

3.2 Environmental influence on RSSI

It was interesting to investigate how the RSSI is affected in the measurement scenario of thehuman body presence. Therefore, measurements were done with the advertising device placed infront and behind a human body. These measurements were done for different distances betweenthe transmitter and the receiver. 225 RSSI samples was collected for the distances 1, 1.5, 2, 2.5 and3 meters and the median RSSI was calculated, for each distance. The result of the measurementscan be seen in Table 1.

Table 1: Difference in RSSI between line of sight and through a human body

Distance [m] RSSI Line of sight [dBm] RSSI Through a human body [dBm]

1 -55 -68

1.5 -54 -71

2 -60 -69

2.5 -59 -73

3 -66 -71

15

Page 28: Demonstrator Development for Phone as a Key Based on ...1117152/FULLTEXT01.pdf · PaaK is a feature that enables a car user to gain the functionality currently offered in the PEPS

In Table 1, the difference in RSSI between different distances does not change as expected, withdecreasing RSSI for increasing distance. However, what is important is that there is a differencebetween RSSI value with line of sight and that through a human body. This means that the humanbody had an impact on the RSSI value.

Figure 12 shows how the RSSI values are distributed for the case when it is two meters betweenthe transmitter and the receiver. In the figure, the blue dots are the RSSI values for line of sightand the red dots are the RSSI values for when there is a human body between the transmitter andthe receiver.

Figure 12: Difference of RSSI values for line of sight and through a human body.

In Figure 12 it can be seen that the RSSI values from the measurement with a human body betweenthe transmitter and the receiver have a lower value. This means that the human body attenuatesthe signal. If the distance equation (1) combined with the calculated n-value is used for the valuesat two meters, shown in Table 1 the difference between the measurements would be 4.8 meters.

16

Page 29: Demonstrator Development for Phone as a Key Based on ...1117152/FULLTEXT01.pdf · PaaK is a feature that enables a car user to gain the functionality currently offered in the PEPS

3.3 Different Smartphone Brands

A test with different smartphones was performed to investigate if there were any differences inRSSI between smartphone brands. In this test, different smartphones were placed one meter froma Texas Instruments CC2650 BLE module that received advertisements from the smartphones.

To send advertisements an application called Beacon Simulator was used. The idea was that thereceived signal strength should be the same for all smartphones when using the same applicationsettings. 80 samples from each smartphone was recorded and the median of these samples wascalculated. The result from this test can be seen in Table 2 where the values are the median valueof each measurement.

Table 2: Difference between smartphone brands

Samsung Galaxy S7 Edge Sony Xperia Z5 LG Nexus 5X Samsung Galaxy Tab S2

-74 dBm -63 dBm -64 dBm -73 dBm

The result in Table 2 shows that it is a difference between the RSSI from different smartphoneswhen using the same settings in the application.

17

Page 30: Demonstrator Development for Phone as a Key Based on ...1117152/FULLTEXT01.pdf · PaaK is a feature that enables a car user to gain the functionality currently offered in the PEPS

18

Page 31: Demonstrator Development for Phone as a Key Based on ...1117152/FULLTEXT01.pdf · PaaK is a feature that enables a car user to gain the functionality currently offered in the PEPS

4 Demonstrator Design

In this chapter, the development and implementation of the demonstrator are described.

4.1 Hardware Setup

Two different hardware setups have been used to measure the RSSI values.

The first hardware setup was consisting of six BLE antennas connected to a computer through aUSB hub. The computer was running the Linux operating system. The antennas used in the firstsetup was ASUS USB-BT400 Bluetooth 4.0 USB Adapter.

The second hardware setup consisted of eight CC2650 Launchpad BLE modules from Texas In-struments. These antennas were connected to a Raspberry Pi through a USB hub. The RaspberryPi was running the Raspbian operating system. The Raspberry Pi was used to collect the RSSImeasurements from the modules and to process the data.

The RSSI measurement is built-in in all BLE devices and therefore no extra hardware was neededfor the RSSI measurements.

4.2 Software

Most of the software was developed in the Python programming language. The language waschosen since the interpreter and its libraries are free and easy to access. Python scripts are alsoeasy to run on Linux based computers. Other programming languages that have been used throughthe project are C and html.

4.3 Data Collection

For the first hardware setup, a free software named Wireshark was used to collect the BLE packagesfrom the ASUS Bluetooth Adapters. The packages were including information about the payload,the RSSI value and the MAC address to the recording antenna. The corresponding MAC addresswas mapped to its antenna location so the RSSI values could be analysed with respect to itslocation.

For the second hardware setup, a program written in C was used to configure the modules fromTexas Instruments. The BLE modules were configured as observers and to simplify the datacollection process, the modules continuously sent text rows to the Raspberry Pi. The modulesprinted the antenna number, measured RSSI value and the payload on each text row. The textrow was transmitted via the UART serial communication protocol on the USB-port. To verify theUART communication, PuTTY was used. PuTTY is a free SSH (Secure Shell) and telnet clientfor Windows. Figure 13 shows an example for when PuTTY is used to read the transmitted text.

19

Page 32: Demonstrator Development for Phone as a Key Based on ...1117152/FULLTEXT01.pdf · PaaK is a feature that enables a car user to gain the functionality currently offered in the PEPS

Figure 13: Reading text rows on the USB-port using PuTTY.

To collect the packages on the Raspberry Pi, a script was written in Python. The script usedthreads to read lines from different USB ports at the same time, one thread per USB port. Thescript gave the collected packages a time stamp and stored the packages into a file.

For the first hardware setup data was collected from fixed locations in and around the car. A mapover the locations can be seen in Figure 14.

20

Page 33: Demonstrator Development for Phone as a Key Based on ...1117152/FULLTEXT01.pdf · PaaK is a feature that enables a car user to gain the functionality currently offered in the PEPS

Figure 14: A map over the locations where data was collected.

The blue dots in Figure 14 correspond to the locations from which data was collected. An examplefor when data is collected from one of these locations can be seen in Figure 15.

Figure 15: Picture of data collection.

For the second hardware setup, data was collected from the predefined zones for PaaK, two ofthese zones can be seen in Figure 16 and Figure 17. Figure 16 shows the zones for the entry points.

21

Page 34: Demonstrator Development for Phone as a Key Based on ...1117152/FULLTEXT01.pdf · PaaK is a feature that enables a car user to gain the functionality currently offered in the PEPS

To unlock for example the driver’s door, the PaaK definition is that the advertising device mustbe inside a circle with a radius of two meters near the driver’s door. Since the vehicle in the figurehas five entry points there is five circles, that corresponds to each entry point.

Figure 16: Entry zones.

Figure 17 shows the welcome zone, which is defined as three meters around the body of the car.

Figure 17: Welcome zone.

22

Page 35: Demonstrator Development for Phone as a Key Based on ...1117152/FULLTEXT01.pdf · PaaK is a feature that enables a car user to gain the functionality currently offered in the PEPS

Data was collected from each zone of the entry points in Figure 16, from the welcome zone shownin Figure 17, from the inside zone and the start zone. To determine which zone the advertisingdevice is in, data from both inside and outside the zones were necessary. Therefore, data was alsocollected from outside each zone. The collected data created a radio map for the system.

To test the system some test walks were recorded, these test walks were recorded by walking aroundand inside the car with the advertising device. To determine how well the system worked the testwalks were filmed with a smartphone. The video was then used to compare if the system reactedat the same time as the event in the video.

Data collected from inside and outside the zones are referred to as training data and the test walksare referred to as test data.

4.4 Input Filter

Since the RSSI measurements are noisy, processing of the incoming data is essential. Filter algo-rithms were used to reduce the noise level before the RSSI value was used for localization estimation.The Kalman filter and average mean filter were implemented in a Python script for evaluation.

In order to evaluate the different filter designs, data was collected for the case when a person withan advertising BLE device was moving towards an antenna. Different values for the process noisein the Kalman filter and window size in the average filter was evaluated.

In Figure 18, the blue dots corresponds to the measured RSSI values and the red line is the samedata processed with a Kalman filter with a process noise of 0.1.

Figure 18: Kalman filter with Process noise of 0.1.

It can be seen in Figure 18 that all peaks are attenuated in the processed data, which means thatlarge derivatives in the input data are ignored. On the other hand, the processed data becomesstable.

The process noise was changed to a larger value to obtain a faster filter and still reduce the noiseto a sufficient level. In Figure 19 the same measured raw data are the blue dots and the new filteroutput is the red line.

23

Page 36: Demonstrator Development for Phone as a Key Based on ...1117152/FULLTEXT01.pdf · PaaK is a feature that enables a car user to gain the functionality currently offered in the PEPS

Figure 19: Kalman filter with Process noise of 1.

In Figure 19, it can be seen that the noise level is higher than in Figure 18, but the filter is alsofaster.

Figure 20 shows when the measured RSSI values were processed with an average mean filter witha window size of 10 samples, the filter output is the red line in the figure.

Figure 20: Average mean filter with 10 samples.

It can be seen in Figure 20 that the filter output is delayed compared to the measured data, inorder to reduce the delay a smaller window size were examined.

The filter output of an Average mean filter with a window size of 6 can be seen in Figure 21. Thefilter is faster than the filter in Figure 20 but on the other hand the noise level is increased.

24

Page 37: Demonstrator Development for Phone as a Key Based on ...1117152/FULLTEXT01.pdf · PaaK is a feature that enables a car user to gain the functionality currently offered in the PEPS

Figure 21: Average mean filter with 6 samples.

After evaluating the performance of the filters the Kalman filter was chosen for the implementation.

4.5 Ring Overlapping based on Comparison of Received Signal Strength

Indicator

The ROCRSSI method is dependent on differences between signal strengths from different devices.In section 2.6.1, the ROCRSSI method compares three RSSI values to determine whether a receiveris located between two other receivers. In this thesis work the device that is to be located is thesender and therefore modifications to the method were done.

The solution for ROCRSSI was that the antenna placed between the front seats was configuredto send advertisements. The RSSI value from the advertisements sent by the antenna was thencompared to the RSSI from the advertising device. If the RSSI from the advertising device issmaller than the RSSI from the advertising antenna at one receiving antenna, it can be estimatedthat the advertising device is located somewhere between the antennas, this is defined as a match.Four antennas were used to check if they have a match. A match gives an area around the antennawhere the advertising device is estimated to be located.

The method could not be used outside the car since no rings were overlapping, instead the solutionfor ROCRSSI estimates the location of the advertising device inside the car.

Figure 22 has light grey areas around each antenna, this area is where the advertising device canbe if the antenna have detected a match. If two matches from two antennas are combined thenthe advertising device must be located in one of the darker grey areas in Figure 22. The darkergrey areas in the figure appear at four locations, this means that the solution for the ROCRSSImethod can detect if the advertising device is in any of these four locations.

25

Page 38: Demonstrator Development for Phone as a Key Based on ...1117152/FULLTEXT01.pdf · PaaK is a feature that enables a car user to gain the functionality currently offered in the PEPS

Figure 22: Areas for the ROCRSSI method.

In theory, this solution should be able to classify which of the four locations the advertising deviceis located in. Although the result from experiments with this method showed that the methoddid not work as intended, therefore localization with this solution was not considered for thedemonstrator.

4.6 Trilateration

A Python script was written to solve the Trilateration equations shown in (19). In (19), x and ycorresponds to the coordinates where the advertising device is estimated to be.

In (19), x1, x2, x3, y1, y2, y3 are the positions of the antennas used for the Trilateration. Since thesepositions are known, (19) can be expanded and all variables that contains these values can bereplaced with parameters calculated for each antenna position. Replacing these values results in(20).

B1 +A1 · x+ x2 + C1 +D1 · y + y2 = E1

B2 +A2 · x+ x2 + C2 +D2 · y + y2 = E2

B3 +A3 · x+ x2 + C3 +D3 · y + y2 = E3

(20)

Where, A, B, C, D, and E are parameters that are calculated using the positions of the antennas.This equation system was then simplified, using substitution of the equations, to the equationsystem in (21). This results in a equation system that is easier to be solved.

{

Ax+By = C

Dx+ Ey = F(21)

where: A = A1−A2,B = B1−B2,C = E1−E2−(B1−B2)−(C1−C2), D = A2−A3, B = B2−B3,E = C2 − C3 and F = E2 − E3 − (B2 −B3)− (C2 − C3).

Since the solution uses the substitution method, there are some cases when the parameters in (21)can be equal to zero. These cases are when the x- or y-position of two antennas are the same.

The script works fine for the case when the RSSI values intersects, however due to the noisethis does not occur often. Therefore localization with Trilateration was not considered for thedemonstrator.

26

Page 39: Demonstrator Development for Phone as a Key Based on ...1117152/FULLTEXT01.pdf · PaaK is a feature that enables a car user to gain the functionality currently offered in the PEPS

4.7 Neural Network

Neural networks were implemented in a Python script, based on the library fann2 (fast artificialneural network 2). Eight neural networks were defined, one for the welcome zone, five networksfor the vehicle entries, one for inside the vehicle and one for the start zone. The collected data wasused to train the neural networks to detect a given zone, the back-propagation method was usedfor the training. Each of the networks was used to classify whether the device was in a certainzone. The output of the neural networks is in the range between zero and one, where one meansthat the neural network estimates that a state is true. If the output is zero it means that theneural network estimates that a state is false. When the output is in the range between zero andone it means that the neural network cannot determine a certain state, but it can be seen as anindicator. For example, if the output is 0.8 it indicates that the state is true and if the output is0.2 it indicates that the state is false.

A classification hierarchy was established to classify in which zone the advertising device waslocated for a certain data set. In the classification hierarchy, a variable was set to minus one ifthere was no possibility for the state to be true. The classification hierarchy can be seen in Figure23.

Figure 23: Classification hierarchy for the Neural Networks.

A list of the variables used in Figure 23 can be seen in Table 3. Each variable corresponds to anoutput of the neural networks.

27

Page 40: Demonstrator Development for Phone as a Key Based on ...1117152/FULLTEXT01.pdf · PaaK is a feature that enables a car user to gain the functionality currently offered in the PEPS

Table 3: Variables index and description for the classification of the neural network

Variable Description

i inside the car

s start zone

w welcome zone

e1 entry 1, right front door

e2 entry 2, right back door

e3 entry 3, trunk

e4 entry 4, left back door

e5 entry 5, right front door

As can be seen in Figure 23, the first classification is whether the advertiser is inside the car ornot. If it is inside the car it cannot be in the welcome zone at the same time, therefore the variablew is set to minus one. If the device is inside the car, then the Neural network for the start zonedetermines if it is in the start zone or not. If the advertiser is not inside the car it cannot be inthe start zone at the same time, hence the variable s is set to minus one. If the device is not inthe welcome zone it cannot be in any of the entry zones, therefore the variables corresponding tothe entry points are set to minus one.

The neural networks used a sigmoid function with values between zero and one. Since the collecteddata was RSSI values which is not between zero and one, normalization was needed. The normal-ization was done by an assumption that the value of the RSSI was within the range -90 dBm to-40 dBm. If the value of the RSSI was smaller than -90 dBm it was set to -90 dBm, if the valuewas larger than -40 dBm it was set to -40 dBm. This means that after this step all data is withinthe range -90 dBm to -40 dBm. The RSSI values was then changed to positive values so that therange 40 to 90 was achieved. From these values 40 was subtracted to change the values from zeroto 50, and all values was divided by 50. (22) shows this normalization. After the normalization,all data was in the range zero to one.

−x− 40

50(22)

Where, x is the RSSI value. If the RSSI value is the highest assumed (-40 dBm) the normalizedvalue is zero, if the RSSI value is the lowest assumed (-90 dBm) the normalized value is one.Therefore, all values higher than -40 dBm is also normalized to zero and all values lower than -90dBm is normalized to one.

Figure 24 shows RSSI values before and after normalization.

28

Page 41: Demonstrator Development for Phone as a Key Based on ...1117152/FULLTEXT01.pdf · PaaK is a feature that enables a car user to gain the functionality currently offered in the PEPS

Figure 24: Before and after normalization.

Before the normalization the input data was filtered. For the first hardware setup, the trainingdata was collected from static locations and the test data was collected with the advertising devicemoving. In this case the neural network had several input filter configurations, one for the trainingdata and another for the localization step. Both filters were Kalman filters and the differencebetween the filters was the prediction model. Since the training data was collected from staticlocations, the prediction model assumed that there was no difference in the current RSSI valuecompared to the previous value. For the test data, it was known that the advertising devise wasmoving and the prediction step assumed that the RSSI value was always increasing.

For the second hardware setup, both training and test data was collected with the advertisingdevice moving. In this case the neural network had only one input filter configuration, with theassumption that there was no difference in the current RSSI value compared to the previous value.This creates a kind of inertia in the filter that disregard fast changes.

After the filtering and normalization, the data can be used for either training of a neural networkor as input to an already trained network. A flowchart of the data through the neural network canbe seen in Figure 25. Several steps are dependent on each other and a change in one step changethe output of the whole network.

29

Page 42: Demonstrator Development for Phone as a Key Based on ...1117152/FULLTEXT01.pdf · PaaK is a feature that enables a car user to gain the functionality currently offered in the PEPS

Figure 25: Flowchart of the data in the Neural Network.

In Figure 25, training means that a neural network uses the data for training. Usage means thatthe data is used in an already trained neural network.

To develop a neural network that worked well for the task, these steps were changed and improved,by trial and error. The process noise in the input filter was the first parameter to be changed inpursuit of a better result.

To validate whether the changes in the system improved the output, a test walk was recorded. Theevent in the test walk is described in Table 4.

Table 4: The events in the test walk, recorded for validation of the neural network

Expected Outputs

Approximate Time [s] Event Welcome Inside Start

0 Start outside the welcome zone 0 0 -1

10 Enter the welcome zone 1 0 -1

20 Enter the car and start zone -1 1 1

35 Exit the car and enter welcome zone 1 0 -1

45 Enter the car but not start zone -1 1 0

The output from the neural networks for the test walk in Table 4 can be seen in Figure 26. Thisoutput is from the first test, without any improvements.

30

Page 43: Demonstrator Development for Phone as a Key Based on ...1117152/FULLTEXT01.pdf · PaaK is a feature that enables a car user to gain the functionality currently offered in the PEPS

Figure 26: first output from the neural networks.

When changing the process noise, it was discovered that different values of the process noise forthe training and for the usage of the network gave a better result. A higher process noise in thetraining process than in the usage gave the best result. Figure 27 shows the output from thenetworks when the process noise for the training process is larger than for the localization process.

Figure 27: Output from the neural networks with improved input filter.

When the input filter was improved and worked well, changes of the normalization was done.At first one normalization was used for all cases, this was then changed. Since the welcomezone is further away from the antennas than the inside zone, the welcome zone should have anormalization that focus on lower RSSI values than for the inside zone. Therefore, a solution withseveral normalizations were introduced. The solution with several normalizations worked betterthan with one general normalization. With several normalizations, the neural networks workedfine for the welcome zone, the inside zone and the start zone as can be seen in Figure 28.

31

Page 44: Demonstrator Development for Phone as a Key Based on ...1117152/FULLTEXT01.pdf · PaaK is a feature that enables a car user to gain the functionality currently offered in the PEPS

Figure 28: Output from the neural networks with final input filter and normalization.

An output filter which filter the output from the neural networks to zero or one, was implementedto improve the result further. This filter compares the output from the neural networks with twothreshold values, one upper and one lower threshold. If the output from the neural network ishigher than the upper threshold, the filtered value is set to one. The filtered value is not changedfrom one to zero until the output is below the lower threshold. In the same way, the filtered valueis not changed from zero to one until the output of the network is above the upper threshold. Thiscreates a kind of inertia in the filter. The result after implementing the output filter can be seenin Figure 29.

Figure 29: Output from the neural networks with the output filter.

The result in Figure 29 shows that neural networks are able to classify if the advertising deviceis inside the welcome zone, inside zone or start zone. These networks were then used in theimplementation of the demonstrator.

32

Page 45: Demonstrator Development for Phone as a Key Based on ...1117152/FULLTEXT01.pdf · PaaK is a feature that enables a car user to gain the functionality currently offered in the PEPS

To develop networks for the entry points, a new test walk was recorded. The new test walk wasrecorded for the case when the advertising device was moved along the entry points around thecar. In the beginning of the test walk the advertising device was located next to entry point one,then it was moved towards entry point two and so on.

The same network configurations, which gave the best result for the previous networks was used.The expected result was that the network for each entry point should be triggered, one after eachother.

The result for the test walk can be seen in Figure 30.

Figure 30: Output from the neural networks with five entry points.

As can be seen in the Figure 30, the networks cannot determine which door the advertising deviceis located next to.

A small set of training data was collected from fixed locations to examine if this gave a betterresult. The test gave an indication that training data from fixed locations could give a betterresult for the entry points.

In order to simplify the detection of an entry point, the definition of the entry points was redefined.The new definition was three entry points instead of five. The new entry points were defined asright, left and behind.

New data was collected for the new definition of the entry points. The new data was collectedfrom fixed locations on each side of the car.

The result from the new definition of the entry points can be seen in Figure 31 where the test datais collected from the right side of the car, this means that the expected output from the networksshould be that the right side has the highest value.

33

Page 46: Demonstrator Development for Phone as a Key Based on ...1117152/FULLTEXT01.pdf · PaaK is a feature that enables a car user to gain the functionality currently offered in the PEPS

Figure 31: Output from the neural networks with three entry points.

The result in Figure 31 was considered an improvement of the entry points. The output filter usedin the previous networks was not used in this case. Instead a comparison of the outputs from thethree networks were implemented. The comparison of the outputs from the networks were basedon the median of five samples from each network. The network with the highest median value anda value above a threshold was considered to represent the most likely location of the device. Thethreshold was needed since there is one case when the device is inside the welcome zone but notinside any of the entry zones. The reason why five samples were used was to disregard fast changes.The new definition of the entry points was used in the implementation of the demonstrator.

In the graphical representation of the outputs from the neural networks it is easy to see theimprovements of the neural networks, but it is hard to determine how accurate the neural networksare compared to reality. To determine the performance of the networks new tests were recorded.In these tests, all data were collected with the advertising device moving in only one zone for eachcollection.

The output from the neural network, corresponding to the zone where the data was collected shouldthen be true for all samples. The numbers of true output values from the network were divided bythe number of collected data samples and in this way the accuracy on the neural network could bepresented in percentage. The results from this test can be seen in table 5.

Table 5: Percentage of correct estimations from each neural network

Neural Network Result [%]

Welcome 62

Inside 100

Start 92

Right 97

Left 89

Behind 49

34

Page 47: Demonstrator Development for Phone as a Key Based on ...1117152/FULLTEXT01.pdf · PaaK is a feature that enables a car user to gain the functionality currently offered in the PEPS

The results in Table 5 are from one measurement and the output filter corresponding to each neuralnetwork were used. This means that the results from the neural networks: Right, Left and Behindwhere based on the comparison of the three networks.

4.8 Graphical User Interface

To illustrate the location of the broadcasting device a GUI (Graphical User Interface) was devel-oped. The first draft of the GUI was a Python script reading a position (x- and y-coordinates)from a file and updating the position in a Cartesian plane. The first draft of the GUI can beseen in Figure 32, where the red dots corresponds to the antenna locations and the blue dot is theestimated position of the advertising device.

Figure 32: Graphical User Interface v1.0.

The x- and y-axis in Figure 32 have the units meter and the distances between the red dots arethe measured distances to the corresponding antennas in the car.

The GUI was used to evaluate the Trilateration algorithm, the estimated position from the algo-rithm was plotted in the GUI and this plot was then compared to the actual position where theRSSI value was collected. This GUI was used to determine that the Trilateration script did notperform well with the collected RSSI values.

The first draft of the GUI was used with the first hardware setup. The GUI was then updated forthe second hardware setup. In the second hardware setup, the Raspberry Pi was used as a Wi-Fiaccess point. The final GUI was therefore a html (Hyper Text Markup Language) based web-pageand can be seen in Figure 33.

35

Page 48: Demonstrator Development for Phone as a Key Based on ...1117152/FULLTEXT01.pdf · PaaK is a feature that enables a car user to gain the functionality currently offered in the PEPS

Figure 33: Graphical User Interface v2.0.

In Figure 33 the advertising device is estimated to be located inside the car. This is illustratedwith the green area inside the car and the text "INSIDE".

To access the final GUI the user must connect to the Raspberry Pi, via Wi-Fi and after this go tothe specific web-page. The second GUI did not show the position in the same way as the first onedid, instead of showing the exact position the final GUI showed which zone the advertising deviceis estimated to be in. With this method, the GUI could be used for the neural networks.

4.9 Real-Time Implementation

A real-time demonstrator gives better demo effect, since it is easy for a crowd to see the eventsin the GUI and at the same compare the events with the reality. The graphs from the recordeddata can be hard to understand and a better visualization was required. Therefore, a real-timeimplementation was developed, when the neural networks and the GUI worked as intended.

The real-time implementation was a Python script running on the Raspberry Pi. The RaspberryPi collected data from the antennas, this data was then processed with the developed input filtersand the normalizations. The processed data was used as input for the trained neural networks andthe output from the networks was represented by the GUI.

The result was a real-time system working well for demonstration of the PaaK technology.

36

Page 49: Demonstrator Development for Phone as a Key Based on ...1117152/FULLTEXT01.pdf · PaaK is a feature that enables a car user to gain the functionality currently offered in the PEPS

5 Number of Antennas and Placement

One research question in this thesis work was to investigate how many BLE antennas that arenecessary to localize a broadcasting device using neural networks. Another related question was,which placement of the antennas that gave the best output from the neural networks. This chapterdescribes how the BLE antennas were placed and how the numbers of necessary antennas wereinvestigated, three different placements of the antennas were considered.

The first placement of the antennas was implemented with the first hardware setup. The ASUSantennas were attached to a Volvo XC90. The placement of each antenna can be seen in Figure34 where each antenna is represented by a red dot.

Figure 34: First antenna setup.

Table 6 shows the name and the location of each antenna.

Table 6: Antenna names and placement for the first setup

Antenna name Position

A1 on top of the console

A2 right front door

A3 between the front seats

A4 left front door

A5 in the roof behind the backseat

A6 inside of the trunk door

For the second placement of the antennas the second hardware setup was used. The Texas In-struments CC2650 Launchpads were attached to a Volvo V60 and the antennas placement arepresented in Figure 35.

37

Page 50: Demonstrator Development for Phone as a Key Based on ...1117152/FULLTEXT01.pdf · PaaK is a feature that enables a car user to gain the functionality currently offered in the PEPS

Figure 35: Second antenna setup.

Table 7 shows the antennas name and which name that correspond to which location.

Table 7: Antenna names and placement for the second setup

Antenna name Position

A1 left front door

A2 between the front seats

A3 right front door

A4 left back door

A5 right back door

A6 inside of the trunk door

A7 on the left side of the console

A8 on the right side of the console

With the second antenna setup BLE packages were lost during the data collection process, thisdata loss appeared to be due to the power consumption of the antennas. The Texas InstrumentsCC2650 power consumption was too high, the Raspberry Pi and the USB-hub could not meet therequired power needed. Therefore, the number of antennas were reduced to seven in the thirdantenna setup.

In the third setup all antennas were placed inside the car, the placement of the antennas can beseen in Figure 36.

38

Page 51: Demonstrator Development for Phone as a Key Based on ...1117152/FULLTEXT01.pdf · PaaK is a feature that enables a car user to gain the functionality currently offered in the PEPS

Figure 36: Third antenna setup.

Table 8 shows all the antenna names and which name that correspond to which location.

Table 8: Antenna names and placements for the third antenna setup

Antenna name Position

A1 B-pillar left side, inside

A2 between the front seats

A3 B-pillar right side, inside

A4 C-pillar left side, inside

A5 C-pillar right side, inside

A6 on the left side of the console

A7 on the right side of the console

Regarding the antennas placement antenna setup three was chosen as the best option, of the threetested, this is due to the fact that antennas on the inside of the car is cheaper than antennason the outside of the car. The result from the neural networks showed that it was possible toestimate the location from all antenna setups but since setup three would be cheaper to implementit was considered as the best option. This antenna setup was chosen for the implementation of thedemonstrator.

The data collection for each antenna setup used all antennas, to determine if the neural networkcould estimate the location of the advertising device with less antennas the data from one or severalantennas could be ignored.

To investigate the performance of the neural networks with fewer antennas, a test was performedwhen the data from antenna five and antenna seven was ignored for the third antenna setup. Figure37 shows the output from the neural networks without the data from antenna five and antennaseven. The test case that was used as input for the neural networks was the same as presentedearlier in table 4.

39

Page 52: Demonstrator Development for Phone as a Key Based on ...1117152/FULLTEXT01.pdf · PaaK is a feature that enables a car user to gain the functionality currently offered in the PEPS

Figure 37: Output from the neural networks with five antennas as input.

The output from the neural networks in Figure 37 shows that the neural networks work as intendedbut not as good as with more antennas, see Figure 28. As expected more antennas gave a betterresult.

40

Page 53: Demonstrator Development for Phone as a Key Based on ...1117152/FULLTEXT01.pdf · PaaK is a feature that enables a car user to gain the functionality currently offered in the PEPS

6 Analysis and Discussion

This chapter presents the analysis from this thesis and discussion about the results.

6.1 RSSI Characteristics

In the RSSI characteristics section it can be seen that the noise level is high. For example inFigure 8 where the median and mean value are compared, the noise level is almost 20 dBm. Areason for the high noise could be that the data was collected inside ACTIA’s garage and the noisecan be due to reflections or because of interference from other Bluetooth and Wi-Fi devices in thesurrounding.

This noise could be the cause to why the relationship between the RSSI value and the distance donot behave as expected. There is a possibility that the relationship between RSSI value and thedistance behaves as in the theory if the measurements are done in an environment without noise.

The calculated difference in meters between the measurements when there is a human body betweenthe transmitter and the receiver and for the case of line of sight is large. Since the value of n wascalculated for the case when there is line of sight the path loss model is not calibrated for othercases. To get a more accurate distance calculation the value of n must be recalculated each timethe environment is changed. This means that it is difficult to get an accurate distance calculationfor the demonstrator since the environment is changing all the time. An example for a changein the environment is when the demonstrator is used, the body of the person using it affect thepropagation of the signal. This contributes to difficulties to use localization techniques based onthe calculated distance.

The difference in the RSSI measured from the different smartphones is probably due to differentBluetooth modules used in the smartphones and the antenna orientation. This should be takeninto account and somehow compensated when developing the application for the PaaK technology.

6.2 Demonstrator Design

During the data collection, there was a problem with the antennas. The antennas did often stopsending data to the Raspberry Pi, as mentioned in 5 the power consumption was probably areason for the losses of data. However, the antennas stopped sending data even when the numberof antennas were reduced and the power consumption was satisfied according to the specifications.It is unknown why the antenna stopped sending data.

For the input filter the Kalman filter was chosen because it was fast and easy to vary how muchnoise that were allowed to pass. It was also chosen because of the low delay compared to theAverage Mean filter, which was an advantage for the real-time implementation. The decision wasbased on comparison of the figures in section 4.4.

The Trilateration script did not work as intended for the calculated data. If the Trilateration scripthad worked it would have been a good solution for localization in the PaaK technology. Since it isbased on mathematical calculations it would have been applicable on all car models by calibratingthe distance between the antennas.

The ROCRSSI method was hard to implement in the PaaK technology since it is designed for indoorlocalization the geometry of antenna placements did not fulfil the requirements. The method isalso designed to localize a receiver and in PaaK the aim is to localize an advertising device. Theidea was that the ROCRSSI method would have been suitable for the PaaK technology, since itcompares RSSI values it is robust to changes in the environment.

The localization with neural networks was prioritised in this work. From the beginning, there waseight neural networks, each network corresponds to a specific zone. With these networks, the mostdifficult part to classify was the five entry points. The reason for the difficulties can be due to theoverlapping of the entry point zones and the noise in the RSSI measurement. When comparingmean values for data collected from each side of the car the behaviour was not as expected. Ifa collection is done on the right side of the car, an antenna on the right side of the car should

41

Page 54: Demonstrator Development for Phone as a Key Based on ...1117152/FULLTEXT01.pdf · PaaK is a feature that enables a car user to gain the functionality currently offered in the PEPS

reasonably have a higher RSSI value than an antenna on the left side. This is not always the caseand therefore it can be difficult for the neural network to find a pattern. The reason why theRSSI do not behave as expected can be due to noise and reflections. Even though the unexpectedbehaviour of the RSSI the neural networks for the Welcome, Inside and Start zone worked asintended.

The performance of the output filter for the Welcome, Inside and Start zone was satisfying, howeverthis filter compares one sample at a time and an improvement could be to compare a median ofmultiple samples.

In the second entry point definition, the neural networks for the entry points worked better, thesenetworks also had more data for the training process which could be the reason for the betterresults. It is therefore possible that the result for the definition with five entry points could havebeen improved with more training data. When more data is collected for the training of the neuralnetworks more hidden layers and neurons can be introduced and this can also improve the result.

During the training of the second entry point definition, it was discovered that it is of importancethat the positive and negative training sets are of the same size.

The neural networks performed better when different normalizations were used. The differentnormalizations were used dependent of whether the device was inside or outside the car. Thenormalizations used a method which normalized the values linearly. There is a possibility that theneural networks can give a better result with other normalization methods. In [18] the authorsdescribe a normalization method where the average of the inputs is shifted to be close to zero andscaled so that the inputs have about the same covariance. This normalization method could givea better result than the linear normalization used.

The GUI developed is a webpage displaying an image with a specific name, this image is refreshedonce every second. The output of the neural networks determines which image that should bedisplayed and save it with the specific name. It is a simple solution that works for the demonstrationbut it can be improved. For example, a webpage that have access to all images and decide whichimage that should be displayed could be a better solution. The reason why the GUI is based on awebpage is because it can be reached from all devices with a Wi-Fi connection and a browser.

In the real-time implementation the neural networks for the Welcome, inside and start zones givesan output ten times per second. The network for the entry points gives an output two times asecond. Since the GUI updates the image to be displayed once per second and overwrites theprevious image, there is a delay between the result from the networks and the image displayed onthe GUI. If the neural networks would be used in a PaaK solution this would not be a problemsince the GUI is only used for demonstration.

6.3 Antenna placement

The antennas were placed at possible locations for implementation in a car. For example, onereasonable placement of an antenna is between the front seats, another reasonable placementinside the car is in the b- or c-pillar. A solution for antennas outside the car could be in the doorhandles.

In the antenna setups, the placements were based on the top view of a car, it did not take heightdifferences between antennas into account. The height differences were considered as a possiblecause of error in the localization.

Figure 38 show one advertising device and two antennas seen from above, the advertising deviceis placed one meter from each antenna.

42

Page 55: Demonstrator Development for Phone as a Key Based on ...1117152/FULLTEXT01.pdf · PaaK is a feature that enables a car user to gain the functionality currently offered in the PEPS

Figure 38: Top point of view of two antennas antennas with 1 meter to the advertising device, theblue dot is the advertising device and the white dots are the antennas.

If the antennas in Figure 38 have a height difference, it is possible that the distances between theadvertising device and the antennas will be different from a three dimensional point of view. Forexample if the difference in height is one meter and the advertising device is placed in the sameplane as one antenna, the distance to the other antenna will be about 1,4 meter see Figure 39.

Figure 39: Two antennas antennas with difference height relative to the advertising device, theblue dot is the advertising device and the white dots are the antennas.

43

Page 56: Demonstrator Development for Phone as a Key Based on ...1117152/FULLTEXT01.pdf · PaaK is a feature that enables a car user to gain the functionality currently offered in the PEPS

The difference between the two and the three-dimensional distances means that the RSSI valueshould be different for the different antennas. The Trilateration script does only consider twodimensions and therefore the height differences between antennas can be a possible source of error.

When the number of antennas needed was investigated, data from antennas in setup three wereignored. A new setup with fewer antennas might have been a better solution for the investigation.For every antenna setup, new sets of training data were needed, which was time consuming to col-lect. Therefore, ignoring data from specific antennas were a more efficient way for the investigation.The test with five antennas indicates that the localization can be possible with fewer antennas.The result with fewer antennas is not as good as for more antennas, however as discussed beforethe output seems to be improved with more training data. This means that it could be possibleto obtain a result with five antennas which is as good as for seven antennas if more training datais collected. The investigation of the number of antennas needed only considered the Welcome,Inside and Start zone, it was assumed that if it works for these three zones then it should work forthe entry zones as well.

44

Page 57: Demonstrator Development for Phone as a Key Based on ...1117152/FULLTEXT01.pdf · PaaK is a feature that enables a car user to gain the functionality currently offered in the PEPS

7 Conclusion

In this section, the conclusions of the work are presented.

The RSSI characteristics are unpredictable and susceptible to noise, this means that the signal fromthe advertising device behave different every time it is measured even though the same devices areused in the same environment.

The Kalman filter is a suitable filter for the PaaK technology. Since the output is predicted thereis no delay, which is good for real-time localization.

The localization algorithms examined in this work, works good with validated test data but notwith collected RSSI values. Since the RSSI is affected by the environment the results are notreliable. Therefore, these algorithms cannot be used for the PaaK technology, at least not withthe implementation done in this thesis work.

Neural networks can find a pattern in the RSSI values and can therefore be used for localizationestimation of the advertising device. More training data improves the result and it is also importantthat the training data is balanced between the positive and the negative data. There neuralnetworks perform better when the training data has a higher noise level than the input data,which is easy to implement with a Kalman filter. The normalization is also important for theperformance of the neural networks. The number of antennas needed for the neural networks isdependent on the quantity of the training data available.

45

Page 58: Demonstrator Development for Phone as a Key Based on ...1117152/FULLTEXT01.pdf · PaaK is a feature that enables a car user to gain the functionality currently offered in the PEPS

46

Page 59: Demonstrator Development for Phone as a Key Based on ...1117152/FULLTEXT01.pdf · PaaK is a feature that enables a car user to gain the functionality currently offered in the PEPS

8 Future Work

This section presents suggestions for further development of the demonstrator.

During the collections of the test data there were no accurate reference to reality. When the datawas recorded the movement of the advertising device was noted and the results from the neuralnetworks were compared to these notes. This reference was satisfying as an initial validation ofthe output from the test, but to get a more precise validation improvements can be done.

An indoor localization system was installed in the ACTIA’s garage during the thesis work. Thissystem could be used as a reference where the position from the indoor localization system can beseen as the real position. This information could then be compared to the result from the neuralnetworks to validate the performance of the neural networks. The system could also be used forcollection of training data, in this case training data could be recorded for a long time and besorted into the zones requested afterwards.

Improvements for the transformation of RSSI to meters can be done by developing code for cali-bration of the path loss model. If the path loss model is continuously updated it is possible thatthe result from the Trilateration algorithm could be improved.

A variation of the Trilateration algorithm where a ring (instead of a circle) is created by themeasured RSSI, could give better results. Another improvement of the Trilateration script is toconsider three dimensions, which means to change the circles into spheres. This solution wouldwork with height differences between the antennas.

If more training data is collected for the five neural networks corresponding to the entry pointsthere is a possibility that the entry points can be detected.

The normalization based on the average of the inputs shifted close to zero and scaled so that theinputs have about the same covariance can be implemented to see if the results are improved.

The GUI could be improved further by using a variable to decide which image that should bedisplayed instead of the Python script which replace an image.

47

Page 60: Demonstrator Development for Phone as a Key Based on ...1117152/FULLTEXT01.pdf · PaaK is a feature that enables a car user to gain the functionality currently offered in the PEPS

References

[1] Atmel. Passive entry/passive start (peps). https://atmel.com/applications/automotive/car_access/passive-entry-passive-start.aspx, 2011. [Online; accessed 13-February-2017].

[2] M. Ji, J. Kim, J. Jeon, and Y. Cho. Analysis of positioning accuracy corresponding to thenumber of ble beacons in indoor positioning system. In 2015 17th International Conferenceon Advanced Communication Technology (ICACT), pages 92–95, July 2015.

[3] Carles Gomez, Joaquim Oller, and Josep Paradells. Overview and evaluation of bluetooth lowenergy: An emerging low-power wireless technology. Sensors, 12(9):11734–11753, 2012.

[4] R. Karani, S. Dhote, N. Khanduri, A. Srinivasan, R. Sawant, G. Gore, and J. Joshi. Imple-mentation and design issues for using bluetooth low energy in passive keyless entry systems.In 2016 IEEE Annual India Conference (INDICON), pages 1–6, Dec 2016.

[5] Bo Xia, Chunyu Xin, Wenjun Sheng, A. Y. Valero-Lopez, and E. Sanchez-Sinencio. A gfskdemodulator for low-if bluetooth receiver. IEEE Journal of Solid-State Circuits, 38(8):1397–1400, Aug 2003.

[6] Robin Heydon. Bluetooth low energy. Prentice Hall, 2013.

[7] E. Mackensen, M. Lai, and T. M. Wendt. Bluetooth low energy (ble) based wireless sensors.In 2012 IEEE Sensors, pages 1–4, Oct 2012.

[8] S. Bertuletti, A. Cereatti, U. Della, M. Caldara, and M. Galizzi. Indoor distance estimatedfrom bluetooth low energy signal strength: Comparison of regression models. In 2016 IEEESensors Applications Symposium (SAS), pages 1–5, April 2016.

[9] N. Kuxdorf-Alkirata and D. Brückmann. Reliable and low-cost indoor localization basedon bluetooth low energy. In 2016 3rd International Symposium on Wireless Systems withinthe Conferences on Intelligent Data Acquisition and Advanced Computing Systems (IDAACS-SWS), pages 92–96, Sept 2016.

[10] Paul Zarchan and Howard Musoff. Fundamentals of Kalman filtering : a practical approach.[Elektronisk resurs]. Progress in astronautics and aeronautics: volume 246. Reston, VA :American Institute of Aeronautics and Astronautics, Inc., [2015], 2015.

[11] Wouter Bulten. Kalman filters explained removing noisefrom rssi signals. https://wouterbulten.nl/blog/tech/

kalman-filters-explained-removing-noise-from-rssi-signals/, 2015. [Online;accessed 20-February-2017].

[12] Alan V. Oppenheim and Ronald W. Schafer. Discrete-time signal processing. Upper SaddleRiver, N.J. ; Harlow : Pearson Education, cop. 2010, 2010.

[13] Y. Wang and A. Zhang. Enhanced stability for local atomic clock ensemble time scale usingweighted moving average filter. In 2016 IEEE International Conference on Mechatronics andAutomation, pages 1948–1952, Aug 2016.

[14] W. K. Zegeye, S. B. Amsalu, Y. Astatke, and F. Moazzami. Wifi rss fingerprinting indoorlocalization for mobile devices. In 2016 IEEE 7th Annual Ubiquitous Computing, ElectronicsMobile Communication Conference (UEMCON), pages 1–6, Oct 2016.

[15] Chong Liu, Kui Wu, and Tian He. Sensor localization with ring overlapping based on compar-ison of received signal strength indicator. In 2004 IEEE International Conference on MobileAd-hoc and Sensor Systems (IEEE Cat. No.04EX975), pages 516–518, Oct 2004.

[16] C. Zhou and A. Wieser. Application of backpropagation neural networks to both stages offingerprinting based wips. In 2016 Fourth International Conference on Ubiquitous Positioning,Indoor Navigation and Location Based Services (UPINLBS), pages 207–217, Nov 2016.

48

Page 61: Demonstrator Development for Phone as a Key Based on ...1117152/FULLTEXT01.pdf · PaaK is a feature that enables a car user to gain the functionality currently offered in the PEPS

[17] G. Félix, M. Siller, and E. N. Álvarez. A fingerprinting indoor localization algorithm baseddeep learning. In 2016 Eighth International Conference on Ubiquitous and Future Networks(ICUFN), pages 1006–1011, July 2016.

[18] Y. LeCun, L. Bottou, G. Orr, and K. Muller. Efficient backprop. In G. Orr and Muller K.,editors, Neural Networks: Tricks of the trade. Springer, 1998.

49