<<

in Human Activity Recognition and Occupancy Detection

Sensorfusion in der menschlichen Aktivit¨ats- erkennung und Pr¨asenzdetektion

Der Technischen Fakult¨at der Friedrich-Alexander-Universit¨at Erlangen-N¨urnberg zur

Erlangung des Doktorgrades Dr.-Ing.

vorgelegt von

Lars Zimmermann aus Freudenberg Als Dissertation genehmigt von der Technischen Fakult¨at der Friedrich-Alexander-Universit¨atErlangen-N¨urnberg Tag der m¨undlichen Pr¨ufung:5. M¨arz2020

Vorsitzender des Promotionsorgans: Prof. Dr.-Ing. habil. Andreas Paul Fr¨oba

Gutachter: Prof. Dr.-Ing. Georg Fischer Prof. Dr. sc. techn. Leonhard Reindl Abstract

This thesis investigates the recognition of human activities from the position of the wrist and the feasibility of occupancy detection based on environmen- tal sensors. In preparation to this thesis, a wrist-worn 10-axis human activity tracker combining a 3-axis , a 3-axis , a 3-axis mag- netometer, and a barometric pressure sensor was developed. Four volunteers participated in collecting a first dataset of 190 measurements by perform- ing ten everyday activities. An approach is introduced by which a person’s energy expenditure can be estimated independently of the measurement po- sition. Using the acceleration data obtained at the wrist, various methods for detecting cycling are presented. It is also shown that the barometer allows discriminating activities that involve a vertical displacement, such as climb- ing stairs or riding an elevator, as well as helps to reduce the false alarm rate of a fall detector. The potential of magnetic field sensing is derived from the signal characteristics of the magnetic interference as experienced during cycling and riding an elevator. It is demonstrated that the examined activity set can be discriminated by fusing the data of either the accelerometer and the barometer or the gyroscope and the barometer. To detect and count occupants, an approach using a fusion of environ- mental sensors from an indoor air quality measurement system is presented. Environmental sensors, as opposed to motion detectors, are nonintrusive, easy to install, low cost, detect nonmoving occupants, do not have dead spots, and can even infer the number of occupants. For this study, measure- ments of carbon dioxide, volatile organic compounds, air , and relative air humidity were conducted in four student apartments for a total of 49 days. Features were extracted from the environmental sensor data and subsets selected using correlation-based feature selection. In this thesis, a comparison of the supervised learning models RIPPER, Na¨ıve Bayes, C4.5 decision tree, logistic regression, k-nearest neighbours, and random forest is performed. Furthermore, a method is proposed to greatly reduce time and effort of collecting training data in residential buildings. The results indicate that the predictive power of volatile organic compound sensing is comparable to that of carbon dioxide. With a simple Na¨ıve Bayes classifier, the approach detected occupancy and estimated the number of occupants with an accu- racy of 81.1 % and 64.7 %, respectively. In addition, a gas sensor test setup was developed that is capable of characterizing carbon dioxide and volatile organic compound sensors simultaneously.

Zusammenfassung Diese Arbeit untersucht die Erkennung menschlicher Aktivit¨atenausgehend von der Position des Handgelenks sowie die Machbarkeit einer Pr¨asenzdetek- tion basierend auf Umweltsensoren. Als Grundlage diente ein 10-Achsen Ak- tivit¨atstracker bestehend aus einem 3-Achsen Beschleunigungssensor, einem 3-Achsen Gyroskop, einem 3-Achsen , und einem baromet- rischen Drucksensor. Vier Freiwillige haben sich durch Ausf¨uhrungzehn allt¨aglicher Aktivit¨atenan der Aufzeichnung eines ersten Datensatzes mit 190 Messungen beteiligt. Zur Sch¨atzung des Energieaufwands einer Per- son wird ein Ansatz vorgestellt, der auf eine beliebige Messposition an- wendbar ist. Unter Nutzung der am Handgelenk gewonnenen Beschleu- nigungsdaten werden verschiedene Methoden zur Erkennung von Fahrrad- fahren pr¨asentiert. Außerdem wird gezeigt, dass das Barometer die Unter- scheidung von Aktivit¨atenwie Treppensteigen oder Aufzugfahren erm¨oglicht sowie die Fehlalarmrate einer Sturzerkennung reduzieren kann. Das Potenzial der Magnetfeldmessung wird aus den Signalcharakteristika der magnetischen St¨orfelder,wie sie bei Fahrrad- oder Aufzugfahren auftreten, abgeleitet. Es wird demonstriert, dass die hier untersuchten Aktivit¨atenmittels einer Fu- sion aus entweder dem Beschleunigungssensor und dem Barometer oder dem Gyroskop und dem Barometer unterschieden werden k¨onnen. Zur Detektion und Bestimmung der Personenanzahl im Raum wird ein Ansatz basierend auf der Fusion von Umweltsensoren eines Raumluftquali- t¨atsmesssystemspr¨asentiert. Im Gegensatz zu Bewegungsmeldern sind Um- weltsensoren unaufdringlich, leicht zu installieren, kosteng¨unstig,erkennen ruhende Personen, weisen keine Abdeckungsl¨ucken auf, und erlauben Schluss- folgerungen auf die Personenanzahl. F¨urdiese Untersuchung wurden in vier Studentenapartments Messungen ¨uber den Gehalt an Kohlendioxid, fl¨uchti- gen organischen Verbindungen, der Lufttemperatur, und der relativen Luft- feuchte mit einer Gesamtdauer von 49 Tagen durchgef¨uhrt. In dieser Arbeit werden die Algorithmen RIPPER, Naiver Bayes, C4.5 Entscheidungsbaum, Logistische Regression, N¨achste-k-Nachbarn, und Random Forest verglichen. Weiterhin wird eine Methode vorgeschlagen, die den Aufwand an Trainings- daten in Wohngeb¨auden deutlich reduziert. Die Ergebnisse zeigen, dass Sen- soren f¨urfl¨uchtige organische Verbindungen eine vergleichbare Prognosef¨a- higkeit wie Kohlendioxidsensoren aufweisen. Mit einem Naiver Bayes Klassi- fikator wurde eine Genauigkeit von 81,1 % bei der Pr¨asenzund von 64,7 % bei der Personenanzahl erzielt. Ferner wurde ein Pr¨ufaufbauentwickelt, mit dem verschiedenartige Gassensoren gleichzeitig charakterisiert werden k¨onnen. Acknowledgements

First and foremost, I would like to thank my supervisor Prof. Dr.-Ing. Georg Fischer for the extraordinary support of my doctorate and the trust placed in me over the years. It was his personal enthusiasm for innovative ideas that only led me to decide to pursue the doctorate. Above all, Prof. Fischer has always given me the necessary freedom to explore and set my own directions in research. Next, I would like to express my thanks to Prof. Dr. Leonhard Reindl for accepting the second review of this thesis. Prof. Reindl is the chair holder of the Laboratory for Electrical Instrumentation at the Department for Mi- crosystems Engineering (IMTEK) and director of the Centre for Renewable Energy (ZEE) of the University of Freiburg. I would like to thank Georg Schmidt for the favourable general conditions at eesy-id, without which my research activities would have been difficult to carry out in the first place. To my former colleagues at eesy-id, in partic- ular Dr.-Ing. Lukas Reuter and Alexander Schmidler, thank you for your professional support during hardware development. Special thanks go to all members of the Institute for Electronics Engi- neering. The chair holder Prof. Dr.-Ing. Dr.-Ing. habil. Robert Weigel, who already supervised me in my diploma thesis, has always taken time for my matters. Furthermore, I would like to thank the whole team of the E|Home-Center for the pleasant time and great cooperation. I thank my former students Jens Pfeiffer, Christian Hesse, Jan Geret, Wolfgang R¨odle,Philipp Pollinger, Kerstin Inkmann, Alexander Hofmann, and Renata de Azevedo Allemand Lopes for their contribution to my re- search. Finally, I would like to thank Thomas Rechenmacher and Daniel Wilhelm for the discussions and their valuable feedback on my written work. Contents

List of Acronyms and Symbolsx

1 Introduction1

2 Related Work6 2.1 Fusion of Wearable Sensors in Human Activity Recognition..6 2.2 Fusion of Environmental Sensors in Occupancy Detection... 12 2.3 Contributions of This Thesis...... 20

3 Human Activity Recognition With a Wrist-Worn Activity Tracker 25 3.1 Assessment of Energy Expenditure...... 27 3.2 Wearable Sensors for Human Activity Tracking...... 28 3.2.1 Accelerometer...... 28 3.2.2 Gyroscope...... 32 3.2.3 Magnetometer...... 35 3.2.4 Barometer...... 39 3.2.5 Other Wearable Sensors...... 42 3.3 Human Activity Recognition System...... 44 3.3.1 System Overview...... 44 3.3.2 Hardware Setup...... 44 3.3.3 Software Description...... 46 3.4 Data Collection...... 48 3.4.1 Activity Set...... 48 3.4.2 Participants...... 49 3.4.3 Dataset...... 50 3.5 Human Activity Recognition Algorithm...... 50 3.5.1 Data Preprocessing...... 50 3.5.2 Feature Extraction...... 51 3.5.3 Computational Complexity...... 57

vii viii Contents

3.6 Results...... 57 3.6.1 Accelerometer-Based Human Activity Recognition and Its Limitations...... 57 3.6.2 Gyroscope-Based Human Activity Recognition and Its Limitations...... 62 3.6.3 Magnetometer-Based Human Activity Recognition and Its Limitations...... 64 3.6.4 Barometer-Based Human Activity Recognition and Its Limitations...... 68 3.6.5 Human Activity Recognition With Sensor Fusion... 70

4 Occupancy Detection With an Indoor Air Quality Monitor 73 4.1 Environmental Sensors for Indoor Air Quality Measurement. 77 4.1.1 Carbone Dioxide...... 77 4.1.2 Total Volatile Organic Compounds...... 83 4.1.3 Air Temperature...... 87 4.1.4 Air Humidity...... 89 4.1.5 Other Environmental Sensors...... 91 4.2 Indoor Air Quality Measurement System...... 93 4.2.1 System Overview...... 93 4.2.2 Ground Truth Occupancy Recorder...... 94 4.2.3 Hardware Setup...... 96 4.2.4 Software Description...... 96 4.3 Data Collection...... 98 4.3.1 Measurement Location...... 98 4.3.2 Participants...... 100 4.3.3 Datasets...... 100 4.4 Occupancy Detection Algorithm...... 102 4.4.1 Data Preprocessing...... 102 4.4.2 Feature Extraction...... 102 4.4.3 Feature Selection...... 106 4.4.4 Classification...... 107 4.5 Performance Metrics...... 109 4.6 Results...... 111 4.6.1 Predictive Power of the Environmental Sensor Fusion. 111 4.6.2 Local Occupancy Detection...... 113 4.6.3 Global Occupancy Detection...... 115

5 Conclusion and Outlook 118

List of References 123 Contents ix

List of Supervised Student Theses 154

List of Authored and Co-Authored Publications 156

A Human Activity Tracker 158 A.1 Schematic...... 158 A.2 Board Layout...... 158 A.3 Mechanical Drawings...... 158

B Indoor Air Quality Measurement System 163 B.1 Schematics...... 163 B.2 Board Layouts...... 163 B.3 Mechanical Drawings...... 168 B.4 Additional Tables...... 168

C Characterization and Calibration of CO2 and VOC Sensors 171 C.1 Introduction...... 171 C.2 Related Work...... 172 C.3 Calibration Setup...... 173 C.3.1 Sensor System...... 174 C.3.2 Gas Mixing System...... 175 C.3.3 Test Chamber...... 176 C.3.4 Gas Mixing Control Software and Measurement Data Acquisition...... 176 C.4 Test Procedures...... 177 C.4.1 Calibration of the CO2 Sensors Using Test Gases... 177 C.4.2 Calibration of the TVOC Sensors Using Test Gases.. 177 C.4.3 Determination of the Sensitivity to Changes in the En- vironmental Conditions...... 178 C.5 Results...... 179 C.5.1 Findings From the Operation of the Gas Mixing Sys- tem and the Test Chamber...... 179 C.5.2 Characterization of the CO2 Sensors...... 181 C.5.3 Characterization of the TVOC Sensors...... 187 C.6 Conclusion and Outlook...... 191 Additional References...... 193 List of Acronyms and Symbols

Acronyms

ABC automatic baseline correction ADC analogue-to-digital converter ADL activities of daily living ANN artificial neural network ARHMM autoregressive hidden Markov model ASIC application-specific BLE Bluetooth Low Energy CAD computer-aided design CFS correlation-based feature selection CSV comma-separated values CMOS complementary metal-oxide-semiconductor DIN Deutsches Institut f¨urNormung (Eng., German Institute for Standardization DCV demand-controlled ventilation dps degree per second EE energy expenditure ELM extreme learning machine EEPROM electrically erasable programmable read-only memory FD first derivative FFT fast Fourier transform FN false negative FNR false negative rate FP false positive FPR false positive rate FS full scale GPS Global Positioning System HMM hidden Markov model HPF highpass filter HVAC heating, ventilation, and air conditioning x Acronyms xi

IGR information gain ratio IMU inertial measurement unit IR infrared IEEE Institute of Electrical and Electronics Engineers I2C Inter-Integrated Circuit k-NN k-nearest neighbours LDA linear discriminant analysis LPF lowpass filter LSB least significant bit microSDHC micro Secure Digital High Capacity MA moving average MAE mean absolute error MEMS microelectromechanical systems MET metabolic equivalent of task MOS metal oxide semiconductor MSE mean-square error MSV moving sample variance NA not available NB Na¨ıve Bayes NDIR nondispersive infrared NPV negative predictive value NTP Network Time Protocol PCB printed circuit board PIR passive infrared PPG photoplethysmography PPV positive predictive value Rd reading (displayed value) RF random forest RIPPER repeated incremental pruning to produce error reduction RMS root mean square RMSE root-mean-square error RS-232 Recommended Standard 232 SATP standard ambient temperature and pressure SD second derivative SPI Serial Peripheral Interface SU symmetric uncertainty SVM support vector machine TN true negative TNR true negative rate TP true positive TPR true positive rate xii List of Acronyms and Symbols

TVOC total volatile organic compounds UBA Umweltbundesamt (Eng., German Environment Agency) UART universal asynchronous receiver-transmitter USB Universal Serial Bus VDI Verein Deutscher Ingenieure (Eng., Association of German Engineers) VOC volatile organic compound Weka Waikato Environment for Knowledge Analysis WLAN wireless local area network

Symbols

| · | absolute value ◦ Hadamard product (·)−1 inverse (·)T transpose ~· vector || · || vector norm a acceleration a+1g acceleration in direction of the gravitational force, measured in a stationary position a−1g acceleration in opposite direction of the gravitational force, measured in a stationary position ax acceleration in x-axis ay acceleration in y-axis az acceleration in z-axis aACT actual acceleration aOFF acceleration offset aOUT measured acceleration value A discrete Fourier transform of the acceleration signal b parameter B magnetic field Bx magnetic field in x-axis By magnetic field in y-axis Bz magnetic field in z-axis Bˆ discrete Fourier transform of the magnetic field c parameter CO2 carbon dioxide

CO2ACT actual carbon dioxide concentration

CO2dry carbon dioxide concentration on a dry basis Symbols xiii

CO2OFF carbon dioxide concentration offset

CO2OUT measured carbon dioxide concentration

CO2reference carbon dioxide concentration at reference conditions

CO2wet carbon dioxide concentration on a wet basis E Energy f frequency fmax dominant frequency ∆f frequency interval of the discrete Fourier transform G matrix of the known gravitational force at six stationary positions h altitude ∆h height difference H power spectrum entropy C4H10 isobutane H2Odry water vapour concentration on a dry basis H2Owet water vapour concentration on a wet basis k Boltzmann constant m number of axes µ arithmetic mean M alignment matrix for a three-axis accelerometer n number of measurement samples N number of frequency bins N2 O2 oxygen ω angular rate ωx angular rate in x-axis ωy angular rate in y-axis ωz angular rate in z-axis ωACT actual angular rate ωOFF angular rate offset ωOUT measured angular rate value Ω discrete Fourier transform of the angular rate p air pressure preference air pressure at reference conditions pSATP air pressure at standard ambient and pressure conditions e partial pressure of water vapour ew saturated water vapour pressure P power spectrum Pn normalised power spectrum r cross-correlation coefficient R range xiv List of Acronyms and Symbols

RH relative air humidity RHi indoor relative air humidity RHo outdoor relative air humidity s scale factor S amplitude spectrum, single-sided σ sample standard deviation t time t1 starting time of a measurement set t2 ending time of a measurement set ∆t measurement interval θ actual value θˆ estimated value T air temperature Ti indoor air temperature To outdoor air temperature Treference air temperature at reference conditions TSATP air temperature at standard ambient and pressure conditions τ delay time V gas volume W matrix of the raw three-axis acceleration values at six stationary positions x raw measurement value X discrete Fourier transform of signal x(t) ZC zero crossing of a signal ZCS the number of zero crossings in a signal Chapter 1

Introduction

In the vision of ubiquitous computing, which was shaped by the computer scientist Weiser in 1991 [1], computers are seamlessly integrated into the environment such that they disappear from our attention. According to the latest estimates, there will be 41.6 billion internet of things devices connected by 2025 [2]. However, for these devices to be perceived as nonintrusive, they must respond to changes in the user and the environment accordingly. The method known as context awareness [3,4] involves such things as determining the location of the user, detecting occupancy, or recognizing what activity a person is performing. As will become apparent in the course of this thesis, context awareness is a complex process that may require the use of multiple sensors to capture the diversity of human behaviour and the environment. The objective of this thesis is therefore to demonstrate that sensor fusion is an enabling technology for context awareness and ubiquitous computing. Sensor fusion merely means combining sensory data from multiple dis- parate sources into a more accurate and reliable result than one would get when these sources were used individually. Besides accuracy and reliability, sensor fusion can lead to more robustness against difficult environments, ro- bustness against erroneous or missing data, lower uncertainty, better reaction time as far as real-time capability, more affordable, maintainable, or minia- turized systems, as well as emerging technologies. The definition of sensor fusion includes systems with a single sensor and measurements taken at dif- ferent time instants. But typically it is understood as a multi-sensor fusion in which either sensors of the same type are fused to generate redundancy, sensors are distributed at different locations, or data from sensors of different modalities are combined. One area of research discussed in this thesis is the recognition of human activities using wearable sensors. Here, a multi-modal sensor system may be better suited than placing sensors at multiple locations of the body, which can be considered intrusive (e.g., P¨arkk¨aet al. [5]). In the

1 2 1. Introduction other field of research dealt with here, the detection of occupancy, multiple sensor systems spread across the room or building become necessary depend- ing on the required spatial coverage. In addition, multiple sensor modalities may be needed to resolve ambiguities resulting from the richness of human behaviour and the environment. The focus in this thesis lies on associating complementary sources to compensate for the deficiencies of individual sen- sor domains. It is further possible to fuse competitive data sources in an attempt to increase the reliability of the system. Sensor fusion also involves an analysis of cost, complexity, power consumption, cumbersomeness, and weight of the fusion system. In addition, the uncertainty and imprecision of the individual sources has to be determined [6].

Human activity recognition is concerned with discriminating physical ac- tivities ranging from everyday actions to specialized doings in personal fit- ness and weight management, professional sports, elderly care (e.g., assessing activities of daily living (ADL) or alarming for potentially dangerous situ- ations, such as a fall), healthcare (e.g., gait analysis), sleep tracking, nav- igation, and military. Traditionally, human activity recognition has been approached either by employing sensors in the environment, such as video cameras (e.g., Gavrila [7]), or by wearable sensors (mainly , e.g., Bao and Intille [8]). However, wearable sensors are better suited be- cause human activities are not bound to a location and certain physiological parameters, heart rate to name one, are otherwise inaccessible. Also, video cameras are considered invasive and image recognition is computationally expensive. Accelerometers are the most dominant sensor type in wearable sensing due to their low power, low price, small footprint, and good per- formance in detecting motion. Nevertheless, human activities are so diverse that a single accelerometer (or any other sensor type for that matter) cannot possibly recognize every human activity. Many researchers have approached the complexity and multidimension- ality of human movements by placing multiple sensor devices at different parts of the body (e.g., [8,5,9, 10]). However, an important factor to record realistic data is the ability to perform physical activities under free-living conditions. The user has to willingly wear the device for long-term measure- ments, and only a device that feels familiar or that is easily forgotten leads to a natural movement. Multiple devices or intrusive locations, such as on the chest (e.g., [11, 12]), might disrupt or alter the way an activity is ex- ecuted. Commercial products that recognize human activities are typically designed as wristbands or smartwatches, likely because wristwatches have been socially accepted for over a century [13]. The Fitbit Charge 3, which is one of many popular activity trackers, uses an algorithm called ”Smart- 1. Introduction 3

Track” that requires physical activities to be carried out for a minimum of 10 continuous minutes [14, 15]. This duration may be appropriate in personal fitness, but activities found in other applications, such as a fall of an elderly person, happen in much smaller time frames. To cover a wider range of ap- plications, a multi-modal sensor fusion as well as a demonstrator of a human activity tracker is presented here. The human activity tracker is worn like a wristwatch to allow measurements under free-living conditions. However, because arm movements can be carried out independently of the rest of the body, the wrist position is particularly challenging. A set of ten everyday activities (sitting, walking, ascending and descend- ing stairs, jogging, running, riding an elevator moving upwards and down- wards, cycling, and falling) is investigated in this thesis. For this purpose, a 3-axis accelerometer, a 3-axis gyroscope, a 3-axis magnetometer, and a barometric pressure sensor were installed on the demonstrator. The 10-axis wrist-worn human activity tracker, which was developed as part of a series of supervised student theses [272, 274, 275, 276], was designed with respect to low power, small form factor, low weight (only 25 g), and high-speed data acquisition. To carry out initial investigations, four volunteers participated in collecting a total of 190 measurements. techniques are presented here to compensate for sensor inaccuracies, such as offset, scaling errors, or the deviation caused by Earth’s gravitational force. The feature extraction of a number of human activity related features is shown. Further- more, a human activity recognition approach to assess the energy expendi- ture (EE) of a person is proposed that has the potential to outperform direct acceleration-basedEE estimation and that works independently of the mea- surement position. The analysis of the results concentrates on determining the capabilities and limitations of each sensor domain. It is discussed which sensor combination is suitable for a sensor fusion approach on the wrist.

The prevalent approach to infer occupancy is to use motion detectors— most commonly, passive infrared (PIR) based motion detectors or ultrasonic sensors. However, PIR motion detectors are limited to a line-of-sight to the occupant, show dead spots where the sensor cannot see, and are unable to detect stationary or slow moving persons, all of which result in a high num- ber of false negatives. Ultrasonic sensors are more sensitive to slow motions, and thus they produce a higher false positive rate and cause potential inter- ference with animals that have ultrasonic hearing [16]. False negatives can lead to frustration among occupants (e.g., are turned off while someone is present), whereas false positives can waste energy when a heating, venti- lation, and air conditioning (HVAC) system assumes occupancy while it is not. Moreover, both sensor types are unable to discern the actual number 4 1. Introduction of occupants (occupancy estimation). Information about the number of oc- cupants becomes relevant in applications such as HVAC, which can operate more efficiently knowing the actual demand. Today’s smart homes are equipped with environmental sensors to asses the quality of the indoor air. These sensors can be anything from simple air temperature sensors to an indoor air quality measurement system hold- ing a variety of sensors or a sensor network thereof. While these devices are designed for the single purpose of determining the indoor air quality, the potential in incorporating occupancy detection or even occupant count- ing remains largely unused. An occupancy detector based on an indoor air quality measurement system, as is proposed here, addresses the inherent lim- itations that come with motion detectors: it is nonintrusive, its installation is effortless, existing infrastructure can be used to achieve a zero-cost setup, slow-moving and nonmoving occupants can be detected, it does not require a line-of-sight to the occupant, there are no dead spots, and it allows occupant counting. A number of things affect the quality of the indoor air in residential build- ings: air contaminants emitted from building materials, furnishings, house- hold chemicals, and occupants and their activities (e.g., smoking, cooking) [17], as well as air infiltration, and manual or mechanical ventilation. Only by fusing the heterogeneous data from a network of environmental sensors does a distinction of the interaction of the occupants with the environment from other influences become possible. Fortunately, existing infrastructure in a smart home may already hold a multitude of sensor types that can be exploited for this purpose. The target applications for the novel occupancy detection approach are in particular HVAC. Environmental sensor readings change slowly over time, which makes reactive applications such as con- trol infeasible or requires the fusion with other sensor types. The approach may be limited to specific room types or seasons as mechanical and manual ventilation can superimpose other effects. To demonstrate the advantages and the feasibility of occupancy detec- tion by environmental sensors, and in particular the benefits attained with sensor fusion, an indoor air quality measurement system with carbon diox- ide (CO2), total volatile organic compounds (TVOC), air temperature, and relative air humidity sensors was developed. Measurements were conducted during winter in four student apartments in Germany for a total of 49 days. Feature extraction of environmental sensor data and subset selection based on correlation-based feature selection (CFS) is presented here. Focusing more on the machine learning part, implementations of the supervised learning algorithms RIPPER, Na¨ıve Bayes, C4.5 decision tree, logistic regression, k-nearest neighbours (k-NN), and random forest are compared. Further- 1. Introduction 5 more, a method is presented to greatly reduce time and effort of collecting training data in residential buildings for supervised learning. As a supplement to this work, a gas sensor calibration test setup is pre- sented. The test setup is capable of calibrating multipleCO 2 and TVOC sensors simultaneously. An analysis of the sensitivity of nondispersive in- frared (NDIR)CO 2 and metal oxide semiconductor (MOS) based TVOC sensors to air temperature and air humidity was performed. Chapter 2

Related Work

2.1 Fusion of Wearable Sensors in Human Activity Recognition

Research on wearable sensors for human activity recognition has been con- ducted since the mid 1990s [18, 19], but has gained much attention in the re- cent years due to developments in microelectromechanical systems (MEMS) technology. Nowadays, there are a number of commercial wristbands and smartwatches that recognize human activities. A pioneer in wearable hu- man activity recognition is Fitbit, Inc. For instance, the Fitbit Charge 3 [14] uses a 3-axis accelerometer to track walking, running, aerobic workout, elliptical trainer workout, cycling, sports (intense workout with continuous movement), swimming, and sleeping. Unfortunately, the details of the algo- rithm, which is named ”SmartTrack”, as well as its accuracy has not been made public. More importantly, because the wristband is targeted at per- sonal fitness, only activities that are carried out for a minimum of 10 min are detected [15]. Climbing stairs, weight lifting, a fall of an elderly person, and many other physical activities are performed in smaller time frames and consequently cannot be detected by ”SmartTrack”. The recognition of human activities using wearable sensors has been in- tensively studied in the recent past, which is why only a fraction of the sensor fusion approaches can be discussed here. Some of these works were chosen due to their relevance at the time of publication. Others were chosen as to indicate the state-of-the-art while focusing on wrist-worn solutions and activities related to the ones analysed in this thesis. Despite considerable developments in human activity recognition, there is still room for improve- ment in accuracy, energy efficiency, unobtrusiveness, or in the discrimination against new activities.

6 2.1. Fusion of Wearable Sensors in Human Activity Recognition 7

One of the earliest sensor fusion studies was conducted in 2002 by Lee and Mase [20], who performed measurements with eight subjects carrying a device in their trousers pocket. The sensors consisted of a 2-axis accelerom- eter and a 1-axis gyroscope. Using a rule set and fuzzy logic, the researchers discriminated the activities sitting, standing, walking, ascending stairs, and descending stairs. The significance of their work lies in the separation of ascending and descending stairs from walking, for which they reported accu- racies of 92.85 to 95.91 %. Their ruleset, however, was tailored to a specific device orientation in the pocket, which is an unrealistic condition outside the laboratory. Lester et al. [21, 22] developed a multi-modal sensor system that included a 3-axis accelerometer, a sound, a barometric pressure, an air humidity, an air temperature, a 2-axis magnetic field sensor, and two different light sensors. In [21], two participants performed in total 12 h of sitting, standing, walking, jogging, ascending and descending stairs, cycling, riding a car, and riding an elevator moving upwards and downwards. The sensing device was worn on a shoulder strap while an additional webcam was used to label the activities. A two-step classification process using an ensemble of decision stumps and a hidden Markov model (HMM) yielded a normalized accuracy of 95 %. The provided confusion matrix shows that the approach mainly had difficulties detecting standing and riding a car. From reading the paper, however, it is understood that large parts of the data that were used for feature selection were reused as test data during the classification process. Also, throughout the paper, the authors stated different numbers for the test data length. It is probable that training and test data were improperly separated. In [22], about 7 h of activity data were collected with twelve participants wearing three sensor systems: one on the shoulder strap, one on the waist, and one on the right wrist. The ground truth was labelled manually by an observing person. The activity set consisted of sitting, standing, walking, ascending and descending stairs, riding an elevator up and down, and brushing teeth. Using the previously described learning model on all three locations, the normalized accuracy was stated to be around 90 %. The actual accuracy (when not normalized) supposedly was considerable lower, as indicated by the provided confusion matrix. Nevertheless, one notable finding was that a generalized classifier that was trained on all three sensor locations performed almost as well as when training and test data came from the same location. In both works, the most discriminative features were found to come from the accelerometer, the sound sensor, and the barometer. The authors explained that acceleration is sensitive to movements of the body, while the microphone captures the sound of the various activities, and the barometric pressure sensor helps detect activities such as walking stairs and riding an elevator. 8 2. Related Work

The temperature and humidity sensor data were discarded as the information was often misleading. Additionally, it was pointed out that the light sensors can be easily obscured by clothing or when the device is carried in a pocket. It was further demonstrated that the performance of a sensor fusion with acceleration, sound, and barometer data was comparable to when all sensors were available, and significantly better than with acceleration data alone. P¨arkk¨aet al. [5] developed a vast sensor data collection system with sensors on various parts of the body (chest, wrist, finger, forehead, shoulder, and back). The sensors included 3-axis accelerometers, 2- and 3-axis mag- netometers, physiological sensors (heart rate, oxygen , skin tem- perature, skin resistance, respiratory rate), a positioning device (GPS), and environmental sensors (air pressure, air temperature, air humidity, sound, light intensity). About 24 h of measurement data from twelve participants were used in the study. The ground truth was recorded manually by a person accompanying the participants. Despite the large number of different sensor domains, only features from the chest and wrist accelerometers and the chest magnetometer were chosen. It was discussed that physiological signals such as heart rate and respiratory rate correlate with the intensity of the activity, but react with a delay and do not reflect the type of activity. Vital signs data also varied largely between subjects. The highest accuracy was achieved with a decision tree. In a leave-one-subject-out cross-validation, the approach showed an accuracy of 86 % discriminating lying, sitting/ standing, walking, Nordic walking, running, rowing, and cycling. The decision tree was followed by a median filter to eliminate fluctuations in the classification that resulted from activity transitions. Classification errors mainly occurred during the detection of rowing. Nordic walking was also easily confused with walking. A large amount of instances was incorrectly classified as sitting/ standing due to inaccuracies in annotation, especially during activity transitions. The authors observed that the accelerometer and magnetic field data were sim- ilar, describing the magnetometer signals as ”a low-pass-filtered version of the accelerometer signal” [5]. Rulsch et al. [23] used a 3-axis accelerometer and a barometer on a hip- worn device to discriminate inactivity, walking, cycling, ascending stairs, and descending stairs. Measurements with twelve participants were recorded for 14.8 h while one of the researchers noted the ground truth. The datasets of six participants were used for training, the remaining six for testing. First, the Euclidean norm was calculated from the three accelerometer axes to dis- tinguish between inactivity and motion. Second, to further split the motion activities into cycling and walking, the power spectrum from one of the ac- celerometer’s axis was analysed. In the frequency band below 3 Hz, the mean power of cycling was said to be much lower than that of walking. Another 2.1. Fusion of Wearable Sensors in Human Activity Recognition 9 difference was seen in the frequency distribution, which was determined by the mean power ratio between 0–3 Hz and above 3 Hz. Third, if the de- cision tree detected walking, it would then determine the height difference as calculated from the barometer data in a 4 s time window. A height dif- ference below -0.75 m was classified as descending stairs and above 0.75 m as ascending stairs. The activities were classified with accuracies between 65.7 and 97.3 %, with ascending and descending stairs showing the lowest performance. Zhu and Sheng [24] used two inertial measurement units (IMUs) from Memsense, LLC, one attached to the waist and one attached to the right foot. According to the authors, the IMU included a 3-axis accelerometer, a 3-axis gyroscope, and a 3-axis magnetometer. From the IMU, only the accelerometer and the gyroscope were used. A single participant recorded 5 datasets for training and 5 for testing. The participant also annotated the data with the ground truth. The classification was a two-step process. At first, two feed-forward artificial neural networks (ANNs) (one for each sen- sor node) were used to separate stationary activities such as standing and transitional activities such as sit-to-stand from activities involving motion (walking, ascending and descending stairs, and running). The motion ac- tivities were discriminated in the second step by an HMM that reached an accuracy of 87.01–92.5 % depending on the activity. Although, good results were achieved in discriminating motion-based activities, the approach should be validated by a larger test group. Bahle et al. [25] investigated if human activity recognition could benefit from the magnetic field disturbance that is measured during gym exercises. It was assumed that each activity experiences a different magnetic field when performed in the proximity of metal objects or electric appliances. The au- thors employed Xsens MTx sensor systems [26] on various locations of the participants’ right arm. The MTx sensor system included a 3-axis accelerom- eter, a 3-axis gyroscope, and a 3-axis magnetometer. In the paper, the mag- netic field disturbance was extracted by subtracting the estimated angular rate of the magnetometer from the measured angular rate as given by the gyroscope. Two participants performed eight gym activities with each 10 to 15 repetitions, resulting in a total of about 5 min per person. Half of the data were used for training and the other half for testing, with the evaluation done independently for each participant. Classification was performed with a Na¨ıve Bayes learner and yielded an average accuracy of 96.8 % using features from all three sensors of one sensor node. It was shown that the informa- tion of the magnetic field disturbance not only increased the classification accuracy significantly, it could also improve the performance of classification tasks where training and test data are from different subjects. Nevertheless, 10 2. Related Work the authors pointed out that their results are only an indication that their method could support human activity recognition and recommended testing it on a wider range of data. In addition, the overall performance shown for the subject-independent classification was poor. A popular human activity recognition benchmark dataset is PAMAP2 (see Reiss et al. [9]). The dataset includes recordings from an IMU and a heart rate monitor on the chest, an IMU on the wrist of the dominant arm, and an IMU on the ankle. The IMUs consisted of two different 3-axis accelerometers, a 3-axis gyroscope, and a 3-axis magnetometer. Twelve ac- tivities from 9 participants were recorded for a duration of about 8 h (namely: lying, sitting, standing, walking, running, cycling, Nordic walking, ironing, vacuum cleaning, rope jumping, ascending stairs, and descending stairs). Some participants performed an additional set of six activities. The ground truth was noted by the participants on a mobile device. In the cited work, a k-NN classifier, which compared to other classifiers performed best, discrim- inated the twelve main activities in a leave-one-subject-out cross-validation with an accuracy of 89.24 %. During the feature extraction process, only the 3-axis acceleration and heart rate data were used, which leaves room for improvements. The authors described that the heart rate is particularly useful in estimating the intensity of physical activities. This was said to help discriminate activities such as walking and ascending stairs that would be infeasible with inertial sensors. In a later work [27], Reiss et al. proposed a confidence-based extension of the AdaBoost.M1 algorithm and classified fifteen activities (including activities from the optional set) with an aver- age accuracy of 77.78 %. Although the activity trackers alone are small and lightweight, attaching three of these trackers on a person’s body can be con- sidered intrusive, which in turn reduces the practicability of their approach. Heart rate monitor chest straps are also intrusive when worn during everyday activities. Other researchers mostly used the PAMAP2 dataset to test new human activity recognition methods. Schuldhaus et al. [28] used the accelerometer and gyroscope data on all three locations to discriminate seven activities from the set. Their approach, which was based on majority voting from decisions reached on sensor level, achieved an accuracy of 87.6 %. Guo et al. [29] con- structed an ensemble classifier based on ANNs to discriminate five known activities and unknown activities (the latter classified as ”other”). Using all available sensors, the mean accuracy was given as 84.8 %. Recently, re- searchers using the PAMAP2 dataset emphasized on deep learning methods: Guan and Pl¨otz[30], M¨unzneret al. [31], Murahari and Pl¨otz,[32], and Zeng et al. [33]. Schuldhaus et al. [34] and Leutheuser et al. [10] placed four SHIMMER 2.1. Fusion of Wearable Sensors in Human Activity Recognition 11 activity trackers [35] on the right wrist, hip, chest, and left ankle. The SHIMMER devices included a 3-axis accelerometer and a 3-axis gyroscope. Nineteen volunteers performed 7 activities in the former and 13 activities in the latter work (activities such as sitting, vacuum cleaning, walking, as- cending stairs, and descending stairs). During the measurements, one of the researchers labelled the ground truth. In [34], the researchers used random forest classifiers on the wrist, hip, and ankle sensor nodes and a support vec- tor machine (SVM) classifier on the chest node for a preliminary decision. For the final decision, majority voting was used. The classification results were evaluated using leave-one-subject-out cross-validation. With all four sensor nodes, a mean classification accuracy of 93.9 % was achieved. The mean accuracy of only the wrist node was 80.7 %. The wrist node classifier mainly had difficulties detecting ascending and descending stairs. In [10], a hierarchical classification framework was developed that used all four sensor nodes at once and achieved a mean accuracy of 89.6 % discriminating the 13 activities. The main purpose of this work was to establish a benchmark dataset that can be used by other researchers. In a later work, Schuldhaus et al. [28] used the dataset from [10] and performed majority voting using decisions reached at the eight sensors instead of on a sensor node level as in [34]. This approach yielded an accuracy of 87.6 % discriminating six ac- tivities. However, as discussed earlier, four activity trackers that need to be worn on different parts of the body can be considered intrusive. The areas of application in this case are limited. Elhoushi et al. [36] used a portable navigation device with a 3-axis accelerometer, a 3-axis gyroscope, a 3-axis magnetometer, and a barome- ter to recognize walking stairs, riding an elevator, riding an escalator while standing, and riding an escalator while walking. However, the magnetometer was not considered for human activity recognition. Measurements were con- ducted with more than ten participants for a duration of approximately 5 h. From the data, 40 % were used for training and the remaining for testing. A decision tree classified the four activities with an accuracy of 80.2–95.0 % depending on the activity. Unfortunately, the authors did not go into detail where the portable device was placed during the measurement. Instead, they claimed that their classifier could be employed in any device that uses the named sensors and would work with any user and on any location of the body. The authors did not provide proof for their statement. Zhu et al. [37] demonstrated human activity recognition using the 3-axis accelerometer and the 3-axis gyroscope of a . Five participants carried the smartphone in their trousers front pocket and performed the activ- ities inactivity, walking, running, ascending stairs, and descending stairs. Of each activity, 90 samples were collected while the ground truth was recorded 12 2. Related Work by the participants themselves. In the paper it was shown that the sensor fusion achieved about 5 % higher recognition accuracy than when using the accelerometer data alone. The authors proposed a feature selector called locality-constrained linear coding as described in [38]. The best performing classifier was the extreme learning machine (ELM) from [39]. In a leave-one- subject-out cross-validation, the ELM classifier discriminated the activity set with an accuracy of 84.67 %. Abdelnasser et al. [40] proposed to fuse the data of an accelerometer and a magnetometer in a smartphone to discriminate inactivity, walking, walk- ing stairs, riding an elevator, and riding an escalator. Three participants recorded a total of 170 activity samples. The authors presented a decision tree with three levels. At the top level, the accelerometer signal was tested for a pattern that matched riding an elevator. A measurement was shown to demonstrate that riding an elevator generated a distinct acceleration pattern as a result of the over-weight and weight-loss periods. At the second level, the variance of the acceleration signal was used to separate activities with constant velocity (inactivity and riding an escalator) from walking and walk- ing stairs. For the third level, an example was shown to underline that the motor of an escalator creates a higher variance of the magnetic field strength than inactivity. Thus, the two activities were discriminated by the variance of the measured magnetic field strength. Also at the third level, walking stairs was discriminated from walking by calculating the correlation coeffi- cient between the signals of the acceleration axis in the direction of gravity and the acceleration axis in the direction of motion. It was said that the cor- relation measure is higher during walking stairs. The results were presented with near perfect performance (false positive rate = 0.2 % and false negative rate = 1.1 %). However, the details of their evaluation, in particular the lo- cation of the smartphone on the body and training and test set separation, were not provided.

2.2 Fusion of Environmental Sensors in Oc- cupancy Detection

Compared to the widespread motion detectors, environmental sensors have a number of advantages in occupancy detection. As already described in the introductory chapter, an environmental sensor fusion approach is non- intrusive, the installation is effortless, existing infrastructure can be used to achieve a zero-cost setup, slow-moving and nonmoving occupants can be de- tected, it does not require a line-of-sight to the occupant, there are no dead 2.2. Fusion of Environmental Sensors in Occupancy Detection 13 spots, and it allows occupant counting. Lam et al. in [41, 42] were the first who conducted research in this field. The researchers equipped two cubicles of an open-plan university office with PIR motion detectors, indoor and outdoorCO 2, air temperature, relative humidity, and sound sensors. Video cameras were used to record the ground truth occupancy. Two datasets with a duration of about 2 months were used to train the classifier, and a week-long third dataset for testing. However, the third dataset fell into the same period as dataset number 2, and it is unclear if the test data were overlapping with the training data. The researchers preferred an HMM classifier as it successfully captured the occupancy profile and ignored abrupt fluctuations of occupancy. The number of occupants in the two cubicles was estimated by the HMM with an accuracy of 65 % and 70 %. A conclusion was drawn that environmental parameters, in particular theCO 2 concentration and the sound level, were correlated with the num- bers of occupants. But the authors also stated that the sound sensor was affected by adjacent cubicles, and that the 20 min moving average of theCO 2 measurements caused a delay in occupancy estimation. Air temperature and relative humidity were said to have low predictive power due to the HVAC system of the building. In a following publication by Dong and Lam [43], the HMM was based on a Gaussian mixture model. The improved classifier estimated the number of occupants in the two cubicles with an accuracy of 82 % and 85 %, with the mean-square error (MSE) at 0.21 and 0.17. Hailemariam et al. [44] installed a PIR motion detector, aCO 2, a sound sensor, two light sensors, and two current meters for computer equipment in an office cubicle. Measurements including video-based ground truth oc- cupancy were taken with one individual over a duration of one week. The occupancy detection was carried out using decision trees. Because the opti- mal time window for feature extraction initially is unknown, the researchers generated features from multiple time periods, namely 1, 2, 4, 8, 16, 32, and 64 min. However, a feature selection was not performed in the work. This was likely the reason for overfitting the decision tree, in which the sensor fusion was outperformed by a single PIR motion detector feature. It is well- known that irrelevant features degrade the performance of decision trees [45]. The accuracy of the PIR motion detector decision tree was reported to be 98.441 %, although the results were biased from an insufficient number of test subjects. Occupancy estimation in a university research laboratory was carried out by Han et al. [46], who applied an autoregressive hidden Markov model (ARHMM) on data from a network of three PIR motion detectors, aCO 2, and a relative humidity sensor. The authors claimed the advantage of an ARHMM as its ability to establish connections between observed variables 14 2. Related Work

(i.e., considering that environmental sensing is a time-varying process). Ten days of measurement were used to train the ARHMM and four days were left for testing. The ground truth occupancy was recorded manually. The ARHMM classifier showed an accuracy of 80.78 % and a root-mean-square error (RMSE) of 0.94 in counting occupants. Problems of the proposed approach, however, result from the complexity of the PIR motion detector installation. It can be time-consuming, costly, and intrusive to install three PIR motion detectors and to adjust them in a way that their field of view does not overlap or leave gaps. Ebadat et al. [47, 48] proposed a regularized deconvolution-based occu- pancy estimator on measurements from aCO 2, an air temperature, and a door state sensor, as well as from HVAC system ventilation level recordings. Two weeks of measurements with manually recorded ground truth occupancy were collected in a university laboratory, of which one week was used for training and the other for testing. The number of occupants was estimated with an accuracy of up to 88.6 % and an MSE of 0.109. However, without the information from the HVAC system and the door state sensor, the au- thors stated that the estimator’s performance decreased to 82.1 % accuracy and an MSE of 0.235. In addition, the datasets were imbalanced such that approximately 75.5 % of the test set instances were vacancy [49]. This num- ber can be seen as a baseline for the performance evaluation. The datasets were further used by Liu et al. [49], who performed a two-stage occupancy classification in an attempt to eliminate abrupt fluctuations from the results. First, preliminary classification results were generated using an ELM. The preliminary values were then used as input for a structured SVM for the final classification. The accuracy of this approach was given as 97.57 %. Nonethe- less, good results were achieved only with the information on the ventilation level, which limits the approach to buildings with HVAC installations. Masood et al. [50] placed three environmental sensor systems comprised ofCO 2, air temperature, relative humidity, and air pressure sensors at the centre of three tables in a mechanically-ventilated university tutorial room. Measurements were taken for seventeen days, of which sixteen were used for training and one day for testing. The ground truth occupancy was recorded with a video camera. The authors proposed using an ELM algorithm that was said to have the advantage of fast learning. Using the ELM model also allowed them to implement a wrapper method for feature selection. Without the ELM, wrapper-based feature selection is computationally expensive [45]. The ELM classifier yielded an accuracy of 74.06 % for the number of occu- pants estimation and an accuracy of 81.37 % by combining occupant counts to five different occupancy levels. However, the authors made the mistake that they based the feature selection on the same data that were later used 2.2. Fusion of Environmental Sensors in Occupancy Detection 15 to evaluate the classifier. Furthermore, the deployment of the sensor systems in the centre of the table likely reduces reaction time, but it is also prone to overestimation because occupants may breath directly onto the sensors. In a more recent work, the environmental sensor fusion approach of [50] had been adopted by Chen et al. [51], who combined occupancy estimation models such as the ELM with a particle filter algorithm. Here, aCO 2, an air temperature, a relative humidity, and an air pressure sensor were installed in a large mechanically-ventilated university office. The ELM fusion approach estimated occupancy in four occupancy levels with an accuracy of 74.18 % and discriminated occupancy from vacancy with an accuracy of 93.18 %. The authors have published a series of papers in which they use this setup or small variations of it to detect and count occupants in the university office. Notably, Chen et al. [52] proposed an inhomogeneous hidden Markov model with multinomial logistic regression, Chen et al. [53] used a convolutional deep bidirectional long short-term memory approach, and Zhu et al. [54] used a local receptive fields based ELM. The performance presented in these papers was improved slightly. Dey et al. [55] used the existing infrastructure of a university build- ing (CO2 sensors, air temperature and supply air temperature sensors, and HVAC ventilation levels) to infer the occupancy level in class rooms and laboratories. The ground truth occupancy was observed manually for three weeks and divided into 5 occupancy levels. It was discussed that the air tem- perature is dominated by the HVAC system, and that the information on the ventilation level is only useful in a sensor fusion as it can be influenced by occupants as well as by seasonal changes. TheCO 2 concentration was said to correlate with occupancy, but its effect is mitigated by HVAC system activities. A random forest learning model was trained and validated using 10-fold cross-validation. Although, the authors did not provide information on how the folds were created, which is crucial due to the temporal depen- dency of the environmental sensors. The accuracy of the sensor fusion in the three examined rooms was roughly between 83 and 96 %. Without the information of the HVAC system’s ventilation level, the accuracy dropped to about 72–92 %. Ekwevugbe et al. [56, 57, 58] used ANNs to estimate occupants in three office spaces of a university building. The authors investigated the use of data from PIR motion detectors, a volatile organic compound (VOC) sen- sor, multipleCO 2, PC case temperature, air temperature, relative humidity, and sound sensors. An infrared camera was utilized to manually record the ground truth occupancy. After preprocessing the data, about one to three weeks of data were obtained from every room. In [56] and in [58], the predictive power of the VOC sensor was calculated using a symmetric 16 2. Related Work uncertainty (SU) measure and shown to be relatively low. It was discussed that other sources than the occupants generated the majority of VOCs in the building. In [57], the authors pointed out that theCO 2 sensor features were sorted out in the feature selection process and concluded that this may have been because of the specific setting. The large volume of the office space and air infiltration from the large windows and ventilation hatches may have influenced the predictability of theCO 2 features. Also, the PC case temper- ature sensor features were said to have failed to detect occupants that used laptops instead of PCs. On the other hand, in [58] theCO 2 sensor data were described to strongly correlate with the number of occupancy. Although, the slow decay rates made it difficult to detect abrupt changes of occupancy such as for incoming occupants. The sound features were also found to be effective in estimating the level of occupancy. In [57], the ANN classified the number of occupants with an accuracy of 68.11–84.59 % and an RMSE of 1.63–0.37 depending on the day of testing. However, the researchers provided defini- tions of the extracted features that were partly incomplete or incorrect: the first and second order differences showed misplaced parentheses, the area un- der the curve and the variance were incorrectly derived, the sound and PIR features were calculated differently from what was described, and the nota- tions were inconsistent. In addition, it remains unclear whether the feature selection process was applied only to the training data or to training and test data. Yang et al. [59, 60] developed a multi-sensor system consisting of a PIR motion detector, an infrared, aCO 2, an air temperature, a relative humidity, a light, a sound, and a door state sensor. Measurements were conducted for 1 month in two individual offices and for 20 days in two shared offices in- cluding ground truth occupancy recordings by video cameras or touch-screen devices. The building was controlled by an HVAC system. With a decision tree classifier, which showed the highest performance of all tested learning models, the sensor fusion approach achieved an occupancy detection accu- racy of 96.0–98.2 % for the individual offices and an accuracy of 97.3–97.8 % for the shared offices. The RMSE of the occupancy estimation ranged from 0.144 to 0.109 and from 0.156 to 0.141 for the individual and the shared offices, respectively. However, the performance was evaluated using 10-fold cross-validation in the machine learning software Waikato Environment for Knowledge Analysis (Weka). Weka splits the instances randomly into train- ing and test sets. Due to the temporal dependency of the environmental parameters, the cross-validation leads to overly optimistic estimates. In ad- dition to the first evaluation, the learning models were trained with the data from one room and tested on data from the other room. In the individual offices, the decision tree algorithm then detected occupancy with an accuracy 2.2. Fusion of Environmental Sensors in Occupancy Detection 17 of 91.1–92.6 % and the number of occupants with an RMSE of 0.195. For the shared offices, only the RMSE was provided, which was between 0.688 and 0.632. Overall, the authors concluded that theCO 2, door state, and light sensors had the highest impact on the results. Notably, the work was preceded by a series of papers with varying methods [61, 62, 63]. Khan et al. [64] developed a hierarchical classification framework, in which higher levels of occupancy granularity were provided with the esti- mates and confidence values of the preceding level. Three levels of occupancy granularity were defined: occupied (yes or no), categorical occupancy levels, and the exact number of occupants. Their approach was tested for ten week- days in an open-plan office using a wireless sensor system that contained a PIR motion detector, an air temperature, a relative humidity, a light, and a sound sensor. Another fourteen weekdays were collected in a meeting room with additional information on the meeting schedule and PC activity reports. In the open-plan office the ground truth occupancy was acquired by video cameras and in the meeting room by manual recordings from one of the re- searchers. The classification was validated using 10-fold cross-validation, but the authors did not provide information on how the folds were created, which as already described, has a great influence on the results when using environ- mental sensor data. In the open-plan office, a k-NN classifier detected the state of occupancy, estimated the occupancy level, and counted the number of occupants with accuracies of 94.6, 84.7, and 74.5 %, respectively. With- out contextual information such as the meeting schedule, the k-NN classifier performed occupancy detection in the meeting room with an accuracy of 92.4 %, the level of occupancy estimation with 91.6 %, and the number of occupants estimation with 74.9 %. Adding the contextual information or us- ing an SVM instead, the results improved by about 2–3 %. In summary, the authors demonstrated that their hierarchical approach greatly improved the results in subsequent levels of occupancy granularity. Arora et al. [65] employed a sensor network in an office room that con- sisted of a PIR motion detector,CO 2, indoor and outdoor air temperature, door state, and window state sensors; and four power meters used on the par- ticipants’ notebooks. Additionally, the time of day partitioned in four states and the weekday state were used as features. The ground truth occupancy was acquired using two video cameras. Eleven days were collected to train a C4.5 decision tree based algorithm and five days for testing. The decision tree classifier estimated the number of occupants with an accuracy of 65 %. The provided precision indicated that vacancy was detected more reliably, while the number of occupants’ precision was poor. In a more recent paper, Amayri et al. [66] added the data from a sound sensor. Here, the accuracy of the C4.5 decision tree classifier was 88 %. The training and test sets were 18 2. Related Work each collected during different seasons, which likely was the reason that the sound sensor feature was ranked high and theCO 2 features lower than in the previous work. Although, it is not described whether the higher accuracy resulted from the sound sensor data or the new measurements. Particularly, the test data fell into a period with a high number of national holidays that, due to an increased number of vacancy instances, could also explain the better performance. Freˇseret al. [67] equipped three mixed-size offices with Netatmo weather stations [68] and window state sensors for a duration of two months. From the Netatmo weather station, the sensors for indoor air temperature, indoor relative humidity,CO 2, outdoor air temperature, and outdoor relative hu- midity were used. An application on a smartphone was used to self-report the ground truth occupancy. An SVM classified between occupancy and vacancy. Whenever occupancy was detected, a support vector regression algorithm es- timated the number of occupants. At first, the datasets from each office were split into training and test sets (70 % and 30 % respectively). The mean absolute error (MAE) for the number of occupants estimation was given as 0.60 and the RMSE as 1.20. In another experiment, the data from two offices were used as training and the remaining as test data. Then an MAE of 0.46 and an RMSE of 0.8 was achieved. A surprising finding is that the results from the second experiment, in which training was performed with offices of a different size, were considerably better than in the first experiment. A setup consisting of aCO 2, an air temperature, a relative humidity, and a light sensor was installed in a two-person university office by Can- danedo and Feldheim [69]. The ground truth occupancy was recorded with a video camera. A seven-day-long measurement was taken for training and two measurements, three and eight days long, for testing. The best results were realized with a linear discriminant analysis (LDA) classifier, achieving an accuracy of 97.90 % for test set 1 and 99.33 % for test set 2. Their find- ings indicated the light sensor as the most valuable component, which also showed the lowest correlation to all other sensors in the set. Although their occupancy detector achieved remarkably accurate results, the outcome was based on the fact that the occupants were disciplined in switching the lights on when arriving and off when leaving. Without the light sensor data, the LDA classifier’s accuracy dropped to 84.88 % and 72.32 % for test set 1 and 2, respectively. Ang et al. [70] utilized off-the-shelve sensor systems (including a Netatmo weather station [68]) for two weeks to infer occupancy in an individual office. The time of day, the time of day partitioned into four states, raw values of the air temperature, relative humidity,CO 2, air pressure, light, and sound level were extracted as features. The ground truth occupancy was collected 2.2. Fusion of Environmental Sensors in Occupancy Detection 19 using a web-based application and verified with a door state sensor, a motion sensor, and a power meter on the occupant’s computer monitor. Occupancy was detected most reliably by a random forest classifier with an accuracy of 98 %. However, it was not discussed how or if training and test data were separated, and the results were biased from an insufficient number of test subjects. The significance of a sensor domain was evaluated using linear regression, whereCO 2, light, and sound were identified as the dominant sensor features. By computing the Pearson correlation coefficient, it was found thatCO 2 and sound were highly correlated with occupancy, whereas the correlation of light and occupancy was relatively weak. Morgner et al. [71] performed occupancy detection in an office environ- ment using only air temperature and relative humidity sensors. Their Na¨ıve Bayes classifier achieved an accuracy of 78.4–93.5 % depending on the lo- cation of the sensor and the room. The data, which included video-based ground truth occupancy, were collected in three university offices for a total of 90 h. However, the data were collected under strict laboratory conditions such as closed windows and restricted occupant access, both of which have a great impact on the environmental sensor measurements. Only recently have environmental sensors been investigated for occupancy detection in residential buildings. W¨orneret al. [72] placed Netatmo weather stations [68] into three apartments for occupancy detection. In two apart- ments participants were required to press a switch for ground truth occu- pancy, whereas video cameras captured the ground truth occupancy in the third apartment. The switch-based ground truth occupancy was found to be unreliable as participants occasionally forgot to press it. The authors further tested iBeacons [73] for ground truth occupancy information, but discovered that the method was unstable for room-level ground truth occupancy. From the sensor data ofCO 2, air temperature, and relative humidity, it was dis- cussed that only theCO 2 features had the ability to separate occupancy from vacancy. The conclusion was that air temperature and relative humidity de- pended more on the environmental conditions than on the occupants. An HMM was trained for every room with seven days of data and tested on two to nine days of data. It was shown that their method was feasible to detect occupancy in living rooms and bedrooms with accuracies somewhere between 60 and 95 % (exact numbers were not provided). However, the detection of occupancy failed in kitchens and bathrooms as a result of the short occu- pancy duration. The long sampling interval of 5 min and the time until the CO2 concentrations changed notably was discussed to be too long for these room types. It was stated that their method is only applicable in winter months as it required windows to be closed most of the time. Von Bomhard et al. [74] further evaluated an unsupervised HMM for occupancy detection 20 2. Related Work using the dataset from the third apartment. The performance was shown to be comparable to the supervised HMM approach. Chaney et al. presented in [75] an unsupervised HMM that used the Dempster-Shafer theory to fuse environmental sensor data for occupancy de- tection. For one month, measurements from aCO 2, an air temperature, and a relative humidity sensor, as well as from a hot water and multiple electri- cal power meters were collected in a residential house. However, the ground truth occupancy was only obtained after the measurements. The partici- pants were asked to recall the past two weeks, which led to an incomplete knowledge of the ground truth. Furthermore, the authors stated that their approach was limited to daytime occupancy detection due to missing sensors in the bedroom and low values on the power meters at night. Candanedo et al. [76] also tested an unsupervised HMM on about six weeks of data gathered in a residential low energy house. Despite some correlation to occu- pancy, the sensor data based on the humidity ratio were heavily influenced by open windows, and the overall method showed a poor performance during vacancy. The authors recommended adding another sensor such as a PIR motion detector.

2.3 Contributions of This Thesis

Contributions in Human Activity Recognition:

ˆ Motion sensors such as accelerometers are often used to estimate theEE during physical activities because of their ability to measure under free- living conditions. However, the acceleration signals are also known to correlate little with the actualEE[77, 78, 79, 80, 81]. To overcome this limitation and to address the particular challenges associated with the wrist position, a two-stepEE estimation approach is introduced that involves human activity recognition and the use of metabolic equivalent of task (MET) values.

ˆ This thesis makes several contributions to the compensation of sen- sor inaccuracies. These include identifying and removing offset and scaling errors in acceleration data, as well as a highpass filter (HPF) that efficiently removes the gravitational force. A method for compen- sating the offset of an angular rate sensor is shown. Hard- and soft- iron compensation of a 3-axis magnetometer is discussed in addition to high-frequency noise reduction by using a lowpass filter (LPF). The barometric pressure signals were subject to a large amount of noise, which made recognizing activity-related characteristics infeasible. For 2.3. Contributions of This Thesis 21

this reason, a Savitzky–Golay smoothing filter was implemented that is shown to have the advantage of preserving the signal’s high-frequency components. Furthermore, to infer the altitude change that occurs when walking stairs and riding an elevator, an LPF is proposed to sep- arate the static atmospheric air pressure from the dynamic air pressure.

ˆ Various human activity related features were extracted. Their use is discussed for every sensor domain in theory and by analysing the avail- able measurement data.

ˆ Recorded with the wrist-worn human activity tracker, the intensity of the acceleration signal during cycling was similar to that of walking and walking stairs. To avoid confusion, different methods based on characteristics in the frequency-domain and based on zero crossings are presented.

ˆ The acceleration and angular rate signals recorded by the wrist-worn human activity tracker showed a high amount of similarity between sitting and riding an elevator, as well as between walking, ascending stairs, and descending stairs. It was discovered that by adding the lowpass-filtered signal of a low-noise barometric pressure sensor, activ- ities that involve a vertical displacement can be easily separated. This finding is also backed up by other research [22, 23]. Furthermore, a fu- sion of the accelerometer or the gyroscope with the barometer achieves to recognize all of the examined activities in this thesis.

ˆ On the examples of cycling and riding an elevator, it is explained that the potential of magnetic field sensing lies in determining the signal characteristics of the magnetic interference. Often, these activities pro- duce similar acceleration and angular rate data when compared to some other activities (here: cycling and walking, or riding an elevator and sitting). Activities with magnetic interference include riding a car, an elevator, an escalator (see [40]), a bicycle, or exercising using gym machines (see [25]). It is pointed out that another advantage of the magnetic domain is that the magnetic distortions are independent of individual users, and thus the recognition performance of algorithms designed for multiple users can be improved.

ˆ The results in this thesis indicate that a wrist-worn fall detector can be established with either an accelerometer or a gyroscope. Although fall detection was also achieved with a barometer by cross-correlating the air pressure signal with a previously recorded template signal, the 22 2. Related Work

approach is computationally expensive. Notably, fall detection requires a particularly low false alarm rate due to the risk of accidentally con- tacting first responders when it was actually an ADL. A number of methods are suggested to minimize false alarms, such as comparing the spread and the mean value of the acceleration signals, calculating the height difference before and after a detected fall using a barometer, or examining the following time slot for inactivity. ˆ It is demonstrated that the activity set examined in this thesis, which consists of ten different everyday activities, can be discriminated at the wrist position using either a fusion of an accelerometer and a barometer or a gyroscope and a barometer. An exemplary decision tree is shown to illustrate the human activity recognition.

Contributions in Occupancy Detection: ˆ Most of the research on occupancy detection with environmental sen- sors has been conducted in office spaces with the motivation of op- timizing HVAC control strategies, or simply because the researchers were able to monitor the equipment during work and react in time to problems such as sensor failure. However, occupant behaviour, pro- file, and numbers in residential buildings differ distinctively from an office scenario. In addition, residential buildings in countries such as Germany are usually naturally ventilated. While office space is typ- ically occupied from nine to five, detecting vacancy at night and on weekends becomes relatively easy. Residential houses and apartments are commonly vacant during the day and occupied at night, but exact times vary, especially on weekends. In this thesis, the research on the residential setting is complemented with measurements in four student apartments that showed particularly high dynamic occupancy patterns. ˆ A demonstrator of an indoor air quality measurement system has been developed. The demonstrator was equipped with the latest gas sensor technology and an additional outdoor air measurement system that was wirelessly connected to the indoor unit. Particular emphasis was given to the installation and operation of the devices, which can be carried out effortlessly by the occupants themselves. ˆ Feature extraction of environmental sensor data and subset selection based on CFS is presented here. ˆ The performance of a variety of machine learning models is compared in the capability to detect and estimate occupancy. 2.3. Contributions of This Thesis 23

ˆ The measurements of this work are made publicly available1 to offer other researchers an economic and fast way to test their algorithms, or to improve and compare their methods to the classifiers presented here. Not only is measuring time-consuming, it also requires persuading people to take part in the survey, especially in sensitive areas such as an apartment.

ˆ A common problem of supervised learning is collecting training data, which is time-consuming or infeasible during deployment. Encouraged by good results in office scenarios [59, 67], it is shown that in residential buildings with equal-sized apartments, it is possible to train the learn- ing model in one apartment and to employ the classification in another without any training.

ˆ In a study from 2016 [82], it was found that the purchasing costs are the main barrier for the dissemination of smart home devices. Most commonly, indoor air quality sensing usesCO 2 sensors based on NDIR spectroscopy technology [83], which is the major cost factor in an in- door air quality measurement system. MOS-based TVOC sensors, on the other hand, currently cost only a fraction of the NDIRCO 2 sen- sor price (average price comparison at Digi-Key Electronics in January 2019 [84]). Because of their relatively low cost, they are a good alter- native for indoor air quality sensing. Another benefit from deploying TVOC sensors is the detection of actual air contaminants. TheCO 2 concentration is known to only correlate with the metabolic rate and the number of occupants [85]. In this thesis, it is demonstrated that a TVOC sensor, contrary to the findings of other researchers [86, 56, 58], can indeed replace aCO 2 sensor for occupancy detection and estima- tion.

ˆ This thesis gives a comprehensive overview on gas sensor calibration methods for NDIRCO 2 and MOS-based TVOC sensors. The sensors’ sensitivity to the environmental parameters air temperature, relative humidity, and air pressure is discussed in detail, and mathematical for- mulas for compensation of theCO 2 sensor were derived. Furthermore, a gas sensor calibration test setup was developed that is capable of calibrating multipleCO 2 and TVOC sensors simultaneously. The test setup contributes to the state-of-the-art as it offers a substantial re- duction in calibration time and cost. Measurements were conducted to characterize the calibration process and to analyse the sensitivity to

1http://bit.ly/occupancy data 24 2. Related Work

air temperature and air humidity. The description of the calibration test setup and the results of the measurements are given in a separate report in ChapterC. Chapter 3

Human Activity Recognition With a Wrist-Worn Activity Tracker

Nonintrusive Tracking of Human Activities

Sensors for human activity recognition can be categorized into sensors in the environment, such as video cameras (e.g., Gavrila [7]), and sensors worn on the body (mainly accelerometers, e.g., Bao and Intille [8]). However, wearable sensors are preferred because human activities are not bound to a location and certain physiological parameters, heart rate to name one, are otherwise inaccessible. Also, video cameras are considered invasive and image recognition is computationally expensive. When employing wearable human activity trackers to record activities un- der free-living conditions, it is nonetheless important that they not appear intrusive. The user has to willingly wear the device for long-term measure- ments, and only a device that fits comfortably and is easily forgotten leads to a natural movement. Devices that are perceived as alien might disrupt or al- ter the way an activity is executed. Apart from truly nonintrusive hardware, acceptance can be achieved by designing the device’s appearance to fit the person’s individual preferences. The companies Fitbit, Inc. or Jawbone, for example, did not intend their trackers to be hidden. Instead, they promote their products as fashion items such that users happily wear them during sports, at work, or when meeting friends. In areas such as elderly care, the reception is higher if the device does not look much like a technical aid. Cer- tainly, there are limitations using wearables in weight, form-factor, durability of materials, and power consumption. Some sensor types should be excluded due to their intrusive nature, microphones for instance. The more sensors

25 26 3. Human Activity Recognition With a Wrist-Worn Activity Tracker are attached to different parts of the human body, the richer the informa- tion gets, which in turn increases the chance of recognizing activities. For example, Bao and Intille [8] placed accelerometers on the hip, wrist, arm, ankle, and thigh. Multiple sensor locations, however, become both uncom- fortable and expensive and are therefore unlikely to succeed under free-living conditions. Human activity trackers can be standalone devices (e.g., a clip-on sensor [22, 23, 10, 87]) or being integrated into clothing [88, 89, 90, 91], watches [92, 93], or even jewellery [94, 95, 96, 97]. Despite efforts on smart textiles, motion sensors such as accelerometers are still housed inside some kind of hardware that is placed or woven into the textile [90, 91]. The placement of the tracker depends on the application and activities to be recognized. Several researchers suggested positioning the wearable device close to the body’s centre of mass [98], which was interpreted either as the lower back [99, 100], the chest [12, 34, 10], or the hip [34, 10]. These positions are ideal in capturing motion of the entire body, but especially the lower back and chest region can be perceived as uncomfortable. Others point out a high acceptance for a human activity tracker when using the sensors of a mobile phone [21]. Activities are tracked whenever the phone is carried in the trouser pockets (e.g., [37]). However, people do not constantly bring the phone or carry it in their trousers pocket. Women, for example, may leave theirs in a handbag, which will lead to gaps in tracking. Besides, different positions of the phone have to be considered. Berchtold et al. [101] therefore distinguished between the phone in the pocket and the phone in the hand. For a variety of applications, such as navigation, human activity recognition, gait analysis, or sports, sensors have been placed onto [102, 103, 104, 105] or embedded into [106, 107, 108, 109, 105] the shoe of a person. A sensor embedded into a shoe certainly goes unnoticed, but is limited to tracking outdoor activities. Several researchers focused their work on the wrist [110, 111, 112] or used the wrist position as part of a sensor fusion [19,8, 22,5, 113,9, 34, 10]. Wearing a device on the wrist, such as a bracelet, a wristband, or a watch, can be considered nonintrusive because wristwatches have been widely used in society for a century [13]. A characteristic of the wrist position is, however, that arm movements can be carried out independently of the rest of the body. Despite the complexity, it was decided to build a wrist-worn human activity tracker to record activities under free-living conditions as nonintrusive as possible. Also, if required, the device can be attached to the lower leg to record physical activities that may not be accessible from the wrist position. Preliminary results of the human activity recognition system were published by the author of this thesis in [286, 288]. 3.1. Assessment of Energy Expenditure 27

3.1 Assessment of Energy Expenditure

The amount of energy that the human organism spends in day is described by the total energy expenditure. It mainly consists of the basal energy expendi- ture, the thermic effect of food, and the physical activity [114]. Although, it is more common to use the resting instead of the basal energy expenditure since the resting energy expenditure has less stringent requirements on the ambient conditions, control of the food intake, and physical activity [115]. There are several methods to asses the energy expenditure (EE): direct calorimetry, indirect calorimetry, doubly labelled water, bioelectrical impedance analysis, physical activity records, heart rate monitoring, body temperature sensing, motion sensors such as accelerometers, and dietary questionnaires [115, 116]. The determination of theEE, particularly for the measurement under free- living conditions, is an active field of research. Motion sensors as in accelerometers have the advantage of being inex- pensive, lightweight, nonintrusive, and are able to measure under free-living conditions. The method of estimatingEE varies among researchers, but typ- ically the magnitude of the acceleration is measured in one or all three axes, and then an association to the actualEE is formulated. A much-cited work is that of Bouten et al. [117, 77], who attached an accelerometer to the waist and determined a correlation between theEE and the sum of the integrals of the absolute acceleration vector:

Z t2 Z t2 Z t2  EE = b |ax|dt + |ay|dt + |az|dt + c (3.1) t=t1 t=t1 t=t1 Bouten et al. measured the actualEE using indirect calorimetry and de- termined the parameters b and c through linear regression. A disadvan- tage of the method, however, is a low sensitivity to sedentary activities and an inability to assess static exercise [77]. In general, accelerometer-based EE estimation does not achieve the accuracy of other established methods [77, 78, 79, 80, 81]. Furthermore, Equation (3.1) is based on the assumption of a linear relationship between the accelerometer output and theEE, which is correct only if measured at the waist. In this thesis the measurement is performed on the wrist. It is unlikely that the movement of the forearm re- flects the totalEE as it can move independently of the rest of the body. For example, cycling does not involve movements of the arms but still results in a highEE. As a result of the low performance with accelerometers, other researchers approachedEE estimation by multi-modal sensor fusion. Liu et al. [118] demonstrated that by fusing two accelerometers and a respiratory rate sensor, it is possible to increase the accuracy. The method was based on a two- 28 3. Human Activity Recognition With a Wrist-Worn Activity Tracker step process that first classified the physical activity and then estimated theEE. However, the installation consisting of several sensor positions can be regarded as intrusive. Sazonov [105] combined the measurement data from an accelerometer attached to a shoe with measurements from pressure sensors placed in the insole of that shoe. After performing human activity recognition, the result was fed to anEE model. The author showed that the footwear sensor fusion significantly reducedEE estimation errors in sedentary activities. This method, nevertheless, can only be used to track outdoor activities. Promising results were also achieved with the Bodymedia armband [119, 120]. The Bodymedia armband, which was worn on the upper arm, included sensors such as skin temperature, skin conductivity, heat flux, 3-axis acceleration, and air temperature. Again, human activity recognition was carried out first, and theEE was estimated subsequently using a regression algorithm. Unfortunately, the methods, such as fused sensors or details on the algorithm, were not disclosed. The described sensor fusion approaches required both human activity recognition andEE estimation, which adds to the complexity of the overall process. Instead, an indirect two-stepEE estimation is proposed here. First, by performing human activity recognition, the type and the duration of the activity is detected. Second, the value of the metabolic equivalent of task (MET) is used to determine the rate ofEE of the detected activity (see [121] for a description of the MET). Further, as demonstrated by Byrne et al. [122] and Kozey et al. [123], personal variations such as sex, age, height, and weight, can be largely accounted for using the Harris-Benedict equation in [124]. The personal information could be collected using a smartphone application questionnaire. A worldwide accepted source of a large range of MET values for physical activity, including different levels of intensity is the ”Compendium of Physical Activities” in [121].

3.2 Wearable Sensors for Human Activity Tracking

3.2.1 Accelerometer Usage in Human Activity Recognition Accelerometers are widely used to measure tilt (static acceleration), acceler- ation, shock (instantaneous acceleration), and vibration (periodic or random acceleration) [125, 126]. By measuring the static acceleration of multiple sen- sors on fixed body positions, the posture of a person can be recognized from 3.2. Wearable Sensors for Human Activity Tracking 29 the orientation of the sensors to Earth’s gravitational force (e.g., [19, 127]). Posture recognition is related to tilt sensing, of which a detailed descrip- tion is given in [128]. Measuring dynamic acceleration, on the other hand, provides information on the intensity, direction, and periodicity of human motion. The magnitude of the acceleration can be translated to the energy cost of an activity. This can be used to discriminate inactivity from motion (e.g., Mathie et al. [129]), or to separate high-intensity activities such as a fall of an elderly person from ADL (e.g., Bourke et al. [130] and Torrent et al. [11]). Some activities, such as elevator riding or a fall, show distinct acceleration patterns that can be detected (e.g., Abdelnasser et al. [40], Jia [131]). Elhoushi et al. [36] and Abdelnasser et al. [40] both used the verti- cal acceleration (acceleration axis in the direction of Earth’s gravity) to help separate activities that involve a vertical displacement: walking stairs, riding an elevator, or riding an escalator. This method, however, requires a fixed sensor position on the person’s body. Furthermore, activities may have a dominant frequency at which the movements reoccur. This frequency can be derived from the frequency domain of the acceleration signal. For example, P¨arkk¨aet al. [5] determined the frequency of walking from a chest-worn accelerometer in vertical direction as 2 Hz and that of running as 2.5 to 3 Hz.

Sensor Principle MEMS accelerometers are either piezoresistive or capacitive-type sensors [132]. Capacitive accelerometers offer a higher resolution compared to the piezoresistive-type, and are better-suited for low-frequency applications [133]. The sensing element of a capacitive-type accelerometer consists of two fixed outer plates attached to a substrate and an inner plate, which is part of the moving mass. The displacement of the mass due to acceleration is detected by a measurement circuit as a change in differential [132]. The design recommendations in [134] suggest placing the accelerometer close to hard mounting points of the printed circuit board (PCB) and to consider choosing thicker board material, which increases the rigidity of the PCB. This prevents errors occurring from undampened PCB vibration. The human activity tracker used in this thesis has the ultra-low power 3-axis digital capacitive-type accelerometer ADXL345 from Analog Devices, Inc. [134] installed. The operating range is adjustable and was set to ±16 g. Experiments in one of the students’ theses that were supervised [274] showed that, when worn on the wrist, the shock during the impact phase of a person falling exceeds accelerations of 12 g. This range is in agreement with findings of other researchers: Bouten et al. [77] determined ±12 g for ”body-fixed” sensors, or Ermes et al. [135] suggested a range of ±10 g with wrist-worn 30 3. Human Activity Recognition With a Wrist-Worn Activity Tracker

accelerometers for vigorous exercises. An output sample rate of 100 Sa/s was chosen to capture high-frequency activities. This rate is sufficient according to Bouten et al. [77], who observed frequencies of up to 20 Hz for daily physical activity. Ermes et al. [135] discovered, however, that a sample rate of 20 Sa/s was insufficient for a wrist-worn accelerometer during the activities running and Nordic walking. The typical sensitivity of the sensor is given as 3.9 mg/LSB, and depending on the axis, the typical noise at an output sample rate of 100 Sa/s is 0.75–1.1 LSB RMS. The sensor’s nonlinearity is ±0.5 %, its sensitivity change due to temperature is negligible, and its offset changes with the temperature depending on the axis by 0.4 to ±1.2 mg/K [134]. The ADXL345 sensor was connected with the human activity tracker using the Serial Peripheral Interface (SPI) interface.

Sensor Calibration Accelerometers can be subject to mechanical stress as a result of the assem- bly process (soldering and board mounting). The static stress affects the offset and the sensitivity of the sensor [128]. There exist various calibration methods to compensate for these effects after assembly. One simple method is to orientate each axis of the sensor to the +1 g and the -1 g field of gravity. This makes a total of six positions for a 3-axis accelerometer. Then, the offset for every axis can be calculated according to Fisher [128]:

~a + ~a ~a = +1g −1g , (3.2) OFF 2 where ~ais the acceleration vector. The sensitivity (scale factor) is found using [128] ~a − ~a ~s = +1g −1g . (3.3) 2 · 1 g The measurements are compensated by entering the offset and scale factor into [128] −1 ~aACT = (~aOUT − ~aOFF) ◦ ~s , (3.4) with ◦ denoting the Hadamard product for element-wise multiplication. A disadvantage of this method, however, is that it considers each axis sepa- rately. The board mounting and soldering paste may have shifted the sensor’s orientation in relation to the system. In this case, Fisher’s method assumes the sensor’s axis has lost sensitivity, which results in an overcompensating high scale factor. A more accurate method for a 3-axis accelerometer is to determine an alignment matrix such that at arbitrary positions the normalized acceleration 3.2. Wearable Sensors for Human Activity Tracking 31 values become [136] q 2 2 2 ax + ay + az = 1. (3.5) The device with the sensor is oriented to the gravitational force in six po- sitions as described earlier. The alignment matrix contains 12 calibration parameters and is obtained using least square approximation where

M = [W TW ]−1W TG. (3.6)

W is a matrix of the raw measurements from the six positions and G is a matrix of the known gravitational force for every position. Lastly, the compensated acceleration values are derived by   ~aACT = ax−OUT ay−OUT az−OUT 1 M. (3.7)

The sensor system in this thesis was oriented into six positions and cali- brated according to the 3-axis normalization method as described. Nonlin- earity and deviations due to changes in temperature were not investigated. However, all measurements were taken with the same human activity tracker and at moderate , which minimized errors resulting from non- linearity or temperature effects.

Signal Filtering Accelerometer signals are composed of the static gravitational force and dy- namic acceleration. The static component can be deducted by sending the acceleration signal through a highpass filter (HPF). Another effect of the HPF is that the sensor offset that was calculated in (3.2) or (3.6) is filtered out. For the cutoff frequency, values between 0.1 [77] and 0.5 Hz [19] are proposed by other researchers. In this work, a fourth-order elliptic function with a cutoff frequency of 0.25 Hz (0.5 dB passband ripple and 40 dB stop- band attenuation below 0.125 Hz) was designed, and the input data were processed by zero-phase digital filtering. The elliptic function was chosen as it minimizes the roll-off [137], which is helpful in preserving low-frequency activities. Drawbacks of an elliptic function are poor phase linearity and ripples in the passband and stopband [137]. The zero-phase digital filtering technique performs forward and reverse filtering, and with it, cancels the nonlinear phase response of the infinite impulse response filter. It also re- sults in a squared magnitude of the frequency response, hence 1 dB passband ripple and 80 dB stopband attenuation. Unfortunately, the filter becomes noncausal and cannot be employed in real-time applications [137] unless the accelerometer data are buffered and a delay in the output signal acceptable. 32 3. Human Activity Recognition With a Wrist-Worn Activity Tracker

Human motion is bounded to a specific frequency range that depends on the sensor position, activity, and physical condition of the person. Acceler- ation above this frequency range is generated by other sources. A lowpass filter (LPF) can eliminate or attenuate unnecessary noise. Typical cutoff frequencies of the LPF lie somewhere between 2.5 [20] and 20 Hz [77]. Using Fourier methods, in particular by computing a fast Fourier transform (FFT), measurements from the student thesis in [276] were converted into the fre- quency domain for spectrum analysis. Figure 3.1a shows the single-sided amplitude spectrum of one of the measurements performing the activity run- ning. The way the arms move during running repeats itself after certain periods of time. The peaks that can be seen in the figure illustrate the cycles in which the arm movements reoccur. Running is shown here because it sup- posedly comprises the periodicity with the highest frequency in the recorded set. To preserve most of the activity’s frequency components, the cutoff fre- quency of an LPF may be set somewhere between 15 and 20 Hz. The noise level of the ADXL345 accelerometer above this range can be considered low. However, as can be seen from Figure 3.1b, which depicts an exemplary mea- surement of the activity falling, the spectrum in this case is distributed over the entire frequency band. Because ”a fall” is one of the activities analysed in this work, an LPF was omitted.

3.2.2 Gyroscope Usage in Human Activity Recognition The angular velocity, also referred to as angular rate, can be measured with a gyroscope. If the angular rate is integrated over time, the angular change can also be determined. are often used togehter with magne- tometers to filter out magnetic interferences (e.g., [138]). The angular rate is given in units of degree per second (dps) and is also an indicator of human motion. Bourke et al. [139] used a 2-axis gyroscope located on the chest and determined thresholds on the angular rate, angular acceleration, and angu- lar change to discriminate a fall of an elderly person from ADL. The angle change is also used to recognize postural transitions of a person (e.g., [140]). However, only approaches that used a gyroscope as part of a sensor fusion were shown to discriminate between multiple activities (see Chapter 2.1).

Sensor Principle MEMS gyroscopes typically include a proof-mass that is driven into vibra- tion. When the sensor is rotated, the resonating mass undergoes a lateral de- 3.2. Wearable Sensors for Human Activity Tracking 33

4 0.15

[g] 3 [g] 0.1 | 2 | x x 0.05 A 1 A | 0 | 0 0 10 20 30 40 50 0 10 20 30 40 50

4 0.3

[g] 3 [g] 0.2 | 2 | y y 0.1 A 1 A | | 0 0 0 10 20 30 40 50 0 10 20 30 40 50

2 0.15

[g] 1.5 [g] 0.1 | | z 1 z 0.05 A 0.5 A | 0 | 0 0 10 20 30 40 50 0 10 20 30 40 50 Frequency [Hz] Frequency [Hz] (a) (b)

Figure 3.1: Single-sided amplitude spectrum of a 5 s acceleration measure- ment during: a) running and b) falling

flection as a result of the Coriolis force [125]. The deflection can be measured with a capacitive sensing structure and then translated to the angular rate. Because the proof-mass is also susceptible to linear acceleration, a mass pair is installed and oscillated in opposite directions to eliminate the acceleration that is not related to the angular motion [141]. MEMS gyroscopes naturally consume more power than MEMS accelerometers due to their driving mass. The low-power 3-axis digital angular rate sensor L3G4200D from STMi- croelectronics [142] was integrated into the human activity tracker used for this thesis. During the student thesis in [275], which used an earlier version of the wrist-worn activity tracker, angular rates of up to 718 dps were measured for the activity running and up to 1059 dps for a simulated fall. For com- parison, Leutheuser et al. [10] set an operating range of ±500 dps for their wrist-worn device, whereby the most physically demanding activities tread- mill running and rope jumping likely lead to lower angular rates than the activities studied in this work. Therefore, an operating range of ±2000 dps was chosen here. The output sample rate was set to 100 Sa/s as it captures high-frequency activities and is the lowest setting of the sensor. Higher out- put sample rates would only result in a higher noise level [143]. The typical 34 3. Human Activity Recognition With a Wrist-Worn Activity Tracker

sensitivity for the ±2000 dps measuring range is given as 0.07 dps/LSB, the √ noise density level for a 50 Hz signal bandwidth as 0.03 dps/ Hz [142], and the nonlinearity is approximately 0.3 %. The effect of temperature on the zero- rate level and sensitivity is negligible [143]. Data were transferred using the sensor’s SPI interface.

Sensor Calibration The L3G4200D gyroscope is calibrated for zero-rate level and sensitivity by the manufacturer [143]. However, as described in Chapter 3.2.1 for the ac- celerometer, MEMS gyroscopes are also exposed to mechanical stress from soldering and board mounting that can cause a shift of the zero-rate level [142]. In addition, a misalignment of the sensor with respect to the overall system leads to changes in sensitivity [143]. The calibration of a 3-axis gy- roscope can be performed using the method of least squares as in [143]. The calibration procedure, however, was skipped because it required a step-motor spin table and because it was expected to improve results only slightly when using a single human activity tracker. Instead, the human activity tracker was simply placed at rest to determine the offset for each of the three axes. The offset-compensated gyroscope values are

~ωACT = ~ωOUT − ~ωOFF, (3.8) with ~ωas the angular rate vector for the three axes. Other errors can occur due to nonlinearity or due to temperature changes affecting the zero rate level and sensitivity. The calibration of these ef- fects are not part of this thesis, but according to [143], the nonlinearity of the L3G4200D gyroscope and the temperature effects are largely negligible. Measurements were taken with a single human activity tracker at moderate temperatures, which minimized any errors coming from nonlinearity or the temperature dependency. The L3G4200D gyroscope includes a temperature sensor, which could be used for temperature compensation in future work if necessary.

Signal Filtering The frequency range of human motion depends on the sensor’s position, activity, and physical condition of the person. Noise recorded outside the frequency range of human motion can be deducted or attenuated by an LPF. Researchers who used gyroscopes in human activity recognition reported a wide range of cutoff frequencies, from 17 Hz in [140] to 100 Hz in [139]. The 3.2. Wearable Sensors for Human Activity Tracking 35

100 40 75 30 [dps] 50 [dps] 20 | |

x 25 x 10 Ω Ω | | 0 0 0 10 20 30 40 50 0 10 20 30 40 50

500 40 375 30 [dps] 250 [dps] 20 | |

y 125 y 10 Ω Ω | 0 | 0 0 10 20 30 40 50 0 10 20 30 40 50

900 60 600 45 [dps] [dps] 30 | | z 300 z 15 Ω Ω | | 0 0 0 10 20 30 40 50 0 10 20 30 40 50 Frequency [Hz] Frequency [Hz] (a) (b)

Figure 3.2: Single-sided amplitude spectrum of a 5 s angular rate measure- ment during: a) running and b) falling frequency spectra of the gyroscope measurements from [276], for which ex- amples are shown in Figure 3.2, revealed that activities such as running can be lowpass-filtered at around 20 Hz. However, similar to the accelerometer measurements shown in Chapter 3.2.1, the recordings of the angular rate during the activity falling extended over almost the entire frequency band. An LPF was therefore not implemented here.

3.2.3 Magnetometer Usage in Human Activity Recognition are generally used to measure the direction and strength of the Earth’s magnetic field. To obtain a navigation system’s tilt-compensated orientation, a 3-axis magnetometer can be fused with a 3-axis accelerometer [144]. Magnetic field sensors are also used in conjunction with a gyroscope to compensate for the integration drift of the angle estimate. However, mag- netic interferences from other sources than Earth’s magnetic field cause errors on the estimated orientation. Conversely, the gyroscope can be used to de- tect and minimize the effect of external magnetic disturbances [138]. With 36 3. Human Activity Recognition With a Wrist-Worn Activity Tracker respect to human activity recognition, the magnetic interference can also serve as an indicator of specific activities. Bahle et al. [25] used the mag- netic field distortions to discriminate various activities performed on gym machines. Abdelnasser et al. [40] observed that the motor of an escalator generates a high variance on the measured magnetic field strength and used this as a feature to discriminate riding an escalator from a person at rest. Other activities in the proximity of an external magnetic field, such as riding an elevator or riding a vehicle, may be detected in a similar manner. Mag- netometers can also be used to discern activities based on human motion. P¨arkk¨aet al. [5] described that during physical activity the magnetometer signals appeared like lowpass-filtered accelerometer signals. To date, magne- tometers have been reported in human activity recognition only as part of sensor fusion approaches (see Chapter 2.1).

Sensor Principle Magnetic field sensors included in integrated circuits are most commonly based on the Hall effect or the magnetoresistive effect. A Hall effect sensor consists of an electrical device that carries a continuous current. In the presence of a magnetic field perpendicular to the direction of the flow, become deflected by the Lorentz force. The resulting Hall voltage is proportional to the magnitude of the magnetic field [125]. The magnetoresistor also uses the Hall effect, but it measures the resistance of the device instead of the voltage [133]. In the human activity tracker of this thesis, the low-power MAG3110 digital 3-axis magnetometer from Freescale Semiconductor, Inc. [145] was installed. The sensor offers an Inter-Integrated Circuit (I2C) communication µ interface, an operating range of ±1000 µT, and a sensitivity of 0.1 T/LSB. Although Earth’s magnetic field ranges only from 22 to 67 µT, a greater range is required to capture hard- and soft-iron effects [146]. The output sample rate was set to the maximum of 80 Sa/s, for which the noise was given as 0.14 µT RMS. Typical nonlinearity is listed as 0.3 %, the maximum hysteresis as 1 %, sensitivity due to temperature as 0.1 %/K, and offset change µ due to temperature as 0.01 T/K [145].

Sensor Calibration Magnetometers are sensitive to Earth’s magnetic field as well as to mag- netic fields generated by other PCB components in the vicinity of the sensor. The magnetic disturbances are classified as either permanent hard-iron or induced soft-iron effects. Hard-iron magnetic fields are produced by perma- 3.2. Wearable Sensors for Human Activity Tracking 37 nently magnetized ferromagnetic components or by electrical currents flow- ing through the PCB or within coils. They add a constant value to the sensor reading. The hard-iron offset can be minimized by careful component selection and magnetometer placement. Typically, this means placing the magnetometer on the edge or at the corner of the PCB away from all hard- iron sources [146]. Because in most cases hard-iron effects cannot be avoided completely, a compensation as in [147, Ch. 6] can be performed. It requires taking a series of measurements and to fit calibration parameters in a least square approximation. A simpler approach is to rotate the sensor system in a circle (or a sphere for 3D) and to determine the origin of the circle by taking the mean value of the maximum and minimum for each axis [148]. The origin can also be found by calculating the centre of an ellipsoid fit as in [147, Ch. 4]. In the student thesis [276] that was supervised, the ellipsoid method was implemented. The ellipsoid fit was realized with the MATLAB program from Petrov [149]. However, for this thesis, a new measurement was conducted in a low-noise environment. The soft-iron distortion describes a deflection of Earth’s magnetic field. It is generated by the induction of a magnetic field into otherwise unmagne- tized ferromagnetic materials. Unlike the hard-iron effect, soft-iron distortion varies with respect to the orientation of the device to Earth’s magnetic field [146]. The calibration, which involves fitting measurements onto the surface of an ellipsoid, is described in [147]. The ellipsoid fit is used to determine a calibration matrix that transforms the magnetometer measurements from the surface of an ellipsoid to the surface of a sphere. For this thesis, the 3D soft-iron compensation was performed using program code developed in [276] and in [149]. Figure 3.3 depicts the measurement from the low-noise envi- ronment before and after compensation. The hard-iron effect can be easily discerned from the axis labels, whereas the soft iron distortion is smaller and indicated by a slightly elliptic shape. Nonlinearity, sensor misalignment, hysteresis effects, and temperature de- pendency were not studied in this work. However, nonlinearity and mis- alignment errors were minimized because the measurements were conducted with a single human activity tracker. Also, the MAG3110 magnetometer is factory-calibrated for sensitivity, offset, and temperature. It further includes a temperature sensor for automatic compensation [145].

Signal Filtering Apart from the hard- and soft-iron noise generated by nearby PCB compo- nents, external magnetic interference is created from various objects in the environment (e.g., from the metal frame of a car). If the external magnetic 38 3. Human Activity Recognition With a Wrist-Worn Activity Tracker

40 260 260 10 230 230 T] T] T] µ µ µ [ -20 [ 200 [ 200 z z y B B B -50 170 170 -80 140 140 60 90 120 150 180 60 90 120 150 180 -80 -50 -20 10 40 Bx [µT] Bx [µT] By [µT] (a)

60 60 60 30 30 30 T] T] T] µ µ µ [ 0 [ 0 [ 0 z z y B B B -30 -30 -30 -60 -60 -60 -60 -300 30 60 -60 -300 30 60 -60 -300 30 60 Bx [µT] Bx [µT] By [µT] (b)

Figure 3.3: Hard- and soft-iron effects: a) raw magnetometer data and b) hard- and soft-iron compensated magnetometer data

field is static, the disturbance can be deducted using an HPF. However, highpass-filtering also deducts Earth’s magnetic field, and the magnetic dis- turbances actually may be used as indicators for some activities. Because in this thesis sensor fusion is investigated, and the detection of activities such as cycling and riding an elevator are analysed, it is expected that the magnetometer provides more information gain without the HPF.

By performing spectrum analysis, minor high-frequency noise was dis- covered in the magnetometer data from [276]. Figure 3.4 shows an example where high-frequency noise was detected during a measurement of the activ- ity walking. To remove the high-frequency noise, an LPF with a tenth-order Chebyshev Type II function and zero-phase filtering was implemented (see Chapter 3.2.1 for the zero-phase filter). The cutoff frequency was set at 15 Hz (0.2 dB passband attenuation and 40 dB stopband attenuation above 18 Hz). A Chebyshev Type II function was chosen to obtain a sharp transition and flat passband [137]. 3.2. Wearable Sensors for Human Activity Tracking 39

20 0.3 T] T] µ 15 µ [ [ 0.2 | | 10 x 5 x 0.1 ˆ ˆ B B | 0 | 0 0 10 20 30 40 50 15 17 19 21 23 25 Frequency [Hz] Frequency [Hz] (a) (b)

Figure 3.4: Single-sided amplitude spectrum of a 5 s magnetic field measure- ment during walking: a) entire frequency range and b) selected frequency range showing high-frequency noise

3.2.4 Barometer Usage in Human Activity Recognition Barometers measure the atmospheric pressure and are frequently used to detect weather changes or to determine altitude (also called altimeters). Re- cently, researchers demonstrated the use of barometers in indoor navigation for detecting floor transitions [150, 151, 152, 153]. Barometers have also been utilized to make inferences about human activities that involve changes in height, such as walking stairs, riding an escalator, or riding an elevator (e.g., Lester et al. [21, 22], Rulsch et al. [23], Elhoushi et al. [36], Muralidha- ran et al. [152], Ye et al. [153], or Vanini et al. [154]). For a few years now, low-noise barometers have been available that allow detecting height differences as small as 0.25 m [155]. With these sensors, it would not only be possible to recognize activities such as climbing stairs, which make up height differences of about 2.5 m per floor, but also smaller height differences such as those measured during a fall when wearing the sensor on the wrist. With the current state of the art, even a root mean square (RMS) noise of approximately 0.1 m [156] is possible. Human activities may be classified either directly by the measured atmo- spheric pressure or after converting to altitude using the barometric formula [157]: 288.15   p 1/5.25577 h = 1 − , (3.9) 0.0065 101325 Pa where p is the measured air pressure. It has to be noted that the abso- lute altitude is not an accurate measure because the air pressure includes weather-induced deviations. These deviations can reach tens or even hun- dreds of meters [158]. However, changes in weather conditions usually occur in larger time frames, and by using the relative altitude difference in the 40 3. Human Activity Recognition With a Wrist-Worn Activity Tracker recognition of human activities, errors in the absolute value can be largely ignored. Noteworthy is an analysis of the effect of varying environmental conditions in [154]. In this thesis, altitude or height is used simply for clarity and will be replaced by air pressure in the final version of the classification system to save computing time.

Sensor Principle Barometric pressure sensors based on MEMS technology are mostly piezore- sistive absolute pressure sensors. They contain a hermetically sealed vacuum reference chamber on the back side of a circular silicon diaphragm and four piezoresistors connected in a Wheatstone bridge. The atmospheric pressure on the top of the sensor forces the diaphragm to bend, which causes a change of resistance that is proportional to the air pressure [133]. Different types of pressure sensors can be built using MEMS technology, whereby the ca- pacitive measurement principle is common in addition to the piezoresistive [132]. To ensure the accurate operation of the barometer, the system requires appropriate ventilation of the sensor, distance from nearby heat sources, as well as avoiding contact with liquids and light [155]. The human activity tracker in this thesis is equipped with the BMP180 ultra-low power capable piezoresistive high precision digital pressure sensor from Bosch Sensortec GmbH [155]. The barometric pressure sensor includes a temperature sensor and anI 2C interface. It offers an operating range of 30–110 kPa, which translates to a height of +9 000 to -500 m around sea level. The ultra-high resolution mode was selected as a trade-off between speed (output sample rate of approximately 33 Sa/s when sensing pressure and temperature) and accuracy. The RMS noise is given as 3 Pa or 0.25 m for the ultra-high resolution mode. An advanced resolution mode, which uses oversampling, reaches an RMS noise of 0.17 m. But the output sample rate of this mode is reduced to approximately 12 Sa/s [155], which may be too slow for human activity recognition. Nevertheless, oversampling techniques can also be implemented in the microcontroller of the human activity tracker or on a PC during evaluation.

Sensor Calibration Although the absolute air pressure value can shift for a number of reasons (mechanical stress, a thermal mismatch between the sensor chip and the packaging material [132], output drift with time, or laser trimming tolerances [133]), this has little effect on the results because in human activity recogni- tion only the relative air pressure difference is taken. Also, the BMP180 air 3.2. Wearable Sensors for Human Activity Tracking 41

288 Raw 286 sgolayfilt order = 1 284 sgolayfilt order = 6 [m] 282

h 280 278 276 012345 Time [s] Figure 3.5: Altitude estimation using the barometric pressure sensor during running and with Savitzky–Golay filtering pressure sensor is factory-calibrated for offset and temperature. The compen- sation algorithm from [155], which further instructs temperature-dependency compensation, was implemented in the microcontroller of the activity tracker.

Signal Filtering The measured total air pressure consists of the static pressure (as part of the atmospheric pressure) and the dynamic pressure induced by human mo- tion or caused by air moving against the sensor’s surface. The difficulty in detecting human activity lies in the large amount of noise in the signal. Mea- surements with the BMP180 barometer at rest showed short-term (10 s time window) deviations from the mean value of roughly up to ±0.9 m (sample standard deviation σ = 0.3 m). Assuming the noise is white noise [159], one solution is to apply a moving average filter. Although, this method works for some activities (e.g., inactivity), the periodic signal of an activity such as running becomes distorted by the averaging. A better solution is to use a Savitzky–Golay filter that preserves the high-frequency components of the signal. The Savitzky–Golay filter is a digital filter that fits a polynomial on a set of fluctuating data using least square approximation [160]. Experi- ments with the measurements from [276] showed that a low polynomial order (order = 1 is a moving average) on a time window of 990 ms (here 33 samples) works well for inactivity, but only a high polynomial order (order = 6) on a time window of 450 ms (here 15 samples) preserves the high-frequency infor- mation of activities such as running (see Figure 3.5). One disadvantage of the Savitzky–Golay filter is that it is not designed for real-time applications. The idea to use a barometric pressure sensor for human activity recogni- tion was always to detect and measure height differences. Apart from this, human-induced pressure fluctuations may additionally help to discriminate physical activity. However, since the dynamic air pressure is complemen- tary, the height difference may become buried in the signal. This becomes 42 3. Human Activity Recognition With a Wrist-Worn Activity Tracker

283 Raw 282 LPF

[m] 281 h 280 279 012345 Time [s] Figure 3.6: Altitude estimation using the barometric pressure sensor during ascending stairs and with an LPF particularly clear when looking again at Figure 3.5. The height changes, which result primarily from variations in dynamic pressure during running, are about 8 m. For comparison, static pressure differences of only 2.5 m (per floor) are expected during stairs climbing. Therefore, to better infer the height difference, a copy of the original signal was taken, and an LPF was applied close to the static pressure to cancel out human-induced pressure changes. A fifth-order Chebyshev Type II function with a cutoff frequency of 0.125 Hz (0.5 dB passband attenuation and 40 dB stopband attenuation above 0.25 Hz) and zero-phase filtering was implemented (see Chapter 3.2.1 about zero-phase filtering). An example of how the filter works on the mea- surement data is given in Figure 3.6. Both the Savitzky–Golay filtered signal and the lowpass-filtered signal are analysed in this thesis.

3.2.5 Other Wearable Sensors Sensors that measure physiological signals of a person, most prominently heart rate sensors, can be employed for human activity recognition. Heart rate can be measured either by electrocardiography as a chest strap or on the wrist using state-of-the art photoplethysmography (PPG) technology. Optical wrist-worn solutions, however, are known to be inaccurate during moderate and intense activities [161]. For sports, there are now armbands such as the Polar OH1 [162], which are based on PPG and offer in intense activities better stability than wrist-based solutions. In general, the heart rate increases with the intensity of the physical activity, but it changes slowly and this can lead to misclassifications at the beginning or at the end of an activity [5, 113]. P¨arkk¨aet al. [5] described that physiological signals such as heart rate also vary largely between subjects. In the works of Reiss et al. [9] and Lara et al. [163] it was said that the ability to estimate the intensity of physical activities with heart rate sensors helps to discriminate activities such as walking, ascending stairs, and descending stairs that are otherwise 3.2. Wearable Sensors for Human Activity Tracking 43 difficult with accelerometers. Other vital sign sensors include measuring skin conductivity (reflecting the amount of sweat from the skin) [120], heat flux sensors (rate of heat dissipation from the body) [120], and respiratory rate sensors as in [5], [163], or [118]. Environmental sensors for human activity recognition (other than the barometric pressure sensor described in Chapter 3.2.4) are sound and light sensors. Sound is typically recorded with a microphone and can be used to recognize activities involving speech [164,5]. However, Foerster et al. [164] observed that speech is not a continuous signal and is also present during other activities. In [21, 22], various physical activities were classified with the help of statistical features extracted from a sound sensor. Other researchers [165, 166] focused on detecting activities by classifying noise from mechanical tools or electrical appliances rather than detecting human-induced sound. Although recording sound and speech is intrusive, restricting the system to record only the sound level as in [164] may represent a compromise in privacy. Photodetectors that measure the intensity of light were used in various human activity recognition sensor fusion approaches (e.g., [21, 22,5, 167]). An example illustrating the use of light sensors would be that a low light intensity is a strong indication of a person sleeping. However, the practicality of light sensors is often limited as the sensors can be easily obscured by clothing or when the device is carried in a pocket [22]. Smart textile sensors for human activity recognition are based on various physical properties: the amount a fabric sensor is stretched is proportional to its electrical resistance [88], or weight-bearing activities are detected by a smart shoe that has a pressure sensitive insole [108, 109, 105]. The advantage of textile sensors lies in their nonintrusive character, while their disadvantage is that they are limited in their applications. The smart shoe, for example, can only record outdoor activities. Positioning of persons can be accomplished using satellite receivers for navigation systems (to name one of many methods), such as the Global Po- sitioning System (GPS). When differentiated, the GPS data lead to the velocity at which a person moves. This can be used to discriminate inactiv- ity, walking, running, riding a bicycle, or a motorised transportation [168]. However, the main use of positioning in human activity recognition is for con- text awareness (e.g., Riboni and Bettini [169]). For instance, a person that was located at the gym may be performing exercise. Other activities such as sleeping, watching TV, or cooking can be ruled out as they are typical to the person’s home environment. The main disadvantage of positioning devices is their large power consumption (compared to ultra-low power sensors such as accelerometers) [168]. Also, the person’s privacy may be violated when tracked. 44 3. Human Activity Recognition With a Wrist-Worn Activity Tracker

Figure 3.7: Human activity tracker with a wristband

3.3 Human Activity Recognition System

3.3.1 System Overview The 10-axis human activity tracker demonstrator was developed as part of a series of student theses that were supervised by the author of this thesis [272, 274, 275, 276]. The activity tracker, which is shown in Figure 3.7, includes a 3-axis accelerometer, a 3-axis gyroscope, a 3-axis magnetometer, and a barometric pressure sensor. The directions of the sensor axes when the device is worn on the left wrist are shown in Figure 3.8. With a weight of only 25 g (the wristband is 11 g), the human activity tracker is lightweight and can be worn on the wrist, the upper arm, the lower leg, or the thigh. In a human activity recognition system, as depicted in Figure 3.9, the ac- tivity tracker acquires the acceleration, angular rate, magnetic field strength, and barometric pressure and stores the measurements in a comma-separated values (CSV) file on a micro Secure Digital High Capacity (microSDHC) card. The measurements from the CSV file are analysed on a PC by a human activity recognition algorithm. The algorithm performs data preprocessing, feature extraction, feature selection, and classification. At a later time, it is intended to integrate a low-power version of the human activity recognition algorithm into the microcontroller of the tracker or to add a wireless commu- nication interface and perform human activity recognition in a cloud-based system that offers more computational power.

3.3.2 Hardware Setup The central control unit of the human activity tracker is the 16-bit micro- controller MSP430F5438A from Texas Instruments Incorporated [171]. The 3.3. Human Activity Recognition System 45

a z

ω z a y / B y ω y

ω x

B a x / B x z

p

Figure 3.8: Coordinate system of the human activity tracker [170]

Human Activity Human Activity Tracker Recognition Preprocessing 3-axis Accelerometer

3-axis Gyroscope CSV Feature File Extraction 3-axis Magnetometer Feature Barometer Selection

Classification

Figure 3.9: Block diagram of the human activity recognition system 46 3. Human Activity Recognition With a Wrist-Worn Activity Tracker

(a) (b)

Figure 3.10: Assembled PCB of the human activity tracker: a) top side (dimensions are 39.8 mm × 29.9 mm) and b) bottom side microcontroller communicates with the accelerometer ADXL345 and the gy- roscope L3G4200D each on a separate SPI bus, while the magnetometer MAG3110 and the barometer BMP180 each transfer their data to the micro- controller on one of theI 2C buses. A microSDHC card, type SDSDQ-004G- E11M from SanDisk Corporation, is used to store the measurements that are received on another SPI bus. The human activity tracker is a low-power design powered by a lithium polymer battery from Round Solutions GmbH & Co. KG [172]. The battery has a nominal voltage of 3.7 V and a capacity of 450 mAh. The average power consumption of the tracker is only 30 mA at a supply voltage of 3.3 V [276], but hardware and software optimizations can further reduce power consumption. In Figure 3.10, the assembled PCB is shown. The schematic and the board layout are given in Figures A.1 through A.3 and the mechanical drawings of the housing in Figures A.4 and A.5.

3.3.3 Software Description The program code of the human activity tracker was specially developed for the acquisition of sensor data at high speed. The main function, which is depicted in Figure 3.11 on the left, begins with the initialization of its vari- ables and internal hardware devices. Part of the microcontroller’s memory is reserved as a double buffer, where each buffer can hold up to 512 byte of sensor data. If one of the two buffers is full, the microcontroller stores the data of the full buffer in a CSV file. In the meantime, the other buffer can receive new data. The actual sensor data are retrieved via a timer interrupt, which pauses the main function at regular intervals (see Figure 3.11 on the right). The in- terrupt handler is programmed to retrieve the accelerometer, gyroscope, and magnetometer readings every 10 ms and the air pressure from the barometer every 30 ms. The sensor values are then written to the currently available 3.3. Human Activity Recognition System 47

Main Function Timer Interrupt

Interrupt Start every 10 ms

get sensor values initialize - acceleration - angular rate - magnetic field

buffer 1/2 full no 30 ms no interval yes save from full buffer yes to CSV file get sensor values - air pressure

write to free buffer 1/2 and exit interrupt

Figure 3.11: Program flow of the human activity tracker buffer. It should be noted that the mentioned magnetometer actually has a maximum output sample rate of 80 Sa/s. Therefore, every fifth sensed value remains at its previous value. Furthermore, an air pressure offset and tem- perature compensation is performed (as in [155]), which was not shown here for ease of explanation. Further details on the program code can also be found in the student thesis in [276]. 48 3. Human Activity Recognition With a Wrist-Worn Activity Tracker

Table 3.1: Activity Set, Abbreviations, and MET Values [121]

Activity Abbreviation MET sitting, arms rested sit 1.3 walking, firm surface walk 2.8–8.3 ascending stairs ascend 4.0–8.8 descending stairs descend 3.5 jogging jog 7.0 running run 6.0–23.0 riding an elevator moving up-/ downwards elev. up/ dn 1.31 cycling cycle 7.5 falling fall NA

3.4 Data Collection

3.4.1 Activity Set Once the set of human activities is established, the recognition system is designed to match that particular set of activities. Adding or removing ac- tivities to the set later would significantly change the performance of the system. This makes it difficult, among other factors such as the measure- ment conditions during recording, to argue that one solution is more accurate than the other. For the sake of simplicity, however, activities that are related in some way can be arranged in groups according to the definitions given by Ainsworth et al. [121] or according to Lara and Labrador [173]. Evaluations in this thesis are based on measurements recorded during the course of a student thesis [276] and a student internship [279]. The activities, their abbreviations, and their MET values are given in Table 3.1. Sitting can be also referred to as ”inactivity” due to the lack of movement in this case. Elevator riding covered a distance of three floors. ”A fall” was only simulated in which healthy subjects walked a series of steps and then fell frontally onto a 50 mm thick crash mat. Typically, it is elderly people who are at risk of a fall, and they are unable to support themselves during the impact. The signal pattern of a fall by an elderly person is likely different from the simulation. However, it is not possible to collect these data unless recorded during a real-life situation. Sitting (or inactivity in general) is considered a static activity, during which the sensor signal is constant. The other activities are dynamic activi- ties, of which walking, ascending and descending stairs, jogging, running, and

1Code 16016: riding in a bus or train 3.4. Data Collection 49 cycling are cyclic activities that are characterized by reoccurring patterns in the signal. Riding an elevator and falling are non-cyclic movements.

3.4.2 Participants

Human activity recognition that uses supervised learning techniques requires training data. Due to personal variations, such as sex, age, height, weight, or personal fitness, individuals perform activities more or less differently. The best result is achieved if one learning model is created for each individual. However, it may not be practical to collect training data from each person: patients can be uncooperative, consumers have privacy concerns, or individ- ual training is simply too time-consuming. Building one model that fits all subjects is also not an optimal solution because it is likely to fail perfor- mance requirements. Lara and Labrador [173] proposed a compromise of both methods, where subjects with similar characteristics are organized in groups. This leads in a considerably smaller number of learning models and persons who need to be involved in the training. In this way, the subjects who participated in the measurements used in this thesis were categorized into one group. The group is characterized by young age (22–31) and general fitness. In a real-world application, the human activity recognition system could include a questionnaire that chooses its classifier based on the submit- ted data (e.g., sex, age, weight, height, fitness). The questionnaire could be implemented as a smartphone application or similar. The set of activities described earlier were performed during [276] by three male subjects at the age of 24–29 (in the following the participants are referred to as A, B, and C). The activities ascending and descending stairs were performed again during [279] by participant B at the age of 31 and additionally by a 22-year old female subject (participant D). All subjects were at good health, that includes that none of the participants were overweight or such that may have increased the intensity of the activity. The participants wore the human activity tracker on the wrist of the non-dominant hand, the same way they would wear a watch. Three of the participants were right- handed and thus carried the device on their left, and one participant was left-handed and wore the tracker on the right. This approach differs from the majority of attempts by other researchers (e.g., [19,8, 113,9]), who instructed the participants to wear the device on their wrist of the dominant hand. Depending on the activity or personal behaviour of the subjects, it can be assumed that the measured values differ between both positions. In particular, activities that are only carried out with the dominant hand, such as brushing teeth, are unlikely to be recorded on the non-dominant side. 50 3. Human Activity Recognition With a Wrist-Worn Activity Tracker

Table 3.2: Number of Measurements per Activity and Participant

Participant (sex, age at measurement) Activity A (M,24) B (M,29/31) C (M,25) D (F,22) A–D sit 5 5 5 0 15 walk 5 5 5 0 15 ascend 5 9 5 16 35 descend 5 9 5 16 35 jog 5 5 5 0 15 run 5 5 5 0 15 elev. up 5 5 5 0 15 elev. dn 5 5 5 0 15 cycle 5 5 5 0 15 fall 5 5 5 0 15 Total 50 58 50 32 190

3.4.3 Dataset In total, 190 activity samples with a duration of about 10 to 60 s were recorded in 2013 and 2015 (see Table 3.2). The activities sitting, ascend- ing stairs, descending stairs, and riding an elevator were performed indoors in an office building. A fall was simulated inside a sports hall, whereas walk- ing, jogging, running, and cycling were performed outdoors on a sports field. Ascending and descending stairs included each a total of 35 measurements and four instead of three participants. This resulted in a more balanced dataset, but also in a greater spread of sensor values, increasing the difficulty of discriminating the activity from others. The ground truth was annotated by an observing person.

3.5 Human Activity Recognition Algorithm

3.5.1 Data Preprocessing The CSV file containing the measurements of the human activity tracker (see Chapter 3.3.3) is processed on a PC using a program written in GNU Octave version 4.0.0. The accelerometer data is scaled according to the datasheet [134], calibrated for offset and sensitivity, and its signals’ gravita- tional components are removed by highpass-filtering as described in Chap- ter 3.2.1. Measurements from the gyroscope are scaled as specified in the datasheet [142] and offset-compensated as described in Chapter 3.2.2. Hard- and soft-iron compensation of the magnetometer data was implemented as 3.5. Human Activity Recognition Algorithm 51 covered in Chapter 3.2.3. The compensated magnetic field measurements are then scaled according to the datasheet [145] and passed through an LPF as described in Chapter 3.2.3. Duplicates of the barometric pressure signal are created, where one data vector is sent through a Savitzky–Golay filter and the other through an LPF (see Chapter 3.2.4). Afterwards, both filtered air pressure measurements are converted to altitude as in (3.9).

3.5.2 Feature Extraction Feature extraction transforms the measurement data into a set of features. By deriving only the relevant information, the classification task can be solved more efficiently. The features described in the following were extracted using GNU Octave version 4.0.0.

Range The range is a measure of spread for a set of measurements. It calculates the difference between the highest and the lowest value:

n n R = max(x(i · ∆t)) − min(x(i · ∆t)), (3.10) i=1 i=1 where x(t) denotes the raw measurement value at time t,∆ t is the time between sensor readings as described in Chapter 3.3.3, and n is the number of measurement samples in the set. The range feature determines the maximum amount of variation in a measurement set. One drawback, however, is that it is sensitive to outliers.

Sample Standard Deviation The standard deviation is another statistic that measures the variability for a set of measurements. It is also expressed as the square root of the variance, but the advantage of the standard deviation over the variance is that it is easier to illustrate because its unit is identical to the input data. The sample standard deviation takes into consideration that only a sample of the whole population is used, such as a set of discrete measurements. It is formulated as v u n u 1 X σ = t (x(i · ∆t) − µ)2, (3.11) n − 1 i=1 where µ is the arithmetic mean value of the measurement set. Unlike the range feature, the sample standard deviation describes the average distance to the mean value and is less affected by outliers. 52 3. Human Activity Recognition With a Wrist-Worn Activity Tracker

Zero Crossings The zero crossings of unbiased sensor data can be counted to discriminate slow movement activities, such as walking, from fast movement activities, such as running [174]. This applies here to the high-pass filtered acceleration and angular rate measurements, which both oscillate around zero. The zero crossings feature cannot be used on the magnetometer because of its direc- tional dependence to Earth’s magnetic field. The high amount of noise in the barometer data also makes it infeasible for this sensor. Zero crossings appear when

ZC(i) = 1 for (x(i · ∆t) · x((i + 1) · ∆t)) ≤ 0, (3.12) = 0 for (x(i · ∆t) · x((i + 1) · ∆t)) > 0.

At the end, the zero crossings are counted:

n−1 X ZCS = ZC(i). (3.13) i=1

Dominant Frequency The periodic structure of cyclic activities, such as walking, can be determined by Fourier analysis. The first feature that was extracted is the dominant frequency fmax at which the amplitude of the frequency spectrum is at its highest: N/2 S(fmax) = max (S(i · ∆f)) . (3.14) i=0 S is the single-sided amplitude spectrum defined as [175, 137]:

S(i · ∆f) = 2/N · |X(i · ∆f)| for i = 1 to (N/2) − 1, (3.15) = 1/N · |X(i · ∆f)| for i = 0 and N/2.

The number of frequency bins of the single-sided spectrum goes from 0 (DC component) to N/2 (Nyquist frequency). X(f) denotes the discrete Fourier transform of signal x(t), and∆ f is its frequency interval. Typically, the Fourier transform is calculated by an FFT. As a second feature, the ampli- tude at the dominant frequency was extracted. The frequency-domain features were extracted from the accelerometer and the gyroscope measurements (in the former, after removing the gravita- tional component by the HPF). The features were not extracted from the magnetometer and barometer data because of their strong DC components (Earth’s magnetic field and the static air pressure, respectively). Moreover, 3.5. Human Activity Recognition Algorithm 53 the magnetic field measurements have a strong dependency on the orienta- tion of the tracking system to Earth’s magnetic field. It should be further noted that frequency-domain features are associated with a relatively high computational cost. Fourier analysis is a powerful method for motion signals with a mere periodic structure. However, for frequency components that are closely lo- cated in time, as for example during transitions of different activities, the wavelet transform [176] that performs time-frequency analysis may be more effective. A number of researchers have extracted wavelet transform features from accelerometer signals for human activity recognition [177, 178, 179], but they did not reach a consensus on the effectiveness of wavelet transform as opposed to separate time- and frequency-domain features [179].

Energy The energy of a measurement set is defined in the time domain as [180]

n X 2 E = (x(i · ∆t)) . (3.16) i=1 Because the time and frequency domain both represent the same signal, energy can be also derived in the frequency domain according to Parseval’s theorem [180]: N−1 1 X E = (X(i · ∆f))2. (3.17) N i=0 For unbiased sensor data, the energy differs from the variance only by the normalizing factor (and additionally by the square root from the standard deviation). By assuming the high-pass filtered acceleration and angular rate measurements to be unbiased (zero mean), the energy feature becomes highly redundant and was therefore not used here. In addition, energy is not a good feature for the magnetometer because it depends more on the orientation of the person to Earth’s magnetic field than on signal changes resulting from the activity. Energy cannot be calculated from the barometer measurements because the absolute value of the measured air pressure is inaccurate (see Chapter 3.2.4).

Power Spectrum Entropy In some cases, the energy feature leads to similar values for different activities. Then other methods, such as calculating the power spectrum in two different frequency bands [23] or estimating the power spectrum entropy, are better 54 3. Human Activity Recognition With a Wrist-Worn Activity Tracker suited. The latter, the power spectrum entropy, reflects the signal’s structure in the frequency spectrum. For the calculation, the power spectrum is first estimated using methods such as the periodogram and FFT[175, 181]: 1 P (i · ∆f) = |X(i · ∆f)|2, i = 0, 1,...,N − 1. (3.18) N The power spectrum is then normalized through [181]

P (i · ∆f) P (i · ∆f) = , (3.19) n PN−1 i=0 P (i · ∆f) and its entropy is obtained using [181]

N−1 X H = − Pn(i · ∆f) · ln (Pn(i · ∆f)). (3.20) i=0 Power spectrum entropy has already been used successfully in human activity recognition with accelerometers [8, 182, 179, 112]. In particular, the discrimination of cycling from running on a hip-worn device [8] and cy- cling from walking and running on a device attached to the ankle [182] was demonstrated. A disadvantage of the power spectrum entropy feature is the relatively high computational cost due to the discrete Fourier transform calculation as described earlier.

Cross-Correlation Coefficient The linear relationship between a pair of measurement sets can be determined by cross-correlation. Correlation may exist between measurements taken at different times, between sensors placed at different parts of the human body, or between the dimensions of a multidimensional sensor. The cross- correlation coefficient normalizes the result to values from -1 to +1 and is defined as [183]: Pn 1 i=1 (x1(i · ∆t) − µ1)(x2(i · ∆t + τ) − µ2) r12 = , (3.21) n − 1 σ1σ2 where τ stands for the delay time of a circular shift. One way to detect human activities is to cross-correlate the current mea- surement set with previously stored data in an attempt to associate the new recording to one of the known activities (e.g., [18]). Because the measure- ment set pair may have been recorded during different stages of an activity, one set is time shifted such that their starting points correlate, and their 3.5. Human Activity Recognition Algorithm 55 cross-correlation coefficient is maximized. In this thesis, for every activity the first measurement set of participant A was taken as the template set and the remaining as test sets. In general, the choice of the template signal is crucial and the results will differ for other template sets. This becomes even more relevant when comparing data from different participants. One disadvantage of the cross-correlation feature is a high computational cost, in particular when a large number of time-shifted versions of the test signal are analysed. As already described, another use of cross-correlation is to determine the relationship between the dimensions of a multidimensional sensor (e.g., [184, 185, 112, 40]). It was discussed in [40] that there is a higher correlation in acceleration signals between the axis of motion and the axis of gravity when ascending or descending stairs as opposed to walking. When correlating sensor axes, the time shift τ is disregarded because the recordings have the same starting point. In the work of Bao and Intille [8], it was also shown that the readings of several sensors distributed on the body can be cross-correlated for human activity recognition as well.

Mean Value of the Euclidean Distance

The Euclidean distance is the distance between two vectors, here in three- dimensional space. By determining the distance between the measured value and the mean value within a specified time, the Euclidean distance portrays the amount of motion carried out in the three-dimensional space. The Eu- clidean distance is defined as:

v u m uX 2 ||~x(t) − ~µ|| = t (xi(t) − µi) , (3.22) i=1 where m denotes the number of axes (here 3 for the accelerometer, gyroscope, and magnetometer). It is assumed that the highpass-filtered acceleration and angular rate have zero-mean, then the Euclidean distance becomes the Euclidean norm, or simply termed norm. From the Euclidean distance or norm, the arithmetic mean value was taken to quantify the average amount of motion in the given time window:

n 1 X µ(||~x||) = ||~x(i · ∆t) − ~µ||. (3.23) n i=1 56 3. Human Activity Recognition With a Wrist-Worn Activity Tracker

Height Difference

The difference in height between the start and end of an activity describes the vertical distance travelled by a person. A positive height difference may refer to ascending stairs or riding an elevator moving upwards and a negative height difference vice versa to descending stairs or riding an elevator moving downwards. The LPF for the barometer, as specified in Chapter 3.2.4, re- duces the measured air pressure to the static (atmospheric) air pressure. The static air pressure at the beginning and end are then converted to altitude using (3.9) and subtracted such that

∆h = hstatic(n) − hstatic(0). (3.24)

Window Length of a Feature

The duration of human activities vary between a few seconds (e.g., a fall) and several hours (e.g., sleeping). Because wearable sensors for human activity recognition typically have high output sample rates, features are extracted on a time window basis containing a specified number of samples (n). The optimal length of the time window depends on the underlying activity set, the sensor type, the measurement interval∆ t, and the feature. Other researchers in human activity recognition who used acceleration signals published mostly fixed window lengths ranging from 80 ms [101] to 12 s [163]. In this thesis, a fixed window of 5 s was used for all features. This length was chosen to provide the time domain features with enough data for recognition and the frequency domain features with a sufficient resolution of 0.2 Hz. Longer time windows are not meaningful for some of the recorded activities such as falling. Nevertheless, in future work individual time frames for every feature and sensor domain may be chosen to enhance the features’ discriminatory power. Long time windows may capture transitions between two activities, for example the transition between walking and climbing stairs. These occur- rences can be addressed by sliding windows that contain data from two con- secutive windows. Often, an overlap of 50 % is chosen [8, 113, 186, 163]. The evaluation of activity transitions is not part of this thesis. However, it depends more on what type of activities are recorded and what requirements are placed on the performance. Under free-living conditions, transitions may represent only a small portion of the total duration and thus there is only a minor effect on the overall classification performance. Further concepts of segmenting activity data, such as event-based segmentation or dynamic window sizes, are described in [174]. 3.6. Results 57

3.5.3 Computational Complexity Wearable human activity trackers, or mobile devices in general, are con- strained in processing power and storage to meet battery life and form factor specifications. Human activity recognition on these devices is not trivial as features and learning algorithms have to be selected based on their computa- tional complexity [187, 188]. Processing frequency-domain features on a mi- crocontroller, for instance, is challenging due to the limited processing power and memory. Computationally expensive features also cause for a shorter battery life or may be infeasible in real-time applications. If the predictive power is comparable, it is more economical to implement low-complexity time-domain features. One way to overcome computational restrictions is to design an appli- cation-specific integrated circuit (ASIC), which can perform human activity recognition on wearable devices efficiently (including frequency-domain com- putations as demonstrated by Pfundt et al. [189]). Unfortunately, this op- tion has high nonrecurring engineering costs, making it cost-efficiently only for high-volume fabrication. Changes to the algorithm also require a redesign of the ASIC. Krause et al. [111] proposed reducing the sensor sample rate or implementing dynamic sample rates to decrease the amount of data to be processed. It was shown that to a certain limit the classification accuracy deteriorated only marginally. A detailed investigation of the relationship be- tween the sample rate and the computational complexity was performed by Tobola et al. [190]. Another solution is to use the mobile device only for data acquisition and execute demanding activity recognition steps in a cloud- based service that offers more computational power and storage capabilities. However, this method requires wireless data transmission, which again has a major effect on battery lifetime [168].

3.6 Results

3.6.1 Accelerometer-Based Human Activity Recogni- tion and Its Limitations Each of the sensor types used was initially evaluated separately to deter- mine their potential in recognizing human activities on a wrist-worn device. Due to the complexity of human motion, the limitations of the individual sensor domains are also discussed. Figure 3.12 shows exemplary acceleration measurements of the investigated activities of participant A. From these mea- surements, it can be derived that the activities can be categorized according 58 3. Human Activity Recognition With a Wrist-Worn Activity Tracker

Table 3.3: Accelerometer-Based Human Activity Recognition, Time Domain

Activity R(ax) in mg σ(ay) in mg R(az) in mg µ(||~a||) in mg sit 32–114 4–26 29–94 7–33 elev. up 41–126 4–12 32–75 9–18 elev. dn 34–132 4–13 38–105 8–21 cycle 604–2 208 113–222 309–1 404 152–318 walk 671–1 022 156–233 379–835 270–315 ascend 578–1 383 108–232 345–995 190–379 descend 589–3 282 234–644 384–1 939 253–806 jog 3 638–9 113 691–1 310 1 553–3 119 1 196–2 332 run 12 352–24 819 3 102–6 117 5 485–11 247 4 544–7 839 fall 7 861–26 867 859–1 319 14 285–25 301 413–997 to their level of recorded acceleration: low-g activities (sitting and riding an elevator), medium-g activities (walking, ascending stairs, descending stairs, and cycling), and high-g activities (jogging, running, and falling). The feature extraction was performed on all three axes in a 5 s time win- dow. Four of the most relevant time domain features are given in Table 3.3: range in x-axis R(ax), sample standard deviation in y-axis σ(ay), range in z-axis R(az), and mean value of the norm µ(||~a||). For the calculation of the features, the entire data from all four participants was used. By using either of the named features, the low-g valued activities can be easily separated from the other activities. However, as can be seen from Figure 3.12 or from the feature table, riding an elevator may be confused with sitting since both activities involve the participant to remain still. Also—unlike in the work of Abdelnassser et al. [40]—the acceleration signals did not show a distinct pattern from the over-weight and weight-loss occurring during the start and stop periods of the elevator, or the deflection was too small to be discrimi- nated from human movements. It could be that the researchers measured in a faster elevator that covered more floors than the three floors travelled here. The medium-g valued activities can be separated from the other activities using the R(ax) or σ(ay) features. It has to be noted that descending stairs showed higher g-values mainly due to participant A, who was more accus- tomed to run down stairs rather than walking. For many of the investigated features, this resulted in acceleration values similar to jogging. With the available measurement data, it is possible to discriminate descending stairs from the remaining medium-g activities using the σ(ay) feature. However, the margin to walking and ascending stairs is only 1 and 2 mg, while the sensor’s sensitivity is specified as 3.9 mg. Ascending and descending stairs 3.6. Results 59

0.1 0.6 0.3

[g] 0 [g] 0 a a -0.3 -0.1 -0.6 012345 012345 (a) Sitting (b) Walking

0.6 2 0.3 1

[g] 0 [g] 0 a -0.3 a -1 -0.6 -2 012345 012345 (c) Ascending stairs (d) Descending stairs

6 10 3 5

[g] 0 [g] 0 a -3 a -5 -6 -10 012345 012345 (e) Jogging (f) Running

0.1 0.1

[g] 0 [g] 0 a a -0.1 -0.1 012345 012345 (g) Riding an elevator up (h) Riding an elevator down

0.6 12 0.3 6 [g] 0 [g] 0 a -0.3 a -6 -0.6 -12 012345 012345 Time [s] Time [s] (i) Cycling (j) Falling

Figure 3.12: 3-axis acceleration measurement of participant A, record 1: - x-axis, - y-axis, - z-axis. 60 3. Human Activity Recognition With a Wrist-Worn Activity Tracker

Table 3.4: Accelerometer-Based Human Activity Recognition, Frequency Do- main

Activity fmax(|Ax|) in Hz fmax(|Ay|) in Hz fmax(|Az|) in Hz sit 0.2–3.8 0.2–1.4 0.2–4.8 elev. up 0.4–3.2 0.2–5.4 0.2–2.8 elev. dn 0.2–10.4 0.2–9 0.2–6.8 cycle 1.8–30 9.4–14.4 0.8–24.2 walk 1 1–2 1 ascend 0.8–1 0.2–4.2 1 descend 0.8–1.8 2–3.6 1–2.4 jog 2.6–3 1.4–2.8 1.4–3 run 1.6–4.2 1.8–3.8 1.6–2 fall 0.4–20.4 0.4–12.2 0.8–2.4 can hardly be separated from walking because the activities are similar in arm motion. Cross-correlation also attested a high correlation among these three activities. Although cycling produced similar g-values to walking and walking stairs using the named time domain features, their frequency spectrum was entirely different. As depicted in Table 3.4, cycling showed dominant frequency bins across most of the frequency band in the x- and z-axis, but a clear distinc- tion from walking and walking stairs can be made in the y-axis (see also Figure 3.13). Thus, cycling can be discriminated from other activities by combining the fmax(|Ay|) feature with one of the time domain features that classifies medium-g activities. Furthermore, the same result can be achieved using the power spectrum entropy feature in the x- and z-axis.

0.2 0.08 [g] [g] 0.06 | | 0.1 0.04 y y A A 0.02 | | 0 0 05 10 15 20 25 05 10 15 20 25 Frequency [Hz] Frequency [Hz] (a) (b)

Figure 3.13: Single-sided amplitude spectrum of a 5 s acceleration measure- ment from participant A, record 1, during: a) walking and b) cycling. The dominant frequency component is highlighted. 3.6. Results 61

Table 3.5: Accelerometer-Based Human Activity Recognition, Zero Crossings

Activity ZCS(ax) ZCS(ay) ZCS(az) sit 21–146 17–158 109–180 elev. up 68–135 67–124 63–138 elev. dn 35–131 61–148 47–155 cycle 137–244 124–170 131–251 walk 9–32 20–42 16–38 ascend 9–25 22–46 9–29 descend 11–40 18–36 18–46 jog 18–30 13–20 27–60 run 33–41 19–45 20–59 fall 33–76 17–55 24–40

The discrimination of cycling from walking and running using frequency- domain features has already been successfully applied by other researchers [8, 182, 23]. Another, simpler and possibly more effective method of detect- ing cycling on the wrist is to count the zero crossings. When riding a bicycle, vibrations on uneven surfaces are transferred to the driver’s arms, which, if Figure 3.12i is examined, account for large parts of the measured accelera- tions. Table 3.5 shows that the zero crossings method can be applied on all three axes to separate cycling from activities such as walking, ascending and descending stairs, jogging, and running. From the high-g valued activities, jogging can be classified using the µ(||~a||) feature, or by combining the R(ax) and R(az) features. Running can be discriminated from the other activities using the σ(ay), the R(az), or the µ(||~a||) feature. ”A fall” is typically characterized by three phases: 1. the person experi- ences weightlessness, 2. the person’s impact on the ground, and 3. the person remains in a state of inactivity (see Figure 3.12j). High-g values are gener- ated during the impact phase, which allows discriminating falling from other high-g activities such as running using the R(az) feature. Falling creates such a unique acceleration pattern that it was also possible (but generally not rec- ommended due to the high computational cost) to classify falling on any of the three axes by cross-correlation with a template signal. If the human activity recognition system is designed as a fall detector with authority to contact first responders, it is further preferable to minimize the false alarm rate. A fall happens only once and takes just about a second. Knowing this, the false-alarm rate can be reduced by combining the R(az) and the µ(||~a||) features. Falling (as opposed to running) produces high acceleration 62 3. Human Activity Recognition With a Wrist-Worn Activity Tracker values during the impact, but a relatively small mean value considering the 5 s time window. Another or an additional way to validate a fall is to test the following time window for inactivity (third phase during a fall). To summarize the findings, the wrist-worn 3-axis accelerometer solution is capable to classify into low-g valued activities, medium-g valued activities, cycling, jogging, running, and falling. The acceleration signals of sitting and riding an elevator as well as that of walking and walking stairs are too similar to discriminate any further. One feature that did not provide the expected information gain was measuring the cross-correlation coefficient between sensor axes. It was observed that there is a correlation between the x- and z-axis during walking, ascending stairs, and descending stairs, but the feature did not lead to new results.

3.6.2 Gyroscope-Based Human Activity Recognition and Its Limitations Gyroscope measurements are shown in Figure 3.14 and indicate that the recorded activities can be categorized in much the same way as with the ac- celerometer according to their level of angular rate. Features were extracted from the three gyroscope axes in a 5 s time window, of which the four most relevant features are given in Table 3.6: range in x-, y-, and z-axis R(ωx), R(ωy), R(ωz), and cross-correlation coefficient between the x- and z-axis rxz. The activities sitting and riding an elevator produced low angular rates and can be separated from the other activities using the R(ωx) feature. Cycling falls in between the low and medium angular rate activities. Because the hand is mostly fixed on the bicycle handle, rotations are expected only from vibrations, taking turns, or signalling road-users by waving the hand. Cycling can be discriminated using R(ωx) feature. Walking, ascending stairs, descending stairs, and jogging can be termed medium angular rate activities. These four activities can be separated from the others by combining the R(ωx) or the R(ωz) feature with the R(ωy) fea- ture. The cross-correlation coefficient of the x- and z-axis signals rxz unfolds a negative correlation between the two axes during jogging. This allows dis- criminating jogging from walking and descending stairs. By combining the rxz feature with the R(ωx) feature, which additionally separates from as- cending stairs, jogging can be singled out. Alternatives that provide greater margins between jogging and ascending stairs are the dominant frequency in z-axis fmax(|Ωz|) feature and cross-correlation using a template signal in the y- or z-axis. 3.6. Results 63

10 250 125 0 0 [dps] [dps] ω ω -125 -10 -250 012345 012345 (a) Sitting (b) Walking

250 400 125 200 0 0 [dps] [dps]

ω -125 ω -200 -250 -400 012345 012345 (c) Ascending stairs (d) Descending stairs

600 1000 300 500 0 0 [dps] [dps]

ω -300 ω -500 -600 -1000 012345 012345 (e) Jogging (f) Running

20 20

0 0 [dps] [dps] ω ω -20 -20 012345 012345 (g) Riding an elevator up (h) Riding an elevator down

60 600 300 0 0 [dps] [dps] ω ω -300 -60 -600 012345 012345 Time [s] Time [s] (i) Cycling (j) Falling

Figure 3.14: Angular rate measurement of participant A, record 1: - x-axis, - y-axis, - z-axis. 64 3. Human Activity Recognition With a Wrist-Worn Activity Tracker

Table 3.6: Gyroscope-Based Human Activity Recognition, Time Domain

Activity R(ωx) in dps R(ωy) in dps R(ωz) in dps rxz sit 1–14 4–24 1–24 -0.4 to +0.7 elev. up 2–17 6–27 3–19 -0.6 to +0.7 elev. dn 2–20 6–46 3–46 -0.6 to +0.6 cycle 23–60 46–231 28–98 -0.3 to +0.8 walk 78–260 161–360 207–359 +0.3 to +1.0 ascend 79–256 203–464 288–567 -0.4 to +1.0 descend 131–332 237–751 290–787 -0.2 to +1.0 jog 257–583 442–731 526–993 -0.9 to -0.3 run 636–1 738 932–2 077 1 601–2 767 -0.7 to +0.8 fall 453–1 351 839–2 027 493–1 534 +0.2 to +0.7

Higher angular rates were measured during running and falling. Running can be classified using the R(ωz) feature. Falling is discriminated from low and medium angular rate activities using the R(ωy) feature and from running using R(ωz). The results of the wrist-worn 3-axis gyroscope human activity recogni- tion are similar to that of the accelerometer in the previous section. This means that low angular rate activities (sitting and riding an elevator), cy- cling, medium angular rate activities (walking, ascending stairs, and descend- ing stairs), jogging, running, and falling can be successfully discriminated. However, it also means that the gyroscope-based solution is limited in fur- ther discrimination of the named low and medium angular rate activities. Differences are found in cycling detection, which can be performed with a gyroscope using the computationally lightweight range feature, whereas jog- ging requires the calculation of the computationally more demanding cross- correlation coefficient between two sensor axes.

3.6.3 Magnetometer-Based Human Activity Recogni- tion and Its Limitations Measurements of the magnetic field, which were initially hard- and soft- iron compensated as described above, are shown in Figure 3.15. However, despite the hard-iron compensation, the axes of the sensor are offset in some cases. This is due to magnetic interference from the environment, such as the metal frame of a bicycle (see Figure 3.15i). Magnetic interference may also have been caused by participants who wore jewellery or other metal objects. Furthermore, it can be seen in Figures 3.15g and 3.15h that the sensors’ 3.6. Results 65 signals slowly shift with time during travel on the elevator. Although the exact reason for the magnetic field drift remained unclear, it is possibly that the magnetic field varied between floors, or it was caused by metal parts that are distributed along the elevator shaft. In general, the magnetic field signals of activities such as walking and running are similar to the acceleration and angular rate signals. The similarity between the signals of a magnetometer and an accelerometer was in fact already discovered by P¨arkk¨aet al. [5]. The feature extraction was performed on the three magnetometer axes in a 5 s time window. However, due to the strong dependence on the orientation of the system to Earth’s magnetic field, the range feature is a poor discrim- inator of human activities. Activities such as jogging generate higher range values than usual when persons take a turn as Earth’s magnetic field is mea- sured from different directions. In addition, sudden magnetic interference can cause misinterpretations when using the range feature. For instance, it was observed that the range of the measured magnetic field strength during walking stairs was considerably higher for participant D. It is likely because participant D is left-handed and wore the activity tracker on the right hand (in Germany it is customary to walk on the right side), that the close prox- imity to the metal staircase handrail resulted in magnetic distortions. Also, sudden spikes in the signal suggest that participant D sometimes held the handrail. The system’s orientation to Earth’s magnetic field during motion is also of general relevance, since it defines the sensor axes on which motion signals are recorded. This affects the range and standard deviation features such that the feature value spread increases significantly. The mean value of the Euclidean distance feature, which is less domi- nated by the system’s orientation, is given in Table 3.7. The magnetic field strength varies little in the activities sitting, riding an elevator, and cycling, whereas the other activities mostly produce higher values as a result of the arm motion. Unfortunately, and in spite of the similarity to the acceleration and angular rate signals, the activity set can hardly be discriminated with the magnetometer due to overlapping feature values. Other features such as cross-correlation did not provide any significant information gain. Also, their dependence on the system’s orientation could not be investigated as a larger amount of data from various directions is required. In a sensor fusion approach, however, the characteristic feature values caused by the magnetic field drift during riding an elevator could be used to discriminate the activity from sitting (see Table 3.7). Both activities pro- duced similar signals with the accelerometer and gyroscope. In this respect, it is still to be checked whether the magnetic field characteristic also occurs in other elevators than the one tested. Furthermore, cycling can be easily separated from walking and walking stairs. Because unlike the acceleration, 66 3. Human Activity Recognition With a Wrist-Worn Activity Tracker

40 60 20 30 T] T] µ µ [ 0 [ 0

B -20 B -30 -40 -60 012345 012345 (a) Sitting (b) Walking

60 60 30 30 T] T] µ µ [ 0 [ 0 B -30 B -30 -60 -60 012345 012345 (c) Ascending stairs (d) Descending stairs

60 60 30 30 T] T] µ µ [ 0 [ 0 B -30 B -30 -60 -60 012345 012345 (e) Jogging (f) Running

10 10 T] T] 0 0 µ µ [ -10 [ -10 B B -20 -20 012345 012345 (g) Riding an elevator up (h) Riding an elevator down

40 20 0 T] T] 20 µ µ [ [ -20 0 B B -40 -20 -60 012345 012345 Time [s] Time [s] (i) Cycling (j) Falling

Figure 3.15: Magnetic field measurement of participant A, record 1: - x-axis, - y-axis, - z-axis. 3.6. Results 67

Table 3.7: Magnetometer-Based Human Activity Recognition, Time Domain

Activity µ(||B~ − ~µ||) in µT sit 0.5–1.7 elev. up 2.0–4.6 elev. dn 2.2–4.8 cycle 1.3–3.2 walk 8.6–14.6 ascend 5.9–29.1 descend 6.2–22.0 jog 4.1–15.1 run 19.7–39.0 fall 9.1–28.6

the magnetic field measurement is less affected by vibrations. These exam- ples demonstrate the potential of magnetic field sensing in recognizing human activities that involve magnetic field interference (as in riding a car, an ele- vator, an escalator [40], a bicycle, or in exercising using gym machines [25]). Generally, there are two types of magnetic interference: constant magnetic interference originating from metal parts and alternating magnetic interfer- ence generated by the motor of a car, an escalator, or an elevator. Another advantage of the magnetic domain is that these magnetic distortions are in- dependent of individual users, which improves the recognition performance for multiple-user algorithms.

The transitional periods between activities without magnetic distortions and activities with abnormalities in the magnetic field are characterized by distinct signatures in the signal. To support this assumption, the transition from walking to riding an elevator from two different participants is depicted in Figure 3.16. The magnetic field measurements show a distinct and repro- ducible magnetic field pattern that indicates that the person is going to ride an elevator. It is likely other patterns can be found during mounting a bicycle or during entering a car. These events can be used as markers for changing activities. Future work that investigates the potential of these markers for human activity recognition, requires recording transitional periods of a vari- ety of elevators and other modes of transportation. It has to be examined if these patterns reoccur between the same mode of transportation, or whether they represent unique cases. 68 3. Human Activity Recognition With a Wrist-Worn Activity Tracker

1234 1234 25 25

T] 0 T] 0 µ µ [ -25 [ -25 B B -50 -50 05 10 15 05 10 15 Time [s] Time [s] (a) (b)

Figure 3.16: Magnetic field measurement of the transitional period walking to riding an elevator: a) participant A and b) participant B. The transition is characterized by four phases: 1. walking, 2. waiting for the elevator, 3. walking into the elevator, 4. riding the elevator. - x-axis, - y-axis, - z-axis.

3.6.4 Barometer-Based Human Activity Recognition and Its Limitations As described in Chapter 3.2.4, two signals were extracted from the baro- metric data: a Savitzky–Golay filtered signal that included the static and dynamic air pressure, and a copy of the original that was lowpass-filtered to remain only the atmospheric air pressure. Examples of the Savitzky–Golay filtered measurements are shown in Figure 3.17. From these examples, it becomes clear that activities with only a small amount of arm motion and altitude difference, such as sitting, walking, and cycling, are mostly buried in the sensor’s noise. In contrast, the vigorous arm movements during jog- ging and especially when running lead to noticeable changes in the measured air pressure. The changing atmospheric air pressure when walking stairs or when riding an elevator is related to a difference in altitude. A fall, as seen in Figure 3.17j, is indicated by a sudden drop in altitude (spike in air pressure). Table 3.8 gives the features range R(h) and sample standard deviation σ(h) of the Savitzky–Golay filtered signal in a 5 s time window. Despite the discovered differences in the signals, these features are unable to accurately discriminate any of the examined activities. Also, using cross-correlation with a Savitzky–Golay filtered template signal, the only activity that can be classified is falling as a result of its unique signal pattern. With regard to sensor fusion, however, the barometer helps to discrim- inate activities that involve height differences. Table 3.8 further gives the height difference feature∆ h as calculated from the lowpass-filtered signal in a 5 s time window. Sitting can be discriminated from riding an elevator us- ing either the R(h), σ(h), or∆ h feature. More importantly, the∆ h feature 3.6. Results 69

281 281 280 280 [m] [m] 279 279 h h 278 278 277 277 012345 012345 (a) Sitting (b) Walking

283 280 282 279 [m] [m] 281 278 h h 280 277 279 276 012345 012345 (c) Ascending stairs (d) Descending stairs

281 281 280 280 [m] [m] 279 279 h h 278 278 277 277 012345 012345 (e) Jogging (f) Running

286 278 285 277 [m] [m] 284 276 h h 283 275 282 274 012345 012345 (g) Riding an elevator up (h) Riding an elevator down

281 281 280 280 [m] [m] 279 279 h h 278 278 277 277 012345 012345 Time [s] Time [s] (i) Cycling (j) Falling

Figure 3.17: Air pressure measurement (converted to altitude) of participant A, record 1. 70 3. Human Activity Recognition With a Wrist-Worn Activity Tracker

Table 3.8: Barometer-Based Human Activity Recognition, Time Domain

Activity R(h) in m σ(h) in m ∆h in m sit 0.8–1.7 0.1–0.5 -0.9 to +0.5 elev. up 2.3–3.4 0.6–0.9 +2.2 to +3.0 elev. dn 2.5–3.3 0.6–1.0 -3.0 to -2.3 cycle 1.1-3.0 0.2–0.8 -0.3 to +2.1 walk 1.0–2.8 0.2–0.5 -0.6 to +0.6 ascend 1.5–3.0 0.3–0.8 +1.0 to +2.4 descend 1.6–3.2 0.4–0.9 -2.5 to -1.0 jog 0.8–5.0 0.2–1.2 -2.0 to +0.4 run 2.1–14.1 0.5–3.2 -1.0 to +0.8 fall 1.4–3.8 0.3–0.9 -1.6 to -0.6 allows to determine the vertical direction of riding an elevator and walking stairs. And the greater the height difference is (rate of pressure change), the more likely the person is riding an elevator as opposed to taking the stairs. Besides, the results of walking stairs are in agreement with the research of Rulsch et al. [23], who assigned ascending and descending stairs a minimum height difference within a 4 s time window of +0.75 and -0.75 m, respectively. Furthermore, the false alarm rate of falling can be reduced by verifying that the vertical displacement was between -1.6 and -0.6 m. In a few measure- ments conducted outdoors, however, it could also be observed that the air pressure drifted in one direction or the other (as indicated in Table 3.8 by the height difference of up to +2.1 m for cycling and -2.0 m for jogging). It is likely this was due to changing weather conditions, but the exact reasons still need to be investigated. In conclusion, when used in a sensor fusion, the static air pressure changes extracted by the∆ h feature allow discriminat- ing between riding an elevator moving upwards or downwards, walking, and ascending or descending stairs. As discussed earlier, these activities show strong similarities in their acceleration and angular rate signals.

3.6.5 Human Activity Recognition With Sensor Fusion In the previous sections, it was found that the wrist-worn 3-axis accelerometer and the 3-axis gyroscope approaches are capable of dividing the examined activities into groups of low, medium, and high amount of arm motion. Both sensor types can further be used to classify cycling, jogging, running, and falling. Although the 3-axis magnetometer and the barometer approaches are unable to accurately recognize human activities, their potential lies in sensor fusion. 3.6. Results 71

R(ax) ≤3.5 g >3.5 g

R(ax) R(az) ≤0.5 g >0.5 g ≤5 g >5 g

∆h ZCS(ax) jog R(az) ≤-2 m >-2 m ≥100 <100 ≤14 g >14 g elev. dn ∆h cycle ∆h run fall <2 m ≥2 m ≤-1 m >-1 m sit elev. up descend ∆h <1 m ≥1 m walk ascend

Figure 3.18: Example of a decision tree based on sensor fusion

For the activity set analysed in this thesis, the basis of a wrist-worn sensor fusion can be established with a 2- or 3-axis accelerometer, or alternatively with a 3-axis gyroscope. However, it is recommended to use the accelerome- ter due to its lower power consumption (see [134, 142]), and because it allows discriminating jogging with low computational cost. Sitting and riding an elevator or walking and walking stairs produce similar acceleration and an- gular rate signals, but their effect on the measured atmospheric air pressure is fundamentally different. When fusing the accelerometer with a low-noise barometer such as the one used here, all of the examined activities can be recognized. Figure 3.18 gives a simplified example of a human activity recognition decision tree classifier using the proposed sensor fusion. Low-g, medium-g, and high-g activities are grouped according to their spread of acceleration values in the sensor’s x-axis. The low-g activities (sitting and riding an elevator moving upwards and downwards) are discriminated by their height difference as measured by the barometric pressure sensor. From the medium- g activities, cycling is detected if at least 100 zero crossings are counted from the x-axis’ signal. The remaining activities (walking, ascending stairs, and descending stairs) are classified based on their height difference. The high-g activities (jogging, running, and falling) are discriminated further depending on their acceleration values in the sensor’s z-axis. 72 3. Human Activity Recognition With a Wrist-Worn Activity Tracker

Apart from the ability to discern certain activities, there is another reason for sensor fusion: confidence. The error rate can be reduced by sensor fusion if information from different sensor domains are included in the decision pro- cess. Therefore, for overall system performance it may be beneficial to fuse information from all four sensors. For example, falling can be detected with higher confidence if validated with other sensor domain features such as the height difference, which lies between -1.6 and -0.6 m for a fall. Also, an ad- vantage of integrating magnetic field sensing is that the magnetic distortions are independent of individual users, and thus the recognition performance of algorithms designed for multiple users is improved. Another method to improve the overall performance is to link the class probabilities with the expected duration of an activity. For example, the duration of riding an elevator is in the range of seconds or a few minutes at most, whereas jogging is typically a form of exercise that is performed in longer durations. Furthermore, a state machine could be implemented that limits the classification to activities that are plausible considering the previ- ously detected activity. Riding an elevator is mostly preceded by walking or, if the time windows are short, by the activity itself. This method, however, requires a high level of confidence on the previous classification result. In fall detection, the same concept could be used to improve its confidence by testing the following time window for inactivity. Chapter 4

Occupancy Detection With an Indoor Air Quality Monitor

Assessment of Indoor Air Quality in Residential Buildings

The quality of the indoor air is determined by the hygienic quality of the respiratory air, by parameters of the indoor climate, and by the perceived air quality [191]. Sources of air contaminants in residential buildings are building materials, furnishings, household chemicals, and occupants depend- ing on their number and their activities (e.g., tobacco smoking or cooking) [17]. The indoor air quality can in turn be improved by natural or mechanical ventilation. A multitude of chemical substances, biological agents, and physical factors affect the hygienic quality of the indoor air. Assessment values exist for many individual parameters, whereas the effect of the simultaneous occurrence of these elements are largely unexplored [191]. Because the measurement of individual parameters is time-consuming, the standard case is to use reference parameters, such asCO 2, that correlate well with the general indoor air quality [191, 17]. The emission of pollutants further depends on the air temperature and the air humidity. A higher air temperature most likely leads to an increase in emission, and a high air humidity can enhance the emission rate of chemicals, such as formaldehyde [192]. Long-lasting high air humidities also facilitate the growth of moulds. Conversely, low air humidities cause dryness and irritation of the eyes and respiratory tracts [17]. The perceived air quality is influenced by the odour intensity, the hedonic tone, and the personal olfactory sensibility. Furthermore, changes in indoor air temperature and humidity also affect the perception of the air quality. Experiments have shown that the rated indoor air quality decreases with

73 74 4. Occupancy Detection With an Indoor Air Quality Monitor higher indoor air temperatures and humidities. To date, neither are all air contaminants that can be sensed by humans known, nor is there information on the sensory impact of the cross-influence of various air contaminant com- binations [17]. The human nose cannot sense all harmful air contaminants or predict their toxicity. Typically, however the perceived air quality and the hygienic quality correlate [193]. The Association of German Engineers (VDI), Society Civil Engineering and Building Services [191], divides the assessment of the hygienic quality of the indoor air into three levels. The first level includes the measurement of theCO 2 concentration, air temperature, and humidity. Assessment levels 2 and 3 are applied when there is a specific suspicion, complaints from occu- pants, or if certain assessment values have been requested. The Heating and Ventilation Technology Standards Committee of the German Institute for Standardization (DIN)[194] describes the main indoor pollutants of residen- tial buildings asCO 2, air humidity, and odours. Another method to assess the multitude of air contaminants is to determine the TVOC as performed by the German Environment Agency (UBA) in [195, 196]. TVOC, also a pa- rameter of the assessment level 2 of the VDI, includes hundreds of odourless and odour substances found indoors [197] that can affect the hygienic and the perceived indoor air quality [195]. To act in accordance with the recommended assessment parameters for a standard case, aCO 2, a TVOC, and an air temperature and humidity sensor were selected for experiments in this thesis and integrated into an indoor air quality measurement system. Besides, there are a number of commercial products that deploy these sensors in their systems as well, but there are only few products that include all four (e.g., the Wave Plus from Airthings AS [198]).

The Resolution of Occupancy Detection The level of detail with which occupancy detection is performed can be re- garded as the resolution. A low resolution may mean that only information about the presence of a person is retrieved, whereas a high resolution may include the number of occupants, their identity, or the type of activity. Melfi et al. [199] gave the resolution of occupancy detection three dimensions (see Figure 4.1): the occupant resolution, the temporal resolution, and the spa- tial resolution. In the context of a study about ”human-sensing”, Teixeira et al. [200] has also addressed the resolution of occupancy and defined the five spatio-temporal properties Presence–Count–Location–Track–Identity. Potential applications of occupancy detection are HVAC and light con- trol. Improvements in energy efficiency, indoor air quality, or thermal comfort 4. Occupancy Detection With an Indoor Air Quality Monitor 75

Figure 4.1: The three dimensions of occupancy resolution (Source: Melfi et al. [199]) are the main focus here. Another field of application is home automation. Furthermore, first responders could be provided with life-saving information for search and rescue in emergency such as a fire outbreak. It is also con- ceivable that occupancy data is used for intrusion detection. Accordingly, the required occupancy resolution depends on the application. Intrusion de- tection, for instance, is based on a yes/ no decision, whereas in search and rescue the exact number of occupants is crucial. HVAC benefits from more detailed information, too, as it can regulate its parameters depending on the actual demand.

Nonintrusive Occupancy Detection With Environmental Sensors The prevalent approach to infer occupancy is to use motion detectors—most commonly, PIR based motion detectors or ultrasonic sensors. However, PIR motion detectors are limited to a line-of-sight to the occupant, show dead spots where the sensor cannot see, and are unable to detect stationary or slow moving persons, all of which result in a high number of false negatives. Ultrasonic sensors are more sensitive to slow motions, and thus they produce a higher false positive rate and cause potential interference with animals that have ultrasonic hearing [16]. False negatives can lead to frustration among occupants (e.g., lights are turned off while someone is present), whereas false positives can waste energy when an HVAC system assumes occupancy while 76 4. Occupancy Detection With an Indoor Air Quality Monitor it is not. Moreover, both sensor types are unable to discern the actual number of occupants. Sensors for indoor air quality measurement are environmental sensors, and as such, have a number of advantages over motion detectors:

– They are nonintrusive

– They can detect slow-moving and nonmoving occupants

– They do not require a line-of-sight to the occupant

– They have no dead spots

– They allow occupant counting

Nowadays, indoor air quality sensors are often installed in smart homes. By extracting information from the existing infrastructure, an additional investment can be avoided (zero-cost setup). However, environmental sensors are not without limitations in occupancy detection. Sensor readings change slowly over time, which makes reactive applications such as light control infeasible or requires the fusion with other sensor types. Occupancy detection with environmental sensors may further be limited to specific room types or seasons as mechanical and natural ventilation can superimpose other effects. Therefore, the target applications are typically HVAC. But also, and that is the main objective of this thesis, only by fusing the heterogeneous data from a network of environmental sensors does a distinction of the interaction of the occupants with the environment from other influences become possible. In the following, the term occupancy detection is used when a binary decision (occupied/ vacant) is made, whereas occupancy estimation is used to describe the exact number of occupants. The latter is a multiclass clas- sification problem and more challenging as it requires the differentiation of different levels of occupancy. Occupant identification or activity recognition with environmental sensors, although not impossible, are not investigated in this thesis. Preliminary results of the occupancy detection using aCO 2 sensor were published by the author of this thesis in [289, 290]. The results of the sensor fusion that are shown in Chapter 4.6 were published by the author of this thesis in [292], (c) 2018 IEEE. 4.1. Environmental Sensors for Indoor Air Quality Measurement 77

4.1 Environmental Sensors for Indoor Air Quality Measurement

4.1.1 Carbone Dioxide How Carbone Dioxide Is Generated Indoors

For more than 150 years, the odourless gasCO 2 has been regarded as an indicator of indoor air quality [201]. The concentration ofCO 2 in the indoor air results from the natural proportion of the atmospheric air, the presence of humans, and combustion processes such as tobacco smoking. The respi- ratory air of humans, which typically is the main source ofCO 2 in a room, is calculated from the product of the exhaled air of 40 000 ppmCO 2 and the person’s respiration rate. The respiration rate in turn depends on the inten- sity of the performed activity, the age, the weight, and the personal fitness [83, 202]. To summarize, the overall indoorCO 2 concentration depends on: – The number of occupants

– The occupants’ respiration rate

– The duration of occupancy

– Indoor combustion processes

– The volume of the room

– The outdoorCO 2 concentration (around 400 ppm [203]) – The outdoor air refresh rate

Usage in Occupancy Detection

TheCO 2 concentration in a closed space generally increases with occupancy, and the more occupants, the steeper theCO 2 rate becomes. However, air infiltration also ensures that the indoor air is constantly exchanged with fresh air from outside. When there is a highCO 2 level or a positiveCO 2 rate, it is likely that the space is occupied. The actual number of occupants may be inferred from theCO 2 rate. A lowCO 2 level or a negativeCO 2 rate, conversely, can be the result of vacancy. This becomes more complicated when occupants open windows and doors or engage in physical activity. On the other hand, these events also represent markers of occupancy. Human occupancy detection using CO2 sensors has a long history in illegal immigrant detection of ship and truck cargo loads [204]. Here, elevated CO2 78 4. Occupancy Detection With an Indoor Air Quality Monitor

levels are used as an indicator of human presence.CO 2 sensors have also been used for some time in demand-controlled ventilation (DCV) systems in commercial and institutional buildings [205]. Researchers have further demonstrated that by fusing theCO 2 data with information on the supply airflow rate of the DCV system, the number of occupants can be estimated (e.g., [206, 207, 208]). However, many residential buildings use natural ven- tilation, so this method cannot be used here. There are few works that focused only onCO 2 for occupancy detection and estimation. Cali et al. [209], who measuredCO 2 in office rooms and in one apartment, wrote that to get solid information on the occupancy status, it is necessary to addition- ally know about the windows’ status. Brennen et al. [210] estimated the number of occupants in a conference room, but the resulting performance was poor. In Chapter 2.2, a number of promising sensor fusion approaches were presented. It was often stated that theCO 2 concentration correlated [42, 65, 72] or highly correlated [63] with the number of occupants. Others simply found thatCO 2 was among the sensor data that contributed most to the model predictive ability [58, 59, 62, 66, 74]. However, some researchers [46, 56, 58, 72, 75] also reported a slow response to abrupt changes in oc- cupancy, such as for incoming occupants. It was described that this was a result of the delay until the actualCO 2 concentration was spread across the room. It follows that the volume of the room and the location of theCO 2 sensor are other significant factors.

Sensor Principle

The most widely spread method to measureCO 2 in indoor air quality ap- plications is based on nondispersive infrared (NDIR) spectroscopy technol- ogy [83]. The strongest infrared (IR) light absorption band ofCO 2 is at a wavelength of 4 260 nm. At this wavelength, other gaseous components are negligible. In an NDIR sensor, light is directed from anIR light source through an optical path filled with gas to anIR light detector. A narrowband filter that matches the particular absorption band is placed in front of the detector. The measured light intensity is proportional to the amount ofCO 2 molecules in the optical path. This configuration is known as single-lamp single-wavelength [211]. Single-lamp dual-wavelength sensors, on the other hand, include a second filter as a reference that is tuned to a wavelength where there is no absorption ofCO 2. This method provides long-term stabil- ity against sensor drift due to ageing of the light source or particle buildup on the sensor surface [205]. The reading of aCO 2 sensor is typically given in parts per million by volume (ppm) or as a percentage of the gas mixture volume [83], although the measurement is based on the molecular density 4.1. Environmental Sensors for Indoor Air Quality Measurement 79

[211]. Unless stated otherwise, in this thesis the number refers to the ratio ofCO 2 to the total (moist) gas. According to [83], the optimal location for a CO2 measurement in rooms of up to 50 m² is given at a height of 1.5 m and a distance to the next wall of 1–2 m. For larger rooms or multiple rooms, multiple sensor stations are recommended. It is further advised to ensure that occupants cannot breathe directly onto the sensors. The indoor air quality measurement system of this thesis is equipped with the dual-lamp single-wavelength NDIR sensor EE891 from E+E ELEK- TRONIK GmbH [212]. In the past, manufacturers ofCO 2 sensors such as the E+E ELEKTRONIK GmbH assumed that a reference infrared source that is only rarely switched on can produce a sensor that is very robust against age- ing [213, 214]. However, this behaviour is now being questioned. [214]. E+E ELEKTRONIK GmbH has also switched to dual-wavelength technology in newer models (e.g., [215]). Fehlmann and Wanner [216] found that in apartmentsCO 2 levels of up to 4 300 ppm can be measured. Consequently, the EE891-5C9 with an operating range of 0–5 000 ppm was chosen. Its accuracy is stated as <±50 ppm ±3 % of the measured value, given at a temperature of +25 °C and an air pressure of 101.3 kPa. In particular, the specifications also comply with the recom- mendations of the VDI Society Civil Engineering and Building Services for the assessment of indoor air quality in [191]. The sensor was connected using the manufacturer’s digital E2 interface (see [217]). The sensor datasheet also lists a sensitivity to air temperature of 2 ppm/K for an air temperature range between 0 and +50 °C and a long term stability of 20 ppm/yr.

Sensor Calibration

NDIR-basedCO 2 sensors are required to be calibrated after production. Some manufacturers calibrate theCO 2 sensors by exposing it to a dry gas mixture (e.g., nitrogen (N2) withCO 2) and report accuracy typically at air temperature and air pressure conditions around +25 °C and at 101.35 kPa [218]. The offset of the sensor is found by applying a knownCO 2 concentra- tion (one-point calibration):

CO2OFF = CO2OUT − CO2ACT , (4.1) whereCO 2OUT is the measured andCO 2ACT the actual gas concentration. By exposing the sensor to two known gas levels (two-point calibration), the scale factor s and the offset are derived as follows: CO −CO s = 2ACT−2 2ACT−1 , CO2 −CO2 OUT−2 OUT−1 (4.2)

CO2OFF = s · CO2OUT−1 − CO2ACT−1 . 80 4. Occupancy Detection With an Indoor Air Quality Monitor

CO2OUT−1 and CO2OUT−2 denote the measuredCO 2 concentration at the cal- ibrations points 1 and 2. To compensate for a nonlinear behaviour, multiple CO2 levels have to be driven (multi-point calibration). However, other re- searchers have demonstrated that commercially availableCO 2 sensors show a high linearity [219, 220], which makes multi-point calibration unnecessary in most cases. The correction parameters can be saved in an electrically erasable programmable read-only memory (EEPROM) for compensation during op- erational use. NDIRCO 2 sensors mostly are recommended for recalibration every three to five years [221]. Another approach is to calibrate the sensor in fresh air, where theCO 2 concentration is about 400 ppm [221]. The actual concentration varies de- pending on the location, season, and annual global rise ofCO 2 levels [203]. The EE891 sensor is not factory-calibrated. Instead, the sensor was ex- posed to fresh air before the measurement, and an automatic baseline cor- rection (ABC) was carried out. In this way, measurements from varying en- vironments have the same baseline. Because the gain and the linearity were not investigated, all measurements were conducted with the same sensor to avoid deviations resulting from different sensors. The ABC first determined the baseline value (lowest measuredCO 2 level) from the previously recorded values. Because the sensor readings of the EE891CO 2 sensor are prone to noise, assuming white noise, the baseline was formed from the unweighted moving average of a 5 min time period:

 n/2  t2 1 X CO2OFF = min  CO2OUT (t − (i · ∆t)) − 400 ppm, (4.3) t=t1 n + 1 i=−n/2 where∆ t was a 15 s measurement interval, n had a value of 20, and t1 and t2 denote the start and end times of the respective measurement set. The difference of the baseline from the 400 ppm fresh airCO 2 concentration

CO2OFF was corrected from the measurements subsequently using (4.1). Parameters that affect the measuredCO 2 concentration of an NDIR sen- sor during operational use are air pressure, air temperature, and air humid- ity. The molecular density of the gas, which serves as the basis for the CO2 measurement, is directly proportional to the air pressure and inversely pro- portional to the air temperature [211]. The effect of the air pressure on the gas can be explained by the Boyle–Mariotte law, which states that the prod- uct of air pressure and gas volume is constant if the air temperature and the amount of substance remain unchanged [222]:

pV = const., (4.4) or p1V1 = p2V2. 4.1. Environmental Sensors for Indoor Air Quality Measurement 81

It follows that an increase in air pressure results in a decrease of the gas vol- ume. Since the amount of substance remains constant, the molecular density increases and hence theCO 2 reading goes up. To be exact, the amount of CO2 in ppm or percentage of the gas volume does not change. This means the ppm-reading of aCO 2 sensor is only valid as long as the value has been measured under its reference conditions (air temperature and air pressure) as stated by the manufacturer. For instance, the standard ambient temperature and pressure (SATP) conditions are TSATP = 298.15 K and pSATP = 100 kPa. Then with (4.4), the deviation from the standard conditions is calculated as % 1 /kPa. To transfer the measuredCO 2 concentration to its reference condi- tions, the following equation can be used: p CO = CO · reference . (4.5) 2reference 2OUT p The temperature effect is explained by Gay-Lussac’s law, which states that a gas volume is directly proportional to its air temperature if the air pressure and the amount of substance remain unchanged [222]: V = kT, (4.6) or V1T2 = V2T1, 23 where k is the Boltzmann constant (1.380650 · 10 J/K). An increase in air temperature thus increases the gas volume but decreases the molecular den- sity (andCO 2 reading). Assuming SATP conditions, the change inCO 2 % reading is calculated as ≈ -0.335 /K.ACO 2 measurement can be trans- ferred to its reference conditions using T CO2reference = CO2OUT · , (4.7) Treference with T and Treference defined in . Notably, the resulting air temperature sensitivity of the EE891CO 2 sensor must (for most parts of its measur- ing range) actually be much higher than the stated 2 ppm/K earlier. Equa- tions (4.5) and (4.7) can also be combined to transfer aCO 2 measurement to its air temperature and air pressure reference conditions at once:

preference T CO2reference = CO2OUT · · . (4.8) p Treference

When water vapour is added to a gas mixture, the CO2 concentration in volume fraction is reduced. The moisture content dilutes the gas mixture as compared to the gas in a dry state. The relationship of the concentration on a dry basis is described by [211] 106 CO = CO · . (4.9) 2dry 2wet 6 10 − H2Owet 82 4. Occupancy Detection With an Indoor Air Quality Monitor

H2Owet is the water vapour concentration in ppm and is obtained by relating the partial pressure of water vapour e to the pressure of the moist gas mixture [223]: e H O = 106 · . (4.10) 2 wet p The partial water vapour pressure in turn is related to the saturation water vapour pressure through the relative humidity. The relative humidity is defined as the ratio of the partial water vapour pressure to the saturated water vapour pressure ew at the same air temperature and air pressure [224]: e RH = . (4.11) ew There are numerous approximations for the saturation water vapour pressure. In this thesis, the formulation of the World Meteorological Organization [224] is used:  17.62 · T  e = 6.112 · exp , (4.12) w 243.12 + T where ew is defined in hPa and T in degree Celsius. The World Meteorological Organization also states an enhancement factor that sets the saturation water vapour pressure in function to the total pressure of the gas. However, since this amounts to changes of a maximum of 0.6 %, this has been omitted here. Similarly, theH 2Odry concentration is derived by relating the partial water vapour pressure to the pressure of the dry gas mixture [223]: e H O = 106 · . (4.13) 2 dry p − e

Using (4.9), (4.10), and (4.13), theCO 2 concentration can also be defined on a wet basis: 106 CO = CO · . (4.14) 2wet 2dry 6 10 + H2Odry In the application area of indoor air quality assessment, it is customary to use the measurement of relative humidity to describe air humidity [191]. To transfer the measuredCO 2 concentration from any moist gas state to another value of relative humidity, such as a reference condition, it can be first translated to the dry concentration and subsequently to the concentration at the specified relative humidity. The calculation can be performed in a single step: 106 106 CO = CO · · . (4.15) 2reference 2OUT 6 6 10 − H2Owet 10 + H2Odry 4.1. Environmental Sensors for Indoor Air Quality Measurement 83

Assuming a reference condition of 50 % relative humidity, theCO 2reference con- centration yields 1 1 CO2RH=50 % = CO2OUT · · , (4.16) 1 − ew · RH/p 1 + ew · 0.5/(p − ew · 0.5) where RH is the measured relative humidity, p the measured total air pres- sure, and ew the saturation water vapour pressure at the measured air tem- perature calculated from (4.12). To conclude,CO 2 sensors that were calibrated need to state the environ- mental conditions at the time of calibration, i.e., air pressure, air temper- ature, and relative humidity. Typically, manufacturers only declare the air pressure and air temperature during calibration [211]. Shrestha and Maxwell [211] have therefore developed a gas mixing apparatus and test chamber that is capable of generating variableCO 2 gas mixtures while regulating the air pressure, the air temperature, and the relative humidity. The researchers have used their test setup to analyse the effects of the three environmental parameters on variousCO 2 sensors. In this thesis,CO 2 measurements have not been compensated for environmental parameters due to the lack of an air pressure sensor in the indoor air quality measurement system and as a simplification for the initial demonstration of occupancy detection. However, at a later date, aCO 2 sensor calibration test setup was developed and mea- surements were conducted with another CO2 sensor model in an attempt to validate the effects of air temperature and relative humidity. A detailed report on the calibration test setup and measurements is given in ChapterC.

4.1.2 Total Volatile Organic Compounds How Volatile Organic Compounds Are Generated Indoors Another established method for indoor air quality sensing is the measurement of the total volatile organic compounds (TVOC). VOCs describe organic compounds with low boiling points, which means that at room temperature a large part of the molecules already convert into gas. Occupants, building materials, and furnishings are all sources of VOCs [197]. In addition to VOCs originating from human breath and skin respiration [225], various other VOCs are associated with human activity, e.g., VOCs from cosmetics, smoking, or cooking odours. Emissions from occupants are generated either periodically or irregularly over time, whereas evaporations from building materials and furnishings are emitted permanently on a constant or declining level [197]. The amount of indoor TVOC depends on: – The number of occupants 84 4. Occupancy Detection With an Indoor Air Quality Monitor

– The occupants, their individual emissions, and their behaviour

– The duration of occupancy

– Evaporations from building materials and furnishings

– The volume of the room

– The outdoor TVOC concentration

– The outdoor air refresh rate

Usage in Occupancy Detection The relationships between the TVOC and occupancy are comparable with those of theCO 2 occupancy detection (see Chapter 4.1.1). It is expected that the amount of VOCs increases with human presence, while at the same time VOCs escape through open windows, cracks in walls or the like. However, with occupancy detection by TVOC measurement, there is the difficulty that neither the exact amount nor the composition of the exhaled VOCs is known and that building materials and furniture can also produce VOCs. All of which makes it hard to relate the TVOC concentration to occupancy. Phillips et al. [226] investigated VOCs in human breath and found that there were wide inter-individual variations in the type of VOCs among the test subjects, but only relatively small differences in their total number. They further identified the presence of a common core of breath VOCs in all test subjects. Burdack-Freitag et al. [225], too, determined a common core of VOCs related to human presence and recommended detecting these marker compounds instead of the TVOC. To recognize the individual human- induced VOCs, the researchers used gas-chromatography and mass spectrom- etry (see [222] for more information), which cannot be employed in smart home applications or for permanent measurements in general. For long-term measurements, TVOC sensors based on MOS technology are suitable. How- ever, the few results obtained so far with TVOC sensors for occupancy de- tection are rather disappointing. Dong et al. [86] concluded that the TVOC concentration in a room is not influenced by its occupants. Ekwevugbe et al. [56, 58] further calculated that the predictive power of a VOC sensor for occupancy detection is low.

Sensor Principle MOS-type TVOC sensors are based on the chemisorption of gaseous mol- ecules at the sensor surface. The sensing layer is commonly made of tin 4.1. Environmental Sensors for Indoor Air Quality Measurement 85

dioxide (SnO2) and placed on a heatable substrate. In clean air, oxygen atoms are adsorbed on the sensor surface and in turn trap free electrons from the semiconductor. This causes a high electrical resistance at the sen- sor. When introducing reducible gases such as combustible gases, these react on the sensor’s surface with the preadsorbed oxygen. In this process, elec- trons are released again and increase the electrical conductance of the sensor. Reducible gases respond with the sensor at operating temperatures between 200 and 500 °C. Using a measurement circuit, the sensor’s conductivity is determined and compared to the clean air state. MOS-type gas sensors show a relatively poor selectivity [227], which makes it difficult to focus on spe- cific compounds, as was done in the studies described in the previous section [226, 225]. To improve the sensor’s selectivity and sensitivity towards certain gases, the composition of the sensor material, its structure, and the operating temperature is varied [227]. The recommended location of the measurement site is given at a height of 1–2 m and a distance to the next wall of 1–2 m. In a standard case, one sensor per room is sufficient [197]. Also, occupants should not be able to breathe directly onto the sensors. In the indoor air quality measurement system, the TVOC sensor iAQ- core with continuous operation mode from AppliedSensor GmbH (since 2014: ams Sensor Solutions Germany GmbH) [228] was installed. The MOS-type sensor operates at a temperature of about 300 °C[229]. Although the term TVOC is not adopted in the datasheet, according to the manufacturer the sensor is sensitive to all VOCs [230]. A proprietary algorithm, which is based on the measurements described in [85], translates the measured TVOC into aCO 2 equivalent unit. The sensing range is given as 450–2000 ppm CO2 equivalents [228], but higher values were measured and are within the specification according to the manufacturer [229]. The data communication was established via theI 2C bus.

Sensor Calibration Typically, MOS-based VOC sensors are not calibrated by the manufacturer due to the broad range of applications and its high dependency on the cal- ibration gas. For indoor air quality applications, a TVOC test composition was stated in [195], but the author suggested redefining the composition to reflect the variety and concentration of TVOC found in today’s residential indoor air. An updated TVOC test composition has not been published to date. The iAQ-core is not factory-calibrated [231] but uses ABC in fresh air (see Chapter 4.1.1 on ABC offset compensation). In a technical document published by Figaro Engineering Inc. [232], a pioneer in VOC sensor technology, it is written and shown by measurements 86 4. Occupancy Detection With an Indoor Air Quality Monitor that there is a dependency of MOS-type VOC sensors to air temperature and air humidity. The air temperature is supposed to affect the rate of chemical reaction and thus the sensitivity of the sensor. It is shown that as the air temperature increases (the relative humidity was kept constant), the sensor’s conductivity increases. However, the authors of the document did not discuss the possibility that the sensor’s sensitivity may have been altered by the change in water vapour. The absolute humidity of the air increases with the air temperature if the relative humidity is kept at a constant value. To reduce the temperature sensitivity, a compensation circuit or a compensation in software was suggested.

It is generally known that water vapour is adsorbed on the sensor surface of a MOS-type VOC sensor [233, 232]. In the technical document in [232], it is also shown that as the relative humidity increases, the sensor’s con- ductivity increases. The manufacturer of the iAQ-core TVOC sensor, ams Sensor Solutions Germany GmbH, confirmed a dependency to air humidity but stated that their sensor is not affected by changes of air temperature [231]. It is further possible that MOS-type VOC sensors react to changes of air pressure. In [232], a dependency of the sensor’s resistance to the partial pressure of oxygen in air was stated. However, an inquiry on the pressure dependency [234] revealed that the persons who conducted the measurement varied the oxygen concentration to change the partial pressure. Therefore, it is unclear if the conductivity changed because of the partial oxygen pressure or because of the different oxygen concentration. The manufacturer of the iAQ-core claimed there is no dependency of their sensor to air pressure [231].

There have been attempts to calibrate MOS-type VOC sensors, in par- ticular Helwig et al. [235] developed a gas mixing apparatus and test cham- ber, which are capable of producing gas mixtures with a target gas in the ppb-range and additionally regulate the air humidity. Low target gas con- centrations were realized using a permeation oven and by diluting the target gas with a carrier gas. A method to regulate the air temperature or air pressure was not installed. The effect of the environmental parameters on the iAQ-core and possibly its ABC algorithm were not investigated for this thesis. However, at a later date, a VOC sensor calibration test setup was developed and measurements were conducted with another MOS-type VOC sensor model to demonstrate the sensitivity of that VOC sensor to air tem- perature and relative humidity. A detailed report on the calibration test setup and measurements is given in ChapterC. 4.1. Environmental Sensors for Indoor Air Quality Measurement 87

4.1.3 Air Temperature How Heat Is Generated Indoors The air temperature influences both the perception of indoor air quality and its hygienic quality. Furthermore, it is a measure of thermal comfort [17]. The indoor air temperature is defined by the outdoor environmental conditions, the thermal insulation of the building, and heat sources inside the room or building. Heat sources in a room include heat generated by humans, which in turn depends on the intensity of the physical activity performed and the individual variability of a person, such as age, sex, weight, height, body surface area, and personal fitness [116]. Other heat sources indoors include electrical appliances, which produce heat either periodically (e.g., a fridge) or irregularly over time (e.g., a washing machine, a TV). In addition, the indoor air temperature can also be controlled by an HVAC system. In total, the indoor air temperature depends on: – The number of occupants

– The type of physical activity performed and the personal variability

– The duration of occupancy

– Heat generated by electrical appliances

– A building’s heating and cooling system

– The building’s thermal insulation

– The volume of the room

– The outdoor environmental conditions

– The outdoor air refresh rate

Usage in Occupancy Detection For the most part, indoor air temperature increases with occupancy, and its rate depends on the number of occupants and their behaviour. Heat gener- ated by electrical appliances or, on the other hand, the natural exchange of air due to open windows may each represent additional markers of occupancy. In general, however, the air temperature changes only slowly, which may mean that the occupant-related change is too small to be detected. Moreover, it is possible that the relationship between occupancy and air temperature is superimposed by the heating and cooling of buildings. 88 4. Occupancy Detection With an Indoor Air Quality Monitor

Air temperature sensors are frequently used in occupancy detection as part of a sensor fusion (see Chapter 2.2). Lam et al. [41] calculated a maximum information gain ratio (IGR) for an indoor air temperature sen- sor of only 37.39 %. Also, the researchers in [42], [46], [57], and [62] all concluded that indoor air temperature changes are dominated by HVAC systems. W¨orner et al. [72] found that the outside air temperature, solar radiation, and the heating system had a greater influence on the indoor air temperature than an occupant. In contrary to this, Yang et al. [59] described that the indoor air temperature was sensitive to changes of the number of occupants and decided that it can be an effective indicator of occupancy in shared offices. Candanedo et al. [76] also showed some connection to occu- pancy using an unsupervised HMM on indoor air temperature data from an office environment.

Sensor Principle Semiconductor temperature sensors commonly are bandgap air temperature sensors, which are based on the temperature dependency of the forward volt- age of the silicon diode. Integrated circuits use the pn-junction of two or more transistors in a Brokaw cell circuit. The resulting voltage difference is proportional to absolute temperature. This type of air temperature sensor offers a high accuracy in addition to a high linearity within an operating range of about -55 to +150 °C[236]. When designing an air temperature sensing system, it is important to decouple the sensor from all nearby sources of the system that potentially induce heat by conduction, convection, or thermal radiation. The design should allow proper ventilation of the sensor to avoid dead air surrounding it and to improve the sensor response time. Application notes on which the recommendations are based are found in [237, 238, 239]. SENSIRION AG, the manufacturer of the air temperature sensor used in this work, further recommends reducing the operating time of the sensor to less than 10 % of the total time to avoid self-heating [239]. During deployment, exposure to solar radiation and thermal radiation from nearby objects such as walls have to be prevented. The sensor response time can be improved by increasing the air velocity of the surrounding air [237, 239]. Inside the indoor air quality measurement system, the air temperature and relative air humidity sensor SHT25 from SENSIRION AG was installed. The bandgap air temperature sensor is integrated on a complementary metal- oxide-semiconductor (CMOS) chip together with a digitalI 2C bus interface. The typical accuracy is given as ±0.2 °C for a measuring range of about +5 to +55 °C. The response time to achieve 63 % of a step function is said to 4.1. Environmental Sensors for Indoor Air Quality Measurement 89

° lie between 5 and 30 s. Long term drift is stated to be below 0.04 C/yr [240]. The sensor specifications are well within the minimum requirements defined by the Ergonomics Standards Committee of the DIN German Institute for Standardization [237]. Furthermore, the SHT25 sensor is factory-calibrated [240]. In addition to the indoor air temperature measurement, an SHT25 air temperature and relative humidity sensor was integrated into an outdoor air measurement system. The motivation was to further detect weather-induced temperature changes that may have an effect on the indoor air temperature. The outdoor air measurement system was attached outside of an apartment close to a window. It was also expected that the outdoor unit helps in the detection of occupancy markers such as opening and closing of windows. In a cold season, opening a window should cause a sudden change in the measured indoor and outdoor air temperature due to a draught of cold air flowing in and warm air flowing out of the apartment.

4.1.4 Air Humidity How Water Vapour Is Generated Indoors The hygienic and the perceived indoor air quality are affected by the air humidity. Air humidity, however, has only a modest impact on the thermal comfort [17]. Measurements of the indoor air humidity are defined as relative humidity [191]. The relative humidity is the ratio of the partial water vapour pressure to the saturated water vapour pressure at the same air temperature and air pressure [224]. Humans generate water vapour through breathing, transpiration, or by performing household activities such as cooking, shower- ing, and drying clothes [241, 194]. The rate of water vapour that is produced directly by the occupants depends on the intensity of the physical activity performed and the individual variability, whereas other occupant related pro- duction is mostly irregular over time. Other factors that affect the indoor air humidity are the outdoor environmental conditions, the absorption and des- orption of humidity in building materials and furnishings [194], and HVAC. The overall indoor relative humidity of the air depends on:

– The indoor air temperature

– The number of occupants

– The type of physical activity performed and the personal variability

– The occupants’ household activities 90 4. Occupancy Detection With an Indoor Air Quality Monitor

– The duration of occupancy

– The absorption and desorption of humidity of and from materials

– A building’s heating and cooling system

– The volume of the room

– The outdoor environmental conditions

– The outdoor air refresh rate

Usage in Occupancy Detection

Humans generate large quantities of water vapour through breathing, tran- spiration, and household activities. While the exhaled air causes the hu- midity to rise fairly steadily, certain household activities can cause abrupt changes in relative humidity. The indoor relative humidity is also related to the number of occupants, but their behaviour, especially the type of house- hold activity, has a greater impact on the total amount of water vapour [194]. Opening and closing of windows could be recognized as events that indicate occupancy. However, depending on the duration, open windows can also suppress the occupants’ effects on the air humidity. The relationship between the relative humidity and occupancy is further complicated by the absorption and desorption of humidity in building materials and furnishings as well as by HVAC systems that may be present in the building. Occupancy detection approaches based on sensor fusion often included relative humidity (see Chapter 2.2). Lam et al. [41] calculated a maximum IGR for a relative humidity sensor of 77.65 %, which was higher than any other sensor type investigated. Yang et al. [62, 59] expressed that rela- tive humidity can be an effective indicator of occupancy in a laboratory or a shared office. Han et al. [46] wrote that occupants’ breathing adds a consider- able amount of water vapour that reflects changes of occupancy. Candanedo et al. [76] also showed some connection to occupancy using an unsupervised HMM on indoor air humidity data from an office environment. On the other hand, Lam et al. also discovered in [42] as well as Ekwevugbe et al. in [57], that relative humidity changes are dominated by HVAC systems. W¨orneret al. [72] found that relative humidity depends more on other environmental conditions than on occupancy. 4.1. Environmental Sensors for Indoor Air Quality Measurement 91

Sensor Principle For indoor air quality applications, especially those with the smart home in mind, relative humidity sensors based on a capacitive or a resistive mea- surement principle are suitable choices. The dielectric film of a capacitive type relative humidity sensor is a polymer or metal oxide, whose relative permittivity changes according to the absorbed moisture from the surround- ing air. The incremental change in the dielectric constant is almost directly proportional to the ambient relative humidity. Compared to resistive relative humidity sensors, capacitive type sensors are more robust against chemical vapours and air contaminants and can be manufactured with minimal long- term drift, minimal hysteresis, and near-linear output. The variance between multiple capacitive type relative humidity sensors can be improved by laser trimming. A two-point calibration achieves a typical accuracy of ±2 %rh [242]. Design rules for the relative humidity sensor system can be taken from Chapter 4.1.3. Special attention should be given to the airflow over the sen- sor and to avoiding materials in the vicinity of the sensor that can absorb moisture. Both measures help to improve the response time [239]. The factory-calibrated air temperature and relative air humidity sensor SHT25 from SENSIRION AG was installed in the indoor air quality mea- surement system. The capacitive relative humidity sensor is integrated on a CMOS chip and its typical accuracy is given as ±1.8 %rh for a measuring range between 10 and 90 %rh. The typical response time reads 8 s (achieving 63 % of a step function), the long term drift is given as <0.5 %rh/yr, the hys- teresis is stated as ±1 %rh, and the nonlinearity is negligible with <0.1 %rh [240]. Notably, the sensor specifications are well within the recommended characteristics of the VDI Society Civil Engineering and Building Services [191]. In the previous section on the air temperature sensor, it was already described that an additional SHT25 air temperature and relative humidity sensor was integrated into an outdoor air measurement system. The influence of weather changes on the indoor relative humidity as well as the detection of occupancy markers such as opening windows can be better studied by analysing both the indoor and outdoor relative air humidity.

4.1.5 Other Environmental Sensors Another parameter that is used to determine the thermal comfort is air veloc- ity. The air velocity is measured indoors using hot-wire anemometers. [243]. Here it is conceivable that the movement of the occupants leads to measurable local changes in the airflow. The same effect may result from opening win- 92 4. Occupancy Detection With an Indoor Air Quality Monitor dows, doors, or cupboards, which then could indicate occupancy. However, the measurement of air velocity varies largely depending on the location and orientation of the sensor [243]. Smoke detectors or carbon monoxide detec- tors, of which the former recently became mandatory in residential buildings of countries such as Germany, have also not yet been studied as occupancy de- tectors. Nevertheless, because occupants rarely produce smoke (unless they are regular smokers) and the carbon monoxide exhaled by a non-smoking person is only about 4 ppm [244] (compared to the 40 000 ppm ofCO 2), it is probable that these sensors are poor indicators of occupancy. Another source of air pollutants is particulate matter. It has been shown that occupants at- tribute to parts of the particulate matter in indoor air, but the outdoor air concentration as well as the ambient conditions (mainly the outdoor air ve- locity) have a large influence on the results [245]. Jeon et al. [246] indicated that the particulate matter concentration is highly sensitive to the type of occupant activity (e.g., sleeping as opposed to vacuum cleaning). Sound sensors, typically realized with a microphone, have been frequently used for occupancy detection as part of a sensor fusion (see Chapter 2.2). Human presence can be derived by detecting changes in the sound level or by discriminating certain sounds or speech from background noise. A correlation between the sound level and occupancy has been reported in [70] and regarding the number of occupants in [42] and [56]. For the sound sensor, Lam et al. [41] calculated a maximum IGR of 77.65 %, which was the second highest value from all investigated sensor types. In [62], Yang et al. determined the average sound level as the most influential feature. In [59], the researchers wrote that the sound sensor had only a minor influence on the classification results, which as they said was probably due to a poor sensor location. Other researchers [42, 247], however, also observed that features based on the sound level are prone to false-positives due to noise from the nearby environment. Sound sensors used for occupancy detection are therefore often fused with other sensor types. Moreover, the recording of sound and speech is considered intrusive. At least in the papers cited in this paragraph, only the use of the sound level has been described, which is far less intrusive. Photodetectors measure the light intensity in a room and were used in a number of sensor fusion approaches (see Chapter 2.2). For rooms that have no windows, simply the information whether the light is switched on is an indication of the presence of persons. In rooms with windows, however, the shines during the day, so that only sudden changes in light intensity can be used as indicators of occupancy. In addition, it must be distinguished from abrupt changes of incoming sunlight caused by cloud fields or such. The results of other researchers reported with light sensor data were mixed. 4.2. Indoor Air Quality Measurement System 93

(a) (b)

Figure 4.2: a) Indoor air quality measurement system and b) outdoor air measurement system [292], (c) 2018 IEEE

Ang et al. [70] described that the light intensity and occupancy were little correlated. Yang et al. [59] described that light was among the most in- fluential sensor data. Candanedo and Feldheim [69] achieved the highest information gain with a light sensor, which also had the lowest correlation to all other sensors in the set. Events such as opening or closing a door or window can cause variations in air pressure of that room. Air pressure sensors have been used to detect occupancy in rooms with mechanical ventilation systems, see [248, 50, 51, 52, 53, 54]. In these publications it was shown that the human-induced changes in air pressure may well be used to infer occupancy. However, Patel et al. [248] also made clear that the accuracy declines substantially without operation of the HVAC system.

4.2 Indoor Air Quality Measurement System

4.2.1 System Overview The demonstrator of the indoor air quality measurement system is shown in Figure 4.2a. It consists of an NDIR spectroscopy typeCO 2 sensor, a MOS-based TVOC sensor, and an air temperature and relative air humidity sensor. In addition, an air temperature and relative air humidity sensor was integrated into the outdoor air measurement system demonstrator, which is shown in Figure 4.2b. The design of the devices allows the installation and operation to be carried out effortlessly by the occupants themselves. 94 4. Occupancy Detection With an Indoor Air Quality Monitor

Outdoor Air Indoor Air Quality Occupancy Measurement BLE Measurement Detection System System Preprocessing To/RHo CO2 CSV Feature NTP Server WLAN TVOC File Extraction Timestamp Ti/RHi Feature Smartphone Selection Ground WLAN Truth Classification Occupancy

Figure 4.3: Block diagram of the measurement systems and occupancy de- tector [292], (c) 2018 IEEE

As depicted in Figure 4.3, the measurements from the outdoor unit are transferred wirelessly to the indoor unit using Bluetooth Low Energy (BLE) technology. A timestamp is retrieved from a Network Time Protocol (NTP) server to initialize the real-time clock of the indoor air quality measurement system’s microcontroller. The ground truth occupancy is recorded with an application that runs on a smartphone. The timestamp and the occupancy values are sent to the indoor unit wirelessly via a wireless local area net- work (WLAN) access point. The indoor air quality measurement system acquires the indoor parameters, performs data cleaning, and stores the mea- surements together with the other values in a CSV file on a microSDHC card at the end of each cycle. The measurements from the CSV file are analysed by an occupancy detector on a PC, which performs data preprocessing, fea- ture extraction, feature selection, and classification. At a later time, it is planned to integrate an economical version of the occupancy detector into the microcontroller of the indoor system or a more sophisticated detector into a cloud-based system that offers enough computational power.

4.2.2 Ground Truth Occupancy Recorder Participants of the occupancy detection study were provided with an Android smartphone and asked to state the ground truth occupancy by pressing a 4.2. Indoor Air Quality Measurement System 95

Figure 4.4: Screenshot of the ground truth occupancy input screen

button on the phone’s touch screen whenever a person entered or left the apartment. The smartphone runs a program written with the application Tasker from Crafty Apps EU. The Tasker application performs actions based on events, which are written in a scripting language. The graphical user interface (in Tasker called ”Scene”) to enter the ground truth occupancy is shown in Figure 4.4. When a button is pressed, the program sends the ground truth occupancy value to the indoor air quality measurement system and confirms the successful transfer acoustically by playing a sound. The input screen of the device is constantly turned on for the occupants to be able to timely press a button. To give the participants the chance to remark special events and as a fail-safe of the occupancy recorder, the participants were additionally handed a notepad. The experiences with switch-based ground truth occupancy recorders that are operated by the participants themselves were mixed among other re- searchers. Mamidi et al. [63] observed that their counter App was a good estimate of the ground truth occupancy, whereas W¨orneret al. [72] pointed out that their switch-based ground truth contained errors from forgetful par- ticipants. Arora et al. [65] had a computer keyboard set up to record the number of occupants but complemented the data with video feeds for relia- bility. Video camera feeds can be used to accurately record occupancy, but the evaluation is time-consuming, they require large amounts of storage, and they raise privacy concerns [72]. 96 4. Occupancy Detection With an Indoor Air Quality Monitor

4.2.3 Hardware Setup The central control unit of the indoor air quality measurement system is the 16-bit microcontroller PIC24FJ128GA006 from Microchip Technology Inc. [249]. As described in Chapter 4.1.1, theCO 2 sensor EE891-5C9 was connected with the microcontroller using the digital E2 interface. The air temperature and relative humidity sensor SHT25, the TVOC sensor iAQ- core, and the BLE module BLE113 from Bluegiga Technologies Oy [250] transfer data on the secondI 2C bus. The WLAN communication is man- aged by the module MRF24WB0MA from Microchip Technology Inc. [251], which operates on the first SPI bus. The EEPROM 24FC256 from Microchip Technology Inc. [252] stores the WLAN settings and uses the firstI 2C bus. Measurements are saved on the microSDHC card SDSDQ-004G-E11M from SanDisk Corporation, which uses the second SPI bus. The system is powered by an external 5 V DC power supply. The air temperature and relative hu- midity sensor was placed on a separate PCB, which is physically decoupled from all potential heat sources of the main PCB. Figure 4.5 shows the assem- bled PCBs. The schematic and the board layouts are given in Figures B.1, B.2, and B.4 and the mechanical drawings in Figures B.6 and B.7. In the outdoor air measurement system, a CC2541 system on a chip from Texas Instruments Incorporated serves as the central control. The CC2541 is part of the BLE module BLE113. The air temperature and relative humidity sensor was connected to theI 2C bus of the module. Because the outdoor unit is a low-power design, it runs with a single CR2032 button cell. The assembled PCB is shown in Figure 4.6. The schematic and the board layout are depicted in Figures B.3 and B.5.

4.2.4 Software Description The software of the indoor air quality and the outdoor air measurement system was based on program code written during the two student theses in [273, 277]. Both works were supervised by the author of this thesis. The program flow is depicted in Figure 4.7. The indoor unit first initializes its variables and internal hardware devices. In the next step, the program awaits the measurement interval (here 15 s). When the interval has passed, the current time is obtained, the indoor parameters are measured, and the ground truth occupancy value is collected. The outdoor sensor values are retrieved subsequently, and the data are saved to the CSV file. The program sequence of the outdoor unit is similar, except at the end of the measurement cycle when it sends the outdoor sensor values and collects the new time interval from the indoor unit’s Bluetooth module for synchronization. 4.2. Indoor Air Quality Measurement System 97

(a)

(b)

(c)

Figure 4.5: Assembled PCB of the indoor air quality measurement system: a) top side (dimensions are 94 mm × 78 mm), b) bottom side, and c) external air temperature and relative humidity sensor (dimensions are 10.75 mm × 11.5 mm) [292], (c) 2018 IEEE 98 4. Occupancy Detection With an Indoor Air Quality Monitor

(a) (b)

Figure 4.6: Assembled PCB of the outdoor air measurement system: a) top side (dimensions are 29 mm × 29 mm) and b) bottom side [292], (c) 2018 IEEE

4.3 Data Collection

4.3.1 Measurement Location

The measurements were carried out from January to March 2015 in apart- ments of a student dormitory in Erlangen, Germany. Each apartment mea- sures 22 m2 and includes one bedroom with a small corridor and a bathroom (the floor plan is depicted in Figure 4.8). The entry door leads to the stu- dent dormitory hallway. The bedroom is furnished with a bed, desk, and kitchen. A double-glazed window is installed in the bedroom, and a mechan- ical ventilation fan in the bathroom turns on with the light. The indoor air quality measurement system was installed in the bedroom either on top of a wall unit of the kitchen or on a shelf atop of the desk, whereas the outdoor air measurement system was fixed on the wall outside of the window. To provide fresh air for the ABC algorithms of theCO 2 and TVOC sensors (see Chapters 4.1.1 and 4.1.2), the window was opened for 10 to 15 min at the beginning of each measurement. The weather was characterized by a typical winter in Germany with near zero temperatures and a mainly wet period. All subjects used a heating radi- ator and opened the window only for air renewal. The participants paid the heating by a fixed monthly rate, which may have led to a higher usage of the radiator in conjunction with open windows than usual. Because the outdoor air measurement system was attached to the outside wall of the apartments, it was exposed to the thermal radiation of the building. Furthermore, the windows of two apartments are facing south by west direction. Here, the out- door air measurement system was exposed to solar radiation that led to the heat up of the system during hours of sunlight. Unfortunately, the outdoor unit could not be installed elsewhere. 4.3. Data Collection 99

Indoor Air Quality Outdoor Air Measurement System Measurement System

Start Start

initialize initialize

interval interval passed no no passed

yes yes

get indoor values get outdoor - timestamp values - To - Ti - RHo - RHi - TVOC

- CO2 - ground truth occupancy send outdoor values

get new time interval to save to synchronize CSV file

Figure 4.7: Program flow of the indoor air quality measurement system and the outdoor air measurement system 100 4. Occupancy Detection With an Indoor Air Quality Monitor

O

I

Figure 4.8: Apartment floor plan, I: indoor air quality measurement system, O: outdoor air measurement system

4.3.2 Participants Two female and two male students, aged 21 to 24, volunteered to participate in the experiment. In general, different participants introduce variety in occupant behaviour that can have an impact on the environmental parame- ters. Each participant performed a side job along typical student obligations, which assured longer unoccupied phases. However, due to the student status, unoccupied phases are more irregular than from persons with a nine-to-five job. This resulted in highly dynamic occupancy patterns. In terms of natural ventilation, it is distinguished between rush airing, where the windows are fully open for a time of 5 to 10 min, and continuous airing, where the windows are tilted for a longer period. The advantage of rush airing is that the room does not cool down, while both methods can ensure sufficient indoor air quality. It is expected that changes by the occupants become more visible during (or even through) rush airing. The participants stated to conduct either rush airing or a combination of rush airing and continuous airing. None of the participants used their entry door for air exchange.

4.3.3 Datasets A total of eight independent data sets having a length of four to nine days each and a measurement interval of 15 s were recorded (see Table 4.1). The datasets can be downloaded here1 and are free to use for research purposes including publication of the results. From a total of 205 354 instances, 84 300

1http://bit.ly/occupancy data 4.3. Data Collection 101

Table 4.1: Distribution of Instances Across Occupancy Numbers [292], (c) 2018 IEEE

Dataset/ Vacant Number of occupants Occupied Total Participant (0) (1) (2) (3) (1–3) T1/ A 15 503 5 554 24 131 596 30 281 45 784 T2/ A 11 490 3 744 13 448 150 17 342 28 832 T3/ B 9 910 7 093 2 925 0 10 018 19 928 T4/ B 20 495 14 319 2 714 0 17 033 37 528 T5/ C 2 946 11 145 5 773 80 16 998 19 944 T6/ C 14 118 2 290 3 276 0 5 566 19 684 T7/ D 5 359 6 907 5 368 0 12 275 17 634 T8/ D 4 479 11 535 6 0 11 541 16 020 T1–8/ A–D 84 300 62 587 57 641 826 121 054 205 354 were recorded as vacant and 121 054 as occupied. The occupied instances were further split in 62 587 instances with one, 57 641 instances with two, and 826 instances with three occupants. Because of the small apartment size, three occupants were exceptional and of shorter duration. The time the sensors respond to changes in the environment depends on the underlying technology of the sensors, the design of the sensor system, the ambient conditions of the air, and the location of the system (more in- formation is given in Chapter 4.1). The sensor response time can be higher during startup or when the sensor is suddenly exposed to new ambient con- ditions. After examining the measurement data, an average response time during startup of about 10 min for the indoor and about 30 min for the out- door sensors was determined. Although, on a wet day when the outdoor relative humidity of the air was high, it happened that the outdoor relative humidity sensor required several hours to reach its final value. In the course of the measurements, participants occasionally reported that they had forgotten to press the button on the ground truth occupancy recorder in time. As discussed in Chapter 4.2.2, W¨orneret al. [72] already noticed this circumstance with participant-controlled occupancy recording. Fortunately, most of the occupancy information were restored with handwrit- ten notes from the participants. From the outdoor measurements, however, 22 % of the data had to be declared missing as interferences in the wireless connection between the outdoor and indoor units caused transmissions er- rors and a faster battery drain of the outdoor air measurement system than initially calculated. Nevertheless, it was decided to use the remainder of the outdoor measurements as the data still can hold locally predictive value and 102 4. Occupancy Detection With an Indoor Air Quality Monitor to chose classification algorithms that handle missing values. After all, this case is also a good example of the benefits of sensor fusion, where multi- ple sensors can compensate for missing data on individual sensor errors or failures.

4.4 Occupancy Detection Algorithm

4.4.1 Data Preprocessing

The measurements that are saved in a CSV file (see Chapter 4.2.4) are pro- cessed on a PC using a program written in GNU Octave version 4.0.0. One of the functions of the program is to perform an ABC of theCO 2 data as described in Chapter 4.1.1. However, it was discovered that the duration of air renewal at the beginning of the measurement (see Chapter 4.3.1) was too short for theCO 2 sensor to reach its minimum readings. Therefore, the ABC was applied to the entire measurement series to ensure a longer period of time with the windows open and thus to achieve a better estimate of the fresh air concentration. The program further converts the timestamp and missing values to a format that can be processed by the data mining tool Weka.

4.4.2 Feature Extraction

The features described in the following were extracted and saved in a Weka- compliant ARFF file using GNU Octave version 4.0.0.

Time of Day and Working Day State

The measurements were timestamped, from which the time of day, a numeric feature given in the unit seconds, was derived. The time can be useful for determining patterns in a day. For example, this may be the times an occu- pant leaves home for work and returns. The working day state is a binary feature, indicating either a working day (1) or a weekend day or holiday (0). Depending on the individual’s schedule, it is expected that on a working day the apartment is vacant for some time during the day and occupied at night, whereas weekend days can occasionally be vacant all day when a student visits their parents. In addition to the two features used here, it is possible to extract further features from the timestamp (e.g., the month or season of the measurement). 4.4. Occupancy Detection Algorithm 103

Raw Value This feature describes the measured raw value including noise from the sen- sor. An exception are the raw values of the outdoor air temperature and the outdoor air relative humidity, which were defined here as the difference between the indoor and outdoor raw values.

Moving Average (MA) The moving average (MA) takes the arithmetic mean of the current and a number of neighbouring measurement values. Here, a laggingMA with the current and the previous n − 1 raw values was applied as it reflects the implementation in a real-time classification system. The unweightedMA is written as n−1 1 X MA(t) = x(t − (i · ∆t)), (4.17) n i=0 where t refers to the time of the current sensor reading, x(t) is its raw value, and∆ t denotes the time between sensor readings (here 15 s, see Chap- ter 4.2.4). The centre of the mean value is lagging from the current raw value by n − 1 τ = · ∆t. (4.18) 2 An information gain is expected from the temporal information of theMA rather than from its smoothing character. For example, a window is opened that results in lowCO 2 values, yet pastCO 2 levels were considerably higher due to earlier occupancy. The raw value feature indicates vacancy, whereas theMA recognizes occupancy. One drawback is that current events are attenuated, which can lead to misclassification due to a slow response time.

Moving Sample Variance (MSV) The variance describes the amount of variability for a set of measurements. The sample variance takes into consideration that only a sample of the whole population is used (here, a set of discrete measurements). Following the notation of theMA feature, the current and the n − 1 previous raw values were taken to build the moving sample variance (MSV):

n−1 1 X 2 MSV(t) = (x(t − (i · ∆t)) − MA(t)) . (4.19) n − 1 i=0

The delay of the MSV is given in (4.18). 104 4. Occupancy Detection With an Indoor Air Quality Monitor

Information about the variance can be used to detect occupancy. The variance typically is higher during times of occupancy as occupants emit CO2, VOCs, heat, and humidity, or they open doors and windows that result in a sudden change of the environmental parameters. Nonetheless, as with the MA feature, the moving character of the MSV can lead to misclassifications due its slower response time. It is further possible to take the sample standard deviation√ instead of the variance. It differs from the MSV by using a different weight ( MSV). However, since no illustration of the features takes place in this chapter, the variance can be used here, which also saves one calculation step.

Moving Range The range determines the difference between the highest and lowest value and is also a measure of spread for a set of measurements. In short periods of time, environmental parameters typically go only up or down, and thus the information that can be drawn from the moving range is comparable to what can be expected from the MSV feature. Although, the moving range is more sensitive to outliers. Because of its similarity to the MSV, and consequently redundancy, the moving range was excluded from the feature set.

First Derivative (FD) The first derivative (FD) describes the rate at which a measurement parame- ter increases or decreases. Differentiation, unfortunately, also magnifies noise from the measurement. This, in most cases, requires filtering when applied on the raw value. For this reason, the laggingMA filter from (4.17) was used prior to the differentiation. TheFD is given by calculating the difference quotient: MA(t) − MA(t − ∆t) FD(t) = . (4.20) ∆t PositiveFD values, using the example ofCO 2, can be the result of occu- pancy, whereas negative values can be due to open windows or air infiltration during vacant times. This relationship can also be reversed depending on the type of sensor and the ambient conditions. Due to the nature of theMA fil- ter, the delay in (4.18) is imposed on theFD feature. The advantages and disadvantages of this effect were already described in theMA feature.

Second Derivative (SD) The second derivative (SD) gives the rate at which theFD increases or de- creases, or in other words, determines if the process is accelerating or de- 4.4. Occupancy Detection Algorithm 105 celerating. TheSD feature is the difference quotient of theMA-filteredFD feature: MA(FD(t)) − MA(FD(t − ∆t)) SD(t) = . (4.21) ∆t The main drawback of theSD feature is that the delay from (4.18) is doubled by the twoMA filters of the first and second derivative. In return, theSD feature can be an additional source of information whenever theFD feature result is ambiguous. For example, the rate theCO 2 concentration is decreasing can—at a certain point in time—indicate an occupant who has opened a window, or as well it can be the exact rate of air infiltration during vacancy. The opening of a window is, however, a more dynamic process that is shown by theSD feature value.

Window Length of a Feature The number of raw values n that are required to build theMA, MSV,FD, and SD features depends on the measurement interval∆ t, the sensor type, and the desired information. In particular, the air temperature sensor is the least sensitive sensor (in terms of noise or abrupt changes) and therefore requires a smaller number of raw values for a smoothing filter as, in turn, the CO2 or TVOC gas sensors. Apart from this, anMA feature with a large window length can have more information gain than a small window when combined with the raw value feature. The MSV in a short time frame ideally captures abrupt changes, whereas when spanned over a long duration captures gradual changes. TheFD andSD features require a certain minimum number of raw values for theMA-filter to cope with a noisy signal. The window length is always a trade-off between different characteristics and can be meaningful for one set of data but poor for another. One way is to generate additional features from a number of time windows, as done for example by Hailemariam et al. in [44]. This method is eligible for classifiers that are robust against redundant features, such as decision trees, but is not recommended for classifiers that require the features to be independent of each other, such as Na¨ıve Bayes [253]. A time window of 5 min was chosen for all features and sensors in this thesis as it proves to sufficiently smooth environmental sensor measurements and is a good compromise in the MSV feature to react on abrupt changes and cover gradual changes. Nevertheless, this can be further optimized at a later stage by defining individual time frames for every feature and sensor domain. To account for the initial period of air renewal and the sensor response times during startup (see Chapter 4.3), the features were extracted from the indoor sensors 20 min after the start of the recording and those 106 4. Occupancy Detection With an Indoor Air Quality Monitor from the outdoor sensors 30 min after. For time slots with missing data, an exception was created that the features were extracted only if more than 50 % of the raw values existed. In that case, the computation of the feature value was performed on the remaining measurements.

4.4.3 Feature Selection Feature Selection is the process of identifying and removing features that are unrelated to the class or redundant to other features. For instance, irrelevant features degrade the performance of decision trees, rule learners, linear re- gression, or instance-based learning algorithms. The Na¨ıve Bayes classifier is robust against irrelevant features, but its operation deteriorates when redun- dant features are added. Typically, preselection improves the performance of a classifier. In this thesis, filter methods were used because they are com- putationally lightweight and independent of the learning model. Another way is to use wrapper methods, which use the same learning algorithm for preselection and classification [45]. The feature selection was performed in Weka version 3.6.12. The best feature combinations were found by testing all possible combinations with an exhaustive search. The relevance of a feature with respect to the class is measured using the symmetric uncertainty (SU) test. TheSU lies between zero and one, where the value one represents the highest predictive ability [45]. Weka allows additional configurations, of which the following was selected:

ˆ missingMerge: True (default) An estimate on the whole dataset is made by distributing counts of missing values across other values. The frequency of a value in a dataset determines the weight of receiving those counts. Another option is to treat missing values as separate values [45], which, however, is not suit- able for the datasets in this work. Especially the missing values of the outdoor air measurement system were simply lost due to transmission errors or empty batteries rather than, for example, exceedingly high air temperatures outside the measuring range of the sensor.

The correlation-based feature selection (CFS) examines the redundancy among features as well as their significance to the class. Internally, it uses the SU test to measure the degree of association between features with the class and features of the set. The attribute ranking metric is called merit and goes from zero to one. If two or more feature subsets result in the same merit, the smallest subset is chosen as the other sets hold redundant features [45]. One disadvantage of CFS is that it is not designed to detect the interaction 4.4. Occupancy Detection Algorithm 107 of features [254]. For example, it cannot discern that occupants tend to sleep out on weekends, which could easily be recognized if the features time of day and working day state are combined. Weka allows additional configurations, of which the following were selected:

ˆ missingSeparate: False (default) This option is identical to the ”missingMerge” option of theSU test. However, the definition is reversed, thus ”False” is selected instead of ”True”.

ˆ locallyPredictive Unselected features that hold locally predictive power that is not al- ready covered by the feature subset are added if the feature’s associa- tion measure with the class is higher than its measure with any of the preselected features [255].

4.4.4 Classification A selection of popular learning algorithms was chosen, all of which are ca- pable of processing numeric and missing values and supporting multi-class classification. The classification was conducted in Weka version 3.6.12.

ZeroR

ZeroR is the simplest rule-based learner that predicts the majority class value from the training set. It is used as a baseline performance measure for other classifiers [45].

JRip

JRip is Weka’s version of the repeated incremental pruning to produce er- ror reduction (RIPPER) rule learner from Cohen [256]. RIPPER randomly splits instances into a growing and a pruning set (ratio 2:1). Then, a rule that covers only positive instances is added and immediately pruned. Sub- sequently, all instances that were classified by the rule are removed. This process is repeated until all positive instances are included in the rule set, or a certain stopping condition is met. Multi-class classification is conducted in order of frequency by starting with the least frequent class value. RIPPER further includes post-optimization of the rule set [256]. 108 4. Occupancy Detection With an Indoor Air Quality Monitor

Na¨ıve Bayes The Na¨ıve Bayes learner (in the following Tables abbreviated asNB) assumes that all features are independent and of equal importance to a class value. For each class value, a posterior probability is determined by multiplying the conditional probability of each feature value for the given class value with the prior probability of the class value. The class value that holds the highest posterior probability is predicted. The implementation in Weka includes Laplace correction to prevent a zero probability outcome [45]. In Weka, the following default setting was changed:

ˆ useSupervisedDiscretization True Normally, Na¨ıve Bayes uses the probability density function of a normal distribution to process numeric values of a feature [45]. This setting chooses the discretization method from Fayyad and Irani [257] instead. Numeric values, here, are converted into nominal values by recursively splitting them into intervals [257]. Experiments with the datasets from this thesis showed that the performance was generally improved by the discretization.

J48 J48 is Weka’s implementation of the C4.5 release 8 decision tree inducer from Quinlan [258, 259]. The C4.5 inducer grows the decision tree by recursively breaking the tree down into subtrees and leafs. The split in each decision node is based on the gain ratio criteria. To avoid overfitting, the initial decision tree is postpruned using subtree raising. The heuristic for the pruning is based on a pessimistic estimate of the error rate from the training data [258].

Logistic In Weka, Logistic is the name of a multinominal logistic regression model. Based on le Cessie and van Houwelingen [260], a ridge estimator is used to obtain the coefficients of the regression functions. Basically, the ridge estimator adds a penalty to the coefficients to avoid overfitting. Logistic uses an iterative search for the maximization procedure and predicts the class value with the highest probability [45]. k-Nearest Neighbours The instance-based learning method Nearest Neighbour stores all training in- stances in the memory. A test instance is compared to the training instances 4.5. Performance Metrics 109 by performing a distance measure, typically the Euclidean distance. Subse- quently, the class value of the closest match is assigned to the test instance. To overcome noisy measurements that easily decrease the performance of the algorithm, a majority vote of the k nearest neighbours can be used. This is called the k-NN learning algorithm. The k-NN representation in Weka is named IBk [45]. Furthermore, the following Weka configuration was applied: ˆ crossValidate True The number of nearest neighbours k typically is determined by exper- imentation. Another way to find a value for k is to perform leave-one- out cross-validation, which was used here to search for the optimum value between 1 and 100. However, the drawback of this method is its computational cost.

Random Forest A random forest is an ensemble learning method that uses bagging on ran- domized decision trees (taking an unweighted majority vote). Randomiza- tion is introduced by randomly resampling the training data for each decision tree as well as by using a randomly selected feature subset to split at each node. The decision trees are not pruned to ensure more diversified classifiers [261, 45]. In the following Tables of this thesis, random forest is abbreviated as (RF).

4.5 Performance Metrics

A number of statistical measures can be used to evaluate the performance of a classifier. To begin with, a binary classification produces one of the following four outcomes: – True positive (TP): Positive instance classified as positive

– True negative (TN): Negative instance classified as negative

– False positive (FP): Negative instance classified as positive

– False negative (FN): Positive instance classified as negative Often the accuracy of a classifier is calculated. The accuracy gives the ratio of the correctly classified instances to the total number of instances [262]: TP + TN Accuracy = . (4.22) TP + TN + FP + FN 110 4. Occupancy Detection With an Indoor Air Quality Monitor

The true positive rate (TPR), also called sensitivity or recall, describes the proportion of correctly classified positive instances [262]:

TP TPR = . (4.23) TP + FN The true negative rate (TNR), also known as the specificity, is the proportion of correctly classified negative instances [262]:

TN TNR = . (4.24) TN + FP Conversely, the false positive rate (FPR), or false-alarm rate, refers to the proportion of negative instances incorrectly classified as positive instances [262]: FPR = 1 − TNR. (4.25) The false negative rate (FNR) gives the proportion of positive instances in- correctly classified as negative instances [262]:

FNR = 1 − TPR. (4.26)

Another metric is the positive predictive value (PPV), also called pre- cision. It describes the proportion of positive classified instances that are positive [262]: TP PPV = . (4.27) TP + FP The PPV is useful to evaluate the certainty of a classification result. How- ever, it also depends on the frequency of a class in a test set. The negative predictive value (NPV) gives the proportion of negative classified instances that are negative [263]: TN NPV = . (4.28) TN + FN In numeric prediction, the size of the errors is considered rather than the hit or miss rates. The mean absolute error (MAE) is a measure of the average magnitude of the errors generated by a numerical predictor and is written as follows [45]:

Pn θˆ − θ i=1 i i MAE = , (4.29) n where θˆ and θ denote the estimated and the actual value. The RMSE is an alternative measure that additionally penalizes outliers by squaring the indi- vidual errors. The square root reduces the result to the same dimensionality 4.6. Results 111 as the predicted value [45]: s Pn (θˆ − θ )2 RMSE = i=1 i i . (4.30) n

The performance of the occupancy detection and the number of occu- pants estimation in the following section is assessed by the classifier’s accu- racy. Furthermore, instances with the class occupancy correctly classified as occupancy are declared true positives, and vacancy vice versa as true nega- tives. The TPR and the TNR are used to indicate the success rate for each state. However, the performance metric used to make decisions depends pri- marily on the desired application (e.g., a high TPR is of great importance in light control systems, whereas the TNR is highly relevant in energy saving applications). Sometimes it is more meaningful to reduce false alarms, for which the false positive and false negative rates can be calculated easily from the TPR and TNR. Other useful measures are the PPV and NPV, which determine the precision of detecting one or the other class. However, the PPV and the NPV depend on the frequency of a class in a dataset. The MAE is used to determine the average magnitude of errors in the number of occupants estimation. In some applications, such as in HVAC, the focus lies on eliminating large fluctuations. Here the RMSE, which penalizes outliers, is a better measure. The MAE and the RMSE are normally used for numeric predictors. In this thesis, multi-class classification was performed instead of numeric prediction, but each class represents a natural number (the number of occupants).

4.6 Results

4.6.1 Predictive Power of the Environmental Sensor Fusion The predictive power of both the individual sensor domains and the environ- mental sensor fusion was determined by applying the CFS on the respective feature space (see Chapter 4.4.3 about CFS). The setting locallyPredictive was turned off. Although the reintroduction of locally predictive features is beneficial for the actual classification, it would degrade the merit calcu- lated by the CFS, which is used in this section as a comparative value. One training set was created for each of the four participants by merging both of their respective training sets into one (compare Table 4.1). The results of the CFS are depicted in Table 4.2, wherein the merit was averaged over the 112 4. Occupancy Detection With an Indoor Air Quality Monitor

Table 4.2: Correlation-Based Feature Selection on Four Training Sets Each From a Different Participant [292], (c) 2018 IEEE

Sensor domain Merit occupancy Merit number of occupants Sensor fusion 0.281 0.316 CO2 0.206 0.232 TVOC 0.187 0.187 Time 0.145 0.187 RHi 0.140 0.161 Ti 0.110 0.127 Ti-To 0.079 0.106 RHi-RHo 0.063 0.098 four sets by taking the arithmetic mean. It becomes clear that the sensor fusion, which is able to take features from all sensors, outperforms the single sensor solutions for both the occupancy and the number of occupants case. Of the environmental sensors, the highest predictability is achieved with the CO2 sensor features. The TVOC sensor proves to be a good alternative to theCO 2 sensor in predictability and, as described in Chapter 2.3, also has a number of advantages. The time features, which include the time of day and working day state, indicate a moderate predictability. Features that were extracted from the indoor relative humidity, and particularly from the air temperature, are less effective in discerning occupancy and its number. The merits obtained from the difference of the indoor and outdoor sensor values are considerably lower than the merits from the indoor sensors. As described in Chapter 4.3.3, 22 % of the instances of the outdoor sensors were declared missing, which lead to the lower merits. With the sensor fusion being the method of choice, its feature subset was examined. For this, locallyPredictive was set to ”True”. It was found that, if all four training sets are considered, CFS picked features from all sensor domains. However, the outdoor air temperature was only used for the occupancy detection, whereas the outdoor relative humidity was only used for the number of occupants estimation. In general, there were large differences between the datasets of the different participants which features were selected. Considering the variety of personal behaviour, it is therefore possible that some features show predictive power only for a specific participant. To determine a more generalized feature subset, the measurement sets T1 to T8 were merged into one big training set representing a dataset with four different occupants. The results of the CFS for the new feature sets 4.6. Results 113

Table 4.3: Correlation-Based Feature Selection on a Training Set That In- cludes Data From All Four Participants [292], (c) 2018 IEEE

Sensor domain Merit occupancy Merit number of occupants Sensor fusion 0.207 0.229 CO2 0.160 0.202 TVOC 0.143 0.146 RHi 0.088 0.107 Time 0.075 0.069 Ti 0.044 0.055 Ti-To 0.026 0.039 RHi-RHo 0.023 0.031

(locallyPredictive was set to ”False”) are shown in Table 4.3. In this training set, the time features are ranked lower, in part because the working day state now holds zero predictive power. The merit is based on the time of day feature only. Again, it should be noted that CFS does not include the interaction of features where the working day feature might be of benefit (see Chapter 4.4.3). The CFS from the sensor fusion, when locallyPredictive was set to ”True”, short-listed features from theCO 2, TVOC, and indoor relative humidity sensors as well as the time of day feature for occupancy detection and estimation. It is concluded that these sensor types are crucial for a generalized occupancy detection, whereas the other sensor types may be omitted. The evaluation of the predictive power is helpful in understanding the performance of the proposed method and in comparing the different sensor domains. The feature selection derived here, however, is not used in any way for the following classification tasks as a general requirement of training and test set separation.

4.6.2 Local Occupancy Detection At the beginning, the feature selection for the respective training set was carried out using CFS (locallyPredictive was set to ”True”). The remaining feature subset was passed on to the learning algorithms. As can be seen from Table 4.1, two series of measurements per participant were recorded. A single holdout procedure, where each participant’s measurement set is used once for training and once as a test set, was applied. The arithmetic mean of the two classification results is taken afterwards. In this thesis, this is referred to as local occupancy detection because training and testing is carried out with the same participant. 114 4. Occupancy Detection With an Indoor Air Quality Monitor

Table 4.4: Local Occupancy Detection With an Environmental Sensor Fusion [292], (c) 2018 IEEE

Occupancy Number of occupants Classifier Acc. [%] TPR [%] TNR [%] Acc. [%] MAE RMSE ZeroR 50.8 75 25 42.7 0.730 0.987 JRip 70.6 78.1 61.4 61.1 0.451 0.746 NB 75.1 81.8 69.0 63.8 0.428 0.728 J48 70.4 75.5 65.2 56.9 0.511 0.799 Logistic 73.4 75.2 68.9 64.3 0.471 0.810 k-NN 68.5 80.6 54.8 58.2 0.502 0.791 RF 70.2 78.0 63.4 58.4 0.495 0.785

The classification results of the local occupancy detection are given as arithmetic mean values in Table 4.4. The ZeroR classifier represents the baseline for the occupancy detection and number of occupants estimation with 50.8 % and 42.7 % accuracy, respectively. These numbers are clearly exceeded by all classifiers, which concludes that the sensor fusion approach is, in general, capable of occupancy detection and estimation. The highest accuracy in occupancy detection is achieved with the Na¨ıve Bayes classifier (75.1 %), and the highest accuracy for the number of occupants estimation is obtained with the Logistic classifier (64.3 %). Based on the true positive and true negative rates, both occupancy and vacancy detection are best performed by Na¨ıve Bayes. It is worth noting that for every classifier the TPR is significantly higher than the TNR. This can be the cause of a higher number of occupancy instances in the training sets (compare Table 4.1), which provides the learning algorithms with more data for training or biases their classification in favour of occupancy simply due to its larger frequency. Another reason can be that it is easier to discern occupancy than vacancy. In estimating the number of occupants, Logistic has more hits, but Na¨ıve Bayes has the lowest MAE with 0.428 and RMSE with 0.728. In addition to the performance measures described, Table B.1 lists the PPV and NPV. To illustrate the process of local occupancy detection, Figure 4.9 shows the Na¨ıve Bayes learner when trained on dataset T1 and tested on dataset T2 (see Table 4.1). The figure depicts the raw sensor readings, the es- timated state of occupancy, the estimated number of occupants, and the ground truth occupancy. The x-axis is labelled with the day, indicated as a consecutive number where day 0 corresponds to the start of the measure- ment, and also the time of day. From the environmental sensor fusion, the CFS selected nine features for occupancy detection, namely time of day, 4.6. Results 115

rawCO 2,MA(CO 2), MSV(CO2), raw TVOC, MSV(TVOC),SD(TVOC), MSV(RHi), andSD( RHi). The model of the number of occupants estimation was built from the following seven features: time of day, rawCO 2,MA(CO 2), MSV(CO2), raw TVOC, MSV(TVOC), and MSV(RHi). It can be observed that the occupancy detection and counting generally follow the ground truth occupancy profile, although at the beginning of the measurement, occupancy is mistaken for vacancy. This is due to the fresh air condition that was forced at the beginning of the measurement (see Chapter 4.3.1). It takes a certain amount of time until characteristic values reoccur so that the algorithm func- tions again. Further, on day 3, occupancy is erroneously classified at times of vacancy. The participant possibly left the apartment for a longer period of time without providing fresh air before leaving. TheCO 2 and TVOC gas concentrations are slowly decreasing as a result of air infiltration. However, the absolute values are relatively high, and hence the rawCO 2,MA(CO 2), and raw TVOC features attribute to the misclassification during this period. At some points in time, typically during the transitions of occupancy states, classification results fluctuate. This behaviour, which is indicated by bold lines in the graph of Figure 4.9, is normal for the Na¨ıve Bayes algo- rithm as it regards each instance in time to be independent and identically distributed [45]. However, in applications such as thermostat control these fluctuations are problematic. The actuating part of the HVAC would rapidly switch between on and off states, which wastes energy, may negatively affect the level of comfort, and possibly damages the equipment in the long term. Although, a simple solution to this is to impose a delay on the detected oc- cupancy state as it is done with PIR sensors [16]. Another possibility is to study the use of a hidden Markov model (HMM), such as in [42, 72]. An HMM determines the probability of a transition based on the temporal se- quence of the features [264]. Liu et al. [49] eliminated frequent fluctuations by classifying occupancy in two stages, where preliminary results from an extreme learning machine were used as an input for a structured support vector machine. Despite the fluctuations, the learning models in this thesis base their decision also on past events as a result of theMA, MSV,FD, and SD features. Moreover, the granularity of the classification was set to only 15 s. The time span can be increased according to requirements of the appli- cation to further improve the general performance or to reduce fluctuations.

4.6.3 Global Occupancy Detection In cases where training with one or more participants is not feasible, a so- lution is to train the learning model in one apartment and to employ the classification in another without any training. This process is referred to 116 4. Occupancy Detection With an Indoor Air Quality Monitor

4000 3000

[ppm] 2000 2 1000

CO 0 0-17 1-05 1-17 2-05 2-17 3-05 3-17 4-05 4-17 5-05 5-17

6000 4500 3000 1500 0

TVOC [ppm] 0-17 1-05 1-17 2-05 2-17 3-05 3-17 4-05 4-17 5-05 5-17

25 20 C]

° 15

[ T T 10 i o

T 5 0 0-17 1-05 1-17 2-05 2-17 3-05 3-17 4-05 4-17 5-05 5-17

90 70 [%] 50 RHi RHo 30 RH 10 0-17 1-05 1-17 2-05 2-17 3-05 3-17 4-05 4-17 5-05 5-17 1 Estimated

Occupancy 0 0-17 1-05 1-17 2-05 2-17 3-05 3-17 4-05 4-17 5-05 5-17 3 2 1 Estimated Occupants Number of 0 0-17 1-05 1-17 2-05 2-17 3-05 3-17 4-05 4-17 5-05 5-17 3 2 1 Truth Ground

Occupancy 0 0-17 1-05 1-17 2-05 2-17 3-05 3-17 4-05 4-17 5-05 5-17 Day and Time of Day [d-hh] Figure 4.9: Local occupancy detection with an environmental sensor fusion using Na¨ıve Bayes trained on dataset T1 and tested on dataset T2 [292], (c) 2018 IEEE 4.6. Results 117

Table 4.5: Global Occupancy Detection With an Environmental Sensor Fu- sion [292], (c) 2018 IEEE

Occupancy Number of occupants Classifier Acc. [%] TPR [%] TNR [%] Acc. [%] MAE RMSE ZeroR 59.7 100 0 40.3 0.850 1.146 JRip 76.2 81.2 69.8 56.0 0.505 0.792 NB 81.1 79.5 84.3 64.7 0.395 0.690 J48 75.9 82.9 66.7 54.1 0.543 0.845 Logistic 76.2 75.6 81.5 60.7 0.451 0.746 k-NN 66.8 72.9 60.6 48.7 0.639 0.947 RF 79.6 85.4 71.9 58.5 0.474 0.763 here as global occupancy detection. However, data collected from one par- ticipant or apartment may not be representative for another. Variations in apartment size, layout and orientation, furnishings, sensor placement, or the participant’s behaviour can cause a number of complications. In this work, all of the apartments are of the same size, layout, and equally furnished (see Chapter 4.3.1), which leaves the participant behaviour as the main variable. As an example, it was assumed that one participant was unavailable for a training period. To introduce generalization into the classification model, the six datasets from the other three participants were merged and declared as training (compare Table 4.1). The remaining two sets of the fourth partic- ipant were merged for the test data. The procedure was repeated for every participant. Table 4.5 depicts the arithmetic mean values of the classifica- tion. The PPV and NPV are given in Table B.2. The most surprising finding is that in occupancy detection, the accuracy of all classifiers except for that of k-NN increased significantly. This can be explained by the larger dataset that is available for training or by the generalization from varying partici- pants as opposed to overfitting the model to one participant. In particular, the true negative rates (classifying vacancy) show a substantial gain in perfor- mance. The Na¨ıve Bayes classifier achieves the highest accuracy with 81.1 % for occupancy detection and 64.7 % for the number of occupants estimation. Considering the true negative rates, Na¨ıve Bayes is also the best choice for detecting vacancy, and provides the lowest MAE with 0.395 and RMSE with 0.690. JRip, J48, or random forest have a higher TPR, which make them better choices at recognizing occupancy. k-NN is the only classifier whose overall performance decreased for global occupancy detection. This is the result of different participants in the training set for which data points are not as close to the test instances as they were with the original participant. Chapter 5

Conclusion and Outlook

In this thesis, the data from multiple disparate sensors were combined in a feature-level fusion process. Based on the recordings of ten everyday activ- ities, it was demonstrated that on a wrist-worn human activity tracker, the fusion of multiple sensor modalities successfully compensates for the deficien- cies of the individual sensor domains. It was also shown that the predictive power of occupancy detection using environmental sensors is improved con- siderably by sensor fusion, encouraging further development on this novel approach.

The demonstrator of a 10-axis wrist-worn human activity tracker com- prises a 3-axis accelerometer, a 3-axis gyroscope, a 3-axis magnetometer, and a barometric pressure sensor. Its qualities are low power consumption, small form factor, low weight (only 25 g), and high-speed sensor data acquisition. The activity tracker can also be worn on the upper arm, the lower leg, or the thigh, and its nonintrusive design allows measuring under free-living condi- tions. Because the magnitude of the acceleration values on the wrist correlate little with theEE during activities such as cycling, a two-stepEE estima- tion approach was proposed that involves human activity recognition and the use of MET values. This approach has the advantage of being indepen- dent of the measurement position and the potential to outperform popular acceleration-based direct estimation methods. The preprocessing in this work included identifying and removing offset and scaling errors from the raw acceleration data, as well as highpass-filtering of the gravitational component. The offset of the angular rate sensor was also compensated. Hard- and soft-iron compensation of the magnetometer data was implemented in addition to high-frequency noise reduction by applying an LPF. Because the activity-related information of the barometer data was buried in noise, a Savitzky–Golay smoothing filter was introduced that

118 5. Conclusion and Outlook 119 has the advantage of preserving the signal’s high-frequency components. To determine the height difference when walking stairs or riding an elevator, the static air pressure was separated from the dynamic air pressure using an LPF. Furthermore, a number of human activity related time- and frequency- domain features were presented. Measurements were taken with four participants performing ten everyday activities. Based on the spread of the acceleration signals, the wrist-worn 3- axis accelerometer approach was capable of dividing the examined activity set into groups of low, medium, and high amount of arm motion, and to discriminate jogging, running, and falling. To discriminate cycling, for which the intensity of the acceleration signal was similar to that of walking and walking stairs, various methods based on the FFT and zero crossings were established. The results of the 3-axis gyroscope approach were similar to that of the accelerometer, except cycling could be discriminated with the computationally lightweight range feature, whereas jogging required the cal- culation of the computationally more demanding cross-correlation coefficient between two sensor axes. In the barometer measurements, it was observed in a few cases that drifts in air pressure occurred during outdoors activities, which may have been due to changing weather conditions. Although the 3-axis magnetometer and the barometer approaches were unable to discriminate the activity set, their potential lies in sensor fusion. It was shown that the acceleration and angular rate signals of sitting and riding an elevator as well as that of walking and walking stairs have a high degree of similarity. It was determined that these activities can be separated when adding the height difference feature from the lowpass-filtered signal of a low-noise barometer such as the one used here. In fact, a fusion of the accelerometer or the gyroscope with the barometer is capable of recognizing all of the ten activities. To reduce the false alarm rate of a fall detector, it was proposed to com- bine a number of features, such as the spread and the mean value of the acceleration signals, the induced height difference as measured by the barom- eter, or to examine the following time slot for inactivity. The potential of the magnetic domain was demonstrated on the activities cycling and riding an elevator. Generally, any activity that experiences magnetic interference may be discerned based on its particular signal characteristics, including riding a car, riding an escalator, or exercising using gym machines. Furthermore, it was discussed that building a learning model for a group of people (based on age, personal fitness, etc.), time and effort for collecting training data can be significantly reduced while still providing competitive performance. In this case, another advantage of integrating magnetic field sensing is that the mag- netic distortions are independent of individual users, and thus the recognition 120 5. Conclusion and Outlook performance of algorithms designed for multiple users can be improved. Since the presented dataset contains only 15 to 70 short-term records per activity, the statistical significance of the overall classification performance may be limited. For a comprehensive study, it is necessary to collect large amounts of data with participants of different ages, sexes, weights, and physi- cal fitness in a variety of environments, and to measure them under free-living conditions. This may even be defined as an interdisciplinary work, where en- gineers collaborate with researchers in the fields of psychology, sports, and medical science. Another limitation that concerns the human activity recog- nition community in general is that comparisons between newly proposed methods and existing approaches are difficult due to large variations in the reported activity sets, groups of people, and training data quality. Possible future directions into which this work can be extended include evaluating computationally lightweight machine learning algorithms for im- plementation into a wearable human activity tracker. Or, depending on the application, more powerful algorithms may be adopted in a cloud-based ser- vice. The tracked activities often only describe a fraction of the person’s daily routine. Activity discovery involves identifying unknown activities, for which a number of solutions are described in [174]. In addition, transitions between two activities must be handled with sliding windows or the like. The feature extraction could be advanced by varying the window lengths with respect to the underlying activity set, feature type, and sensor domain. Another method to improve the overall performance would be to link the class prob- abilities with the typical duration of an activity. Furthermore, developing a state machine that limits the algorithm to choose activities based on its previous classification result would avoid irrational constellations. By the time this work was completed, the miniaturization of sensor technology had advanced to the first 7- and 9-axis system-in-a-package [265, 266, 267, 268]. This allows the development of an even smaller and more power-efficient hu- man activity tracker. It is also possible to integrate other promising sensor types, such as an optical heart rate sensor.

The proposed approach of an environmental sensor fusion has proven suc- cessful in detecting and counting occupants in the four student apartments. For this experiment, an indoor air quality measurement system was presented that captures theCO 2 and TVOC concentration, the indoor and outdoor air temperature and relative humidity, the time of measurement; and collects the ground truth occupancy from a smartphone. The measurements from the student apartments, which are characterized by highly dynamic occu- pancy patterns, were made publicly available. A number of features were introduced that can be extracted from the environmental sensors, and it 5. Conclusion and Outlook 121 was shown that the highest predictive power is attained with sensor fusion. Another quality of the sensor fusion was that it effectively compensated for the missing data of the outdoor system during transmission loss. The novel occupancy detection approach offers a number of advantages, such as being nonintrusive, which is an important aspect in smart homes. A comprehensive overview on gas sensor calibration methods for NDIR CO2 and MOS-based TVOC sensors was given. The gas sensor’s sensitivity to other environmental parameters was examined, that is air pressure, air temperature, and relative humidity. Mathematical formulas for compensa- tion of theCO 2 sensor were derived. The results of the CFS indicate that TVOC sensing is a good alternative toCO 2-based occupancy detection. The significance of this finding, which also refutes previous works [86, 56, 58], lies in the potential to significantly cut costs in indoor air quality gas sensing. It was shown that Na¨ıve Bayes with discretization of numeric values outperformed the other classifiers in most areas. Occupancy detection was achieved with an accuracy of 75.1 %, whereas the number of occupants was obtained with an accuracy of 63.8 % and an MAE of 0.428. Another benefit of Na¨ıve Bayes is its low computational complexity, which becomes relevant when performing occupancy detection inside the indoor air quality measure- ment system. Furthermore, a method named global occupancy detection was proposed. Here, training data are collected from other participants, and thus apartments, than the test participant. This greatly reduces the effort that is required for supervised learning in residential buildings. With global occu- pancy detection, Na¨ıve Bayes detected occupancy and estimated the number of occupants with an accuracy of 81.1 % and 64.7 %, respectively. The MAE was calculated as 0.395. The improved performance resulted from a gen- eralization over several participants in addition to larger training data and highlights the effectiveness of this method. The environmental sensor fusion approach may be limited to applications such as thermostat control as inferring occupants with environmental sen- sors becomes difficult in warm seasons when windows are often kept open. Also, the supervised learning requires collecting training data in sensitive areas such as an apartment. For this reason, global occupancy detection was proposed as a substantial improvement, and the indoor and outdoor devices were designed such that the installation and operation can be carried out ef- fortlessly by the occupants themselves. In future work, the approach may be tested in different buildings, during other seasons, or with a greater variety in the participants’ age and daily routine. Another possibility is to install multiple distributed sensing systems in larger apartments that have multiple adjacent rooms and to investigate the accuracy of room-specific occupancy detection. 122 5. Conclusion and Outlook

Future development on the occupancy detection algorithm would go in two directions. One is the implementation of a classifier on-the-spot in the measurement system. The other is directed at evaluating other types of feature selection and learning algorithms, such as ANNs, which are able to draw more complex relationships and possibly refine the performance of the approach. These techniques can be employed in a cloud-based service where more computational power is available. Unsupervised learning meth- ods can be studied for feasibility to improve the practicality of the approach. Improvements regarding the feature extraction include varying the window length based on the feature type and the sensor domain, defining a weighting function, or using more advanced methods for building the moving average and smoothing data for the first and second derivatives. To reduce fluctua- tions in the results for applications such as thermostat control, the temporal resolution may be increased, time delays can be introduced, or learning mod- els such as the HMM, which accounts for temporal relations in the data, can be tested. Further potential is seen in the fusion with other sensor types or predictive learning, which offers additional opportunities to save energy [269]. List of References

[1] Mark Weiser. The computer for the 21st century. Scientific American, 265(3):94–104, September 1991.

[2] International Data Corporation. The Growth in Connected IoT De- vices Is Expected to Generate 79.4zb of Data in 2025, According to a New IDC Forecast, June 2019. URL https://www.idc.com/getdoc.jsp? containerId=prUS45213219. Accessed on 25th August 2019.

[3] B. Schilit, N. Adams, and R. Want. Context-aware computing applications. In 1994 First Workshop on Mobile Computing Sys- tems and Applications, pages 85–90, Santa Cruz, CA, USA. IEEE. doi:10.1109/WMCSA.1994.16.

[4] Anind K. Dey. Understanding and using context. Personal and Ubiqui- tous Computing, 5(1):4–7, February 2001. doi:10.1007/s007790170019.

[5] J. P¨arkk¨a, M. Ermes, P. Korpipaa, J. Mantyjarvi, J. Pel- tola, and I. Korhonen. Activity classification using realis- tic data from wearable sensors. IEEE Transactions on Infor- mation Technology in Biomedicine, 10(1):119–128, January 2006. doi:10.1109/TITB.2005.856863.

[6] Alain Appriou. Uncertainty Theories and Multisensor Data Fusion. ISTE Ltd, London, UK, 2014.

[7] D.M Gavrila. The visual analysis of human movement: A survey. Com- puter Vision and Image Understanding, 73(1):82–98, January 1999. doi:10.1006/cviu.1998.0716.

[8] Ling Bao and Stephen S. Intille. Activity recognition from user-annotated acceleration data. In Pervasive Computing, pages 1–17, Linz/ Vienna, Austria, 2004. Springer Berlin Heidelberg. doi:10.1007/978-3-540-24646-6 1.

123 124 List of References

[9] Attila Reiss and Didier Stricker. Creating and benchmarking a new dataset for physical activity monitoring. In Proceedings of the 5th In- ternational Conference on PErvasive Technologies Related to Assistive Environments, PETRA ’12, pages 40:1–40:8, Heraklion, Crete, Greece, 2012. ACM. doi:10.1145/2413097.2413148.

[10] Heike Leutheuser, Dominik Schuldhaus, and Bjoern M. Es- kofier. Hierarchical, multi-sensor based classification of daily life activities: Comparison with state-of-the-art algorithms using a benchmark dataset. PLOS ONE, 8(10):1–11, October 2013. doi:10.1371/journal.pone.0075196.

[11] Marc Torrent, Alan Bourke, Xavier Parra, and Andreu Catal`a. Am- bulatory mobility characterization using body inertial systems: An ap- plication to fall detection. In Bio-Inspired Systems: Computational and Ambient Intelligence, pages 1129–1136, Salamanca, Spain, 2009. Springer Berlin Heidelberg. doi:10.1007/978-3-642-02478-8 141.

[12] A. M. Khan, Y. K. Lee, S. Y. Lee, and T. S. Kim. A triaxial accelerometer-based physical-activity recognition via augmented-signal features and a hierarchical recognizer. IEEE Transactions on Infor- mation Technology in Biomedicine, 14(5):1166–1172, September 2010. doi:10.1109/TITB.2010.2051955.

[13] T. L. Martin. Time and time again: parallels in the development of the watch and the wearable computer. In Proceedings. Sixth International Symposium on Wearable Computers, pages 5–11, Seattle, WA, USA, 2002. IEEE. doi:10.1109/ISWC.2002.1167212.

[14] Fitbit, Inc. Fitbit Charge 3 | Advanced Fitness Tracker. URL https: //www.fitbit.com/charge3. Accessed on 26th August 2018.

[15] Fitbit, Inc. What should I know about SmartTrack exercise detec- tion? URL https://help.fitbit.com/articles/en US/Help article/1933. Accessed on 11th January 2018.

[16] E. Yavari, Chenyan Song, V. Lubecke, and O. Boric-Lubecke. Is there anybody in there?: Intelligent radar occupancy sen- sors. IEEE Microwave Magazine, 15(2):57–64, March 2014. doi:10.1109/MMM.2013.2296210.

[17] Indoor environmental input parameters for design and assessment of energy performance of buildings addressing indoor air quality, thermal List of References 125

environment, lighting and acoustics; German version EN 15251:2007. DIN EN Standard 15251:2012-12.

[18] P. H. Veltink, H. J. Bussmann, W. de Vries, W. J. Martens, and R. C. Van Lummel. Detection of static and dynamic activities using uniaxial accelerometers. IEEE Transactions on Rehabilitation Engi- neering, 4(4):375–385, December 1996. doi:10.1109/86.547939.

[19] Jochen Fahrenberg, Friedrich Foerster, Manfred Smeja, and Wolfgang M¨uller.Assessment of posture and motion by multichannel piezoresis- tive accelerometer recordings. Psychophysiology, 34(5):607–612, Jan- uary 1997. doi:10.1111/j.1469-8986.1997.tb01747.x.

[20] Seon-Woo Lee and K. Mase. Activity and location recognition using wearable sensors. IEEE Pervasive Computing, 1(3):24–32, July 2002. doi:10.1109/MPRV.2002.1037719.

[21] Jonathan Lester, Tanzeem Choudhury, Nicky Kern, Gaetano Borriello, and Blake Hannaford. A hybrid discriminative/generative approach for modeling human activities. In Proceedings of the 19th International Joint Conference on Artificial Intelligence, IJCAI’05, pages 766–772, Edinburgh, Scotland, 2005. Morgan Kaufmann Publishers Inc.

[22] Jonathan Lester, Tanzeem Choudhury, and Gaetano Borriello. A prac- tical approach to recognizing physical activities. In Pervasive Com- puting, pages 1–16, Dublin, Ireland, 2006. Springer Berlin Heidelberg. doi:10.1007/11748625 1.

[23] M. Rulsch, M. Benz, C. Arzt, C. Podolak, J. Zhong, and R. Couronn´e. A lightweight approach for activity classification on microcontrollers. In World Congress on Medical and Biomedical Engineering, pages 190–193, Munich, Germany, 2009. Springer Berlin Heidelberg. doi:10.1007/978-3-642-03889-1 51.

[24] C. Zhu and W. Sheng. Human daily activity recognition in robot- assisted living using multi-sensor fusion. In 2009 IEEE International Conference on Robotics and Automation, pages 2154–2159, Kobe, Japan. doi:10.1109/ROBOT.2009.5152756.

[25] Gernot Bahle, Kai Kunze, and Paul Lukowicz. On the use of magnetic field disturbances as features for activity recognition with on body sensors. In Smart Sensing and Context, pages 71–81, Passau, Germany, 2010. Springer Berlin Heidelberg. doi:10.1007/978-3-642-16982-3 6. 126 List of References

[26] Xsens North America Inc. MTx - Products. URL https://www.xsens. com/products/mtx/. Accessed on 3rd December 2017.

[27] Attila Reiss, Gustaf Hendeby, and Didier Stricker. A novel confidence- based multiclass boosting algorithm for mobile physical activity mon- itoring. Personal and Ubiquitous Computing, 19(1):105–121, January 2015. doi:10.1007/s00779-014-0816-x.

[28] Dominik Schuldhaus, Heike Leutheuser, and Bjoern Eskofier. To- wards big data for activity recognition: A novel database fu- sion strategy. In 9th International Conference on Body Area Net- works, BodyNets ’14, pages 97–103, London, UK, 2014. ICST. doi:10.4108/icst.bodynets.2014.256946.

[29] Haodong Guo, Ling Chen, Liangying Peng, and Gencai Chen. Wear- able sensor based multimodal human activity recognition exploit- ing the diversity of classifier ensemble. In Proceedings of the 2016 ACM International Joint Conference on Pervasive and Ubiquitous Computing, UbiComp ’16, pages 1112–1123, Heidelberg, Germany. doi:10.1145/2971648.2971708.

[30] Yu Guan and Thomas Pl¨otz. Ensembles of deep LSTM learners for activity recognition using wearables. Proceedings of the ACM on Inter- active, Mobile, Wearable and Ubiquitous Technologies, 1(2):11:1–11:28, June 2017. doi:10.1145/3090076.

[31] Sebastian M¨unzner, Philip Schmidt, Attila Reiss, Michael Hansel- mann, Rainer Stiefelhagen, and Robert D¨urichen. CNN-based sensor fusion techniques for multimodal human activity recogni- tion. In Proceedings of the 2017 ACM International Symposium on Wearable Computers, ISWC ’17, pages 158–165, Maui, HI, USA. doi:10.1145/3123021.3123046.

[32] Vishvak S. Murahari and Thomas Pl¨otz.On attention models for hu- man activity recognition. In Proceedings of the 2018 ACM Interna- tional Symposium on Wearable Computers, ISWC ’18, pages 100–103, Singapore, Singapore. doi:10.1145/3267242.3267287.

[33] Ming Zeng, Haoxiang Gao, Tong Yu, Ole J. Mengshoel, Helge Langseth, Ian Lane, and Xiaobing Liu. Understanding and improving recur- rent networks for human activity recognition by continuous atten- tion. In Proceedings of the 2018 ACM International Symposium on List of References 127

Wearable Computers, ISWC ’18, pages 56–63, Singapore, Singapore. doi:10.1145/3267242.3267286.

[34] Dominik Schuldhaus, Heike Leutheuser, and Bjoern M. Eskofier. Clas- sification of daily life activities by decision level fusion of inertial sensor data. In 8th International Conference on Body Area Net- works, BodyNets ’13, pages 77–82, Boston, MA, USA, 2013. ICST. doi:10.4108/icst.bodynets.2013.253534.

[35] A. Burns, B. R. Greene, M. J. McGrath, T. J. O’Shea, B. Kuris, S. M. Ayer, F. Stroiescu, and V. Cionca. SHIMMER— – a wireless sensor platform for noninvasive biomedical research. IEEE Sensors Journal, 10(9):1527–1534, September 2010. doi:10.1109/JSEN.2010.2045498.

[36] M. Elhoushi, J. Georgy, A. Wahdan, M. Korenberg, and A. Noureldin. Using portable device sensors to recognize height changing modes of motion. In 2014 IEEE International Instrumentation and Measurement Technology Conference (I2MTC) Proceedings, pages 477–481, Montev- ideo, Uruguay. doi:10.1109/I2MTC.2014.6860791.

[37] Q. Zhu, Z. Chen, and Y. C. Soh. Smartphone-based human ac- tivity recognition in buildings using locality-constrained linear cod- ing. In 2015 IEEE 10th Conference on Industrial Electronics and Applications (ICIEA), pages 214–219, Auckland, New Zealand. doi:10.1109/ICIEA.2015.7334113.

[38] J. Wang, J. Yang, K. Yu, F. Lv, T. Huang, and Y. Gong. Locality-constrained linear coding for image classification. In 2010 IEEE Computer Society Conference on Computer Vision and Pattern Recognition, pages 3360–3367, San Francisco, CA, USA. doi:10.1109/CVPR.2010.5540018.

[39] G. B. Huang, H. Zhou, X. Ding, and R. Zhang. Extreme learning machine for regression and multiclass classification. IEEE Transactions on Systems, Man, and Cybernetics, Part B (Cybernetics), 42(2):513– 529, April 2012. doi:10.1109/TSMCB.2011.2168604.

[40] H. Abdelnasser, R. Mohamed, A. Elgohary, M. F. Alzantot, H. Wang, S. Sen, R. R. Choudhury, and M. Youssef. SemanticSLAM: Using environment landmarks for unsupervised indoor localization. IEEE Transactions on Mobile Computing, 15(7):1770–1782, July 2016. doi:10.1109/TMC.2015.2478451. 128 List of References

[41] Khee Poh Lam, Michael H¨oynck, Rui Zhang, Burton Andrews, Yun- Shang Chiou, Bing Dong, and Diego Benitez. Information-theoretic en- vironmental features selection for occupancy detection in open offices. In Proceedings of Building Simulation 2009, pages 1460–1467, Glasgow, Scotland. International Building Performance Simulation Association.

[42] Khee Poh Lam, Michael H¨oynck, Bing Dong, Burton Andrews, Yun- Shang Chiouhang Chiou, Diego Benitez, and Joonho Choi. Occupancy detection through an extensive environmental sensor network in an open-plan office building. In Proceedings of Building Simulation 2009, pages 1452–1459, Glasgow, Scotland. International Building Perfor- mance Simulation Association.

[43] Bing Dong and Khee Poh Lam. Building energy and com- fort management through occupant behaviour pattern detection based on a large-scale environmental sensor network. Journal Building Performance Simulation, 4(4):359–369, December 2011. doi:10.1080/19401493.2011.577810.

[44] Ebenezer Hailemariam, Rhys Goldstein, Ramtin Attar, and Azam Khan. Real-time occupancy detection using decision trees with multi- ple sensor types. In Proceedings of the 2011 Symposium on Simulation for Architecture and Urban Design, SimAUD ’11, pages 23–30, Boston, MA, USA. Society for Computer Simulation International.

[45] Ian H. Witten, Eibe Frank, and Mark A. Hall. Data Mining: Practical Machine Learning Tools and Techniques. Morgan Kaufmann Publish- ers, Burlington, MA, USA, 3rd edition, 2011.

[46] Z. Han, R. X. Gao, and Z. Fan. Occupancy and indoor environment quality sensing for smart buildings. In 2012 IEEE International Instru- mentation and Measurement Technology Conference Proceedings, pages 882–887, Graz, Austria. doi:10.1109/I2MTC.2012.6229557.

[47] Afrooz Ebadat, Giulio Bottegal, Damiano Varagnolo, Bo Wahlberg, and Karl H. Johansson. Estimation of building occupancy levels through environmental signals deconvolution. In Proceedings of the 5th ACM Workshop on Embedded Systems For Energy-Efficient Buildings, BuildSys’13, pages 1–8, Rome, Italy, 2013.

[48] A. Ebadat, G. Bottegal, D. Varagnolo, B. Wahlberg, and K. H. Johans- son. Regularized deconvolution-based approaches for estimating room List of References 129

occupancies. IEEE Transactions on Automation Science and Engineer- ing, 12(4):1157–1168, October 2015. doi:10.1109/TASE.2015.2471305.

[49] T. Liu, Y. Li, Z. Bai, J. De, C. V. Le, Z. Lin, S.-H. Lin, G.-B. Huang, and D. Cui. Two-stage structured learning approach for stable occu- pancy detection. In 2016 International Joint Conference on Neural Networks (IJCNN), pages 2306–2312, Vancouver, BC, Canada. IEEE. doi:10.1109/IJCNN.2016.7727485.

[50] Mustafa K. Masood, Yeng Chai Soh, and Victor W.-C. Chang. Real- time occupancy estimation using environmental parameters. In 2015 International Joint Conference on Neural Networks (IJCNN), pages 1–8, Killarney, Ireland. IEEE. doi:10.1109/IJCNN.2015.7280781.

[51] Zhenghua Chen, Mustafa K. Masood, and Yeng Chai Soh. A fusion framework for occupancy estimation in office buildings based on envi- ronmental sensor data. Energy and Buildings, 133:790–798, December 2016. doi:10.1016/j.enbuild.2016.10.030.

[52] Z. Chen, Q. Zhu, M. Masood, and Y. C. Soh. Environmental sensors- based occupancy estimation in buildings via IHMM-MLR. IEEE Trans- actions on Industrial Informatics, 13(5):2184–2193, October 2017. doi:10.1109/TII.2017.2668444.

[53] Z. Chen, R. Zhao, Q. Zhu, M. K. Masood, Y. C. Soh, and K. Mao. Building occupancy estimation with environmental sensors via CD- BLSTM. IEEE Transactions on Industrial Electronics, 64(12):9549– 9559, December 2017. doi:10.1109/TIE.2017.2711530.

[54] Qingchang Zhu, Zhenghua Chen, Mustafa K. Masood, and Yeng Chai Soh. Occupancy estimation with environmental sens- ing via non-iterative LRF feature learning in time and fre- quency domains. Energy and Buildings, 141:125–133, April 2017. doi:10.1016/j.enbuild.2017.01.057.

[55] A. Dey, X. Ling, A. Syed, Y. Zheng, B. Landowski, D. Anderson, K. Stuart, and M. E. Tolentino. Namatad: Inferring occupancy from building sensors using machine learning. In 2016 IEEE 3rd World Forum on Internet of Things (WF-IoT), pages 478–483, Reston, VA, USA. doi:10.1109/WF-IoT.2016.7845462.

[56] T. Ekwevugbe, N. Brown, V. Pakka, and D. Fan. Real-time build- ing occupancy sensing using neural-network based sensor network. 130 List of References

In 2013 7th IEEE International Conference on Digital Ecosystems and Technologies (DEST), pages 114–119, Menlo Park, CA, USA. doi:10.1109/DEST.2013.6611339. [57] T. Ekwevugbe, N. Brown, and V. Pakka. Real-time building occupancy sensing for supporting demand driven HVAC operations. In Proceedings of the 13th International Conference for Enhanced Building Operations, Montreal, QC, Canada, 2013. Energy Systems Laboratory; Texas A&M University. [58] Tobore Ekwevugbe, Neil Brown, Vijay Pakka, and Denis Fan. Improved occupancy monitoring in non-domestic buildings. Sustainable Cities and Society, 30:97–107, April 2017. doi:10.1016/j.scs.2017.01.003. [59] Zheng Yang, Nan Li, Burcin Becerik-Gerber, and Michael Orosz. A systematic approach to occupancy modeling in ambient sensor- rich buildings. SIMULATION, 90(8):960–977, August 2014. doi:10.1177/0037549713489918. [60] Joe Touch. The BLEMS augmented sensor device. Technical Report ISI-TR-689, USC Information Sciences Institute, Marina del Reym, CA, USA, March 2014. URL ftp://ftp.isi.edu/isi-pubs/tr-689.pdf. [61] Zheng Yang, Nan Li, Burcin Becerik-Gerber, and Michael Orosz. A multi-sensor based occupancy estimation model for supporting demand driven HVAC operations. In Proceedings of the 2012 Symposium on Simulation for Architecture and Urban Design, SimAUD ’12, pages 49– 56, Orlando, FL, USA. Society for Computer Simulation International. [62] Zheng Yang, Nan Li, Burcin Becerik-Gerber, and Michael Orosz. A non-intrusive occupancy monitoring system for demand driven HVAC operations. In Construction Research Congress, pages 828–837, West Lafayette, IN, USA, 2012. American Society of Civil Engineers. doi:10.1061/9780784412329.084. [63] Sunil Mamidi, Yu-Han Chang, and Rajiv Maheswaran. Improving building energy efficiency with a network of sensing, learning and pre- diction agents. In Proceedings of the 11th International Conference on Autonomous Agents and Multiagent Systems - Volume 1, AAMAS ’12, pages 45–52, Valencia, Spain, 2012. International Foundation for Autonomous Agents and Multiagent Systems. [64] Aftab Khan, James Nicholson, Sebastian Mellor, Daniel Jackson, Karim Ladha, Cassim Ladha, Jon Hand, Joseph Clarke, Patrick List of References 131

Olivier, and Thomas Pl¨otz.Occupancy monitoring using environmen- tal & context sensors and a hierarchical analysis framework. In Pro- ceedings of the 1st ACM Conference on Embedded Systems for Energy- Efficient Buildings, BuildSys ’14, pages 90–99, Memphis, TN, USA, 2014. doi:10.1145/2674061.2674080.

[65] Abhay Arora, Manar Amayri, Venkataramana Badarla, St´ephane Ploix, and Sanghamitra Bandyopadhyay. Occupancy estimation us- ing non intrusive sensors in energy efficient buildings. In Proceedings of Building Simulation 2015, pages 1441–1448, Hyderabad, India. In- ternational Building Performance Simulation Association.

[66] Manar Amayri, Abhay Arora, Stephane Ploix, Sanghamitra Bandhy- opadyay, Quoc-Dung Ngo, and Venkata Ramana Badarla. Estimating occupancy in heterogeneous sensor environment. Energy and Buildings, 129:46–58, October 2016. doi:10.1016/j.enbuild.2016.07.026.

[67] Martin Freˇser, Boˇzidara Cvetkovi´c, Anton Gradiˇsek, and Mitja Luˇstrek. Anticipatory system for T–H–C dynamics in room with real and virtual sensors. In Proceedings of the 2016 ACM In- ternational Joint Conference on Pervasive and Ubiquitous Comput- ing: Adjunct, UbiComp ’16, pages 1267–1274, Heidelberg, Germany. doi:10.1145/2968219.2968442.

[68] Netatmo S.A. Netatmo Weather | Weather Station - Rain and Gauge. URL https://www.netatmo.com/en-US/product/weather/ weatherstation. Accessed on 17th March 2017.

[69] Luis M. Candanedo and V´eroniqueFeldheim. Accurate occupancy detection of an office room from light, temperature, humidity and CO2 measurements using statistical learning models. Energy and Buildings, 112:28–39, January 2016. doi:10.1016/j.enbuild.2015.11.071.

[70] I. B. A. Ang, F. Dilys Salim, and M. Hamilton. Human occupancy recognition with multivariate ambient sensors. In 2016 IEEE In- ternational Conference on Pervasive Computing and Communication Workshops (PerCom Workshops), pages 1–6, Sydney, NSW, Australia. IEEE. doi:10.1109/PERCOMW.2016.7457116.

[71] Philipp Morgner, Christian M¨uller,Matthias Ring, Bj¨ornEskofier, Christian Riess, Frederik Armknecht, and Zinaida Benenson. Privacy implications of room climate data. In Computer Security – ESORICS 132 List of References

2017, pages 324–343, Oslo, Norway, 2017. Springer International Pub- lishing. doi:10.1007/978-3-319-66399-9 18.

[72] D. W¨orner,T. von Bomhard, M. R¨oschlin, and F. Wortmann. Look twice: Uncover hidden information in room climate sensor data. In 2014 International Conference on the Internet of Things (IOT), pages 25–30, Cambridge, MA, USA. IEEE. doi:10.1109/IOT.2014.7030110.

[73] Apple Inc. iBeacon. URL https://developer.apple.com/ibeacon/. Ac- cessed on 22nd January 2017.

[74] Thomas von Bomhard, Dominic W¨orner,and Marc R¨oschlin. Towards smart individual-room heating for residential buildings. Computer Science - Research and Development, 31(3):127–134, August 2016. doi:10.1007/s00450-014-0282-8.

[75] Joel Chaney, Edward Hugh Owens, and Andrew D. Peacock. An evi- dence based approach to determining residential occupancy and its role in demand response management. Energy and Buildings, 125:254–266, August 2016. doi:10.1016/j.enbuild.2016.04.060.

[76] Luis M. Candanedo, V´eroniqueFeldheim, and Dominique Deramaix. A methodology based on hidden Markov models for occupancy detection and a case study in a low energy residential building. Energy and Build- ings, 148:327–341, August 2017. doi:10.1016/j.enbuild.2017.05.031.

[77] C. V. C. Bouten, K. T. M. Koekkoek, M. Verduin, R. Kodde, and J. D. Janssen. A triaxial accelerometer and portable data pro- cessing unit for the assessment of daily physical activity. IEEE Transactions on Biomedical Engineering, 44(3):136–147, March 1997. doi:10.1109/10.554760.

[78] G. J. Welk, S. N. Blair, K. Wood, S. Jones, and R. W. Thompson. A comparative evaluation of three accelerometry-based physical activity monitors. Medicine & Science in Sports & Exercise, 32(9):S489–S497, September 2000. doi:10.1097/00005768-200009001-00008.

[79] John M. Jakicic, Marsha Marcus, Kara I. Gallagher, Colby Randall, Erin Thomas, Fredric L. Goss, and Robert J. Robertson. Evaluation of the SenseWear Pro Armband— to assess energy expenditure during exercise. Medicine and science in sports and exercise, 36(5):897–904, May 2004. doi:10.1249/01.mss.0000126805.32659.43. List of References 133

[80] Dimitrios Papazoglou, Giovanni Augello, Mariantonella Tagliaferri, Giulio Savia, Paolo Marzullo, Efstratios Maltezos, and Antonio Liuzzi. Evaluation of a multisensor armband in estimating energy expendi- ture in obese individuals. Obesity, 14(12):2217–2223, December 2006. doi:10.1038/oby.2006.260.

[81] Maxime St-Onge, Diane Mignault, David B. Allison, and R´emiRabasa- Lhoret. Evaluation of a portable device to measure daily energy expen- diture in free-living adults. The American Journal of Clinical Nutrition, 85(3):742–749, March 2007.

[82] GfK SE. Smart home: Insights on consumer attitudes to the smart home, 2016. URL http://www.gfk.com/landing-pages/smart-home- white-paper/.

[83] Indoor air - part 26: Sampling strategy for carbon dioxide (CO2) (ISO 16000-26:2012); German version EN ISO 16000-26:2012. DIN EN ISO Standard 16000-26:2012-11.

[84] Digi-Key Electronics. Gas Sensors | Sensors, Transducers | DigiKey. URL https://www.digikey.com/products/en/sensors-transducers/gas- sensors/530. Accessed on 10th January 2019.

[85] S. Herberger, M. Herold, H. Ulmer, A. Burdack-Freitag, and F. Mayer. Detection of human effluents by a MOS gas sensor in correlation to VOC quantification by GC/MS. Building and Environment, 45(11): 2430–2439, November 2010. doi:10.1016/j.buildenv.2010.05.005.

[86] Bing Dong, Burton Andrews, Khee Poh Lam, Michael H¨oynck, Rui Zhang, Yun-Shang Chiou, and Diego Benitez. An information technol- ogy enabled sustainability test-bed (ITEST) for occupancy detection through an environmental sensing network. Energy and Buildings, 42 (7):1038–1046, July 2010. doi:10.1016/j.enbuild.2010.01.016.

[87] Fitbit, Inc. Fitbit Zip— Wireless Activity Tracker. URL https://www. fitbit.com/zip. Accessed on 13th January 2018.

[88] J. Farringdon, A. J. Moore, N. Tilbury, J. Church, and P. D. Biemond. Wearable sensor badge and sensor jacket for context aware- ness. In Digest of Papers. Third International Symposium on Wear- able Computers, pages 107–113, San Francisco, CA, USA, 1999. IEEE. doi:10.1109/ISWC.1999.806681. 134 List of References

[89] E. Wade and H. Asada. Conductive fabric garment for a cable-free body area network. IEEE Pervasive Computing, 6(1):52–58, January 2007. doi:10.1109/MPRV.2007.8.

[90] Hexoskin (Carr´eTechnologies Inc.). Hexoskin Shirt - Technical Spec- ifications. URL https://cdn.shopify.com/s/files/1/0284/7802/files/ Hexoskin.pdf?15303810385753780610. Accessed on 30th April 2019.

[91] Polar Electro Oy. Polar Team Pro | GPS Athlete Performance Tracking Solution. URL https://www.polar.com/en/b2b products/ team sports/team pro. Accessed on 13th May 2018.

[92] Fitbit, Inc. Fitbit Ionic— Watch. URL https://www.fitbit.com/ionic. Accessed on 13th January 2018.

[93] Apple Inc. Apple Watch Series 3. URL https://www.apple.com/lae/ apple-watch-series-3/. Accessed on 13th January 2018.

[94] Boo-Ho Yang, Sokwoo Rhee, and H. H. Asada. A twenty-four hour tele- nursing system using a ring sensor. In Proceedings of the 1998 IEEE International Conference on Robotics and Automation, volume 1, pages 387–392, Leuven, Belgium. doi:10.1109/ROBOT.1998.676438.

[95] Sokwoo Rhee, Boo-Ho Yang, Kuowei Chang, and H. H. Asada. The ring sensor: a new ambulatory wearable sensor for twenty-four hour patient monitoring. In Proceedings of the 20th Annual Inter- national Conference of the IEEE Engineering in Medicine and Biol- ogy Society, volume 20, pages 1906–909, Hong Kong, China, 1998. doi:10.1109/IEMBS.1998.746970.

[96] Motiv Inc. Technology - Wearable Tech for Health & Exercise — Motiv Ring. URL https://mymotiv.com/technology/. Accessed on 14th May 2018.

[97] Oura Health Oy. The Science Behind Oura, November 2017. URL https://ouraring.com/the-science-behind-oura/. Accessed on 25th April 2019.

[98] Stewart G. Trost, Kerry L. McIver, and Russell R. Pate. Conduct- ing accelerometer-based activity assessments in field-based research. Medicine & Science in Sports & Exercise, 37(11):S531–S543, Novem- ber 2005. doi:10.1249/01.mss.0000185657.86065.98. List of References 135

[99] C. V. C. Bouten, A. A. H. J. Sauren, M. Verduin, and J. D. Janssen. Effects of placement and orientation of body-fixed accelerometers on the assessment of energy expenditure during walking. Medical and Biological Engineering and Computing, 35(1):50–56, January 1997. doi:10.1007/BF02510392. [100] M. Sekine, T. Tamura, M. Akay, T. Fujimoto, T. Togawa, and Y. Fukui. Discrimination of walking patterns using wavelet-based fractal analysis. IEEE Transactions on Neural Systems and Rehabilitation Engineering, 10(3):188–196, September 2002. doi:10.1109/TNSRE.2002.802879. [101] Martin Berchtold, Matthias Budde, Hedda R. Schmidtke, and Michael Beigl. An extensible modular recognition concept that makes activity recognition practical. In KI 2010: Advances in Artificial Intelligence, pages 400–409. Springer Berlin Heidelberg, 2010. doi:10.1007/978-3- 642-16111-7 46. [102] S. Godha, G. Lachapelle, and M. E. Cannon. Integrated GPS/INS system for pedestrian navigation in a signal degraded environment. In Proceedings of the 19th International Technical Meeting of the Satellite Division of The Institute of Navigation (ION GNSS 2006), pages 2151– 2164, Fort Worth, TX, USA, 2006. The Institute of Navigation, Inc. [103] S. Beauregard. Omnidirectional pedestrian navigation for first responders. In 2007 4th Workshop on Positioning, Navigation and Communication, pages 33–36, Hannover, Germany. IEEE. doi:10.1109/WPNC.2007.353609. [104] J. Barth, J. Klucken, P. Kugler, T. Kammerer, R. Steidl, J. Win- kler, J. Hornegger, and B. Eskofier. Biometric and mobile gait analy- sis for early diagnosis and therapy monitoring in parkinson’s disease. In 2011 Annual International Conference of the IEEE Engineering in Medicine and Society, pages 868–871, Boston, MA, USA. doi:10.1109/IEMBS.2011.6090226. [105] E. Sazonov. Footwear-Based Wearable Sensors for Physical Activity Monitoring, volume 2 of Pervasive and Mobile Sensing and Comput- ing for Healthcare. Smart Sensors, Measurement and Instrumentation, pages 89–110. Springer Berlin Heidelberg, 2013. doi:10.1007/978-3- 642-32538-0 4. [106] Nike Inc. Nike and Apple Launch Nike + iPod Sport Kit, July 2006. URL https://news.nike.com/news/nike-and-apple-launch-nike- ipod-sport-kit. Accessed on 12th March 2018. 136 List of References

[107] adidas AG. adidas miCoach SPEED CELL fact sheet. URL https: //preview.thenewsmarket.com/Previews/ADID/DocumentAssets/ 218315.pdf. Accessed on 14th January 2018.

[108] K. Kong and M. Tomizuka. A gait monitoring system based on air pres- sure sensors embedded in a shoe. IEEE/ASME Transactions on Mecha- tronics, 14(3):358–370, June 2009. doi:10.1109/TMECH.2008.2008803.

[109] S. M. M. De Rossi, T. Lenzi, N. Vitiello, M. Donati, A. Per- sichetti, F. Giovacchini, F. Vecchi, and M. C. Carrozza. Develop- ment of an in-shoe pressure-sensitive device for gait analysis. In 2011 Annual International Conference of the IEEE Engineering in Medicine and Biology Society, pages 5637–5640, Boston, MA, USA. doi:10.1109/IEMBS.2011.6091364.

[110] T. Degen, H. Jaeckel, M. Rufer, and S. Wyss. SPEEDY: A fall detector in a wrist watch. In Seventh IEEE International Symposium on Wear- able Computers, 2003. Proceedings., pages 184–187, White Plains, NY, USA. doi:10.1109/ISWC.2003.1241410.

[111] A. Krause, M. Ihmig, E. Rankin, D. Leong, Smriti Gupta, D. Siewiorek, A. Smailagic, M. Deisher, and U. Sengupta. Trading off predic- tion accuracy and power consumption for context-aware wearable computing. In Ninth IEEE International Symposium on Wear- able Computers (ISWC’05), pages 20–26, Osaka, Japan, 2005. doi:10.1109/ISWC.2005.52.

[112] M. Nguyen, L. Fan, and C. Shahabi. Activity recognition using wrist- worn sensors for human performance evaluation. In 2015 IEEE In- ternational Conference on Data Mining Workshop (ICDMW), pages 164–169, Atlantic City, NJ, USA. doi:10.1109/ICDMW.2015.199.

[113] E. M. Tapia, S. S. Intille, W. Haskell, K. Larson, J. Wright, A. King, and R. Friedman. Real-time recognition of physical activities and their intensities using wireless accelerometers and a heart rate monitor. In 2007 11th IEEE International Symposium on Wearable Computers, pages 37–40, Boston, MA, USA. doi:10.1109/ISWC.2007.4373774.

[114] Institute of Medicine. Dietary Reference Intakes for Energy, Car- bohydrate, Fiber, Fat, Fatty Acids, Cholesterol, Protein, and Amino Acids. The National Academies Press, Washington, DC, USA, 2005. doi:10.17226/10490. List of References 137

[115] A. C. Pinheiro Volp, F. C. Esteves de Oliveira, R. Duarte Mor- eira Alves, E. A. Esteves, and J. Bressan. Energy expenditure: compo- nents and evaluation methods. Nutrici´onHospitalaria, 26(3):430–440, 2011. [116] Ergonomics of the thermal environment - determination of metabolic rate (ISO 8996:2004); German version EN ISO 8996:2004. DIN EN ISO Standard 8896:2005-01. [117] C. V. Bouten, K. R. Westerterp, M. Verduin, and J. D. Janssen. As- sessment of energy expenditure for physical activity using a triaxial accelerometer. Medicine and science in sports and exercise, 26(12): 1516–1523, December 1994. [118] S. Liu, R. X. Gao, D. John, J. W. Staudenmayer, and P. S. Freed- son. Multisensor data fusion for physical activity assessment. IEEE Transactions on Biomedical Engineering, 59(3):687–696, March 2012. doi:10.1109/TBME.2011.2178070. [119] Darcy L. Johannsen, Miguel Andres Calabro, Jeanne Stewart, Warren Franke, Jennifer C. Rood, and Gregory J. Welk. Accuracy of armband monitors for measuring daily energy expenditure in healthy adults. Medicine & Science in Sports & Exercise, 42(11):2134–2140, November 2010. doi:10.1249/MSS.0b013e3181e0b3ff. [120] Nisarg Vyas, Jonathan Farringdon, David Andre, and John Ivo Stivoric. Machine learning and sensor fusion for estimating con- tinuous energy expenditure. AI MAGAZINE, 33(2):55–66, 2012. doi:10.1609/aimag.v33i2.2408. [121] Barbara E. Ainsworth, William L. Haskell, Stephen D. Herrmann, Nathanael Meckes, David R. Bassett, Catrine Tudor-Locke, Jennifer L. Greer, Jesse Vezina, Melicia C. Whitt-Glover, and Arthur S. Leon. 2011 compendium of physical activities: a second update of codes and MET values. Medicine & Science in Sports & Exercise, 43(8):1575–1581, August 2011. doi:10.1249/mss.0b013e31821ece12. [122] Nuala M. Byrne, Andrew P. Hills, Gary R. Hunter, Roland L. Wein- sier, and Yves Schutz. Metabolic equivalent: one size does not fit all. Journal of Applied Physiology, 99(3):1112–1119, September 2005. doi:10.1152/japplphysiol.00023.2004. [123] Sarah Kozey, Kate Lyden, John Staudenmayer, and Patty Freed- son. Errors in MET estimates of physical activities using 3.5 ml 138 List of References

·kg−1 · min−1 as the baseline oxygen consumption. Journal of Physical Activity and Health, 7(4):508–516, July 2010. doi:10.1123/jpah.7.4.508.

[124] J. Arthur Harris and Francis G. Benedict. A biometric study of human basal metabolism. Proceedings of the National Academy of Sciences of the United States of America, 4(12):370–373, December 1918.

[125] Michael J. McGrath, Cliodhna Ni Scanaill, and Nafus. Sensor Technologies: Healthcare, Wellness and Environmental Applications. Apress, Berkeley, CA, USA, 1st edition, 2013. doi:10.1007/978-1-4302- 6014-1.

[126] Kimberly Tuck. Frequency analysis in the industrial market using ac- celerometer sensors application note AN3751 (rev. 0). Freescale Semi- conductor, Inc., July 2008.

[127] K. Aminian, Ph. Robert, E. E. Buchser, B. Rutschmann, D. Hayoz, and M. Depairon. Physical activity monitoring based on accelerom- etry: validation and comparison with video observation. Medical & Biological Engineering & Computing, 37(3):304–308, May 1999. doi:10.1007/BF02513304.

[128] Christopher J. Fisher. Using an accelerometer for inclina- tion sensing application note AN-1057 (rev. 0). Analog De- vices, Inc., 2010. URL https://www.analog.com/media/en/technical- documentation/application-notes/AN-1057.pdf.

[129] M. J. Mathie, N. H. Lovell, A. C. F. Coster, and B. G. Celler. De- termining activity using a triaxial accelerometer. In Proceedings of the Second Joint Engineering in Medicine and Biology/ Biomedical Engi- neering Society Conference, volume 3, pages 2481–2482, Houston, TX, USA, 2002. doi:10.1109/IEMBS.2002.1053385.

[130] A.K. Bourke, J.V. O’Brien, and G.M. Lyons. Evaluation of a threshold- based tri-axial accelerometer fall detection algorithm. Gait & Posture, 26(2):194–199, July 2007. doi:10.1016/j.gaitpost.2006.09.012.

[131] Ning Jia. Fall detection application by using 3-axis accelerometer ADXL345 application note AN-1023 (rev. 0). Analog Devices, Inc., 2009.

[132] Min-Hang Bao. Micro Mechanical Transducers - Pressure Sensors, Ac- celerometers and Gyroscopes. Elsevier, Amsterdam, The Netherlands, 1st edition, 2000. List of References 139

[133] Jon S. Wilson. Sensor Technology Handbook. Elsevier, Burlington, MA, USA, 2005. [134] Analog Devices, Inc. ADXL345: 3-axis, ±2 g/±4 g/±8 g/±16 g digital accelerometer datasheet (rev. B), 2010. [135] M. Ermes, J. P¨arkk¨a, J. M¨antyj¨arvi, and I. Korhonen. Detec- tion of daily activities and sports with wearable sensors in con- trolled and uncontrolled conditions. IEEE Transactions on In- formation Technology in Biomedicine, 12(1):20–26, January 2008. doi:10.1109/TITB.2007.899496. [136] STMicroelectronics N.V. Parameters and calibration of a low-g 3-axis accelerometer application note AN4508 (rev. 1), June 2014. [137] Richard G. Lyons. Understanding Digital Signal Processing. Prentice Hall, Upper Saddle River, NJ, USA, 3rd edition, 2011. [138] D. Roetenberg. Inertial and magnetic sensing of human motion. PhD thesis, University of Twente, 2006. [139] A.K. Bourke and G.M. Lyons. A threshold-based fall-detection algo- rithm using a bi-axial gyroscope sensor. Medical Engineering & Physics, 30(1):84–90, January 2008. doi:10.1016/j.medengphy.2006.12.001. [140] B. Najafi, K. Aminian, F. Loew, Y. Blanc, and P. A. Robert. Mea- surement of stand-sit and sit-stand transitions using a miniature gy- roscope and its application in fall risk evaluation in the elderly. IEEE Transactions on Biomedical Engineering, 49(8):843–851, August 2002. doi:10.1109/TBME.2002.800763. [141] John Geen and David Krakauer. New iMEMS angular-rate-sensing gyroscope. Analog Dialogue, 37(1):12–15, March 2003. [142] STMicroelectronics N.V. L3G4200D - MEMS motion sensor: ultra- stable three-axis digital output gyroscope preliminary datasheet (rev. 3), December 2010. [143] STMicroelectronics N.V. Everything about STMicroelectronics’ 3-axis digital MEMS gyroscopes technical article TA0343 (rev. 1), July 2011. [144] Talat Ozyagcilar. Implementing a tilt-compensated ecompass using accelerometer and magnetometer sensors application note AN4248 (rev. 4.0). Freescale Semiconductor, Inc., November 2015. URL https://www.nxp.com/docs/en/application-note/AN4248.pdf. 140 List of References

[145] Freescale Semiconductor, Inc. MAG3110: 3-axis digital magnetometer datasheet (rev 2.0), February 2011.

[146] Talat Ozyagcilar. Layout recommendations for PCBs using a magne- tometer sensor application note AN4247 (rev. 4.0). Freescale Semicon- ductor, Inc., November 2015. URL https://www.nxp.com/docs/en/ application-note/AN4247.pdf.

[147] Talat Ozyagcilar. Calibrating an ecompass in the presence of hard- and soft-iron interference application note AN4246 (rev. 4.0). Freescale Semiconductor, Inc., November 2015. URL https://www.nxp.com/ docs/en/application-note/AN4246.pdf.

[148] Christopher Konvalin. Compensating for Tilt, Hard-Iron, and Soft- Iron Effects | Sensors Magazine, December 2009. URL http://www. sensorsmag.com/node/23481. Accessed on 26th August 2017.

[149] Yury Petrov. Ellipsoid fit MATLAB program (v. 1.1), July 2009. URL http://de.mathworks.com/matlabcentral/fileexchange/ 24693-ellipsoid-fit.

[150] Y. Bai, W. Jia, H. Zhang, Z. H. Mao, and M. Sun. Helping the blind to find the floor of destination in multistory buildings using a barometer. In 2013 35th Annual International Conference of the IEEE Engineering in Medicine and Biology Society (EMBC), pages 4738–4741, Osaka, Japan. doi:10.1109/EMBC.2013.6610606.

[151] Yang Gu, M. Ma, Yang-huan Li, and Q. Song. Accurate height estimation based on apriori knowledge of buildings. In International Conference on Indoor Positioning and Indoor Nav- igation, pages 1–7, Montbeliard-Belfort, France, 2013. IEEE. doi:10.1109/IPIN.2013.6817891.

[152] Kartik Muralidharan, Azeem Javed Khan, Archan Misra, Rajesh Kr- ishna Balan, and Sharad Agarwal. Barometric phone sensors: More hype than hope! In Proceedings of the 15th Workshop on Mobile Computing Systems and Applications, HotMobile ’14, pages 12:1–12:6, Santa Barbara, CA, USA, 2014. ACM. doi:10.1145/2565585.2565596.

[153] H. Ye, T. Gu, X. Tao, and J. Lu. B-Loc: Scalable floor localiza- tion using barometer on smartphone. In 2014 IEEE 11th International Conference on Mobile Ad Hoc and Sensor Systems, pages 127–135, Philadelphia, PA, USA. doi:10.1109/MASS.2014.49. List of References 141

[154] Salvatore Vanini, Francesca Faraci, Alan Ferrari, and Silvia Giordano. Using barometric pressure data to recognize vertical displacement ac- tivities on . Computer Communications, 87:37–48, August 2016. doi:10.1016/j.comcom.2016.02.011.

[155] Bosch Sensortec GmbH. BMP180 data sheet (rev. 2.8), May 2015. URL https://ae-bst.resource.bosch.com/media/ tech/media/ datasheets/BST-BMP180-DS000.pdf.

[156] Bosch Sensortec GmbH. BMP388 – datasheet (rev. 1.1), March 2018. URL https://ae-bst.resource.bosch.com/media/ tech/media/ datasheets/BST-BMP388-DS001.pdf.

[157] John R. Rumble, editor. CRC Handbook of and Physics. CRC Press/ Taylor & Francis, Boca Raton, FL, USA, 98th edition, (Internet Version 2018).

[158] Guangwen Liu, Masayuki Iwai, Yoshito Tobe, Dunstan Matekenya, Khan Muhammad Asif Hossain, Masaki Ito, and Kaoru Sezaki. Be- yond horizontal location context: Measuring elevation using smart- phone’s barometer. In Proceedings of the 2014 ACM International Joint Conference on Pervasive and Ubiquitous Computing: Adjunct Publication, UbiComp ’14 Adjunct, pages 459–468, Seattle, WA, USA. doi:10.1145/2638728.2641670.

[159] Dimosthenis E. Bolanakis. MEMS barometers toward vertical position detection: Background theory, system prototyping, and measurement analysis. Synthesis Lectures on Mechanical Engineering, 1(1):1–145, May 2017. doi:10.2200/S00769ED1V01Y201704MEC003.

[160] Abraham. Savitzky and M. J. E. Golay. Smoothing and differentiation of data by simplified least squares procedures. Analytical Chemistry, 36(8):1627–1639, July 1964. doi:10.1021/ac60214a047.

[161] Simone Benedetto, Christian Caldato, Elia Bazzan, Darren C. Green- wood, Virginia Pensabene, and Paolo Actis. Assessment of the Fitbit Charge 2 for monitoring heart rate. PLOS ONE, 13(2):1–10, February 2018. doi:10.1371/journal.pone.0192691.

[162] Polar Electro Oy. Polar OH1 | Optical heart rate sen- sor. URL https://www.polar.com/uk-en/products/accessories/oh1- optical-heart-rate-sensor. Accessed on 12th July 2019. 142 List of References

[163] Oscar´ D. Lara, Alfredo J. P´erez,Miguel A. Labrador, and Jos´eD. Posada. Centinela: A human activity recognition system based on acceleration and vital sign data. Pervasive and Mobile Computing, 8 (5):717–729, October 2012. doi:10.1016/j.pmcj.2011.06.004.

[164] F. Foerster, M. Smeja, and J. Fahrenberg. Detection of posture and motion by accelerometry: a validation study in ambulatory monitor- ing. Computers in Human Behavior, 15(5):571–583, September 1999. doi:10.1016/S0747-5632(99)00037-0.

[165] Paul Lukowicz, Jamie A. Ward, Holger Junker, Mathias St¨ager, Ger- hard Tr¨oster,Amin Atrash, and Thad Starner. Recognizing workshop activity using body worn microphones and accelerometers. In Perva- sive Computing, pages 18–32, Linz/ Vienna, Austria, 2004. Springer Berlin Heidelberg. doi:10.1007/978-3-540-24646-6 2.

[166] Q. Zhu, Z. Chen, and Y. C. Soh. Using unlabeled acoustic data with locality-constrained linear coding for energy-related activity recogni- tion in buildings. In 2015 IEEE International Conference on Automa- tion Science and Engineering (CASE), pages 174–179, Gothenburg, Sweden. doi:10.1109/CoASE.2015.7294058.

[167] U. Maurer, A. Smailagic, D. P. Siewiorek, and M. Deisher. Ac- tivity recognition and monitoring using multiple sensors on different body positions. In International Workshop on Wearable and Im- plantable Body Sensor Networks (BSN’06), Cambridge, MA, USA, 2006. doi:10.1109/BSN.2006.6.

[168] Sasank Reddy, Min Mun, Jeff Burke, Deborah Estrin, Mark Hansen, and Mani Srivastava. Using mobile phones to determine transportation modes. ACM Transactions on Sensor Networks (TOSN), 6(2):13:1– 13:27, February 2010. doi:10.1145/1689239.1689243.

[169] Daniele Riboni and Claudio Bettini. COSAR: hybrid reasoning for context-aware activity recognition. Personal and Ubiquitous Comput- ing, 15(3):271–289, March 2011. doi:10.1007/s00779-010-0331-7.

[170] LibreOffice contributors. Pedestrian-Blue. LibreOffice (Version 5.1) [Computer Software], The Document Foundation, Berlin, Germany, 2016.

[171] Texas Instruments, Inc. MSP430F543xA, MSP430F541xA mixed- signal microcontrollers datasheet (rev. E), July 2015. List of References 143

[172] Round Solutions GmbH & Co. KG. Lithium ion polymer rechargeable battery BAT-LIPO450A-10 datasheet, September 2006.

[173] O. D. Lara and M. A. Labrador. A survey on human activity recogni- tion using wearable sensors. IEEE Communications Surveys Tutorials, 15(3):1192–1209, 2013. doi:10.1109/SURV.2012.110112.00192.

[174] Diane J. Cook and Narayanan C. Krishnan. Activity Learning: Discovering, Recognizing and Predicting Human Behavior from Sen- sor Data. Wiley Series on Parallel and Distributed Comput- ing. John Wiley & Sons, Inc, Hoboken, NJ, USA, February 2015. doi:10.1002/9781119010258.

[175] Saeed V. Vaseghi. Advanced Digital Signal Processing and Noise Re- duction. John Wiley & Sons, Ltd., Chichester, UK, 4th edition, 2008. doi:10.1002/9780470740156.

[176] S. G. Mallat. A theory for multiresolution signal decomposition: the wavelet representation. IEEE Transactions on Pattern Analysis and Machine Intelligence, 11(7):674–693, July 1989. doi:10.1109/34.192463.

[177] J. Mantyjarvi, J. Himberg, and T. Seppanen. Recognizing human mo- tion with multiple acceleration sensors. In 2001 IEEE International Conference on Systems, Man and Cybernetics. e-Systems and e-Man for Cybernetics in Cyberspace (Cat.No.01CH37236), volume 2, pages 747–752, Tucson, AZ, USA. doi:10.1109/ICSMC.2001.973004.

[178] P. Barralon, N. Vuillerme, and N. Noury. Walk detection with a kinematic sensor: Frequency and wavelet comparison. In 2006 International Conference of the IEEE Engineering in Medicine and Biology Society, pages 1711–1714, New York, NY, USA. doi:10.1109/IEMBS.2006.260770.

[179] S. J. Preece, J. Y. Goulermas, L. P. J. Kenney, and D. Howard. A comparison of feature extraction methods for the classifica- tion of dynamic activities from accelerometer data. IEEE Trans- actions on Biomedical Engineering, 56(3):871–879, March 2009. doi:10.1109/TBME.2008.2006190.

[180] Julius O. Smith III. Mathematics of the Discrete Fourier Transform (DFT): with Audio Applications. Stanford University, CA, USA, 2nd edition, 2007. URL https://www.dsprelated.com/freebooks/mdft/. 144 List of References

[181] A. Zhang, B. Yang, and L. Huang. Feature extraction of EEG sig- nals using power spectral entropy. In 2008 International Conference on BioMedical Engineering and Informatics, volume 2, pages 435–439, Sanya, China. IEEE. doi:10.1109/BMEI.2008.254.

[182] M. Ermes, J. Parkka, and L. Cluitmans. Advancing from offline to online activity recognition with wearable sensors. In 2008 30th An- nual International Conference of the IEEE Engineering in Medicine and Biology Society, pages 4451–4454, Vancouver, BC, Canada. doi:10.1109/IEMBS.2008.4650199.

[183] Glenn J. Myatt and Wayne P. Johnson. Making Sense of Data I: A Practical Guide to Exploratory Data Analysis and Data Mining. John Wiley & Sons, Inc., Hoboken, New Jersey, USA, 2nd edition, 2014. doi:10.1002/9781118422007.

[184] Nishkam Ravi, Nikhil Dandekar, Preetham Mysore, and Michael L. Littman. Activity recognition from accelerometer data. In Proceedings of the 17th Conference on Innovative Applications of Artificial Intel- ligence - Volume 3, IAAI’05, pages 1541–1546, Pittsburgh, PA, USA, 2005. AAAI Press.

[185] Y. Hanai, J. Nishimura, and T. Kuroda. Haar-like filtering for hu- man activity recognition using 3D accelerometer. In 2009 IEEE 13th Digital Signal Processing Workshop and 5th IEEE Signal Process- ing Education Workshop, pages 675–678, Marco Island, FL, USA. doi:10.1109/DSP.2009.4786008.

[186] Nam Pham and Tarek Abdelzaher. Robust dynamic human activity recognition based on relative energy allocation. In Distributed Comput- ing in Sensor Systems, pages 525–530, Santorini Island, Greece, 2008. Springer Berlin Heidelberg. doi:10.1007/978-3-540-69170-9 39.

[187] M. Ring, U. Jensen, P. Kugler, and B. Eskofier. Software-based per- formance and complexity analysis for the design of embedded classifi- cation systems. In Proceedings of the 21st International Conference on Pattern Recognition (ICPR2012), pages 2266–2269, Tsukuba, Japan, 2012. IEEE.

[188] Ulf Jensen, Patrick Kugler, Matthias Ring, and Bjoern M. Eskofier. Approaching the accuracy–cost conflict in embedded classification sys- tem design. Pattern Analysis and Applications, 19(3):839–855, August 2016. doi:10.1007/s10044-015-0503-1. List of References 145

[189] B. Pfundt, M. Reichenbach, B. Eskofier, and D. Fey. Smart sensor architectures for embedded biosignal analysis. In 2013 Conference on Design and Architectures for Signal and Image Processing, pages 174– 181, Cagliari, Italy. IEEE.

[190] A. Tobola, F. J. Streit, C. Espig, O. Korpok, C. Sauter, N. Lang, B. Schmitz, C. Hofmann, M. Struck, C. Weigand, H. Leutheuser, B. M. Eskofier, and G. Fischer. Sampling rate impact on en- ergy consumption of biomedical signal processing systems. In 2015 IEEE 12th International Conference on Wearable and Implantable Body Sensor Networks (BSN), pages 1–6, Cambridge, MA, USA. doi:10.1109/BSN.2015.7299392.

[191] VDI Society Civil Engineering and Building Services. Ventilation and indoor-air quality - assessment of indoor-air quality. Beuth Verlag GmbH, July 2011. VDI Guideline 6022 Part 3.

[192] Ben Bronsema, Maria Bj¨orck, Paolo Carrer, Geo Clausen, Klaus Fitzner, Gaute Flatheim, Tom Follin, Ulla Haverinen, Milan Jamriska, Jarek Kurnitski, and Marco Maroni. ISIAQ-CIB task group 42 report: Performance criteria of buildings for health and comfort. Technical report, International Society of Indoor Air Quality and Climate, 2004. URL https://www.isiaq.org/docs/TG42-report.pdf.

[193] Ventilation for buildings - design criteria for the indoor environment. CR Standard 1752:1998-12.

[194] Heating and Ventilation Technology Standards Committee. Ventilation for buildings - design and dimensioning of residential ventilation sys- tems. DIN Technical Report CEN/TR 14788, DIN German Institute for Standardization, Berlin, Germany, October 2006.

[195] B. Seifert. Richtwerte f¨ur die Innenraumluft: Die Beurteilung der Innenraumluftqualit¨at mit Hilfe der Summe der fl¨uchtigen or- ganischen Verbindungen (TVOC-Wert). Bundesgesundheitsblatt- Gesundheitsforschung-Gesundheitsschutz, 42(3):270–278, March 1999. doi:10.1007/s001030050091.

[196] Ad hoc Arbeitsgruppe aus Mitgliedern der Innenraumlufthygienekom- mission (IRK) des Umweltbundesamtes sowie der Arbeitsgemein- schaft der Obersten Landesgesundheitsbeh¨orden(AOLG). Beurteilung von Innenraumluftkontaminationen mittels Referenz- und Richtwerten. 146 List of References

Bundesgesundheitsblatt - Gesundheitsforschung - Gesundheitsschutz, 50(7):990–1005, July 2007. doi:10.1007/s00103-007-0290-y.

[197] Indoor air - part 5: Sampling strategy for volatile organic compounds (VOCs) (ISO 16000-5:2007); German version EN ISO 16000-5:2007. DIN EN ISO Standard 16000-5:2007-05.

[198] Airthings AS. Wave Plus: Radon and indoor air quality monitor prod- uct sheet. URL https://cdn2.hubspot.net/hubfs/4406702/Website/ Product%20Sheets/Wave%20Plus/WavePlus%20Product%20Sheet. pdf.

[199] R. Melfi, B. Rosenblum, B. Nordman, and K. Christensen. Measuring building occupancy using existing network infrastructure. In Green Computing Conference and Workshops (IGCC), 2011 International, pages 1–8, Orlando, FL, USA. IEEE. doi:10.1109/IGCC.2011.6008560.

[200] Thiago Teixeira, Gershon Dublon, and Andreas Savvides. A survey of human-sensing: Methods for detecting presence, count, location, track, and identity. Technical report, Yale University, New Haven, CT, USA, 2010.

[201] Max Pettenkofer. Uber¨ den Luftwechsel in Wohngeb¨auden. J.G. Cotta’sche Buchhandlung, 1858.

[202] VDI/DIN-Commission on Air Pollution Prevention (KRdL) Stan- dards Committee. Indoor-air pollution measurement - measurement of indoor air change rate. Beuth Verlag GmbH, July 2001. VDI Guide- line 4300 Part 7.

[203] NOAA Earth System Research Laboratory/Global Monitoring Divi- sion. Global greenhouse gas reference network. URL http://www.esrl. noaa.gov/gmd/ccgg/CCGGhandout.pdf. Accessed on 4th July 2014.

[204] D. A. Brown. Human occupancy detection. In Proceedings The Insti- tute of Electrical and Electronics Engineers. 29th Annual 1995 Inter- national Carnahan Conference on Security Technology, pages 166–174, Sanderstead, Surrey, UK. doi:10.1109/CCST.1995.524907.

[205] Steven J. Emmerich and Andrew K. Persily. State-of-the-art review of CO2 demand controlled ventilation technology and application. Tech- nical Report NISTIR 6729, National Institute of Standards and Tech- nology, Gaithersburg, MD, USA, March 2001. List of References 147

[206] Shengwei Wang, John Burnett, and Hoishing Chong. Experimental validation of CO2-based occupancy detection for demand-controlled ventilation. Indoor and Built Environment, 8(6):377–391, 1999. doi:10.1177/1420326X9900800605.

[207] T. Leephakpreeda, R. Thitipatanapong, T. Grittiyachot, and V. Yungchareon. Occupancy-based control of indoor air ventilation: A theoretical and experimental study. ScienceAsia, 27(4):279–284, De- cember 2001. doi:10.2306/scienceasia1513-1874.2001.27.279.

[208] Stanley A. Mumma. Transient occupancy ventilation by monitoring CO2. ASHRAE IAQ Applications, 2004.

[209] Davide Cal`ı, Peter Matthes, Kristian Huchtemann, Rita Stre- blow, and Dirk M¨uller. CO2 based occupancy detection algo- rithm: Experimental analysis and validation for office and residen- tial buildings. Building and Environment, 86:39–49, April 2015. doi:10.1016/j.buildenv.2014.12.011.

[210] Colin Brennan, Graham W. Taylor, and Petros Spachos. De- signing learned CO2-based occupancy estimation in smart build- ings. IET Wireless Sensor Systems, 8(6):249–255, December 2018. doi:10.1049/iet-wss.2018.5027.

[211] Som S. Shrestha and Gregory M. Maxwell. An experimental evaluation of HVAC-grade carbon dioxide sensors — part I: Test and evaluation procedure. ASHRAE Transactions, 115(2), 2009.

[212] E+E ELEKTRONIK GmbH. EE891 series datasheet v1.3. URL http://www.epluse.com/fileadmin/data/product/ee891/ datasheet EE891.pdf.

[213] E+E ELEKTRONIK GmbH. Tutorial CO2-Messung v2.0.

[214] Vaisala Oyj. Infrared sensor technology and its impact on HVAC CO2 measurement accuracy application note (ref. B211311EN-B), 2019. URL https://www.vaisala.com/sites/default/files/documents/VIM- G-HVAC-CO2-Measurement-Accuracy-Application-note-B211311EN- B-LOW-v4.pdf.

[215] E+E ELEKTRONIK GmbH. EE894 datasheet v1.5. URL https: //www.epluse.com/fileadmin/data/product/ee894/datasheet EE894. pdf. 148 List of References

[216] J. Fehlmann and H.U. Wanner. Indoor climate and indoor air qual- ity in residential buildings. Indoor Air, 3(1):41–50, March 1993. doi:10.1111/j.1600-0668.1993.t01-3-00007.x.

[217] A. Haider. Specification E2 interface version 4.1. E+E ELEKTRONIK GmbH, May 2011. URL http://www.epluse.com/fileadmin/data/sw/ Specification E2 Interface.pdf.

[218] Som Shrestha and Gregory Maxwell. Product testing report - wall mounted carbon dioxide (CO2) transmitters. Technical report, Iowa State University, Ankeny, IA, USA, June 2009.

[219] Som S. Shrestha and Gregory M. Maxwell. An experimental evalua- tion of HVAC-grade carbon dioxide sensors: Part 2, performance test results. ASHRAE Transactions, 116(1), 2010.

[220] Udo D. J. Gieseler and Gerhard Wiegleb. Stabilit¨atund Kalibri- erf¨ahigkeit von Kohlendioxid Gassensoren f¨urdie Klima- und L¨uftung- stechnik. cci Zeitung 08/12, pages 1–15. Article number cci14605.

[221] Som S. Shrestha and Gregory M. Maxwell. An experimental evaluation of HVAC-grade carbon dioxide sensors — part 4: Effects of ageing on sensor performance. ASHRAE Transactions, 116(2), 2010.

[222] Charles E. Mortimer, Ulrich M¨uller,and Johannes Beck. Chemie - Das Basiswissen der Chemie. Title of the Original English Language Edition: Chemistry. Georg Thieme Verlag, Stuttgart, Germany, 12th edition, 2015. doi:10.1055/b-003-125838.

[223] P. Wiederhold. Water Vapor Measurement. CRC Press, Boca Raton, FL, USA, 1st edition, April 1997.

[224] World Meteorological Organization. Guide to meteorological instru- ments and methods of observation: (CIMO guide). Technical Report WMO-No. 8, Geneva, Switzerland, 2014 edition, Updated in 2017. URL https://library.wmo.int/opac/doc num.php?explnum id=4147.

[225] Andrea Burdack-Freitag, Rainer Rampf, Florian Mayer, and Klaus Breuer. Identification of anthropogenic volatile organic compounds correlating with bad indoor air quality. In Proceedings of Healthy Build- ings, pages 1928–1932, Syracuse, NY, USA, 2009. International Society of Indoor Air Quality and Climate (ISIAQ). List of References 149

[226] Michael Phillips, Jolanta Herrera, Sunithi Krishnan, Mooena Zain, Joel Greenberg, and Renee N. Cataneo. Variation in volatile organic com- pounds in the breath of normal humans. Journal of Chromatography B: Biomedical Sciences and Applications, 729(1–2):75–88, June 1999. doi:10.1016/S0378-4347(99)00127-9.

[227] Tim C. Pearce, Susan S. Schiffman, H. Troy Nagle, and Julian W. Gardner. Handbook of Machine Olfaction: Electronic Nose Technology. WILEY-VCH Verlag GmbH & Co. KGaA, Weinheim, Germany, 2003. doi:10.1002/3527601597.

[228] AppliedSensor GmbH. iAQ-core datasheet, 2014.

[229] Simon Scharpf (Sales Manager, AppliedSensor GmbH). RE: Fragen zum iAQ-core Sensor. personal communication. E-mail from 8th Au- gust 2014.

[230] Simon Scharpf (Sales Manager, AppliedSensor GmbH). RE: Fragen zum iAQ-core Sensor. personal communication. E-mail from 12th August 2014.

[231] Simon Scharpf (Marketing Manager, ams Sensor Solutions Germany GmbH). Re: Fragen zum iaq-core sensor. personal communication. E-mail from 25th February 2015.

[232] Figaro Engineering Inc. General information for TGS sensors, March 2005.

[233] Tom Aiken. MOS air quality sensors make vehicle cabins safer. Sensors, 21(2):3, February 2004.

[234] Figaro Engineering Inc. Relationship between oxygen concentration and Rs Excel sheet, January 2005.

[235] Nikolai Helwig, Marco Sch¨uler,Christian Bur, Andreas Sch¨utze,and Tilman Sauerwald. Gas mixing apparatus for automated gas sensor characterization. Measurement Science and Technology, 25(5):055903, March 2014. doi:10.1088/0957-0233/25/5/055903.

[236] Analog Devices, Inc. Basic Linear Design. Norwood, MA, USA, 2007.

[237] Ergonomics of the thermal environment - instruments for measur- ing physical quantities (ISO 7726:1998); German version EN ISO 7726:2001, April 2002. EN ISO Standard 7726:2001. 150 List of References

[238] Donal McNamara. Temperature measurement theory and prac- tical techniques application note AN-892 (rev. 0). Analog De- vices, Inc., 2006. URL https://www.analog.com/media/en/technical- documentation/application-notes/AN 892.pdf.

[239] Sensirion AG. SHTxx design guide (rev. 1.0), June 2010.

[240] Sensirion AG. Datasheet SHT25 version 2, December 2011.

[241] Indoor air - part 1: General aspects of sampling strategy (ISO 16000- 1:2004); German version EN ISO 16000-1:2006. DIN EN ISO Standard 16000-1:2006-06.

[242] Denes K. Roveti. Choosing a Humidity Sensor: A Review of Three Technologies. Sensors Online, July 2001. URL https://www.sensorsmag.com/components/choosing-a-humidity- sensor-a-review-three-technologies. Accessed on 3rd March 2018.

[243] Ventilation for buildings - test procedures and measurement methods to hand over air conditioning and ventilation systems; German version EN 12599:2012. DIN EN Standard 12599:2013-01.

[244] S. Erhan Deveci, Figen Deveci, Yasemin A¸cik,and A. Tevfik Ozan. The measurement of exhaled carbon monoxide in healthy smokers and non-smokers. Respiratory Medicine, 98(6):551–556, June 2004. doi:10.1016/j.rmed.2003.11.018.

[245] Martin Braniˇs,Pavla Rez´aˇcov´a,andˇ Mark´etaDomasov´a. The effect of outdoor air and indoor human activity on mass concentrations of PM10, PM2.5, and PM1 in a classroom. Environmental Research, 99 (2):143–149, October 2005. doi:10.1016/j.envres.2004.12.001.

[246] Yunwan Jeon, Chanho Cho, Jongwoo Seo, Kyunglag Kwon, Hansaem Park, Seungkeun Oh, and In-Jeong Chung. IoT-based occupancy detec- tion system in indoor residential environments. Building and Environ- ment, 132:181–204, March 2018. doi:10.1016/j.buildenv.2018.01.043.

[247] X. Guo, D. K. Tiller, G. P. Henze, and C. E. Waters. The per- formance of occupancy-based lighting control systems: A review. Lighting Research and Technology, 42(4):415–431, December 2010. doi:10.1177/1477153510376225.

[248] Shwetak N. Patel, Matthew S. Reynolds, and Gregory D. Abowd. De- tecting human movement by differential air pressure sensing in HVAC List of References 151

system ductwork: An exploration in infrastructure mediated sensing. In Pervasive Computing, pages 1–18, Sydney, Australia, 2008. Springer Berlin Heidelberg. doi:10.1007/978-3-540-79576-6 1.

[249] Microchip Technology Inc. PIC24FJ128GA010 family datasheet DS39747F (rev. F), January 2012. URL http://ww1.microchip.com/ downloads/en/DeviceDoc/39747F.pdf.

[250] Bluegiga Technologies Oy. BLE113 data sheet version 1.4, March 2014.

[251] Microchip Technology Inc. MRF24WB0MA/MRF24WB0MB data sheet DS70632C (rev. C), May 2013. URL http://ww1.microchip.com/ downloads/en/DeviceDoc/70632C.pdf.

[252] Microchip Technology Inc. 24AA256/24LC256/24FC256 datasheet DS20001203U (rev. U), November 2013. URL http://ww1.microchip. com/downloads/en/DeviceDoc/20001203U.pdf.

[253] Pang-Ning Tan, Michael Steinbach, and Vipin Kumar. Introduction to data mining. Pearson Education Limited, London, UK, Pearson new international edition, July 2013.

[254] M. A. Hall. Correlation-based feature selection for machine learning. PhD thesis, University of Waikato, Department of Computer Science, Hamilton, New Zealand, 1999.

[255] Mark A. Hall. Correlation-based feature selection for discrete and nu- meric class machine learning. In Proceedings of the Seventeenth Inter- national Conference on Machine Learning, ICML ’00, pages 359–366. Morgan Kaufmann Publishers Inc., 2000.

[256] William W. Cohen. Fast effective rule induction. In Machine Learn- ing Proceedings 1995, pages 115–123, Tahoe City, CA, USA. Morgan Kaufmann. doi:10.1016/B978-1-55860-377-6.50023-2.

[257] U. M. Fayyad and K. B. Irani. Multi-interval discretization of continuous-valued attributes for classification learning. In Proceedings of the Thirteenth International Joint Conference on Artificial Intelli- gence, pages 1022–1027, Chambery, France, 1993. IJCAI.

[258] J. Ross Quinlan. C4.5: Programs for Machine Learning. Morgan Kauf- mann Publishers, San Francisco, CA, USA, 1993. 152 List of References

[259] J.R. Quinlan. Improved use of continuous attributes in C4.5. Journal of Artificial Intelligence Research, 4:77–90, March 1996. doi:10.1613/jair.279.

[260] S. le Cessie and J. C. van Houwelingen. Ridge estimators in logistic regression. Journal of the Royal Statistical Society. Series C (Applied Statistics), 41(1):191–201, 1992. doi:10.2307/2347628.

[261] Leo Breiman. Random forests. Machine Learning, 45(1):5–32, October 2001. doi:10.1023/A:1010933404324.

[262] Max Bramer. Principles of Data Mining. Springer-Verlag, London, UK, 2nd edition, 2013.

[263] Geoff Dougherty. Pattern Recognition and Classification. Springer, New York, NY, USA, 2013. doi:10.1007/978-1-4614-5323-9.

[264] Charu C. Aggarwal. Data Mining: The Textbook. Springer, Cham, Switzerland, 2015. doi:10.1007/978-3-319-14142-8.

[265] STMicroelectronics N.V. LSM9DS1 - iNEMO inertial module: 3D ac- celerometer, 3D gyroscope, 3D magnetometer datasheet (rev. 3), March 2015. URL https://www.st.com/resource/zh/datasheet/lsm9ds1.pdf.

[266] InvenSense, Inc. ICM-20948 - world’s lowest power 9-axis MEMS motiontracking device datasheet (rev. 1.3), June 2017. URL http://www.invensense.com/wp-content/uploads/2016/06/DS- 000189-ICM-20948-v1.3.pdf.

[267] InvenSense, Inc. ICM-20789 - 7-axis, high performance integrated 6-axis inertial and barometric pressure sensor datasheet (rev. 1.4), January 2018. URL http://www.invensense.com/wp-content/uploads/ 2017/10/DS-000169-ICM-20789-TYP-v1.4.pdf.

[268] Bosch Sensortec GmbH. BMX160 – data sheet (rev. 1.1), May 2018.

[269] Wilhelm Kleiminger, Friedemann Mattern, and Silvia Santini. Pre- dicting household occupancy for smart heating control: A comparative performance analysis of state-of-the-art approaches. Energy and Build- ings, 85:493–505, December 2014. doi:10.1016/j.enbuild.2014.09.046.

[270] Herrlich. 2D Zeichnung ART-CASE S110 F B5013227. Odenw¨alder Kunststoffwerke Geh¨ausesystemeGmbH, July 2009. URL https:// www.okw.com/de/drawings-pdf/00011634.PDF. List of References 153

[271] Claus H¨orner (Project Engineering, Odenw¨alder Kunststoff- werke Geh¨ausesysteme GmbH). Freigabezeichnung Art Case 110 (B5012617/B5012517) mit Bearbeitung. personal communication. E-mail from 11th November 2014. List of Supervised Student Theses

[272] Jens Pfeiffer. Entwurf und Aufbau einer Multisensorplattform zur Sturz- und Aktivit¨atsdetektion am Handgelenk. Diploma thesis, In- stitute for Electronics Engineering, Friedrich-Alexander University Erlangen-N¨urnberg, 2011. [273] Christian Hesse. Drahtlose Kommunikationsplattform f¨urGassensorik zur Luftqualit¨ats¨uberwachung. Bachelor’s thesis, Institute for Electron- ics Engineering, Friedrich-Alexander University Erlangen-N¨urnberg, 2012. [274] Jan Geret. Aktivit¨ats-und Sturzdetektion mittels eines am Handge- lenk befestigten 3-Achsen Beschleunigungssensors. Bachelor’s thesis, Institute for Electronics Engineering, Friedrich-Alexander University Erlangen-N¨urnberg, 2012. [275] Wolfgang R¨odle.Messdatenerfassung und Evaluierung eines Gyroskops und eines Barometers zur Aktivit¨ats-und Sturzdetektion. Bachelor’s thesis, Institute for Electronics Engineering, Friedrich-Alexander Uni- versity Erlangen-N¨urnberg, 2012. [276] Philipp Pollinger. Integration eines Magnetometers in eine Multisen- sorplattform zur Aktivit¨ats-und Sturzdetektion am Handgelenk. Mas- ter’s thesis, Institute for Electronics Engineering, Friedrich-Alexander University Erlangen-N¨urnberg, 2013. [277] Kerstin Inkmann. Development of a Bluetooth Low Energy sensor net- work for air parameter analysis. Master’s thesis, Institute for Electron- ics Engineering, Friedrich-Alexander University Erlangen-N¨urnberg, 2013. [278] Alexander Hofmann. Entwicklung eines Gateways zur Vernetzung WLAN-f¨ahiger Ger¨ate mit dem Feldbus KNX. Bachelor’s thesis,

154 List of Supervised Student Theses 155

Institute for Electronics Engineering, Friedrich-Alexander University Erlangen-N¨urnberg, 2014.

[279] Renata de Azevedo Allemand Lopes. Using sensors to recognize height change inside buildings. Internship report, July 2015. List of Authored and Co-Authored Publications

[280] Lars Zimmermann. Geometric dilution of precision in ToA, TDoA and AoA. Presented at RadioTecC, Berlin, Germany, 2010. GEROTRON COMMUNICATION GmbH. [281] Lars Zimmermann. Intelligentes Frequenzmanagement bei profes- sionellen Drahtlosmikrofonen (PMSE) - Eine Reaktion auf die Her- ausforderung durch die Digitale Dividende. Presented at RADCOM, Hamburg, Germany, 2011. GEROTRON COMMUNICATION GmbH. [282] Lars Zimmermann. Kognitives Frequenzmanagement f¨urprofessionelle Drahtlosmikrofone (PMSE) mittels eines Scanempf¨anger-Netzwerks. Presented at EEEfCOM, Ulm, Germany, 2011. GEROTRON COM- MUNICATION GmbH. [283] S. Schroeter, L. Zimmermann, O. Schwender, G. Fischer, and A. Koelpin. Demonstrator of a scanning receiver subsystem for cogni- tive professional wireless microphone systems. In 2011 Technical Sym- posium at ITU Telecom World (ITU WT), pages 193–198, Geneva, Switzerland. IEEE. [284] Lars Zimmermann. Kooperationsprojekt C-PMSE - Cognitive Program Making and Special Events. Presented at BICC OpenLabs, Garching, Germany, 2012. BICCnet Bavarian Information and Communication Technology Cluster. [285] Lars Zimmermann. Sensors and wireless data distribution in agri- culture. Presented at TGGS Multidisciplinary Seminar, Bangkok, Thailand, 2012. The Sirindhorn International Thai-German Gradu- ate School of Engineering. [286] Lars Zimmermann. Mobile health monitoring in a wrist watch. Pre- sented at TGGS Multidisciplinary Seminar, Bangkok, Thailand, 2012.

156 List of Authored and Co-Authored Publications 157

The Sirindhorn International Thai-German Graduate School of Engi- neering.

[287] L. Zimmermann, A. Goetz, G. Fischer, and R. Weigel. GSM mo- bile phone localization using time difference of arrival and angle of arrival estimation. In International Multi-Conference on Systems, Signals and Devices, pages 1–7, Chemnitz, Germany, 2012. IEEE. doi:10.1109/SSD.2012.6197970.

[288] Lars Zimmermann. Aktivit¨ats-und Sturzdetektion von Personen am Handgelenk. Presented at RADCOM, Hamburg, Germany, 2013. GEROTRON COMMUNICATION GmbH.

[289] Lars Zimmermann. Pr¨asenzdetektion von Personen in Innenr¨aumen mittels CO2-Gassensorik. Presented at RADCOM, Hamburg, Ger- many, 2013. GEROTRON COMMUNICATION GmbH.

[290] Lars Zimmermann. Intelligente Gassensorik-Plattform - Pr¨asenzde- tektion in Innenr¨aumenmittels CO2 zur Erh¨ohung der Sicherheit im betreuten Wohnen. Presented at EEEfCOM, Ulm, Germany, 2013. GEROTRON COMMUNICATION GmbH.

[291] Lars Zimmermann, Alexander G¨otz,Georg Fischer, and Robert Weigel. Performance analysis of time difference of arrival and angle of arrival estimation methods for GSM mobile phone localization. In Commu- nication, Signal Processing & Information Technology, volume 4 of Advances in Systems, Signals and Devices, pages 17–34. De Gruyter, Berlin, Boston, April 2017. doi:10.1515/9783110448399-002.

[292] L. Zimmermann, R. Weigel, and G. Fischer. Fusion of nonintru- sive environmental sensors for occupancy detection in smart homes. IEEE Internet of Things Journal, 5(4):2343–2352, August 2018. doi:10.1109/JIOT.2017.2752134. Appendix A

Human Activity Tracker

A.1 Schematic

The schematic of the human activity tracker is shown in Figures A.1 and A.2, pages 159–160.

A.2 Board Layout y x X Y Z Z X Y

(a) (b)

Figure A.3: Board layout of the human activity tracker: a) top side (di- mensions are 39.8 mm × 29.9 mm) and b) bottom side (Based on: Pollinger [276])

A.3 Mechanical Drawings

The computer-aided design (CAD) drawings of the human activity tracker housing are shown in Figures A.4 and A.5, pages 161–162.

158 A.1. Schematic 159 N r

r g

O h

n e e r

g U

e C

o u 2 D E L K c _ t g t K Y b i r A a R l _ e E 1 a w T u C T D h D A S g n B A

6 0 C 2 e r 0

C 1 0 9 5 e R y

R 7

r

k 0 8 k 0 0 1 w 1 e 9 e u

o

2

t 0

g 7 8 R t R C 1 D

P

N

a

a 3 V 3 + G

t

4

l 2 3 V 3 u + B C 1 D D o N N 5 2 V G G W 3 S 3 T - _ D O T S 1

R

5 4

V N

S 0

E N

E E G 1 3 R T W G N E O T R I C T P R V N D A B 5

1 4 F T T 5 3 D S E 7 S 5 n N R R R 2 D 1 G 0 B S V G T C 1 N

S H X

1 2 U G C A 4 D W n 2 4 6 8 U M S 8 N 0

2 0 1 G G 1 2 3 C 1 D A N 1 T 1 3 5 7 P G J 5 J 2 u 3 S I O K * C 1 D M D D C

D

C T T T T

N N w o l l e

C y

G V G

k 1 D E L 5 N 6 . R 1 O W C S

_

_ N O C _ U C C Y A R R E E

I

T

W S K R E W O P B S U O D T O C M D

A T P

T T T B

d e r

3 D E L 0 5 r 7 I D

O

e

S N 0 1 K R l S I I O S L l G O L S A K I C C M M S U C D I O O o L _ _ _ _ S D K D K S S S r C M M D D D D I O X K L S _ _ X t _ _ _ 0 0 0 0 I I I 5 5 A R T M M C C 0 0 0 0 8 8 _ _ _ P P P _ _ _ _ 2 2 2 2 n 0 0 1 1 1 L L L L S S S 4 4 4 4 P P A A C _ _ _ X X X X o G G G G C C D D D M M D D D D D 3 3 3 3 c A L L L L A A B B A A U U S S S o r c i 0 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 1 0 9 8 7 6 5 4 3 2 1 2 M 4 3 2 1 1 9 9 9 8 8 8 8 8 8 8 7 7 7 7 7 7 7 7 7 7 6 6 6 6 6 6 6 5 5 5 8 7 6 5 5 5 5 5 5 5 4

D

8

8 N

7 3 G

3 6

5 1

2 1

D

2

6 N

0 1 G n 4

0 1

9 7 C

4

7 8

n 9

0 1

8 3 0 C 1

8 n

D

1 0

4 6 N 0 C 1 G

n 7

0 1

6 1 0 C 1

n 6

0 1

1 1 0 C 1 n 5 0 1 0 C 1 z k h 8 M

6

2

7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 9 0 1 3 4 5 6 7 8 9 0 6 5 4 3 2 1 9 0 3 4

5 7 3 V 3 1 1 1 2 2 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 4 4 4 4 4 4 4 4 4 5 9 9 9 9 9 9 8 9 1 1 + . Q 2 1 2 Q 3 1 1 2 1 1 2 D D 2 3 T T T T T p p N N 2 2 8 8 N N N N N G G I I I I I C C 1 1 2 _ _ _ _ _ L L I Q D D G L T T S S K A

D O f X X 0 0 D 0 1 A S S C p p D C 4 2 C C o M D 0 0 D D T 2 2

8 8 E T _ S R M _ S 2 2 T T I A A C C 1 1 D D _ T _ 4 4 D P N N G G S G G D S A 3 3 A G G _ N L L M M D G D S N G r r 1 L A e r T e e D C t t N p o I S S _ _ _ e e s o G G G A A A c n

m m

M M M 3 V 3

s + k 7 . 4 e o o I t o

r

O

S

2 1 S r 3 K R S

I T T e

O I e

L S

O

1 2 S l y N N k 7 . K 4 C M M C I I e S n T T I O S L ______r e N N

n

C M M C I I L D D D D D D A

G g

3 0 4 R k 0 1 D C ______0 0 0 0 0 0 c u 1 7 S S L L L L L L 0 0 0 0 0 0 a _ _ C 4 2 2 2 2 2 2 c s

X X X X X X

5 5 n

8 8 4 4 4 4 4 4 0 5 D D D D D D R 0 0 7 s 0 G G G G G G P P A M A A A A A A C 1 3 3 3 3 3 3 D D M M

e

L L L L L L B B

2

N N n k 7 . r 4 1 0 G G

C 1

P

1 2 3 4 R

7 1 1 1 8 9

4 k 7 . 2 3 4 5 6 7 1 4 L 1 2 S A

O 9

u

T T

C

D 2 8 9 6 7

C I D 2

L R 2 1

C L 1

S N N S O S 3 V 3 S I I + D L T T C C D 5 S P N N S / n S I I 6 5 4 4 O A I 0 L 1 3 A D O 8 D D D D I 0 D D T L C D D S L 1 C 1 N N N D C C C D A D D N S S X V I D

C C D

D V V N N N G G G

N 1

D

0 S N V S 3 V 3 G G G G + V G U A G 0 O 0 I V D D D D D 2 0 1 1 6 3 2 4 5 1 0 D D D D V V V V V O 1 1 A R 4 1 I 8 - - N S S S S S S D D D 3 D D D 1 G D D P P V V R R R R R R G N 3 N N N 3 C A A P D D G 1 n G U L C C G G V V N G A 2 $ 0 M 6 5 0 1 2 3 1 8 9 4 0 U M U B 1 1 1 1 1 1 C 1 D 2 3 1 7

N 0 1 4 5

D 3 V 3

+ 1 G

N

D 3 V 3 + G N u 3 n n n 0 G 0 7 0 0 0 C 1 1 6 3 0 0 0 C C C 1 1 1 Figure A.1: Schematic of the human activity tracker, sheet 1 of 2 (Based on: Pollinger [ 276 ]) D D

N N

3 V 3 n + G G 0 2 n n 0 1 u 0 0 C 1 D 1 5 1

0 0 0

N

C C C 1 1 1

D 3 V 3 + G N G 160 A. Human Activity Tracker d r a

C

D N G

D

2 W S

1 @ H C T I W S S

1 W S

D C _ D S H C T I W S I O S D K 3 S S O I N C V C M S G M / 3 1 2 3 4 5 6 7 8

1 2 3 4 5 6 7 8 k 7 4

1 1 R

k 7 4 K L

C

2 1

R _

I

k 7 4 P

S

_

3 1 R D n S 1 0 3 0 C 1

1 2 3 4 5

3 V 3 + D D D D D N N N N N D

G G G G G

N

k 7 4

G

4 1 R

k 7 4 D

N 5 1 R G I S O S C S O I _ I M M P _ _ I I S P P _ S S D _ _ S D D S S n D D X X o R T _ _ 1 1 C

A A C C B U U D N S G U 2 0 2 1 2 1 0 1 6 * 7 0 3 2 3 8 3 6 7 3 2 2 1 1 9 2 4 1 2 I 0 1 2 3 4 T S S D D D D R D D R R S S S S S S T T T X S X N N N C E U U U U U R C T D R D D G G G T B B B B B C C C C C T Q P M T U O R I O C C C C C D I E D D O 2 C C C N N N N N N S B B C C 3 - - - - - 3 N S S E S S G C C V - 2 3 3 5 9 2 2 V V R O O U U A 3 5 1 1 2 2 2 T C I F 9 8 7 8 6 4 5 4 1 1 1 2 2 1 1 1 2 n 0 0 D 3 0 N C 1 D G N G u 4 7 3 . C 4 6 p 3 7 C 4 D n 3 N 0 3 0 G C 1 5 p 3 7 C 4 D 2 N n 3 0 G C 1 D N Figure A.2: Schematic of the human activity tracker, sheet 2 of 2 (Based on: Pollinger [ 276 ]) G S D U R

N + - B

E D

D D V G I B S W U O P B S U A.3. Mechanical Drawings 161 SHEET 2 OF Solid Edge Solid alle unbemaßten Fasen 0,5 x 45° DWG NO REV Gehäuse Multisensor Plattform REVISION HISTORY REVISION A3 SIZE FILE NAME: Gehäuse1.dft SCALE: WEIGHT: TITLE DATE 11/30/12 NAME PP ANGLES ±X.X°

REV DESCRIPTION DATE APPROVED

2 PL ±X.XX 3 PL ±X.XXX

414 UNLESS OTHERWISE SPECIFIED

DIMENSIONS ARE IN MILLIMETERS

212 36,7 DRAWN CHECKED ENG APPR MGR APPR

7,7

6,5 5,4 21,7

E 3,5 1

1,5 4,5 ° 0 9 G X ,3 6

1 33,4 24,4 26,4 5 O 2 2 , 3 K R R IN O ' S

F 3 C M Schnitt EE F

E 6,5 D

1,5 7

1,5

4,4 2,41

5

, 1 R 5,5 6,5 7,9

41,7

3

30,5 9

3 ,

Schnitt FF 4

6,29

°

0 1 1 8,2 Einzelheit G

6,5 Einzelheit D

1 9 O , 2

3

1,5 R 0,6 Figure A.4: CAD drawing of the human activity tracker housing, sheet 1 of 2 (Source: Pollinger [ 276 ]) 162 A. Human Activity Tracker SHEET 1 OF 1 Solid Edge Solid DWG NO REV Deckel für Gehäuse Multisensorplattform REVISION HISTORY REVISION A3 SIZE FILE Deckel.dft NAME: SCALE: WEIGHT: TITLE DATE

11/30/12

°

5

4

X

5 , NAME 0 PP ANGLES ±X.X° REV DESCRIPTION DATE APPROVED 2 PL ±X.XX 3 PL ±X.XXX UNLESS OTHERWISE SPECIFIED DIMENSIONS ARE IN MILLIMETERS

DRAWN CHECKED ENG APPR MGR APPR

°

5

4

X

5 , 0

0,5

°

5

4

X

1 Einzelheit B

0,5

1

R

Schnitt CC

414

12,3

8,5

4,6 4,4

8,9

4 , 3,7

1,5 x 45° 4,2

7,3 1,7

, 2,5

, 2,2 , 1,2 5,5 0,5 x 45° 5 7,2 7,6 19,3 C C

8,7 1 12

R A

30 27

33,4

5 ,

2

10 4,2 O Ansicht A Ansicht

7,8 7,1

B 6,3 2,8 4,8

6,3 7,4

1 4,5 O 8,6 Figure A.5: CAD drawing of the human activity tracker housing, sheet 2 of 2 (Source: Pollinger [ 276 ]) Appendix B

Indoor Air Quality Measurement System

B.1 Schematics

The schematic of the indoor air quality measurement system is shown in Figures B.1 and B.2, pages 164–165.

The schematic of the outdoor air measurement system is shown in Figure B.3, page 166.

B.2 Board Layouts

The board layout of the indoor air quality measurement system is shown in Figure B.4, page 167.

(a) (b)

Figure B.5: Board layout of the outdoor air measurement system: a) top side (dimensions are 29 mm × 29 mm) and b) bottom side

163 164 B. Indoor Air Quality Measurement System 6 5 4 3 2 1 0 9 8 7 6 5 3 3 3 3 3 3 3 2 2 2 2 2 # 0 1 2 3 4 5 6 7 D D C ______T N N N 0 0 0 0 0 0 0 0 E G G P P P P P P P P S E

R

0 _ 1 P

4 2

1 _ 1 P

3 2

2 _ 1 P

2 2

3 _ 1 P

1 2

4 _ 1 P

0 2

5 _ 1 P

9 1 D D 2 1 0 7 6 D D D D D D D D L A D D _ _ _ _ _ N N N N N N N N C V C D 2 2 2 1 1 V G G G G G G G A P P P P P S S N D G 0 1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8 9 1 1 1 1 1 1 1 1 1 H C T I W S 1 2 3 4 5 6 7 8 I 2 1 S K S H D O 7 9 1 6 0 6 7 5 2 4 3 3 D T T L S 1 2 3 6 4 5 9 2 1 7 2 2 2 3 3 3 2 3 C C D D / S A A C / V T V S 3 I D D / D T 0 W A M T I I S D T T T S X S K A E P K X C D D N O O D D S T T E N D C C C E R D D D M D W T I S _ A _ _ S T R S T T V V S _ _ _ N G E _ _ G G G G R G U R A G G U A T A A E B A A T B J T T T T J B E E I J J J J D D H D D D D N N N N G G G G D D D D D D D D 1 2 3 4 N N N N N N N N C C C C C C C C C C N N N N N N N N N N G G G G G G G G @ @ @ @ D D D D N N N N G G G G 1 2 3 4 5 2 4 1 0 8 9 5 8 0 6 2 8 1 1 1 1 1 1 2 2 3 1 1 1 2 2 3 3 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 4 4 4 4 4 4 4 4 4 3 3 3 3 3 3 3 5 1 0 4 3 5 2 0 9 8 3 2 3 S B S D 1 1 1 1 1 1 F D D D G G S S U D

D D C C C C A R V R R R R R U B

V 4 8 D R R R R

R R V V

S

1 D R 5 F R

9 4 2 3

2 D R 4 F R

L

0 5 1

3 P

3 D R 5 1 B R C 2 1 0

1 5 0 3 S W A A A

4 D R 4 1 B R

2 5 9 2

5 D R I D T 6 7 3 2 1

3 5 8 2

6 D R K C T

4 5 7 2

7 D R D D V

5 5 6 2

E R O C D D V S S V

6 5 5 2

G E R V N E O D T

7 5 4 2

0 F R S M T

8 5 3 2

1 F R 9 B R

9 5 2 2

0 E R 8 B R

0 6 1 2

1 E R S S V A

1 6 0 2

2 E R D D V A

2 6 9 1

3 E R 7 B R

3 6 8 1

4 E R 6 B R

4 6 7 1 R L 6 7 8 9 D 5 6 7 5 4 3 2 1 0 S C E E E B B B B B B G G G G D S R R R R R R M R V V R R R R R R 2 4 0 1 2 3 4 5 6 1 2 3 4 5 6 7 8 9 1 1 1 1 1 1 1 D D N N G G 1 2 3 4 1 2 3 4 3 T U

O

V

D N G

4

D N G 2 0 Figure B.1: Schematic of the indoor air quality measurement system, sheet 1 of 2 2 4 1 N I V N I 2 1 1 3 7 9 1 T U O 3 2 1 6 5 4 3 2 1 B.1. Schematics 165 D L C A N C C C D C V S S N N G 6 2 4 1 5 3 D L A N C D + V S S G L + A D V C D N S S G 3 4 C C

N N

D N G

7

D D V

5

D N G 2 L A D C S S 1 6 8 7 6 4 1 1 D C L A N C C D V G S S 0 0 L A C C D N N S S E Figure B.2: Schematic of the indoor air quality measurement system, sheet 2 of 2 1 2 3 5 1 2 3 4 1 2 3 4 166 B. Indoor Air Quality Measurement System 3 4 C C

N N

D N G

7

D D V

5

D N G 2 L A D C S S 1 6 6 5 4 3 2 1 0 9 8 7 6 5 3 3 3 3 3 3 3 2 2 2 2 2 # 0 1 2 3 4 5 6 7 D D C ______T N N N 0 0 0 0 0 0 0 0 E G G P P P P P P P P S E

R

0 _ 1 P

4 2

1 _ 1

P Figure B.3: Schematic of the outdoor air measurement system

3 2

2 _ 1 P

2 2

+ V - V 3 _ 1 P

1 2

4 _ 1 P

0 2

5 _ 1 P

9 1 D D 2 1 0 7 6 D D D D D D D D L A D D _ _ _ _ _ N N N N N N N N C V C D 2 2 2 1 1 V G G G G G G G A P P P P P S S N D G 0 1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8 9 1 1 1 1 1 1 1 1 1 0 N I 2 4 1 2 1 T U O 1 3 7 9 B.2. Board Layouts 167

(a)

(b)

Figure B.4: Board layout of the indoor air quality measurement system: a) top side and b) bottom side. The dimensions of the main PCB are 94 mm × 78 mm and that of the external air temperature and humidity sensor are 10.75 mm × 11.5 mm. 168 B. Indoor Air Quality Measurement System

B.3 Mechanical Drawings

The CAD drawings of the indoor air quality measurement system housing are shown in Figures B.6 and B.7, pages 169–170.

B.4 Additional Tables

Table B.1: Extended Performance Measure. Local Occupancy Detection With an Environmental Sensor Fusion.

Occupancy Classifier Acc. [%] TPR [%] TNR [%] PPV [%] NPV [%] ZeroR 50.8 75 25 42.7 8.1 JRip 70.6 78.1 61.4 74.8 67.4 NB 75.1 81.8 69.0 79.8 69.5 J48 70.4 75.5 65.2 75.6 65.0 Logistic 73.4 75.2 68.9 82.3 62.9 k-NN 68.5 80.6 54.8 72.7 65.2 RF 70.2 78.0 63.4 75.2 66.5

Table B.2: Extended Performance Measure. Global Occupancy Detection With an Environmental Sensor Fusion.

Occupancy Classifier Acc. [%] TPR [%] TNR [%] PPV [%] NPV [%] ZeroR 59.7 100 0 59.7 0 JRip 76.2 81.2 69.8 80.1 69.9 NB 81.1 79.5 84.3 88.7 75.2 J48 75.9 82.9 66.7 79.2 71 Logistic 76.2 75.6 81.5 86.3 74.0 k-NN 66.8 72.9 60.6 73.8 59.7 RF 79.6 85.4 71.9 83.0 76.6 B.3. Mechanical Drawings 169 1 5 6 3 4 2 J J

1 :

DIN 6 Teil 2 Maßstab: Bearbeiter: Herrlich Dateiname: 00011634 72 DIN 16901 T130 Toleranzen: Zeichnungsart: KUNDE H H This document contains proprietary information of OKW Gehäusesysteme GmbH and is tendered subject to the conditions that information be retained in confidence not be reproduced or copied and used incorporated in any product. B501322. Für dieses Dokument behalten wir uns alle Urheberrechte vor. Es darf auch auszugs- weise weder vervielfältigt noch Dritten in irgendeiner Form zugänglich gemacht werden. ART-CASE S110 F, (Version VI) Material: Farbe: . 03.07.09 Herrlich 1 74 66 Bearb. am: Ersteller: Freigabe: Rev. Index: Stand: Oberteil-Innenansicht Top-Part-Inside-View 42 Unterteil-Innenansicht Buttom-Part-Inside-View will not be updated wird nicht aktualisiert Informationskopie Copy for Information

G G Technische Änderungen vorbehalten. Irrtümer oder Druckfehler begründen keinen Anspruch auf Schadenersatz. Wichtige Ein- baumaße bitte direkt mit dem aktuellen Produkt abstimmen. Subject to technical modification without prior notice. Typogra- phical and other errors do not justify any claim for damages. All dimensions should be verified using an actual moulded part. Sous reserve de modifications techniques. Toute erreur ou faute d'impression ne justife aucune demande d'indemnisation. Nous prions les clients de verifer dimensions des composants avec les boitiers avant le montage.

42 42

66

79,50 6 F F 79,50 74,53

Steckermodul Plug section Folientatstatur membrane keyboard 1,70

E E 5,70

0,50 72 SCHNITT C-C 1 2,50 4,50 94 74 Platine P C B D D 7,83

SCHNITT A-A

5,10 2,09

78

24,13 14,55 SCHNITT B-B

5,30 72

C C 79,52 B B C C 79,52 A A 110,61 B B

A A

39,18 110,61 1 3 5 2 4 6 Figure B.6: CAD drawing of the indoor air quality measurement system housing, sheet 1 of 2 (Source: Herrlich [ 270 ]) 170 B. Indoor Air Quality Measurement System 1 2 3 ±0,8 ±0,031 02 über 400 bis 1000 over 15,75 to 39,37

Revision Status Produktionsfreigabe ±0,5 ±0,020 over 4,72 to 15,75 über 120 bis 400 Blatt: 1 D D

±0,3

±0,012 R0,75 R0,75 over 1,18 to 4,72 über 30 bis 120 1,50 {24} ±0,2 ±0,008 11.11.2014 C. Hörner

über 6 bis 30 over 0,24 to 1,18

2,50 2,50 {23} 9,50 ±0,1 ±0,004 B5013A01 Freigabe: Art Case 110 (B5012617/B5012517) mit Bearbeitung über 0,5 bis 6 over 0,02 to 0,24 NOT BE REPRODUCED OR COPIED AND USED INCORPORATED IN ANY PRODUCT. ES DARF AUCH AUSZUGSWEISE, WEDER KOPIERT NOCH VERVIELFÄLTIGT, ODER DRITTEN IN IRGENDEINER FORM ZUGÄNGLICH GEMACHT WERDEN FÜR DIESES DOKUMENT BEHALTEN WIR UNS ALLE URHEBERRECHTE VOR. TENDERED SUBJECT TO THE CONDITIONS THAT INFORMATION BE RETAINED IN CONFIDENCE THIS DOCUMENT CONTAINS PROPRIETARY INFORMATION OF OKW-GEHÄUSESYSTEME KG AND IS DIN ISO 2768 m T1 (mm) Erstellt am: 20.09.2013 Ersteller: Administrator Zuletzt geändert am: Letzter Änderer: Toleranzklasse (mm) DIN ISO 2768 m T1 [inch] tolerance class [inch]

C C R0,75 (4x) {29} {29} (4x) R0,75 6,50 {25} 2 {27}

F-F

21,95 {28} {28} 21,95 15 {26} {26} 15

37,50 {4} {4} 37,50

28,50 {3} {3} 28,50 22,50 {2} {2} 22,50 0,3 mm. All other dimensions:

A 16,50 {1} {1} 16,50 2,50 {22} B B B

All dimensions < 30mm to the reference edge of case with a tolerance of unless otherwise specified against DIN ISO 2768m T1. 9 {17} {17} 9

F F 21 {18} {18} 21 A-A 9 {5} 57 {9} 45 {8} 33 {7} 21 {6} 75 {10}

A

2,50 {19}

0,3 mm, sonstige nicht tolerierte 2,50 {20} {20} 2,50 {21} 2,50

A A 9 {11} {11} 9

21 {12} {12} 21

33 {13} {13} 33

45 {14} {14} 45 57 {15} {15} 57

Maße unterliegen der DIN ISO 2768m T1 Alle Maße < 30mm zur Gehäusebezugskante Toleranz 75 {16} {16} 75 1 2 3 Figure B.7: CAD drawing of the indoor air quality measurement system housing, sheet 2 of 2 (Source:271 ]) H¨orner[ Appendix C

Characterization and Calibration of CO2 and VOC Sensors

C.1 Introduction

Gas sensors such as CO2 sensors with NDIR technology and MOS sensors for detecting VOCs are usually not calibrated by the manufacturer for cost reasons. In addition, the sensors react to changes in the environmental conditions. Depending on the application, it would therefore be necessary to calibrate the sensors beforehand and to calculate and deduct the cross- sensitivities during operation. The calibration of the gas sensors can be carried out by supplying a defined test gas. During the calibration process, the air temperature, relative air humidity, and air pressure must be recorded. It would be even better to be able to regulate the environmental parameters. Details on the calibration requirements and cross-sensitivities of theCO 2 sensors have already been given in Chapter 4.1.1 and for the VOC sensors in Chapter 4.1.2. A calibration test setup was developed to analyse NDIRCO 2 sensors and MOS-based VOC sensors with a range of test gases. The setup is charac- terized by the ability to calibrate both types of gas sensors simultaneously, which provides the basis for considerable cost and time savings. Furthermore, the influence of the environmental conditions air temperature and relative humidity on theCO 2 and VOC sensors was investigated in a climate test chamber. On the basis of this investigation, it is discussed which extensions or improvements are considered necessary for the calibration setup.

171 172 C. Characterization and Calibration of CO2 and VOC Sensors

C.2 Related Work

Test assemblies which are commercially available as well as those from the scientific community are presented in the following. The individual solutions reflect the state of the art for the calibration of NDIRCO 2 and MOS-based VOC sensors.

ˆ V¨otsch Industrietechnik GmbH provides a climate test chamber with a gas mixing system [293]. The air temperature and relative humidity can be regulated. However, it is not possible to change the air pressure. The smallest test gas concentration that can be generated is specified as 10 ppm, which is sufficient for the calibration of theCO 2 sensor (typical fresh air has about 400 ppmCO 2), but hinders the calibration of the VOC sensor for a wide range of gases in the lower and medium measuring range (see [294]).

ˆ BINDER GmbH offers a vacuum drying chamber with a gas connection. The air pressure of the test chamber can be regulated, but the air temperature and air humidity cannot be influenced [295].

ˆ Endres et al. [296] from the Fraunhofer Institute in Munich have de- veloped a test system for gas sensors that is characterized by a high degree of flexibility in the choice of test gas. Gas mixtures are gen- erated directly at the test setup fromN 2 or synthetic air and up to two test gases. A wide variety of test gases can be added in successive steps, which allows the calibration of different gas sensors or sensors for different applications in one test procedure. In addition, the regu- lation of air humidity was made possible by a bubble humidifier. The air temperature was kept within a narrow temperature range using a climate test chamber that enclosed the gas test chamber. An actual control of the air temperature and in particular an air pressure con- trol was not provided. A disadvantage of the described setup is that costly prefabricated gas mixtures were used to achieve smaller test gas concentrations as required for the VOC sensors.

ˆ Shrestha and Maxwell of the Iowa State University [211] demonstrated a test setup that allowsCO 2 sensors to be calibrated with a defined test gas and to control the air pressure, air temperature, and air humidity. The dry gas mixture, consisting ofN 2 andCO 2, is first produced in a gas mixer and then enriched with air humidity through a bubble hu- midifier. Pneumatic cylinders are used to vary the air pressure. The air temperature is regulated by a water-filled enclosure. The test setup C.3. Calibration Setup 173

demonstrates that aCO 2 calibration including the control of all three cross-sensitivities is possible. The test chamber, however, allows the simultaneous calibration of only a few sensors and could be further op- timized with respect to air distribution. Unfortunately, the calibration of VOC sensors was not planned.

ˆ Gieseler and Wiegleb from the Dortmund University of Applied Sci- ences and Arts [220] have developed a test setup with which it is possi- ble to calibrateCO 2 sensors with a gas mixture generated fromN 2 and CO2. The setup is characterized particularly by the fact that there is a separate gas outlet for each sensor, which is supposed to ensure an opti- mal supply of the test gas. In addition, it is possible to place the setup in a climate test chamber to control the air temperature inside. This, however, does not allow regulating the air humidity of the gas. Air pressure regulation was carried out in an exemplary manner directly on the cuvette of the sensor, but proved to be an inaccurate method and represents too much effort if several sensors are to be calibrated.

ˆ The company 3S GmbH, which emerged as a spin-off from the Univer- sity of Saarland, has a test setup in which VOC sensors can be cali- brated with a gas mixture under control of the air humidity [235]. An air temperature or air pressure control was not provided. In particular, this solution is distinguished by the possibility of producing gas mix- tures with test gas concentrations in the ppb range. This is achieved by a permeation furnace and the pre-dilution with a carrier gas. A similar approach has been shown by Ballesta et al. [297], whose setup additionally featured control of the air temperature and air velocity.

C.3 Calibration Setup

The presented calibration assemblies only partially meet the requirements for a comprehensive characterization ofCO 2 and VOC sensors or are only designed for small quantities. In addition, only one sensor type was con- sidered in each solution, which would require the uneconomical purchase of two separate test apparatus. Also due to long delivery times and taking into account the development and acquisition costs incurred, it was decided to develop the calibration setup in-house. In the proposed solution, the calibration of theCO 2 and VOC sensors is carried out in a test chamber. The chamber is flushed by various test gases, which are generated by a computer-controlled gas mixing system. Dur- ing the process, the environmental conditions air pressure, air temperature, 174 C. Characterization and Calibration of CO2 and VOC Sensors

PC Control Data Acquisition

RS-232 USB

Gas Cylinder Gas Mixing Test Cabinet System Chamber

CO2 N2 79 %N 2 Test TVOC Gas 20.9 %O O2 2 Gas T Exit 400 ppmCO 2 RH CO2 2 ppmC H 4 10 p C4H10

Figure C.1: Block diagram of the gas sensor calibration test setup and relative humidity are measured. The calibration test setup is shown schematically in Figure C.1. The environmental parameters were not regu- lated. Instead, the characterization of the air temperature and air humidity sensitivity took place in a separate climate test chamber. Due to the simple physical relationship between the air pressure and the measuredCO 2 value (see Chapter 4.1.1) as well as due to the uncertainty about a sensitivity of the VOC sensor to air pressure (see Chapter 4.1.2), a vacuum drying chamber was not considered in view of the acquisition costs. The components of the calibration test setup are described in detail in the following.

C.3.1 Sensor System

The sensor systems included the NDIRCO 2 sensor Telaire 6713 from Amphe- nol Corporation [298], the MOS-type TVOC sensor TGS 2600 from Figaro Engineering Inc. [294], an air temperature and air humidity sensor, and an air pressure sensor. Each sensor system was controlled by a microcontroller and could output measured data during operation via a universal asynchronous receiver-transmitter (UART) interface. The measurement data included the CO2 value, the count of a 10 bit analogue-to-digital converter (ADC) from the analogue TVOC reading, the air pressure, the air temperature, and the relative humidity. For direct communication with a PC, UART to Universal Serial Bus (USB) converters were used. A total of nine sensor systems and four UART to USB converters were available for this study. C.3. Calibration Setup 175

C.3.2 Gas Mixing System

The calibration ofCO 2 or VOC sensors using a test gas can be carried out in two ways: 1. The test chamber is filled with ambient air, ideally ”fresh air”. Then, a defined quantity of test gas (e.g.,CO 2) is supplied into the closed test chamber. The amount of the test gas must be chosen according to the volume of the test chamber, and it must be ensured that the test gas can be distributed evenly. This method is the most cost-effective solution. However, since the initial concentration ofCO 2 and VOCs in the test chamber is insufficiently known, this method is susceptible to error depending on the local conditions.

2. The test chamber is continuously supplied with test gas. Via an exit on the test chamber, the air or gas mixture initially present in the test chamber is forced outwards by the supplied test gas. Assuming an optimal gas flow within the test chamber, this method supplies the sensor with approximately the exact concentration of the test gas. Due to the higher reliability, this method was used for the calibration setup. The test gas required for the second method can be generated in one of the following ways:

a) The test gas consists ofN 2, with which the offset of aCO 2 sensor can be determined. For the operation of a VOC sensor, however, a gas mixture with a certain oxygen (O2) content is required. TheN 2 test gas is therefore only a cost-effective option for a one-point calibration of aCO 2 sensor. b) The test gas is a prefabricated gas mixture from a gas supplier. This allows the calibration with definedCO 2 and VOC concentrations. The disadvantage, however, is that a separate gas cylinder is necessary for each test gas concentration, which causes high costs.

c) The test gas is a gas mixture produced by a gas mixing system directly at the test setup. This allows any desired test gases to be generated. While the one-time installation costs are high, ongoing operation is significantly cheaper than ready-made test gases. For economic reasons, it was therefore decided to produce the test gases in this way. The gas mixtures for the test gases were based on synthetic air (79 % N2 and 20.9 %O 2) to which a defined concentration ofCO 2, or isobutane (C4H10), or both was added. The synthetic air contained the necessaryO 2 176 C. Characterization and Calibration of CO2 and VOC Sensors

Table C.1: Specification of the Mass Flow Controllers

Gas Flow Range Accuracy N2 (0) ... 0.8 ... 40 ln/min ±0.8 % Rd ±0.2 %FS O2 (0) ... 0.2 ... 10 ln/min ±0.8 % Rd ±0.2 %FS CO2 (0) ... 5 ... 250 mln/min ±0.8 % Rd ±0.2 %FS C4H10 (0) ... 0.1 ... 5 mln/min ±1 %FS concentration for operating the VOC sensor and ensured that no safety- relevant test gases were produced. With regard to the TGS 2600 VOC sen- sor,C 4H10 was added to the gas mixture because, according to the manu- facturer’s datasheet [294], there is a high sensitivity to the gas and at low concentrations (here up to 100 ppm) it is below the maximum workplace con- centration of 1 000 ppm [299]. Also, theC 4H10 should not interfere with the CO2 sensor measurement because its IR light absorbance around 4 260 nm (the absorption band ofCO 2) is low [300]. At the same time, the VOC sensor cannot detect theCO 2 concentrations due to its measurement principle (see Chapter 4.1.2). This allowed the simultaneous supply ofCO 2 andC 4H10. The gas mixing system contains one mass flow controller for each of the four gases. The controllers have the properties given in Table C.1. At the output of the gas mixer, the gas flow is the sum of the flow rate of all the mass flow controller. The concentration of a particular gas is calculated from the gas flow rate of its mass flow controller divided by the total gas flow rate. The gas mixing system allows a minimumCO 2 concentration of up to 100 ppm and aC 4H10 concentration of up to 2 ppm.

C.3.3 Test Chamber The test gas enters the test chamber via a gas connection on one side. Fans were installed to circulate the gas. The gas finally escapes through an opening on the opposite side of the chamber. The test chamber was further equipped with a connector for the power supply of the fans and sensor systems and a connector for the USB communication of the UART to USB converters.

C.3.4 Gas Mixing Control Software and Measurement Data Acquisition The mass flow controllers of the gas mixing system can be controlled by soft- ware either manually or automatized. It is also possible to develop its own control software based on the manufacturer’s provided technical documenta- C.4. Test Procedures 177 tion of the interface. To control the sensor systems and to receive measurement data, a software was programmed in Labview. Since four UART to USB converters were available for communication with the sensor systems, the software was also developed for the simultaneous operation of up to four sensor systems. The measurement data were received during operation of the sensor systems and stored in a CSV file on the PC.

C.4 Test Procedures

A total of nine sensor systems and four UART to USB converters were avail- able for the study. Due to the limited number of UART to USB converters, four sensor systems were measured alternately. The sensor systems were operated without housing covers to ensure optimum ventilation of the gas sensors.

C.4.1 Calibration of the CO2 Sensors Using Test Gases

The NDIRCO 2 sensor Telaire 6713 from Amphenol Corporation has a mea- suring range of 0–5 000 ppm and is specified with an accuracy of ±30 ppm ±3 % of the measured value. The temperature dependence is listed as 5 ppm/K or 0.5 %/K (the greater value applies). As stated in the manufacturer’s data- sheet, there is a dependency on the air pressure of 0.13 %/mmHg (≈ 1 %/kPa) [298]. The ABC algorithm of the sensor was deactivated for the investiga- tions. To characterize the behaviour of theCO 2 sensor, measurements were car- ried out at several differentCO 2 concentrations. For economic and time reasons, however, a one-point calibration for determining the offset or a two- point calibration for additional determination of the scaling is aimed for later use in production. The environmental conditions inside the test chamber were recorded with an air pressure and an air temperature and relative hu- midity sensor. This allows the measured values to be converted to reference conditions if required.

C.4.2 Calibration of the TVOC Sensors Using Test Gases The MOS-type sensor TGS 2600 from Figaro Engineering Inc. is a TVOC sensor whose value is the sum of the reaction with different gases. The sensi- tivity of the sensor also depends on the particular gas and the measurement 178 C. Characterization and Calibration of CO2 and VOC Sensors circuit. According to the datasheet [294], there is a nonlinear relationship between the measured value and theC 4H10 test gas used here. The measure- ment circuit is not documented, which means that the results presented here cannot necessarily be transferred to other systems. Due to the expected nonlinear relationship between the measured value and the test gas, a multi-point calibration is considered necessary. However, for a simple statement whether the air is good or bad (for which the criteria still have to be defined), a one-point calibration is sufficient. By measuring the environmental conditions inside the test chamber, measured TVOC con- centrations may be transferred to reference conditions provided that their relationship has been thoroughly investigated.

C.4.3 Determination of the Sensitivity to Changes in the Environmental Conditions

Due to the simple physical relationship between the air pressure and the measuredCO 2 value (see Chapter 4.1.1) as well as due to the uncertainty about a sensitivity of the TVOC sensor to air pressure (see Chapter 4.1.2), the purchase of a vacuum drying chamber was not considered in view of the acquisition costs. The sensitivity of the gas sensors to air pressure was therefore not tested in this study. For theCO 2 sensor, the conversion formula in (4.5) can be used. To characterize the sensitivity to air temperature and relative air humid- ity, measurements were taken in a climate test chamber. Since the physical relationship between the measuredCO 2 value and the environmental con- ditions are sufficiently known, the measurements with theCO 2 sensor only served to validate the theoretically calculated sensitivity from Chapter 4.1.1. The sensitivity of the TVOC sensor to air temperature and relative humid- ity, however, depends on the test gas and measurement circuit and must be determined by experiment. The climate test chamber WK-180/40 from Weiss Umwelttechnik GmbH was used for the air temperature and relative humidity tests. The chamber is specified for a climate operation of +10 to +95 °C and 10 to 98 %rh. Its air temperature accuracy is given as ±0.3 °C with homogeneity in space of ±1 °C. The relative humidity is regulated with an accuracy of ±3 % [301]. The sensor systems were designed for an operating temperature of 0 to +50 °C and a relative humidity of 0 to 95 %. The climate simulation test setup is shown in Figure C.2. However, the photo was taken during a preliminary measurement with a different climate test chamber model. C.5. Results 179

(a) (b)

Figure C.2: Climate simulation test setup

C.5 Results

C.5.1 Findings From the Operation of the Gas Mixing System and the Test Chamber Distribution of the Test Gas Inside the Test Chamber The test chamber was supplied with a test gas at a gas flow rate of about 50 ln/min. The time until a gas exchange has taken place was determined by the steady-state of the gas sensors, which generally is higher than the actual time due to the individual sensor response time. The TVOC sensors took between 2 and 10 min to reach their final value. Both the initialC 4H10 gas concentration in the test chamber and the concentration of the test gas were decisive for the speed. Since chemical processes take place here, temporal differences at different start and end concentrations are plausible. Due to the optical measurement method, the reaction speed of theCO 2 sensor is independent of the concentration ofCO 2 gas. Instead, other factors, possibly related to the specific sensor model or the gas flow in the test chamber, affected the sensor’s response time, which resulted in a steady-state time of up to 15 min. The design of the test setup provided for a simultaneous calibration of CO2 and VOC sensors (see Chapter C.3.2). In experiments in whichCO 2 and C4H10 were added to the test gas, it was found that theCO 2 concentration had no noticeable effect on the VOC measurement and theC 4H10 concen- tration, in turn, had no noticeable influence on theCO 2 measurement. The 180 C. Characterization and Calibration of CO2 and VOC Sensors significance of this outcome is that this approach can potentially cut the oper- ating costs and calibration time during production by half. This assumption is based on the fact that there is no need to generate a separate test gas for each sensor type and that there is no waiting time between measurements that are otherwise performed individually. To ensure an economical operation, it is planned to maximize the num- ber of units within the test chamber. The distribution of the test gas with a higher number of sensor devices was simulated by creating an exemplary structure with several unpopulated PCBs. In terms of space, a maximum number of 48 sensor systems at a distance of 25 mm was determined. How- ever, a new analysis is required once the drive electronics have been designed for a larger number of sensor systems and the unpopulated PCBs are re- placed by the actual devices. In particular, a higher number ofCO 2 and VOC sensors can lead to thermal effects in the test chamber.

Air Pressure Inside the Test Chamber The air pressure inside the test chamber results from the air pressure of the test gas and the tightness of the chamber. The test gas operation in flow- through is supposed to prevent pressure build-up within the chamber. In addition, the test chamber was equipped with a pressure relief valve. When sealing the test chamber, however, an overpressure of approximately 1 bar was generated, which caused the glass panel of the chamber to dissolve due to insufficient adhesive strength. The test chamber was then repaired and the tightness adjusted according to the flow rate of the gas mixing system.

Air Temperature Inside the Test Chamber The air temperature inside the test chamber results from the air tempera- ture of the test gas and the air temperature of the ambient air. The test gas has a cooling effect depending on the ambient air temperature. It was ob- served that the air temperature measured in the test chamber corresponded approximately to the ambient air temperature.

Relative Air Humidity Inside the Test Chamber The test gas was generated from dry gases. This means that the relative humidity inside the test chamber was decreased to 0 % by the test gas. Un- fortunately, the firmware of the sensor systems was not designed for a relative humidity around 0 %, which led to errors in the data acquisition (negative values). As a simple solution, the values recognized as wrong were set to 0 %rh. C.5. Results 181

CO2 Sensor 1 CO2 Sensor 2 5000 CO2 Sensor 3 CO2 Sensor 4 CO2 Sensor 5 CO2 Sensor 6 CO2 Sensor 7 CO Sensor 8 3000 2 by the Gas Sensor [ppm] 2 1000 400 0

Measured CO -1000 0 400 1000 3000 5000

MeasuredCO 2 by the Gas Mixing System [ppm]

Figure C.3:CO 2 reading for varying test gas concentrations

C.5.2 Characterization of the CO2 Sensors

Measurements With Varying CO2 Test Gas Concentrations

To evaluate the calibration process and theCO 2 sensor, four measurements with fourCO 2 sensors each were carried out on 23rd and 26th June and on 13th July 2015. In total, eight differentCO 2 sensors were examined. A script was written that automatically generated test gases with different CO2 concentrations. The test chamber was flushed with the respective test gas for 15 min. From theCO 2 values measured at the end of a flushing process, the arithmetic mean was formed over a period of 1 min. TheCO 2 readings are shown in Figure C.3, where the x-axis represents the measured CO2 value by the gas mixing system and the y-axis represents the measured CO2 value by the gas sensor in the test chamber. Some sensors have been used multiple times. In this case, the arithmetic mean was determined over all measurements. The accuracy specified by the mass flow controller for a CO2 concentration of 400 ppm is about ±13 ppm and for 5 000 ppmCO 2 it is about ±50 ppm (see Table C.1). Figure C.3 reveals that there are considerable fluctuations in the mea- sured values between the individual sensors and that they increase with the appliedCO 2 concentration (standard deviation across all sensors is about σ = 288 ppm at 0 ppmCO 2 and about σ = 926 ppm at 5 000 ppmCO 2). 182 C. Characterization and Calibration of CO2 and VOC Sensors

Notably, the sensor’s actual standard deviation at 5 000 ppm is lower than indicated because the given deviation also includes the the tolerance of the mass flow controller. The offset at 400 ppmCO 2, which is roughly considered to be the value of fresh air, is between -594 and +319 ppm. Of the eightCO 2 sensors tested, six were outside of the manufacturer’s specified accuracy of ±42 ppm (accuracy given for aCO 2 concentration of 400 ppm) [298]. For the determination of the scaling, aCO 2 concentration of 400 ppm is recommended as the first measuring point, which is the lowest measurable concentration in a natural environment, and aCO 2 concentration of 5 000 ppm, which is the end of the measuring range of the sensor, as the second measuring point. The scaling parameters of the examinedCO 2 sensors lie between 0.940 and 1.490. Notably, the actual offset and scaling parameters depend on the envi- ronmental conditions for which theCO 2 values are defined (air temperature, air pressure, and relative humidity). The investigations have further shown that the sensors have a high degree of linearity within the specified sensor and controller accuracy and therefore a two-point measurement is considered. The results of the linearity results are consistent with statements from other publications of the same sensor type [219, 220].

Measurement Under Control of the Air Temperature

According to the Gay-Lussac law (see Chapter 4.1.1), the measuredCO 2 concentration of an NDIR sensor decreases as the air temperature increases. The change is approximately -0.335 %/K. The manufacturer Amphenol Cor- poration specifies for its Telaire 6713CO 2 sensor an unsigned dependency of 5 ppm/K or 0.5 %/K (whichever is greater) [298]. Based on the theoretical analysis already described, an inversely proportional relationship to the air temperature is assumed in the manufacturer’s specification. To verify the theoretically determined temperature sensitivity and the manufacturer’s indication, the measuredCO 2 concentration was recorded in the climate test chamber described in Chapter C.4.3. A total of two measurements with fourCO 2 sensors each were carried out on 23rd and 24th June 2015. An air temperature range of +10 to +50 °C was selected, which was limited on the lower end by the climate test chamber and on the upper end by the maximum operating temperature of the sensor system. The air temperature was changed in increments of 5 °C and kept constant for 10 min each after the steady-state of the chamber was reached. The relative humidity was regulated to 50 %. Figure C.4 depicts the two measurements compared to the theoretically determined values and the manufacturer’s indication. To avoid outliers in the measurement values, each value was formed from the arithmetic mean of neighbouring measuring points. Due to the individual C.5. Results 183

CO2 offset, the measurement values were additionally normalized at +25 °C (SATP) to a value of 400 ppmCO 2. The actualCO 2 concentration during the measurements was unknown, which is why the two measurements cannot be directly compared. Figure C.4 shows that the manufacturer’s specification is significantly steeper than the theoretically calculated deviation. The measurements of the sensors, however, follow in no apparent direction. It must be noted that the specified accuracy of the sensor for aCO 2 concentration of 400 ppm is ±42 ppm [298] and thus can explain a large part of the measurement devi- ations. It is also likely that changes in theCO 2 concentration of the am- bient air have influenced the measurements more strongly than changes in temperature have. The conclusion from the experiment is therefore that a temperature behaviour of theCO 2 sensor cannot be detected without a con- trolledCO 2 concentration in the climate test chamber. It is necessary to repeat the measurement in a test chamber that can both ensure a defined CO2 concentration and regulate the air temperature. In addition to the above, it should be taken into account that theCO 2 mass flow controller for the current test setup has an accuracy of approxi- mately ±13 ppm at a concentration of 400 ppm and an accuracy of approx- imately ±50 ppm at 5 000 ppm (see Table C.1). This makes it difficult to detect the temperature sensitivity, at least in the lower sensor measuring range, and may therefore require a mass flow controller with higher accuracy. Furthermore, it may be necessary to replace theCO 2 sensors with more ac- curate models or to work directly with the manufacturer to develop solutions that minimize measurement inaccuracies. To underline the point: at aCO 2 concentration of 400 ppm, the measured deviation due to temperature with respect to +25 °C is about +21 to -31 ppm, which has to be compared to the sensor accuracy of ±42 ppm. This is different with higherCO 2 concentra- tions, where the temperature effect outweighs the sensor accuracy. At this point, the change in absolute humidity has not yet been addressed. The fact that the air temperature was changed, but the relative humidity was kept at 50 %, resulted in changes of the absolute humidity. The saturation water vapour pressure as defined in (4.12), Chapter 4.1.1, increases with higher air temperature. The increased water vapour content dilutes the gas mixture, which leads to a reduction in the measuredCO 2 value. In the case that theCO 2 values are given on a dry basis (see (4.9)), the deviation from +10 to +50 °C with respect to +25 °C is calculated to be approximately +4 to -18 ppmCO 2 (assuming aCO 2 concentration of 400 ppm measured at a relative humidity of 50 %). The changes in air pressure measured during the experiment, on the other hand, were at a maximum of 0.152 kPa and, according to (4.5), had a negligible effect on the measuredCO 2 value. 184 C. Characterization and Calibration of CO2 and VOC Sensors

550

500

450 [ppm] 2 400

350 Theory

Measured CO Specification CO2 Sensor 1 300 CO2 Sensor 2 CO2 Sensor 3 CO2 Sensor 4 250 10 15 20 25 30 35 40 45 50 Air Temperature [°C] (a)

550

500

450 [ppm] 2 400

350 Theory

Measured CO Specification CO2 Sensor 5 300 CO2 Sensor 6 CO2 Sensor 7 CO2 Sensor 8 250 10 15 20 25 30 35 40 45 50 Air Temperature [°C] (b)

Figure C.4:CO 2 reading with changing air temperature and a relative hu- midity of 50 % on a) 23rd and b) 24th June 2015 C.5. Results 185

Measurement Under Control of the Relative Humidity

It was described in Chapter 4.1.1 that with increasing water vapour in the gas mixture, the measuredCO 2 value of an NDIR sensor decreases. The datasheet of theCO 2 sensor Telaire 6713, however, gives no indication of a dependence on air humidity. In the context of indoor air quality, the air humidity is usually measured as the relative humidity [191]. Since the sensitivity to relative humidity is also determined by the air temperature and air pressure, SATP conditions (T = +25 °C and p = 100 kPa) are assumed here. The air temperature in the climate test chamber was regulated to +25 °C, whereas no influence could be exerted on the air pressure. The sensitivity to humidity was examined by measurement on 26th June 2015 using fourCO 2 sensors in the climate test chamber. Originally, a relative humidity range of 10 to 90 % was chosen, considering the climate operation requires a relative humidity of at least 10 % and setting the upper end at 90 % to rule out condensation and thus damage to the sensor systems. However, it turned out that the expected setting time for 10 %rh should be several hours, which is why a value of 11.5 %rh had to be chosen to complete the measure- ment in time during working hours. The relative humidity was changed in increments of 10 % and kept constant for 5 min after the steady-state was reached. Figure C.5a shows the measurement compared to the theoretically determined values. The measured values were formed from the arithmetic mean of neighbouring measuring points and normalized at 50 %rh to a value of 400 ppmCO 2. The theoretically determined deviations indicate that the measuredCO 2 value decreases with increasing relative humidity. From the CO2 sensor measurements, however, no relationship with the relative humid- ity can be derived. The humidity analysis was extended by a second measurement on 9th July 2015, where a higher air temperature of +50 °C was set to achieve a higher spread in absolute humidity than in the first measurement. In the second measurement, which is shown in Figure C.5b, only three humidity states were tested (at 15 %rh, 50 %rh, and 90 %rh). Although the estimated deviation resulting from changes in the absolute humidity is higher here, a sensitivity to air humidity cannot be discerned. It is probable that changes in theCO 2 concentration in the ambient air had a greater influence on the measurements than changes in air humidity (as was also the case with the temperature sensitivity measurement). In addition, it could not be resolved why the measured values during the humidity tests deviated only little be- tween the sensors, whereas the spread from the temperature measurements in Figure C.4 was significantly higher. It is possible that the climate test 186 C. Characterization and Calibration of CO2 and VOC Sensors

550 Theory CO2 Sensor 5 500 CO2 Sensor 6 CO2 Sensor 7 CO2 Sensor 8 450 [ppm] 2 400

350 Measured CO 300

250 11.5 20 30 40 50 60 70 80 90 Relative Humidity [%] (a)

550 Theory CO2 Sensor 4 500 CO2 Sensor 6 CO2 Sensor 7 CO2 Sensor 8 450 [ppm] 2 400

350 Measured CO 300

250 15 50 90 Relative Humidity [%] (b)

Figure C.5:CO 2 reading with changing relative humidity on a) 26th June (air temperature at +25 °C) and b) 09th July 2015 (air temperature at +50 °C) C.5. Results 187 chamber was able to produce a locally more homogeneous air distribution during the humidity test. In summary, it can be said that to prove the described humidity be- haviour, the measurement must be repeated in a test chamber that ensures a definedCO 2 concentration and can also regulate the humidity. Difficulties that may arise from the measurement tolerance of the mass flow controller and theCO 2 sensor have already been discussed in the previous section. Measures to increase the overall accuracy are particularly necessary for the detection of the humidity sensitivity, because based on a relative humidity of 50 % and an air temperature of +25 °C, the calculated deviation for aCO 2 concentration of 400 ppm is roughly below ±5 ppm. Only if the air tem- perature is raised to +50 °C and the suppliedCO 2 concentration is around 5 000 ppm, the humidity sensitivity may become visible. The air pressure in this experiment varied at a maximum of 0.298 kPa, which according to (4.5) and (4.15) from Chapter 4.1.1 had a negligible effect on the measuredCO 2 value.

C.5.3 Characterization of the TVOC Sensors

Measurements With Varying C4H10 Test Gas Concentrations The measurements of the TVOC sensors were carried out at the same time as theCO 2 measurements described in Chapter C.5.2. Due to the design of the calibration setup, a test gas could be generated with bothCO 2 andC 4H10. In total, eight TVOC sensors were used for the measurements, from which four sensors were tested in each of the measurements. Figure C.6 shows the measurements of the sensors at varyingC 4H10 concentrations. The arithmetic mean over a period of 1 min was formed at the end of a flushing process. From sensors that have been used multiple times, the arithmetic mean over all measurements was calculated. The accuracy of theC 4H10 mass flow controller is specified as 1 % of the full scale (FS) (here 100 ppm, see also Table C.1), which corresponds to 1 ppm inC 4H10. Because of this, the measurements in the lower measuring range, especially at 2 ppmC 4H10, are not directly comparable. For a better comparison of differentC 4H10 concentrations, the arithmetic mean across all sensors was additionally marked in the figure. In addition to the measurements already described, aC 4H10 concentration of 400 ppm was generated in a further measurement with four TVOC sensors by reducing the flow rate of the carrier gas. In this case, the accuracy was ±4 ppm. Figure C.6 shows that the contaminant-free air was correctly indicated by the TVOC sensors with a counter value of 0. As theC 4H10 concentration 188 C. Characterization and Calibration of CO2 and VOC Sensors

1000 TVOC Sensor 1 TVOC Sensor 2 TVOC Sensor 3 TVOC Sensor 4 800 TVOC Sensor 5 TVOC Sensor 6 TVOC Sensor 7 600 TVOC Sensor 8

400

200

Measured [ ADC TVOC Counter Value] 0 028 25 100 400

MeasuredC 4H10 by the Gas Mixing System [ppm]

Figure C.6: TVOC counter value for varyingC 4H10 test gas concentrations

was increased, so did the measured TVOC value. Because of the mass flow controller measurement tolerance, the standard deviation was calculated for each measurement separately and averaged subsequently. This gives a mean standard deviation of approximately σ = 51 at 2 ppmC 4H10 and a mean standard deviation of approximately σ = 22 at 100 ppmC 4H10. Deviations in the measured values may be due to the sensor tolerance or caused as a result of the manufacturing process [294]. At aC 4H10 concentration of 2 ppm, the TVOC sensors had already reached almost half of their measuring range (µ = 464.25). It is therefore likely that the examined sensor model can detect C4H10 concentrations in the ppb range. Furthermore, it can be seen that the sensors had not yet reached the end of their measuring range at aC 4H10 level of 400 ppm. The measured TVOC values with respect to the supplied C4H10 concentration were nonlinear, which is generally consistent with the manufacturer’s measurements from [294]. However, the manufacturer has tested under other environmental conditions (+20 °C, 65 %rh) and may have used a different measurement circuit. As a result of the nonlinear behaviour, a multi-point calibration is recommended. C.5. Results 189

Measurement Under Control of the Air Temperature

In Chapter 4.1.2, it was described that the VOC reading of a MOS-type sen- sor from Figaro Engineering Inc. is related to the temperature of the ambient air. The sensitivity results from the temperature-dependent chemical reac- tion rate, which when the air temperature increases leads to an increase in conductivity of the sensor. The sensitivity to changes in the air temperature is also explicitly named for the examined TGS 2600 sensor model [294]. To evaluate the temperature behaviour of the TVOC sensors, two mea- surements were carried out with four TVOC sensors each. The measure- ments were conducted in the climate test chamber together with theCO 2 sensor measurements, the details of which have already been described in Chapter C.5.2. Figure C.7 shows the TVOC readings in relation to the air temperature. The TVOC values were formed from the arithmetic mean of neighbouring measuring points. The actual TVOC concentration or com- position during the measurements was not known, which is why the two measurements cannot be directly compared. From Figure C.7, it can be seen that the TVOC sensors have a measurable nonlinear dependence to the air temperature. A nonlinear behaviour with respect to air temperature (and constant relative humidity) is also consistent with the manufacturer’s mea- surements in [294], although other test conditions such as an unknown ”air” gas mixture, a different relative humidity, and possibly a different measure- ment circuit was used. There are two ways to deal with the air temperature sensitivity. In the technical document in [232], the manufacturer Figaro Engineering Inc. de- scribes a temperature compensation circuit as a solution. Another option is to map the measurement curve with a nonlinear function and to compensate the deviations in software either by a calculation or a lookup table. However, both methods have in common that they may have to be adapted every time a new gas mixture is tested. To determine the exact temperature sensitivity of a defined gas mixture, it is necessary to perform the measurement in a test chamber that ensures both a defined TVOC concentration and the ability to regulate the air temperature. It has already been described in Chapter C.5.2 that when the air temper- ature is increased, but the relative humidity is kept constant, the absolute humidity is increased. It is therefore conceivable that the sensitivity to air temperature described here results primarily from the change in absolute hu- midity or from the sum of the changes in both parameters. Unfortunately, no information about this could be found in the literature. Furthermore, the influence of the air pressure on the TVOC sensor is unclear (see the descriptions in chapter 4.1.2). 190 C. Characterization and Calibration of CO2 and VOC Sensors

900 TVOC Sensor 1 850 TVOC Sensor 2 TVOC Sensor 3 800 TVOC Sensor 5 750 700 650 600 550 500 450 [ ADC TVOC Counter Value] 400 350 10 15 20 25 30 35 40 45 50 Air Temperature [°C] (a)

900 TVOC Sensor 6 850 TVOC Sensor 7 TVOC Sensor 8 800 TVOC Sensor 9 750 700 650 600 550 500 450 TVOC [ ADC Counter Value] 400 350 10 15 20 25 30 35 40 45 50 Air Temperature [°C] (b)

Figure C.7: TVOC reading with changing air temperature and a relative humidity of 50 % on a) 23rd and b) 24th June 2015 C.6. Conclusion and Outlook 191

Measurement Under Control of the Relative Humidity

It is generally known that water vapour is adsorbed on the sensor surface of a MOS-based VOC sensor [233, 232]. According to [294] and [232], the conductivity of the sensor of the TGS 2600 and other type-identical VOC sensors from the manufacturer Figaro Engineering Inc. increases with the relative humidity. The humidity sensitivity of the TVOC sensors was measured together with theCO 2 sensors in the climate test chamber (see Chapter C.5.2 for details on the measurement). Figure C.8 depicts the measurement values of four different TVOC sensors. Again, the arithmetic mean was taken from neighbouring measurement points and the actual TVOC concentration and its composition were unknown. From the figure, it can be derived that the relationship between the TVOC reading and the relative humidity is non- linear. The measured humidity behaviour is consistent with measurements conducted by the manufacturer [294] (taking into account that other test conditions were applied). To specify TVOC concentrations for a defined rel- ative humidity, it is possible (as with the sensitivity to air temperature) to determine a nonlinear function as an approximation and to use this function for a calculation or lookup table for compensation. The function may need to be calculated individually for each gas mixture and determined in a test chamber that ensures a defined TVOC concentration and can also regulate the relative humidity. In a second experiment on 26th June 2015, it was investigated whether the sensitivity of the TVOC sensor intensifies with a simultaneous increase in relative humidity and air temperature. Figure C.9 shows the arithmetic mean values calculated from the four TVOC sensors (2, 3, 6, and 7) for vary- ing relative humidity and air temperature. It can be seen that the effects of changes in both parameters is mutually reinforcing. However, as already discussed with the temperature measurement, it must be noted that the sen- sitivity may also result exclusively or primarily from the change in absolute humidity.

C.6 Conclusion and Outlook

A calibration test setup was presented that is capable of calibratingCO 2 and VOC sensors at the same time. The simultaneous calibration of both gas sensor types is the basis for a considerable cost and time reduction during production. The setup is further characterized by an accuracy of ±10 ppm ±0.08 % of the measuredCO 2 value and an accuracy of ±1 ppm of theC 4H10 192 C. Characterization and Calibration of CO2 and VOC Sensors

900 TVOC Sensor 2 850 TVOC Sensor 3 TVOC Sensor 6 800 TVOC Sensor 7 750 700 650 600 550 500 450 [ ADC TVOC Counter Value] 400 350 11.5 20 30 40 50 60 70 80 90 Relative Humidity [%]

Figure C.8: TVOC reading with changing relative humidity (air temperature at +25 °C)

900 15 °C 850 25 °C 35 °C 800 750 700 650 600 550 500 450 [ ADC TVOC Counter Value] 400 350 30 50 70 Relative Humidity [%]

Figure C.9: TVOC reading with changing relative humidity and air temper- ature Additional References 193 value. In addition, the gas mixing control and data acquisition software offers automated test procedures. As part of this thesis, the sensitivity of the measuredCO 2 value of an NDIR sensor to the environmental conditions of air pressure, air tempera- ture, and relative humidity was extensively investigated. Unfortunately, the theoretically determined values could not be validated by measurement, pri- marily due to the unknownCO 2 concentrations in the climate test chamber. The relationship between the TVOC reading of a MOS-type sensor and the environmental conditions, in particular the air pressure, has not been suffi- ciently investigated in the literature. Measurements of TVOC in the climate test chamber showed a high sensitivity to air temperature and relative hu- midity. However, it was pointed out that the sensitivity to air temperature may also be due to the change in absolute humidity. The calibration setup can be improved or extended by a number of mea- sures. First, the air distribution within the test chamber can be further opti- mized. For use during production, the test chamber also has to be adapted to larger quantities. To increase the accuracy of the gas mixing system as well as to generateC 4H10 concentrations in the ppb range, a gas cylinder contain- ing a prefabricated gas mixture ofN 2 as carrier gas andCO 2 orC 4H10 can be used instead of the pure test gas. Another option is to replace the mass flow controllers with models of higher accuracy or to use aC 4H10 controller with a smaller measuring range. Furthermore, a humidity control could be realized with the installation of a bubble humidifier. To regulate the air pres- sure or the air temperature, existing solutions [220, 211] may be examined for feasibility, accuracy, and cost-effectiveness.

Additional References

[293] Uwe Schaudt and Dirk Utech. V¨otsch – Pr¨ufschrank Modell VT3 4018 SATH-S mit Gasdosiereinrichtung zur Herstellung einer k¨unstlichen Atmosph¨are.V¨otsch Industrietechnik GmbH. Offer number 56236905 from 25th February 2015.

[294] Figaro Engineering Inc. Technical information for TGS2600 rev. 10/12, October 2012.

[295] BINDER GmbH. Model VD 115 — vacuum drying cham- bers for non-flammable solvents datasheet, March 2019. URL https://www.binder-world.com/en/content/download/113554/ 3050091/file/Data%20Sheet%20Model%20VD%20115%20en.pdf. 194 Additional References

[296] Hanns-Erik Endres, Hildegard D. Jander, and Wolfgang G¨ottler. A test system for gas sensors. Sensors and Actuators B: Chemical, 23(2): 163–172, February 1995. doi:10.1016/0925-4005(94)01272-J.

[297] P. P´erezBallesta, A. Baldan, and J. Cancelinha. Atmosphere genera- tion system for the preparation of ambient air volatile organic com- pound standard mixtures. Analytical Chemistry, 71(11):2241–2245, June 1999. doi:10.1021/ac981291l.

[298] Amphenol Corporation. Telaire 6713 series CO2 module datasheet AAS-920-634A, July 2014.

[299] Deutsche Forschungsgemeinschaft. MAK- und BAT-Werte-Liste 2017. WILEY-VCH Verlag GmbH & Co. KGaA, Weinheim, Germany.

[300] Coblentz Society, Inc. NIST Chemistry WebBook, NIST Standard Reference Database Number 69, chapter Evaluated Infrared Refer- ence Spectra. National Institute of Standards and Technology. doi:10.18434/T4D303. Accessed on 9th February 2019.

[301] Weiss Umwelttechnik GmbH. WT series and WK series datasheet, 2007.