• No results found

Investigation of magnetic sensors and hardware design of a sensor platform for human-computer interaction purposes

N/A
N/A
Protected

Academic year: 2021

Share "Investigation of magnetic sensors and hardware design of a sensor platform for human-computer interaction purposes"

Copied!
87
0
0

Loading.... (view fulltext now)

Full text

(1)

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

Investigation of magnetic

sensors and hardware design of a

sensor platform for

human-computer interaction

purposes

Christopher Forsmark

(2)

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

Investigation of magnetic

sensors and hardware design of a

sensor platform for

human-computer interaction

purposes

Examensarbete utfört i Elektroteknik

vid Tekniska högskolan vid

Linköpings universitet

Christopher Forsmark

Handledare Magnus Karlsson

Examinator Amir Baranzahi

(3)

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ör

ickekommersiell forskning och för undervisning. Överföring av upphovsrätten

vid en senare tidpunkt kan inte upphäva detta tillstånd. All annan användning av

dokumentet kräver upphovsmannens medgivande. För att garantera äktheten,

säkerheten och tillgängligheten finns det lösningar av teknisk och administrativ

art.

Upphovsmannens ideella rätt innefattar rätt att bli nämnd som upphovsman i

den omfattning som god sed kräver vid användning av dokumentet på ovan

beskrivna sätt samt skydd mot att dokumentet ändras eller presenteras i sådan

form eller i sådant sammanhang som är kränkande för upphovsmannens litterära

eller konstnärliga anseende eller egenart.

För ytterligare information om Linköping University Electronic Press se

förlagets hemsida

http://www.ep.liu.se/

Copyright

The publishers will keep this document online on the Internet - or its possible

replacement - for a considerable time from the date of publication barring

exceptional circumstances.

The online availability of the document implies a permanent permission for

anyone to read, to download, to print out single copies for your own use and to

use it unchanged for any non-commercial research and educational purpose.

Subsequent transfers of copyright cannot revoke this permission. All other uses

of the document are conditional on the consent of the copyright owner. The

publisher has taken technical and administrative measures to assure authenticity,

security and accessibility.

According to intellectual property law the author has the right to be

mentioned when his/her work is accessed as described above and to be protected

against infringement.

For additional information about the Linköping University Electronic Press

and its procedures for publication and for assurance of document integrity,

please refer to its WWW home page:

http://www.ep.liu.se/

(4)

Link¨

oping University

Campus Norrk¨

oping

TQET33 - MASTER THESIS

Investigation of magnetic sensors and

hardware design of a sensor platform

for human-computer interaction

purposes

Author:

Christopher Forsmark

Examiner:

Amir Baranzahi

Supervisor:

Magnus Karlsson

December 6, 2017

(5)

Abstract

Company A develops algorithms and hardware for the application of magnet tracking, to be able to use a dipole magnet as an interaction tool between humans and computers.

This master thesis investigates the available magnetic sensors through a market survey and practical testing of a selection of the sensors in purpose to determine the most suitable magnetic sensor and magnetic sensor technology for the application of magnet tracking. With the most suitable sensor found in the investigation, a sensor platform is designed and manufactured.

The sensor HMC5983 from Honeywell is found to be the most suitable sensor and is designed into the sensor platform, which also includes ,for instance, a wireless MCU, CC2640 from Texas Instru-ments, together with a PCB antenna and a PSU including a battery charger, BQ24075 from Texas Instruments. The most suitable mag-netic sensor technology was found to be magnetoresistive sensors.

The sensor platform was designed according to the requirements and is working good enough to enable company A to start testing their algorithms for magnet tracking on the new platform.

(6)

Contents

1 Introduction 1 1.1 Background . . . 1 1.2 Purpose . . . 1 1.3 Question formulation . . . 2 1.4 Delimitations . . . 2 1.5 Project structure . . . 2 1.6 Material . . . 2 1.6.1 Computer softwares . . . 2 2 Theoretical background 4 2.1 Magnetic Sensors . . . 4 2.1.1 Magnetoresistive sensors . . . 4

2.1.2 Hall effect sensors . . . 7

2.1.3 Search-coil Magnetometer sensor . . . 9

2.2 Antenna Theory - Inverted F antenna . . . 9

3 Analysis and evaluation of magnetic sensors 12 3.1 Market survey . . . 12

3.2 Hardware design of the magnetic sensor modules . . . 14

3.3 Practical tests . . . 17

4 Hardware design of the main sensor platform 27 4.1 Hardware requirements . . . 27

4.2 Component selection . . . 27

4.3 Hardware design of the platform . . . 28

4.3.1 Inverted F antenna design . . . 28

4.3.2 MCU schematic design . . . 29

4.3.3 PSU schematic design . . . 31

4.3.4 Magnetic sensor schematic design . . . 33

4.4 PCB layout . . . 34

4.5 Test and verification . . . 34

4.5.1 Antenna test . . . 35

5 Discussion 40 5.1 Investigation of Magnetic sensors . . . 40

5.1.1 Market survey discussion . . . 40

5.1.2 Magnetic sensor hardware design discussion . . . 40

5.1.3 Practical test Discussion . . . 41

(7)

5.2 Hardware design of the main sensor board . . . 42

5.2.1 Component selection discussion . . . 42

5.2.2 Antenna design discussion . . . 43

5.2.3 PSU hardware design discussion . . . 43

5.2.4 Test and verification discussion . . . 44

6 Conclusion 45

References 46

(8)

List of Figures

1 Thin film structure of MR-sensors . . . 5

2 Resistive response of the MR-sensor . . . 5

3 Effect of the Set/reset circuit in a Magnetometer . . . 7

4 Principle of the hall effect sensor[35][36] . . . 8

5 Basic design of an IFA . . . 10

6 Equivilant circuit of an IFA . . . 10

7 Schematic for MLX90393 . . . 15

8 PCB-layout for MLX90393 . . . 16

9 Schematic for MMC3416xPJ . . . 16

10 PCB-layout for MMC3416xPJ . . . 17

11 The test rig. . . 18

12 Block diagram of the test rig . . . 19

13 Flowchart of the software for the test rig . . . 20

14 Results of detectability tests of HMC5983 with the X-axis point-ing towards the magnet. . . 22

15 Results of detectability tests of HMC5983 with the Y-axis point-ing towards the magnet. . . 22

16 Results of detectability tests of HMC5983 with the Z-axis point-ing towards the magnet. . . 23

17 Results of detectability tests of MLX90393 with the X-axis pointing towards the magnet. . . 23

18 Results of detectability tests of MLX90393 with the Y-axis pointing towards the magnet. . . 24

19 Results of detectability tests of MLX90393 with the Z-axis point-ing towards the magnet. . . 24

20 Results of detectability tests of MMC3416 with the X-axis point-ing towards the magnet. . . 25

21 Results of detectability tests of MMC3416 with the Y-axis point-ing towards the magnet. . . 26

22 Results of detectability tests of MMC3416 with the Z-axis point-ing towards the magnet. . . 26

23 IFA design . . . 29

24 IFA simulation results . . . 29

25 Scheamtic for CC2640 . . . 30

26 Schematic for antenna filter, debug header and CH340G. . . . 31

27 Schematic for the PSU . . . 33

28 Schematic for HMC5893 . . . 34

(9)

30 Frequency response of the antenna with the x-axis towards the receiver . . . 37 31 Frequency response of the antenna with the z-axis towards the

receive . . . 38 32 Radiation pattern from the antenna test, plotted in polar

(10)

List of Tables

1 Summary of market survey . . . 13 2 Standard deviation of the sensor noise . . . 21

(11)

Acronyms

ADC Analog to Digital Converter. 43 AMR Anisotropic magnetoresistance. 4, 6

COM-port Communication port. 18, 19, 27, 28, 34 EDV End of Discharge Voltage. 43

EMC Electromagnetic Compatibility. 2, 35, 44, 45 EMI Electromagnetic Interference. 45

ESD Electrostatic Discharge. 31 EVM Evaluation Module. 12, 35, 42 FPGA Field Programmable Gate Array. 3 GPIO General Purpose Input Output. 41 I2C Inter-Integrated Circuit. 14–16, 18, 27, 42 IC Integrated Circuit. 17, 31, 32, 34, 43, 44 IFA Inverted-F Antenna. iv, 9, 10, 28, 29 JTAG Joint Test Action Group. 30, 35, 44, 45 LDO Low Dropout Regulator. 28, 30, 33, 43 LED Light Emitting Diode. 32

LSB Least significant bit. 13

MCU Microcontroller Unit. i, ii, 1–3, 13, 27, 29, 33–35, 41, 43, 45 MUX Multiplexer. 28, 43

NDA Non-Disclosure Agreement. 1, 2, 27 ODR Output Data Rate. 13, 14, 21, 40, 42, 45

(12)

P2P Pin to Pin. 42

PCB Printed Circuit Board. i, iv, 3, 12, 14–17, 28, 34, 40, 42–45 PSU Power Supply Unit. i–iv, 2, 30, 31, 33, 43, 45

RMS Root mean square. 13

RSSI Received signal strength indication. 35 RX Receive. 35

SCL Serial Clock Line. 15, 16 SDA Serial Data Line. 15, 16 SNR Signal-to-noise ratio. 24, 25

SPI Series Peripheral Interface. 14, 15, 27, 33, 42, 45 TI Texas Instruments. 29, 35

TX Transmit. 35

UART Universal Asynchronous Receiver/Transmitter. 18, 19, 27, 30 USB Universal Series Bus. 27, 31, 35

(13)

1

Introduction

This master thesis aims at investigating magnetic sensors to see which is the most suitable for the application of tracking of a dipole magnet. When a suitable sensor is found, a sensor platform will be developed using the selected magnetic sensor together with an appropriate MCU.

1.1

Background

This project is carried out together with a company which develops tech-nology for the next generation human-computer interaction. According to a non-disclosure agreement (NDA) the company name is not given in this master thesis report and they will be referred to as Company A.

Company A has previously developed a sensor platform which measures the magnetic field of an external magnet and is able to track and determine the position of the magnet in three dimensions with five degrees of freedom. The application of the platform is mainly to work as a new type of interaction tool between humans and computers.

During the development of this technology, Company A has focused mainly on the software and no effort was put to determine which magnetic sensors and other hardware that are most suitable for this application of dipole magnet tracking.

The previous version of the platform was developed during the develop-ment of the algorithm and had the main purpose of delivering test data to evaluate the tracking algorithm. This version has hardware that is too ex-pensive in both price and size of the components to make a cost efficient product. Some of the components are also no longer manufactured. Com-pany A has a plan to launch a home user version and therefore there is a need for a cost efficient solution of the platform.

Since the previous development of the platform there has been a major development of the magnetic sensor technology and therefore there is a need for an investigation of the sensors currently available on the market.

1.2

Purpose

The purpose of the master thesis is to investigate and determine which mag-netic sensors are most suitable for tracking position and orientation of an external magnet. With the magnetic sensor that, together with company A, is determined to be most suitable, a new sensor platform is developed.

(14)

1.3

Question formulation

The questions that will be covered in this thesis are:

• What are the main criteria for the magnetic sensors to fulfill to be suitable for tracking of a dipole magnet?

• Which magnetic sensor technology is most suitable for magnet track-ing?

1.4

Delimitations

The investigation will only cover 3-axis magnetic sensors, as that is a re-quirement from Company A. The complete design of the sensor platform will not be presented due to NDA-restrictions. Instead, the individual parts like processor-, sensor-, PSU- and antenna design are presented individual. The testing of the final hardware design do not include any magnet tracking, due to the lack of time to program the MCU. The master thesis does not include functionality tests of parts that include programming. This includes testing of the magnetic sensor placed on the sensor platform. The antenna is tested in an EMC chamber with a tool from Texas Instruments, SmartRF studio.

1.5

Project structure

The project work is carried out by the author together with Company A. The work process is divided into these phases:

1. Investigation of magnetic sensors - theoretical background study and practical testing.

2. Main sensor platform hardware design - Component selection, schemat-ics, PCB-design and prototype manufacturing.

3. Test and verification - Function test, antenna-performance test and proposals for future development.

1.6

Material

In this section the materials used in the master thesis are presented. 1.6.1 Computer softwares

To execute the project several computer softwares are used to ease the design process. This includes softwares for electronics circuit design, circuit simula-tion, embedded software development and mathematical computation.

(15)

Advanced Design System Advanced Design System (ADS) is an elec-tronic design automation software for RF, microwave, and high speed digital applications [1]. ADS can be used as a tool for frequency-domain and time-domain simulation and electromagnetic field simulation. In this project, ADS is used to simulate and tune the 2.4 GHz PCB-antenna.

Altium Designer Altium designer is a complete electrical design automa-tion (EDA) software for PCB, FPGA and embedded software design. Al-tium designer has a wide design support including component library and the schematic design environment is closely paired to the PCB-layout tool making the design process easier. Altium Designer includes tools for fabri-cation file extraction and verififabri-cation directly in the software.

Arduino IDE Arduino IDE is an open source software for embedded soft-ware development of the Arduino MCU platforms. It is simple and easy to use and have many examples and references in the online community. In this project the Arduino IDE is used to program the Arduino MCU:s used to collect data samples from the sensors during the sensor tests.

MATLAB MATLAB is a computation tool from MathWorks. MATLAB is short for ”Matrix Laboratory” because it only uses matrices as variables. Matlab is used for many things including data acquisition, algorithm de-velopment, signal processing and advanced computations. In this project, MATLAB is used to collect data form the sensors during the tests and then visualize the results to make it easier to draw conclusion.

(16)

2

Theoretical background

This section contains theory about magnetic sensors and the inverted-F an-tenna.

2.1

Magnetic Sensors

A magnetometer is an instrument that provides information about the netic field that is applied to it. There are various technologies used in mag-netic sensors to measure the magmag-netic field. In this thesis, three technologies have been chosen to have a closer look at, Magnetoresistive (MR)-sensors, Hall effect sensors and search-coil magnetometer sensors.

2.1.1 Magnetoresistive sensors

The MR sensor is build out of a thin film of anisotropic magnetoresistance (AMR) materials. AMR materials change their electrical resistance as a response of the change in angel and strength between the magnetization vector of the external magnetic field and the direction of the electrical current flowing through the AMR material [31]. The most common AMR-material used is permalloy, which is a ferromagnetic alloy made out of nickel and iron. The sensor structure of the MR-sensors is shown in figure 1a. The thin film has a magnetization vector in the longitudinal direction of the thin film. When no external magnetic field is applied to the thin film, the resistance is at the minimum rate. When an external magnetic field is applied perpendicular to the direction of the current the magnetization vector of the thin film rotates (in the plane of the thin film) and the resistance of the permalloy increases. One big drawback of this structure is that the response is the same for both polarities of the magnetization. This issue is solved by applying a so-called barber poles of a highly conductive material on top of the thin film of permalloy. This material is usually aluminum [34]. These bars are places in a 45◦ angle with respect to the longitudinal axis of the thin film, as shown in figure 1b. Due to that the aluminum bars are more conductive than the permalloy the current will be forced to take the shortest path between the bars. This path has a direction that is perpendicular to the direction of the bars. Now the current and the magnetization vector are making a 45◦ angle with each other.

(17)

(a) Original electrode structure (b) Barber pole electrode structure

Figure 1: Thin film structure of MR-sensors

The introduction of this angle between the magnetization vector and the current changes the sensitivity and linearity of the sensor. As seen in figure 2, with barber poles a linear region is introduced around the zero and the sensor is now able to sense the difference between positive and negative magnetic fields.

Figure 2: Resistive response of the MR-sensor This phenomenon is explained analytically in equation 1.

(18)

R(ϕ) = r⊥+ (rk− r⊥) ∗ cos2(ϕ) (1) Where R is the resistance, dependent of the angle(ϕ) between the external magnetic field and the longitudinal axis. r⊥ and rk are the resistance in the material along the axis perpendicular and parallel with the longitudinal axis. This is an even function and is therefore symmetrical across the null point of the X-axis, as seen in figure 2. The introduction of the barber poles, which makes the current path diverse by 45◦ in respect to the longitudinal axis, changes the equation to

R(ϕ) = r⊥+ (rk− r⊥) ∗ cos2(ϕ − 45◦) (2) and in other words adds a 45◦ phase shift to the resistive response curve of the thin film.

The AMR-material have different magnetic domains in the material. The direction of the magnetization in each of these domains can be changed by an external magnetic field, if it is stronger than the operational range of the material. The direction of the magnetization of these domains need to be aligned in the same direction, in order to get the correct properties of the material. To restore this phenomena and align the magnetic domains, a Set/reset circuit is used. This circuit generates a strong magnetic field close to the thin film during a short pulse which align the direction of the magnetization of the domains in the same direction. If the domains are not aligned the response of the magnetoresistive material to a magnetic field are reduced. Figure 3 illustrates the set/reset circuit.

(19)

Figure 3: Effect of the Set/reset circuit in a Magnetometer

The MR-sensor is the most suitable sensor technology for magnet track-ing. The sensor has good sensitivity and can sense far field magnetic field from an external magnet as long as the strength of the magnet is stronger than the earths magnetic field.

2.1.2 Hall effect sensors

The hall effect sensor is built out of a thin film of p-type semiconductor, called Hall element. The principle of the hall effect sensor is based on Lorentz force, which is a physical law that describes the force applied on a charged particle (electron) in an electro-magnetic field.

In a hall effect sensor a current is sent through the hall element. When no external magnetic field is applied to the sensor, the electrons flows straight through the material and takes the shortest path between the two poles. When a magnetic field is applied over the hall element, the electrons diverse from the shortest path over the material. The positive charged particles will accumulate on one side and the negative charged will accumulate on the other side. The separation of the differently charged particles generates a potential difference between the two sides of the hall element, the hall voltage. By measuring the hall voltage, the strength of the magnetic field can be determined. The principle of Hall effect is illustrated in figure 4.

(20)

Figure 4: Principle of the hall effect sensor[35][36]

The hall voltage is often in magnitude of a few µV and therefore ampli-fication circuitry is needed to be able to measure the voltage with an ADC.

(21)

2.1.3 Search-coil Magnetometer sensor

The search coil, or induction coil, is a sensor technology measuring the change of magnetic flux through a coil of conductive material with a ferromagnetic core. The principle is based on Faraday law of induction and Lenz’s law. The basic principle of the sensor is that an inductive element together with a capacitance and an amplifier forms a LC-oscillator. This is a self-oscillating circuit. The oscillating frequency and amplitude are dependent on the value of the inductance. Through the Faraday and Lenz relationship, it is shown that the inductance of the coil can be changed if an external magnetic field is applied to the coil. This change in inductance will change the frequency and amplitude of the oscillating signal of the circuit. Through observing these parameters the changes in the magnetic field can be measured. In the application of 3-axis sensor this sensor has a big drawback. Due to the fact that the coil itself generates a magnetic field, simultaneous measurements are not possible. Therefore, the measurements for each axis have to be executed sequentially and the output data rate of the magnetic sensor will be three times slower.

2.2

Antenna Theory - Inverted F antenna

An antenna is, according to Balanis[29], ”a means for radiating or receiving radio waves”. What the antenna does is to convert electromagnetic energy form the transmitter to electromagnetic waves which can travel in free-space. The antenna can therefore be seen as a transitional structure between free-space and a guiding device. The guiding device is referred to as the transport medium which transports the electromagnetic energy from the transmitter to the antenna or from the antenna to the reviver, usually a transmission line.

Antennas have three types of radiation patterns, isotropic, directional or omnidirectional. An isotropic radiator is defined as ”a hypothetical lossless antenna having equal radiation in all direction”[29]. A directional radiator is more efficient on transmitting and reviving electromagnetic waves in a specific direction. An omnidirectional radiator radiates in all directions in a given plane.

An inverted-F antenna (IFA) is an evolution of the quarter-wavelength monopole antenna and is used in many wireless communication applications. The IFA has two big advantages over traditional monopole antennas. The antenna is more compact and the impedance matching is accomplished by the design of the antenna without the need of external components.

(22)

antenna is usually a straight wire which forms the antenna. By bending it 90◦ to make a part of the trace parallel with the ground plane, a capacitance is introduced to the antenna. This ”L” shaped antenna is called an inverted L antenna and is illustrated in figure 5 if part A is removed. When the shorting path(part A in figure 5) is introduced, it contributes with an inductive part to the design.

Figure 5: Basic design of an IFA

In figure 6 the equivalent circuit of the IFA is shown. L1 is the inductance created by part A in figure 5, C2 is the capacitance created by the open stub marked as part B in figure 5 and R1 is the radiation resistance of the antenna. To accomplish impedance matching at the resonance frequency, L1 and C2 should cancel out leaving only the radiation resistance, R1.

Figure 6: Equivilant circuit of an IFA

The design typology of the IFA lacks a complete analytical solution. The guidelines that are available to use as a starting points of the antenna design are:

λ = L + S + H (3)

(23)

where λ is the wavelength of the resonance frequency, W is the width of the antenna trace and L,S and H are as shown in figure 5.

Equation 3 and 4 works only as a starting point of the design and must be optimized for the specific application. Depending on the amount of sur-rounding ground plane, dielectric constant of the substrate and other factors the capacitance, C1, and inductance, L1, may not have the expected value and the resonance frequency may differ from the calculated value of equation 3 and 4. The easiest method of tuning is by trial and error. With moderns simulation tools the resonance frequency can be observed and corrected by using the guidelines in the list below.

• Increase L to decease the resonance frequency. • Decrease L to increase the resonance frequency. • Increase W to to increase the resonance frequency. • Decrease W to to decrease the resonance frequency.

(24)

3

Analysis and evaluation of magnetic

sen-sors

In this section the analysis of the magnetic sensors will be presented. The investigation of the magnetic sensors aimed at determine which sensors are the most suitable for magnet tracking. The analysis is split into two parts, first a market survey is performed to see which sensors are available. In the second part the most interesting sensors from the market survey are tested. Some sensors are available to buy as evaluation modules (EVM) that are ready to connect and evaluate right away. If the sensor does not have an EVM to buy, a PCB is designed to work as an EVM in order to evaluate the sensor. After the second part the most suitable and most cost efficient magnetic sensor is chosen to be designed into the sensor platform.

3.1

Market survey

The aim of the market survey is to find all available sensors on the market that could be suitable for the application of the sensor platform covered in this thesis. The basic requirements that the sensors have to fulfill are:

• The magnetic sensor should have three measurement axes.

• The magnetic sensor should have at least ±6 Gauss full scale measure-ment range.

The market survey is limited to involve sensors available from three of the leading semiconductor distributors in the world. These distributors are DigiKey Electronics, Mouser Electronics and Farnell Element 14.

The sensors found in the market survey are shown in table 1, together with the parameters that are most interesting to compare.

(25)

Table 1: Summary of market survey

Sensor ODR [Hz] Protocol Range [G] Resolution [mG] Noise level [mG] Price: 1k units1

[$]

HMC1043[9] N/A Analog ±6 N/A Discontinued

HMC5883L[7] 160 I2C ±8 2 4.35 Discontinued

LIS3MDL[10] 1000 I2C, SPI ±16 0.3 5.3 0.747

MAG3110[11] 80 I2C ±10 1 4 0.82

FXMS3110[12] 80 I2C ±10 1 4 1.66

LSM303AH[13] 100 I2C, SPI ±50 Not found 3 1.01

LSM303DLH[14] 75 I2C ±8,1 Not found 3 2.9

HMC5983L[8] 220 I2C, SPI ±8 2 4.35 1.6

BMC156[15] 100 I2C, SPI ±13 3 6 1.52

BMC150[16] 100 I2C, SPI ±13 3 6 1.52

TLV493D-A1B6[17] 100 I2C ±1300 980 1000 0.6

MC6470[18] 100 I2C ±24 Not found 3.5 1.94

MLX90393[6] 716 I2C, SPI ±20 8 50 0.8

BMM150[19] 100 I2C, SPI ±24 3 6 0.6

MMC3416xPJ[24] 800 I2C ±16 6 1.5 1.75

STJ-3D[20] N/A Analog ±20 N/A 0.1 Not found

BM1422GMV[21] 1000 I2C ±12 0.42 Not found 3

RM3100[22] 534 I2C, SPI ±8 0.25 0.03 15.5

MMC5883MA[23] 600 I2C ±8 0.05 1.2 1.5

The first column, ODR, represents the maximum output sample rate that the magnetic sensor is capable to deliver complete samples of X, Y and Z axis to the MCU. The second column, Protocol, is the supported communication protocols in the sensor. Analog means that the magnetic sensor output is an analog voltage that changes according to the change in the magnetic field that is applied. The third column, Range, is the maximum supported range of magnetic field strength of the sensor, measured in Gauss. One Gauss is equal to 100 µT. The fourth column, Resolution, is the resolution of the sensor. It is calculated through milli-gauss per LSB. The fifth column, Noise level, is the RMS noise level of the magnetic sensor measured in milli-Gauss. All the sensors are compared according to the parameters in the list below. • Resolution of the magnetic field

• Measurement range

• Output Data Rate (ODR) • Noise level

• Communication protocol used • Unit price

1

(26)

From the summary in table 1 the magnetic sensors with the highest po-tential to fit the application are chosen to be tested in part two. The re-quirements of choosing the sensors for part two are determined to be; the magnetic sensor shall have as low noise level as possible. The communication protocol should be either SPI or I2C, but SPI is preferred. The resolution should be as high as possible. There is no known upper or lower limit for this application so it is assumed that higher resolution is better. The price of the magnetic sensor are taken into account but in this stage the performance is more important to compare. When the magnetic sensor for the sensor platform in chapter 4 is chosen the price is considered.

The minimum ODR is determined from interaction technologies which are already established, such as a computer mouse. The standard ODR, or polling rate as it is called in computer mouses, is 125 Hz. More advanced computer mouses can have polling rates up to 1000 Hz. Due to that the application of magnet tracking involves more computations that the standard computer mouse, it can be assumed that the ODR has to be larger than 125 Hz to generate a smooth experience for the user without any lag. However, in this investigation an ODR of 125 Hz is set to be the minimum limit.

From table 1, four sensors are chosen to be tested. These sensors are HMC5983L from Honeywell Aerospace, MMC3416 from MEMSIC, Inc, MLX90393 from Melexis and RM3100 from PNI Sensor Corporation. The first three sen-sors are chosen primarily because of their high ODR. The RM3100 is chosen because it has good performance according to the datasheet. This magnetic sensor is a search coil sensor and the other three sensors are MR-sensors.

The sensor LIS3MDL is not chosen because of the author of this report misread the datasheet and noted in table 1 that the max ODR is 100 Hz instead of 1000 Hz, which is the correct ODR. This error was noticed after the tests and design of all the hardware had already began. The sensor MMC5883MA was not yet launched at the moment of testing of the sensors and therefor is not able to be tested in this project.

3.2

Hardware design of the magnetic sensor modules

The MLX903939 and MMC3416 have no finished modules available for a reasonable price, and therefor there is a need for these modules to have hardware designed. The HMC5983 and RM3100 are available as modules and therefor no hardware design is needed for these two sensors. The design of circuit schematics and PCB-layout are performed in Altium designer. Both Melexis and Memsic provides references and design guidelines for the sensors in their datasheets[6][24]. This makes the design process of the sensor’s PCB’s quite straightforward.

(27)

In figure 7 the schematic design of the MLX90393 magnetic sensor is shown. The component U1 is the MLX90393 magnetic sensor IC. It has one decoupling capacitor, C1, connected between VCC (+3.3VDC) and ground (GND). This will be placed as close to U1 as possible to decrease impedance on the ground return path to U1. R1 is a 0 Ω resistor and will not be mounted if the magnetic sensor is used in SPI-mode. If R1 is mounted, pin 2 of U1 will be connected to VCC and the magnetic sensor will work in I2C-mode. The resistors R2 and R7 work as pull-up resistors for the SCL- and SDA-lines of the I2C-bus. R3, R4, R5 and R6 are used to determine the address of the device when in I2C-mode by mounting 0 Ω resistors to either pull A0 and A1 high or low. This makes it possible to configure this magnetic sensor to four different I2C-addresses.

Figure 7: Schematic for MLX90393

The PCB layout of the MLX90393 magnetic sensor is shown in figure 8. The figure comes from the 3D-view of Altium Designer and therefor all the components are ”mounted” on the PCB. The layout considerations of this design are that C1 have to be places as close as possible to U1 to reduce impedance of the ground path. Below U1 traces are not allowed and the ground plane is removed directly under the MLX90393 sensor.

(28)

Figure 8: PCB-layout for MLX90393

In figure 9 the schematic design of the MMC3416xPJ is shown. U1 is the MMC3416xPJ magnetic sensor. This sensor has two different power supply pins, VDD and VDA. The VDD pin supply’s the magnetic sensor part in-cluding the registers and sampling. The VDA pin powers the I2C bus of the sensor. C1 and C2 are both decoupling capacitors and help filter out noise on the power line. C3 works as an external bootstrap capacitor to the sensor. R1 and R2 are pull-up resistors for the SCL- and SDA-lines of the I2C-bus.

(29)

The PCB-layout for MMC3416xPJ is shown in figure 10. The design consid-erations of this PCB is that no traces are allowed under the IC U1 and the ground plane has a cutout and is removed directly under the IC U1.

Figure 10: PCB-layout for MMC3416xPJ

3.3

Practical tests

The practical tests of the sensors are performed in two steps. The first test is to determine the noise level of the sensors. The second test is to determine the detectability of the sensors. This is performed by measuring the magnetic field strength when a magnet is placed at different distances from the sensors. The noise test is performed by collecting samples from all three axis of the sensors during 10 seconds. During this time the magnetic sensor is held still and all magnetic objects is held at a safe distance from the sensor. The method to determine the noise level of the signal is to calculate the standard deviation of the samples collected during 10 seconds.

To determine the detectability of the sensors, a test rig is created to move a magnet towards the sensors at a constant velocity. This test rig is shown in figure 11. The test rig is driven by a stepper motor which is controlled by an Arduino UNO microcontroller [3]. The magnetic sensor is placed on top of the blue part in the upper right corner of figure 11. When the test starts the sled moves from left to right in figure 11 until it hits the end. The distance

(30)

the sled moves is 850 mm and the sled is moving at a velocity of 0.23 m/s.

Figure 11: The test rig.

The samples from the sensors are collected with an Arduino Leonardo microcontroller [4]. The Arduino Leonardo communicates with the sensors through I2C. The Arduino acts as a serial port (COM-port) and sends the samples through UART to the host computer. On the host computer, MAT-LAB revives the measurements and performs calculations and plotting the results in graphs. The Arduino Leonardo and the Arduino UNO communi-cate through two logic signals. The Arduino Leonardo sends a logical high pulse to the Arduino UNO to start the stepper motor and move the sled. When the Arduino UNO has finished moving the sled it sends a logical high pulse to the Arduino Leonardo. The setup of the measurement acquisition and motor electronics is illustrated in figure 12.

(31)

Figure 12: Block diagram of the test rig

In figure 13 the flowchart of the test rigs software is shown. The test starts when MATLAB sends a start command through UART to the Ar-duino Leonardo. The ArAr-duino Leonardo sends a logical high pulse to the Arduino UNO to start the stepper motor which drives the sled of the test rig. Simultaneously the Arduino Leonardo starts sampling measurements from the magnetic sensor and converts the values of the measurements to integers. The measurements are sent to MATLAB through the COM-port of the computer by the Arduino Leonardo. The Arduino Leonardo collects samples until the Arduino UNO has driven the sled of the test rig to the end-point and sent the end signal to the Arduino Leonardo. When the Arduino Leonardo receives the end signal from the Arduino UNO it stops sampling measurements from the magnetic sensor and after the last sample is sent to MATLAB an end-command is sent to tell MATLAB to stop listening to the COM-port and start processing the collected data. MATLAB process the data by calculating the mean sample frequency and plotting the data as a graph with distance from magnetic sensor on the X-axis and the strength of the magnetic field on the Y-axis.

(32)
(33)

The noise test is performed in a similar way except from the code in the Arduino UNO that is changed to a code that does not move the motor, but instead it waits 10 seconds until it sends the end signal to the Arduino Leonardo. The code for the Arduino UNO, Arduino Leonardo and MATLAB is shown in appendix A.

The test is repeated with every axis of the magnetic sensor pointing to-wards the magnet.

The testing of the sensor RM3100 was not successful because the sensor did not respond to an external magnetic field as expected and the full test could to be performed. Therefor no results from that sensor is included.

The standard deviation of the noise level test is shown in table 2. Table 2: Standard deviation of the sensor noise

Sensor ODR [Hz] Standard deviation [µT] X-Axis Y-Axis Z-Axis

HMC5983 226 0.2380 0.2427 0.2273

MLX90393 197 0.8524 0.8373 0.6997

MMC3416 221 0.1852 0.1792 0.1957

RM3100 - - -

-The results from the detectability tests are shown in the graphs in figure 14 to 22. In each of the figures the Y-axis of the graphs is the detected magnetic field strength, B, measured in µT and the X-axis is the distance between the magnet and the magnetic sensor in centimeters. The title of each graph, X-axis, Y-axis and Z-axis indicates which of the three measurements axis of the magnetic sensor that the measurements of the sensor comes from.

The distance were the magnetic sensor begin to sense the magnetic field of the external magnet is defined as the detection threshold. This is set to be when the magnetic field strength is measured to be outside of the boundary of three times the standard deviation of the noise. The saturation distance is when the magnetic sensor is out of range and are not able to measure that strong magnetic field.

The results of HMC5983 in figure 14 to 16 show that the sensor starts to detect the magnet at a distance of approximately 350 to 360 millimeters. The magnetic sensor gets the biggest readings at the measurement axis pointing towards the magnet.

(34)

Figure 14: Results of detectability tests of HMC5983 with the X-axis pointing towards the magnet.

Figure 15: Results of detectability tests of HMC5983 with the Y-axis pointing towards the magnet.

(35)

Figure 16: Results of detectability tests of HMC5983 with the Z-axis pointing towards the magnet.

The results of the sensor MLX90393 is shown in figure 17 to 19. The resulting detection threshold is approximately 225 to 235 mm.

Figure 17: Results of detectability tests of MLX90393 with the X-axis pointing towards the magnet.

(36)

Figure 18: Results of detectability tests of MLX90393 with the Y-axis pointing towards the magnet.

Figure 19: Results of detectability tests of MLX90393 with the Z-axis pointing towards the magnet.

The results of the sensor MMC3416 is shown in figure 20 to 22. The resulting detection threshold is determined to be at approximately 80 mm. The detec-tion threshold is hard to determine due to the low SNR of the measurements.

(37)

This results in that Matlab finds the detection threshold in the noise instead of the signal. Because of the low SNR the detection threshold is not plotted in figure 21 and 22 and is determined mainly based on the results in figure 20.

Figure 20: Results of detectability tests of MMC3416 with the X-axis pointing towards the magnet.

(38)

Figure 21: Results of detectability tests of MMC3416 with the Y-axis pointing towards the magnet.

Figure 22: Results of detectability tests of MMC3416 with the Z-axis pointing towards the magnet.

(39)

4

Hardware design of the main sensor

plat-form

In this section the design process of the sensor platform will be presented. The magnetic sensor chosen to be designed into the platform is HMC5983 from Honeywell. The focus of the design will be on the individual subsystems and describe the design of each of them. The report will not include the complete final design due to the NDA.

4.1

Hardware requirements

The requirements of the platform are the following. These requirements are produced together with Company A.

• SPI- and I2C-support.

• Processor with integrated Bluetooth support.

• The platform shall be powered externally from a USB-port. • Integrated battery charger powered by the USB-port.

• The platform shall be able to communicate with a host computer through both Bluetooth and the USB-port. When USB is connected it shall appear on the computer as a COM-port.

4.2

Component selection

The downside of most processors with integrated wireless support is that they often lack the support of USB-communication. This lead to a comparison between having integrated wireless support and have to use external chips for USB communication or having integrated USB support and use an external chip for wireless communication, with respect to cost and performance. The conclusion is that it is more cost efficient to use a processor with integrated wireless communication and an external chip which converts UART to USB. Also because of the external wireless chips do not support Bluetooth 4 and above to a reasonable price.

The processor chosen for the platform is the CC2640 from Texas Instru-ments. The CC2640 is a wireless MCU with a 48 MHz ARM Cortex-M3 processor core. It has SPI, I2C and UART and it has support for Bluetooth 5, which is the next generation of Bluetooth. It is also suited for battery pow-ered applications due to its low-power ratings. Texas instruments provides a

(40)

large base of support including reference material on every component they ship which makes the design process easier.

The battery solution is chosen to be based around another Texas in-struments component, BQ24075. The BQ24075 is a combined linear Li-ion charger and power-MUX. What the power-MUX does is if the USB-power source is connected the system will be power from the USB simultaneously as the battery is charged. If the USB is disconnected, the power-MUX will automatically switch over to power the system from the battery, given that there is enough power left in the battery. The BQ24075 has an output volt-age of 4.2 V. The CC2640 is rated for 3.3 V and therefore a LDO-regulator is chosen to regulate the voltage from 4.2 V to 3.3 V. A LDO-regulator is chosen instead of a switched buck converter because the low power consump-tion of this platform. The maximum current consumpconsump-tion calculated for the platform is approximately 5 mA. This makes it safer to use a LDO-regulator which has less noise than a switched regulator even when it is less effec-tive. The LDO will minimize the noise from the sensors and increase the performance.

To solve the USB to UART communication, the chip CH340G is chosen. This chip is cheap and is able to handle UART baud-rates up to 2 Mbit/s and it appears on a computer as a COM-port.

4.3

Hardware design of the platform

In this subsection the hardware design of the Sensor platforms individual parts will be presented.

4.3.1 Inverted F antenna design

To reduce the cost a 2.4 GHz inverted-F antenna (IFA) printed on the PCB is used. The design is from a reference document by Texas instruments [27]. In this document there are no specifications on the substrate used and many other parameters which are critical to know to be able to design a perfectly tuned antenna. So the antenna is designed and simulated in Advanced design System with the parameters of the PCB used in this thesis, which is 1 mm thick FR4 substrate with 35 µm copper thickness.

The antenna from the reference document is drawn in ADS. In the first simulation with the parameters of this thesis, the resonance frequency of the antenna ended up at 2.75 GHz. There are several ways to change the resonance frequency in this stage. With reference to chapter 2.2 and figure 5 the dimension L is increased to accomplish a resonance frequency of 2.4 GHz. In figure 23 the antenna design is shown.

(41)

Figure 23: IFA design

The simulation results of the antenna is shown in figure 24. The lowest point is 2.45 GHz which is inside the bandwidth of Bluetooth2.

Figure 24: IFA simulation results

The antenna design from ADS is exported into Altium designer and de-signed in with the other parts of the sensor platform.

4.3.2 MCU schematic design

The CC2640 has a lot of reference documentation provided by TI. Therefor the design process is quite straightforward. In figure 25 the schematic for the CC2640 is shown. The capacitors on the top of the figure are decoupling capacitors which should be placed as near as possible to each power supply pin of the U1. FL1 at the top of figure 25 is a ferrite inductor which is a part of the filtering circuit of the power supply. The power signal VDD EB comes

2

(42)

directly from the PSU and the DCDC SW signal comes from the internal 1.8V LDO of the CC2640. The CC2640 needs two external crystals, one 24 MHz and one 32.768 kHz, and these are denoted as Y1 and Y2. C16 is a decoupling capacitor for the internal 1.8V LDO. On the UART-lines there is one resistor placed on each of the lines to limit the current and reduce spikes on the signal. This to improve the signal integrity of the UART communication.

Figure 25: Scheamtic for CC2640

(43)

the CH340G is shown in figure 26. The antenna filter is designed according to references in the datasheet of CC2640.

The schematic for CH340G is designed according to references in the associated datasheet of CH340G [33]. D2 and D3 are ESD-diodes that will protect the input ports of the CH340G IC against high voltage spikes from Electrostatic Discharge.

Figure 26: Schematic for antenna filter, debug header and CH340G. 4.3.3 PSU schematic design

The PSU is based around the component BQ24075. The external power source comes from a micro-USB connector. This input power line has one decoupling capacitor, C21, at 10µF to stabilize the supply voltage and reduce noise. The BQ24075 is configured through the resistors R16, R17 and R24,

(44)

which are connected to the ports ILIM, TMR and ISET. The ILIM port configures the input current limit of the chip. This includes both the system supply and the battery charging. The TRM port configure the fast charge safety timer. If the battery is not fully charged by the time the IC hits the time limit the fast charging mode will be disabled. The ISET port configures the battery charging current when the BQ24075 is in fast charge mode.

Equation 5 shows the calculation for R16, RI LI M. II LI M is the set maxi-mum current limit and KI LI M is the maximum input current factor and can be found in the electrical characteristics table of the BQ24075 datasheet[26]. II LI M is set to 1 A.

Equation 6 shows the calculation for R17, RT M R. tM AX CH G is the time limit of the fast charge mode in seconds and KT M R is the time factor and can be found in the electrical characteristics table of the BQ24075 datasheet [26]. tM AX CH G is set to 6 h.

Equation 7 shows the calculation of R24, RI SET. ICH G is the battery fast charge current chosen and KI SET is the fast charge current factor and can be found in the electrical characteristics table of the BQ24075 datasheet [26]. ICH G is set to 250 mA. RI LI M = KI LI M II LI M = 1550AΩ 1A = 1550Ω ≈ 1.5kΩ (5) RT M R = tM AX CH G 10 ∗ KT M R = 6hr ∗ 3600s/hr 10 ∗ 48s/kΩ = 45000Ω ≈ 47kΩ (6) RI SET = KI SET ICH G = 890AΩ 0.250A = 3560Ω ≈ 3.48kΩ (7) The port TS, on the chip BQ24075 in figure 27, is to monitor the temperature of the battery with a 10 kΩ NTC resistor built into the battery pack. The battery used in this project does not include temperature monitoring and therefor the temperature monitor function of the chip is bypassed with a 10 kΩ resistor.

The ports CHG and PGOOD are used for status-LED:s. PGOOD will be set low and light up the PGOOD LED if the supply voltage, VI N, is between 3.5 V and 6.6 V. The CHG port will be set to low and light up the CHG LED if the chip is in fast charge mode. The PGOOD and CHG LED:s current limit resistors are set to 1.5 kΩ. This gives a current through the LED:s at 2.8 mA. This value is chosen because the BQ24075 is able to handle sink current at a maximum of 5 mA each on the PGOOD and CHG ports.

In the lower right corner of figure 27 the power button circuit is shown. This circuit is a toggling circuit which allows the use of one push button

(45)

to both turn on and off the system. When the push button, denoted as Power PB in figure 27, is pressed the voltage at port OUT of the chip U5 will go from 0 V to VSY S, which is the supply voltage. When the push button is pressed again the voltage goes from VSY S to 0 V. This voltage is feed into the LDO:s, U3, standby port, which will turn on and off the supply to VOU T according to the input signal of the standby port. The toggle circuit is based around a timer circuit named NE555 [28].

Figure 27: Schematic for the PSU 4.3.4 Magnetic sensor schematic design

The HMC5983 schematic design is shown in figure 28. VDDS is the supply voltage. It has one decoupling capacitor, C29, connected to reduce noise of the supply voltage. The capacitor C30 is an external bootstrap capacitor used for the SET/RESET circuit of the chip. SCK, SDI, SDO, CS1N and DRDY1 are SPI signals used to communicate between the magnetic sensor and the MCU. C28 is a reservoir capacitor.

(46)

Figure 28: Schematic for HMC5893

4.4

PCB layout

The PCB design is made in Altium Designer. The schematic designs are transferred to the PCB-editor in Altium designer and the layout are made. The PCB has a 2-layer stack-up and most of the power and signals are placed on the top layer. This is to get a close to solid ground plane on the bottom layer to get a low resistance and short ground path of all the circuits.

During the PCB-design the some general guidelines are followed. This in-cludes design guidelines of each manufacturer to ensure correct functionality and good decoupling of all the IC:s, especially the MCU and sensor.

4.5

Test and verification

The tests that are performed on the sensor platform are functional test on the battery charger circuit and an antenna test. The other parts are not able to be tested due to the lack of time to program the processor in order to perform those tests.

The functional test of the battery is performed through verifying that the fast charging current to the battery fulfill the configured value, through connecting an ampere meter between the battery and the sensor platform. The test showed a measured fast charge current of 187 mA. The configured value of the fast charge current is 250 mA.

The CH340G is verified to work through connecting a USB-cable to the sensor platform and a computer and verify that the CH340G appear on the computer as a COM-port.

(47)

4.5.1 Antenna test

The test that is performed on the antenna is an antenna performance test. This test includes a link test between the sensor platform and a CC2650 EVM from TI, and a radiation test of the antenna.

The link test is performed with a software from TI named SmartRF studio [32]. This software helps the developers of wireless applications to test the antenna in various ways without having to program the embedded processor. The CC2640 MCU is connected to a computer through a JTAG-debugger which is connected to the debug header of the sensor platform and the USB port of the computer.

SmartRF Studio controls the MCU through the USB to JTAG debugger. SmartRF Studio has four modes, Continuous RX, Continuous TX, Package RX and Package TX. In continuous RX mode, the program continuously measures the RSSI in dBm. In continuous TX mode, SmartRF studio con-tinuously transmit data on a specific channel through the connected device. This is to be able to measure the transmitting efficiency of the antenna.

In Package RX and Package TX SmartRF studio sends data packages from one device to another. In this mode the user gets statistics from the finished test including average RSSI, received correct packages, received in-correct packages, package error rate and bit error rate.

In package TX and RX mode the user set the Bluetooth channel (fre-quency) to transmit and receive on. In transmission mode the transmitting power can be specified. The number of packages to transmit and the number of packages expected to be received can also be specified.

The link test is performed by sending data packages in both directions, with the sensor platform as TX and the EVM as RX, and then vice versa. The transmitting power is set to max, 5 dBm, and the frequency to 2402, Bluetooth channel 1. The number of package sent are set to 100 packages.

The link test was not performed successfully. The application SmartRF studio crashed during the test and a complete test could not be performed. When the link test starts and works through approximately 10 packages, the application loses the connection to the sensor platform and the test fails. This is determined to be caused by EMC issues on the JTAG-bus.

The antenna performance test is performed in an EMC chamber. This chamber is isolated from any distortion and radiation from the outside world. And the inside walls of the chamber consists of absorbing materials to prevent the RF waves of bouncing on the walls. The antenna that will be tested are placed in the chamber at the same height as the receiving horn antenna and at a distance of 3 meters away from each other.

(48)

a horn antenna connected to a spectrometer is used. The received signal is captured by MATLAB which plotted the resulting signal.

The test is performed by continuously transmitting from the sensor plat-form. Then the platform is placed with the antenna pointing towards the horn antenna. In figure 29 the direction is illustrated as the x-axis pointing towards the horn antenna. The test is then repeated with the sensor plat-form standing, with the antennas plane perpendicular to the horn antenna. In figure 29 the direction of the antenna is illustrated as the z-axis pointing towards the horn antenna.

Figure 29: Antenna with coordinate system in the test

With these two placements the receiver measures the received signal be-tween 2 GHz and 3 GHz to identify the transmitting frequency and measure the strength of the transmitted signal. In this case it is 2404 MHz, or channel 0, in the Bluetooth band. The graph from both frequency sweeps is shown in figure 30 and 31. The upper curve in the graph is the Quasi-peak mode measurements and the lower curve is average mode measurements.

In figure 30, when the x-axis illustrated in figure 29 is pointing towards the receiver, the antenna is able to transmit a signal at ∼25 dBµV over the noise level in Quasi-peak mode and ∼15 dBµV over the noise level in average mode.

(49)

2 2.1 2.2 2.3 2.4 2.5 2.6 2.7 2.8 2.9 3 Frequency [GHz] 109 20 30 40 50 60 70 80 Magnitude [dBµV]

Figure 30: Frequency response of the antenna with the x-axis towards the receiver

In figure 31, when the z-axis illustrated in figure 29 is pointing towards the receiver, the antenna is able to transmits the signal at ∼28 dBµV over the noise level in Quasi-peak mode and ∼20 dBµV over the noise level in average mode.

(50)

2 2.1 2.2 2.3 2.4 2.5 2.6 2.7 2.8 2.9 3 Frequency [GHz] 109 20 30 40 50 60 70 80 Magnitude [dBµV]

Figure 31: Frequency response of the antenna with the z-axis towards the receive

The last antenna test is performed in a similar way as the previous, but with the sensor platform placed on a rotation table. The sensor platform is placed with the negative x-axis in figure 29 pointing towards the horn antenna at the start of the test, and the z-axis pointing up throughout the test. The antenna transmitted at 2404 MHz and the receiver measured the received signal strength at 2404 MHz with the sensor platform rotating from 0◦ to 360in steps of 10.

The radiation pattern from this test is shown in figure 32. The mea-surements in the graph are normalized. The antenna has an uneven radia-tion pattern between 0◦ and 360. Between 15and 60the radiated signal strength drops radically in power. Between 90◦ and 315(-45) the radiated signal strength has a reasonable power level.

(51)

15°

30°

45°

60°

75°

90°

105°

120°

135°

150°

165°

180°

-165°

-150°

-135°

-120°

-105° -90° -75°

-60°

-45°

-30°

-15°

-16

-12

-8

-4

0

Figure 32: Radiation pattern from the antenna test, plotted in polar coordinate system

(52)

5

Discussion

In this section the results of the project will be discussed.

5.1

Investigation of Magnetic sensors

In this subsection the discussion of the magnetic sensor investigation is pre-sented

5.1.1 Market survey discussion

The market for magnetic sensors contains many different types of sensors, and the application of magnet tracking is not the usual field of application. Major parts of the available magnetic sensors are suitable as compasses and therefore have a limited range of measurement of magnetic field strength, often +/- 1 gauss. Another limitation is the filtering tools on the distributors web stores. The filters rely on that all products have complete information about all parameters and that the parameters are formatted in the same way. This is not the case of the three web store that were visited during the market survey. This results in that some magnetic sensors could have been missed out.

The requirements on the sensors were determined during the project and by the author. This leads to the fact that some sensors could have been sorted out during the market survey because of the lack of information of the implementation of magnetic tracking. The tradeoffs that were concerned was the price versus ODR, resolution and noise level. The numeric limit of the ODR is set to 125 Hz. This is not verified that it is the lowest limit that the algorithm from Company A can handle. If the limit could be lower, many sensors have possibly been sorted out too early in this survey.

5.1.2 Magnetic sensor hardware design discussion

The two sensors, MLX90393 and MMC3416, were designed according to ref-erence designs in the datasheets of the sensors. There are complete guidelines of both schematic design and PCB-layout. This aspect should not impact the results of the magnetic sensor tests. To save time, the PCB:s where man-ufactured manually in the PCB lab at Link¨opings University. The process consists of many steps and every step need to be performed correctly other-wise the resulting performance of the circuit boards will be decreased. The lab does not contain any equipment for quality control of the PCB when it is finished. Therefor it is not easy to determine if the manufacturing process did impact the performance of the magnetic sensor modules.

(53)

5.1.3 Practical test Discussion

The choice of test platform was made with the ambition to be able to test the response from the sensors, when a magnet is moving towards the magnetic sensor in different velocities. Due to limited speed of the stepper motor, the maximum velocity accomplished was only 0.23 m/s. The ambition was to be able to get velocities of 1 m/s or higher. If a higher velocity was possible, we could have tested the ”Step response”, when the magnet is moved a short distance at a high velocity. In this kind of test, measurements of delay time between the start of movement of the magnet and the response of the magnetic sensor could be made to determine the latency times of the test system. If higher velocities had been accomplished, test of the linearity of the measurements at different velocities could also have been made. This is to determine if there are limitations in the magnetic sensor that affect the sensors ability to detect rapid changes in the magnetic field.

The MCU used to collect the measurements and control the stepper motor where chosen to be an Arduino Leonardo and an Arduino UNO. This because of the simplicity of these MCU:s. The software Arduino IDE uses a simplified programming language which enables fast development of the code for these simple applications and saves time. Arduino MCU:s are supported by Matlab and there are a wide range of references on Arduino’s website to get started as fast as possible. This was a necessary aspect to have in mind when choosing the MCU:s for the test platform in order to save time.

The reason for the use of two Arduino devices where that the number of GPIO ports on one Arduino was not enough.

5.1.4 Choice of magnetic sensor discussion

The chosen magnetic sensor to be designed into the main platform was HMC5983. The fact that this magnetic sensor had a finished module and the other two sensors(MMC3416 and MLX90393) had to be designed and manufactured by hand are most likely to have an impact on the test results. Unfortunately, the magnetic sensor could not be tested on the finished sensor platform due to the lack of time to program the MCU to be able to run these tests. The specifications from the different manufacturers of the magnetic sensor conclude that the best sensor should have been MMC3416, but this sensor had a detection distance3 that was too short and therefore not suit-able for this implementation. If the application would allow the magnet to be closer than 10 cm form the sensor(s) at all time, this magnetic sensor would

3

(54)

be the most suitable choice. But this limitation was considered to limit the end applications too much.

After the tests had been performed a new magnetic sensor was released from Memsic, which also make the MMC3416. This sensor is called MMC5883MA and is P2P compatible with the HMC5983. The big difference is that MMC5883MA does not includes SPI-communication, but only I2C. The MMC5883MA has lower noise, higher resolution, higher ODR and lower price. The drawback that will affect the complete design is that the MMC5883MA sensor has the same I2C-address on every version and can therefore not be placed on the same I2C-bus. The CC2640 only support one I2C-bus. The solution is to use an I2C-hub to switch between the different buses.

The magnetic sensor LIS3MDL where sorted out too early after the mar-ket survey because of a misreading of the datasheet, resulting in that a maximum ODR of 100 Hz where inserted instead of 1000 Hz. This sen-sor can be interesting to investigate further to see of it can perform as well as MMC5883MA or HMC5983L. Some of the benefits of using this sensor are that it has SPI-communication and would not need any extra components as the MMC5883MA.

At the end of the project the HMC5983L was found to be discontinued at all distributors, meaning that this sensor in no longer manufactured by Honeywell. This results in that the first thing to do as a further development has to be to change the magnetic sensors of the main platform. The magnetic sensor recommended to look at to replace the HMC5983L is MMC5883MA and LIS3MDL.

5.2

Hardware design of the main sensor board

This subsection discuses the hardware design of the main sensor board. 5.2.1 Component selection discussion

The processor, CC2640 was selected for several reasons. Firstly, Texas In-struments provide a lot of resources in form of schematic design, PCB-layout guidelines and complete reference designs, example codes, computer soft-ware for product evaluation and EVM:s to a reasonable price. This support combined with the good performance and the support for Bluetooth 5 were the key reasons for this choice. Texas Instruments have recently released a upgraded version that is P2P compatible with the CC2640. It is called CC2640R2F and includes more RAM memory and improved RF performance to the same price as the CC2640.

(55)

In the PSU the regulator chosen to supply the complete system includ-ing MCU and magnetic sensor was a LDO regulator. This kind of voltage regulator has drawbacks like poor efficiency. In this case the currents of the system were so low that a switched voltage regulator would not have made a big difference. To get an efficient voltage regulator a switched regulator together with a robust filter will be needed. These filters are most commonly pie-filters and contains of inductors and capacitors. Depending on the volt-age and current ratings of the filter, these components could be rather big. if space on the PCB are limited the efficiency aspect of the LDO can be overseen.

5.2.2 Antenna design discussion

The inverted-F antenna was designed with a large bandwidth to minimize the risk of manufacturing errors affect the performance of the antenna. This was the case during the manufacturing. The factory did not notice the spec-ified substrate thickness of 1 mm and instead used the standard thickness of 1.6 mm thick FR4 substrate. This displaced the center frequency of the antenna, but due to the large bandwidth of the antenna, the performance is still good enough according to the results form the antenna test in figure 32. The different substrate thickness could also affect the performance of the microstrip lines between the MCU and the antenna. The impact is, most likely, not that big due to the short length of these microstrip lines.

5.2.3 PSU hardware design discussion

The battery charger on the platform is only a linear charger with included power MUX. When the finished design was tested, some functions would have been preferred to be included in the battery management circuitry. The first is a circuit for measurement of the battery voltage, to be able to determine when the battery hits EDV. There are dedicated IC:s for this purpose called fuel gauges. They monitor and predict the remaining capacity of the battery and can control protection stages that break the circuit form the battery if any faults occur. At the moment, the circuits does not include any protection that will break the circuit when the battery voltage is too low. A simple fuel gauge could be implemented with one of the internal ADC:s in the MCU. Or with a comparator circuit that compares the battery voltage to a reference and turn off the supply to the MCU and the rest of the system if the battery voltage becomes too low. The battery circuit does not include a reverse voltage protection and this should be included in future versions to eliminate the risk of damage of the complete board if the battery is connected with

(56)

reverse polarity.

The power toggle circuit was implemented to be able to use a small push button instead of a big mechanical switch, which would have been many times larger than the push button used. The drawback of the power toggle circuit is that the supply of the NE555 IC is connected directly after the battery and therefor it is constantly on and draws current. The NE555 have an idle current of 2 mA, which is a large current compared to other sleep currents of the complete system. This current will discharge the battery quickly. This power toggle circuit has to be redesigned in order to reduce the current leakage.

5.2.4 Test and verification discussion

During the antenna testing, the communication between the debugger and the CC2640 was unstable. When larger amounts of data was sent between the devices the communication stopped and the tests failed. This is a typical error if the communication lines have issues with EMC. More exact, the lines of the JTAG-communication causes reflection that interfere with the data stream and causes communication failure. This can be solved by placing a resistor in series on every communication line of the JTAG.

To be able to compare the results of the simulation and the performance test of the antenna a frequency sweep on the antenna should have been per-formed. However, the evaluation software SmartRF studio did not support this function and therefor a fair comparison between the simulation and the antenna was not accomplished.

The results from the frequency sweep, shown in figure 30 and 31, shows that the antenna has the ability to radiate the desired signal at a good level which should be enough to be able to transmit data without any major losses. The polar measurement of the antenna radiation shows that the antenna has one blind spot. The inverted-F antenna should have an omnidirectional radiation pattern, meaning that when measuring the radiation around the Z-axis of the antenna (see figure 29 for antenna coordinate system) the radiation should be equal in all direction in the X-Y plane. The reason that the pattern is not equal in all direction could be due to the wrong thickness of the PCB substrate.

References

Related documents

Reliability of IMUs to quantify ADL tests in the upper extremities was also established, and the clinical applicability of trunk sway measurements and relevance of a set of

It was shown that gyroscopes may be used to measure postural stability in stance and gait, and that clinically more applicable IMUs are suited for measurement of upper

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

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

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

Therefore, this thesis will identify the possibility to determine the direction to a transmitter with randomly placed sensors by using the Direction Finding method MUltiple

Even that NiTi wires shows large dependence on temperature (which would make them usable as thermometers too), they shows also several advantages including on ranges linear

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