Faculty of Electrical Engineering - Universiti Teknologi Malaysia

6 downloads 280 Views 2MB Size Report
Jun 24, 2013 ... kelebihan dan manfaat kepada pengguna kerana pemantauan tahap tekanan ... beban kos dapat dikurangkan oleh pengguna dan masalah ..... in order to obtain further and more precise information about the state of mind. ..... Fuzzy inference is the process of formulating the mapping from a given input to.
ii

PSZ 19:16 (Pind. 1/07)

UNIVERSITI TEKNOLOGI MALAYSIA DECLARATION OF THESIS / UNDERGRADUATE PROJECT PAPER AND COPYRIGHT

Author’s full name

:

SITI NUR ZULIKASAHIERA BINTI RAHIM

Date of birth

:

30th

Title

: STRESS DETECTOR

STRESS DETECTOR

Academic Session :

MAY 1990

2012/2013

SITI NUR ZULIKASAHIERA BINTI RAHIM

I declare that this thesis is classified as : CONFIDENTIAL

(Contains confidential information under the Official Secret Act 1972)*

RESTRICTED

(Contains restricted information as specified by the organization where research was done)*

OPEN ACCESS

I agree that my thesis to be published as online open access (full text)

A thesis submitted in fulfilment of the I acknowledged that Universitifor Teknologi Malaysia reservesofthe right as follows: requirement the award of the degree

of property Engineering (ElectricalMicroelectronic) 1. The Bachelor thesis is the of Universiti Teknologi Malaysia. 2. The Library of Universiti Teknologi Malaysia has the right to make copies for the purpose of research only. 3. The Library has the right to make copies of the thesis for academic exchange. Certified by

SIGNATURE

SIGNATURE OF SUPERVISOR

SITI NUR ZULIKASAHIERA BINTI RAHIM

Faculty of Electrical Engineering

Universiti (900530-01-5634) Date : 24th JUNE 2013

Teknologi Malaysia DR. RABIA BAKHTERI Date :24th JUNE 2013

iii

“I hereby declare that I have read this thesis and in my opinion this thesis is sufficient in terms of scope and quality for the award of the degree of Bachelor of Engineering (Electrical- Microelectronic

Signature

:

............................................................................

Name

:

DR RABIA BAKHTERI

Date

:

21 JUNE 2013

ii

STRESS DETECTOR

SITI NUR ZULIKASAHIERA BINTI RAHIM

A thesis submitted if fulfilment of the award of the degree of requirements for the Bachelor of Engineering (Electrical- Microelectronic)

Faculty of Electrical Engineering Universiti Teknologi Malaysia

JUNE 2013

ii

I declare that this thesis “STRESS DETECTOR” is the result of my own research except as cited in the references. The thesis has not been accepted for any degree and is not concurrently submitted in candidate of any other degree.

Signature

:

…………………………………………………………….

Name

:

SITI NUR ZULIKASAHIERA BINTI RAHIM

Date

:

21 JUNE 2013

iii

Dedicated in thankful appreciation for support, encouragement and understanding to family members, supervisor and friends

iv

ACKNOWLEDGEMENT

Alhamdullillah, thanks to Allah S.W.T for His blessing and mercy, for giving me strength to complete the final year project. Firstly, I would like to express my gratitude to all those who have made the completion of this thesis possible. Special thanks goes to my helpful supervisor, Dr. Rabia Bakhteri whose help, stimulating suggestions and encouragement have helped me throughout the researched and thesis writing. The supervision and support the she gave me has truly helped the progression and smoothness of the project and her co-operation is much appreciated. My grateful thanks also go to Dr Nadzir Marsono, Dr Usman Ullah Sheikh, Mr. Zuraimy, Mr.Jeff and Mr. Sia for their big contribution to help me in my final year project.

My appreciation also go to my family members especially my parents, Rahim bin Yasim and Sapiah bt Abu Bakar for their fully supports throughout the year to accomplish my final year project successfully. Special thanks also go to a special person in my life and my beloved friends who really help me direct or indirect in my project and I really appreciate all their help, support.

I would like to sincerely thank to Universiti Teknologi Malaysia and Faculty of Electrical Engineering, UTM for providing the facilities and equipments for this research project.

v

ABSTRACT

Nowadays, stress has significant impact on human health. Stress is body’s reaction to a change that requires physical, mental or emotional adjustment or response. Stress becomes a health concern when the amount of physiological changes or mental pressure experienced by an individual is much higher than required by the event that caused it. This project describes a health monitoring system that is called in Stress Detector which can receive bio-signals from human beings and us the data to assess whether the person is under stress or not. In this thesis, Arduino Uno board is used to transmit and receive the data from the temperature sensor, galvanic skin resistance and pulse rate sensor which are connected directly with human body. The device gives many advantages to the user since they can monitor their stress level anytime and anywhere. Otherwise, burden cost can be minimized by the user and the problem regarding time consuming can be settled down by using stress detector. This project also consists of creating an intelligent system which is fuzzy logic that is used to measure stress level. The system is a real time application as it can detect and measure stress levels in 7 to 10 seconds depending on the human bio-signals itself. In conclusion, the stress detector system has been created and implemented that allows a better health monitoring technique for the user.

vi

ABSTRAK

Alat pengesan tekanan mempunyai impak yang penting delam kesihatan manusia. Tekanan ialah reaksi badan untuk mengubah fizikal, mental ataupun kepelbagaian emosi atau tindak balas. Projek ini menerangkan system pemantauan kesihatan di dalam alat pengesan stress yang mampu menerima bio-isyarat daripada manusia dan data digunakan untuk menilai sama adaseseorang itu dalam keadaan tertekan atau tidak. Dalam tesis ini, Arduino Uno digunakan untuk menghantar dan menerima data daripada sensor suhu badan manusia, rintangan kulit galvani dan sensor kadar nadi yang disambungkan terus kepada badan manusia. Alat ini memberi banyak kelebihan dan manfaat kepada pengguna kerana pemantauan tahap tekanan secara berterusan boleh dibuat pada bila-bila masa dan di mana sahaja. Selain daripada itu, beban kos dapat dikurangkan oleh pengguna dan masalah berkaitan dengan kekangan masa juga boleh diselesaikan dengan mudah dengan alat pengesan stress. Projek ini juga terdiri daripada menghasilkan sistem yang bijak iaitu sistem fuzzy yang boleh diguna untuk mengesan dan mengukur tahap stress. Sistem ini juga merupakan aplikasi yang pantas dimana ia dapat mengesan dan mengira tahap stress dalam masa 7 hingga 10 saat bergantung kepada signal di dalam badan manusia. Sebagai konklusi, alat pengeasan tekanan telah dapat dicipta dan di guna pakai yang dapat meninjau kesihatan seseorang dengan lebih baik.

vii

TABLE OF CONTENTS

CHAPTER

1

2

TITLE

PAGE

DECLARATION

ii

DEDICATION

iii

ACKNOWLEDGEMENT

iv

ABSTRACT

v

ABSTRAK

vi

TABLE OF CONTENTS

vii

LIST OF TABLES

x

LIST OF FIGURES

xi

LIST OF ABBREVIATIONS

xiii

LIST OF APPENDICES

xiv

INTRODUCTION

1

1.1 Background of Study

1

1.2 Problem Statement

3

1.3 Objective

4

1.4 Scope

4

1.5 Thesis Outline

5

LITERATURE REVIEW

7

2.1 Introduction

7

2.2 Stress Detection System

13

2.2.1 Support Vector Machine

13

viii

3

2.2.2 K-Nearest Neighbor

14

2.2.3 Fuzzy Logic

16

RESEARCH METHODOLOGY

19

3.1 Introduction

19

3.2 Sensor Operating Principles

21

3.2.1 Temperature Sensor (LM35)

21

3.2.1.1 Temperature Sensor with ADC Chip

22

3.2.1.2 Temperature Sensor with AVR Board

25

3.2.1.3 Temperature Sensor with ARDUINO

27

UNO board 3.2.2 Pulse Sensor 3.2.2.1 Pulse Sensor with Arduino Uno Board 3.2.3 Galvanic Skin Resistance (GSR) 3.3 Fuzzy Logic Stress Detection System

27 28 29 31 32

3.3.1 Fuzzy Logic in Matlab

33

3.3.2 Fuzzy Logic Decicsion Making Module on

36

Arduino IDE

4

5

RESULT AND DISCUSSION

37

4.1 Introduction

37

4.2 Results and Analysis

37

4.2.1 Prototype Design

38

4.2.2 Body Temperature Sensor Result’s

39

4.2.3 Pulse Rate Sensor

40

4.3 Problem and Challenges

42

4.4 Discussion

42

CONCLUSION

45

5.1 Conclusion

45

ix

5.2 Future Work and Recommendation

46

REFERENCES

49

APPENDIX

49

x

LIST OF TABLES

TABLE NO. 2.1

TITLE Literature Review on Physiological Signals Involved in

PAGE 12

Stress Detection 2.2

Summary of Decision Making Algorithm used by

18

Researchers 3.3

Resolution versus Step Size of ADC0804

23

3.4

Rules of Stress Detection System

35

4.1

Result of User’s Bio-signals

43

xi

LIST OF FIGURES

FIGURE NO.

TITLE

PAGE

1.1

Cause and Effects of Stress

2

1.2

Stress Detection System Flow

6

2.1

Placement of Electrodes

8

2.2

GSR Stress Detection System using N-5148

9

2.3

Design with Contact Sensor for Vehicle Safety

10

2.4

SHIMER Sensors

11

2.5

Support Vector Machine Types

14

2.6

Artificial Neural Network

15

2.7

Example of Distinct Function (above) and Fuzzy

16

Function (below) 2.8

Characteristic of Fuzzy Logic

17

2.9

Type of Membership Function

18

3.1

Block Diagram of Stress Detection System

20

3.2

Temperature Sensor

22

3.3

LM35 with ADC0804

22

3.4

Architecture of ADC0804

24

3.5

First Prototype of Stress Detector with Temperature

24

Sensor on DE1 Board FPGA Board 3.6

ATmega32 Architecture

25

3.7

ADC Recommended Connection

26

3.8

First Prototype Stress Detector with Atmega32 and LCD

26

3.10

Arduino Pulse Rate sensor

28

xii

3.11

Arduino Uno board

29

3.12

Schematic of Arduino Uno

30

3.13

Schematic of Pulse Sensor

30

3.14

GSR Circuit Prototype

31

3.15

GSR Circuit using LM324N

32

3.16

Membership Function

34

3.17

Output Variable of Stress Detector

35

4.1

The Serial Monitor of the PC Showing the Result

38

4.2

Prototype Design

38

4.3

Body Temperature Displayed

39

4.4

Temperature Displayed in Serial Monitor of Arduino

40

Uno Board 4.5

Processing of Pulse Rate

41

4.6

Text File (.txt) of BPM

41

xiii

LIST OF ABBREVIATIONS

ACC

Acceloremeter

ADC

Analog to Digital Converter

BT

Body Temperature

BVP

Blood Volume Pressure

DIP

Dual In Line

ECG

Electrocardiogram

EMG

Electromyogram

FPGA

Field Programmable Gate Array

GND

Ground

GPIO

General Purpose I/O

GSR

Galvanic Skin Resistance

GUI

Graphical Processing Unit

HR

Heart Rate

IDE

Integrated Development Environment

k-NN

K-Nearest Neighbor

LCD

Liquid-Crystal Display

LED

Light Emitting Diode

PWM

Pulse Width Modulation

PC

Personal Computer

PD

Pupil Diameter

PR

Pulse Rate

SCA

Skin Conductance Algesimeter

SVM

Support Vector Machine

xiv

LIST OF APPENDICES

APPENDIX A

TITLE Programming Source Code

PAGE 48

1

CHAPTER 1

INTRODUCTION

1.1

Background of Study

Human beings constantly have to adapt and adjust to changes in their environment. Events that require a person to represented or adjust in physical, mental or emotional way cause a physiological reaction in the body known as stress. The events or changes that cause this reaction are known as stressors. Stress can cause certain negative emotions such as frustration, anger, nervousness and anxiety.

In this high-speed, technology based era, the amount of information and knowledge that is available is increasing at a rapid speed. People have to learn how to use constantly changing and updating technology, learn and know more in order to stay up-to-date. This fast paced lifestyle is taking its toll in the form of higher stress levels that cause a multitude of health problems. Health professionals have identified stress as the underlying cause of 46% of all medical problems faced by the workers [8].

There are three types of stress: acute stress, episodic acute stress and chronic stress [2]. Each of these types has its own characteristic, symptoms, duration and treatment approaches. Normal level of stress or acute stress is a small dose of stress in

2

human body such as running fast on a challenging ski slope while episodic acute stress occurs is when someone who suffers from acute stress regularly such as waiting too long in the traffic jam everyday [10]. As for chronic stress, it is a very dangerous level of stress and should be prevented. It is defined as a never-ending mode of stress and in long term can lead to high blood pressure [10]. Human beings are faced with situations that make the body react to stress with physical and emotional reactions such as fatigue, headaches, insomnia, unable to focus etc [11].

Stress is a highly individualistic experience and does not depend on external factors such as lack of time but depends on specific physiological determinants that trigger a stress response. Therefore, human stress can be detected by measurement of human signals such as heart rate, voice tone, salivary alpha-amylase, blood pressure, muscle-rigidity,

pupil

diameter,

skin

conductance,

body

temperature

and

electromyogram [1-3, 6, 8]. The cause and effect of stress can be seen in Figure 1.1.

Figure 1.1: Causes and Effects of Stress

This project consists of designing a device that can detect the stress level in human body using three biological signals which are galvanic skin resistance (GSR), pulse rate (PR) and body temperature (BT). The stress detector system consists of three sensors which are temperature sensor, galvanic skin response sensor and pulse rate

3

sensor. Body temperature will be measured at the fingertip with a temperature sensor with a microprocessor for computation and results displayed on a monitor. Pulse rate sensor is already available in the market. GSR is handmade sensor which is pure amplifier and can extract the data. These sensors detect the bio-signals from the human body, filter and amplify the signals before sending it for processing. The stress detector uses a fuzzy logic decision making module to compute the stress levels and display the result on the monitor.

1.2

Problem Statement

Stress can be categorized into two types which are stress with positive and negative effects [11]. Positive effects of stress happen when people use the stress to meet their challenge or resolve a situation as is common in daily life problems. However, overstress or over pressure has negative impact on human if it happens continuously and can cause several diseases such as depression [11]. Stress can contribute to illness directly through its physiological effects or indirectly through maladaptive health behavior such as low level confidence, anger or lack of sleep [10]. It is important for human beings to adjust their behavior and life style and start using appropriate stress coping strategies so that they achieve optimum health and a balanced lifestyle. Due to the dangers to health, people have to see the doctor personally for regular check-ups and evaluation which can be time-consuming and expensive. In fact, some people may be uncomfortable with the environment of clinic or hospital itself.

Other than that, high levels of stress are also dangerous for children who suffer from autism. Autistic children show less attention to social stimuli, suffer from sleep disorder (86 %), difficulties in communication since they use a different way to communicate and sometimes display unpredictable behavior (34%) [12, 13]. Basically, the symptoms for high stress become apparent in children under age six years old [14].

4

Autistic children are more susceptible to anxiety disorders and feelings of anger. High level of stress in autistic children can cause anxiety attacks. So, it is crucial to track their stress early to avoid health problem and complications.

This project can also benefit pregnant women and senior citizens above 65 years of age. During pregnancy, a women suffering from high levels of stress has chances of having a premature baby (born before completing 37 weeks of pregnancy) or a baby with low-birth weight and can cause health problems like heart disease for the mother [14, 15]. This project is safe to be used by pregnant women because it only uses small voltage values and the sensors are suitable for all ages. As for senior citizens, they have to make frequent visits to their doctor to get their vital signs measured. Regular monitoring of vital signs is essential as they are the primary indicators of an individual’s physical well-being and ensure their health for longer period. So, the stress detector allows the user to monitor their own health on a regular basis from the comfort of their home.

1.3

Objective

The main objective of this project is to develop a prototype of low cost and low power stress detector using the Arduino Uno board. It is a stand-alone stress detection system that can be used for various medical applications.

1.4

Scope

The main characteristics of the stress detector is its non-invasiveness, real-time response and high accuracy in detecting stress, together with fuzzy algorithm to elucidate to what extent an individual is under stress. This design is for low cost and real

5

time performance with acceptable accuracy. The scope of the project is described below: 

The project is implemented on the Arduino Uno board.



Three bio-signals were used to measure the stress levels which are heart rate, galvanic skin resistance and body temperature.



The heart rate was measured using pulse sensor Arduino.



Temperature was measured by LM 35 chip.



GSR was measures by handmade sensor.



The decision making module used fuzzy logic to indicate stress levels.



The tools used in this project include MATLAB, AVR4 Studio, Quartus II and C++ programming.

1.5

Thesis Outline

The project began with the background review where previous research was studied including the definition of stress and the study on how to measure biological signals. Then, the project continues by defining the technical specifications. The project used Arduino Uno board with Analog Digital Converter (ADC) to convert the data from the three sensors. The stress detector allows the user to check the stress level on the user fingertip. After that, the process is continued by designing the system using C++ programming. The system is designed for minimum cost and minimum complexity. As the software and hardware part are completely designed, the final steps is to get the data process to determine the stress levels. Figure 1.2 shows the process flow of the stress detection system.

6

Data Capturing

Noise Reduction

Feature Extraction

Feature Selection

Classification

Figure 1.2: Stress Detection System Flow

The data capturing block consists of bio-signals from human body which are pulse rate, body temperature and sweat production. Noise reduction refers to the process of filtering the other noise inside human body and feature extraction will extract all the signals wanted to be the parameter in the system. Then, feature selection like mean and standard deviation of the signals will be selected and classify based on algorithm of the system.

7

CHAPTER 2

LITERATURE REVIEW

2.1

Introduction

This chapter provides the discussion on the methods of measuring stress level based on physiological signals in human body. This discussion covers approaches that are used by other researchers. The problem of stress detection has been tackled with different approaches. However, formal works can be divided into two criteria: depend on the use of bio-signal or other behavioral characteristics.

For example, Jorn Bakker et al [2] said that 62% of Americans say work has a significant impact on stress levels. 54% of employees are concerned about health problems caused by stress. One in four employees has taken a mental health day off from work to cope with stress (APA Survey 2004) [2]. Therefore, measuring stress related physiological signal from the sensor data like Galvanic Skin Resistance (GSR) and facial expression can make the stressors visible and detectable. The researchers [2] used GSR data and measured it at the wrist of the user. However, the GSR data is difficult to analyze due to the signal instability and other factors such as weather or room temperature having an effect on the user’s GSR value. In fact, the researchers in [2] use

8

only GSR signal to measure the stress level of the user so it is might be inaccurate or biased.

Meanwhile, Hanne Storm wrote about Med-Storm’s skin conductance algesimeter (SCA) to measure pain based on GSR. The device was adaptable to real time change of GSR signal. It also has higher sensitivity compared to other bio-signals like heart rate [21]. However, this detector is capable of only detecting the user’s pain instead of stress level.

H.Storm et al [24] presented detection of stress pattern from GSR for the workers who are stressed at their work place. The purpose of the research was to measure whether the GSR can be used to accurately measure human stress. The researchers used LabView National Instrument software. The software analysis program could also analyse smaller segments of the recorded data. The apparatus, shown in Figure 2.1, and the software program were commercially developed by Med-Storm Innovation. Further clinical studies are needed to examine whether the skin conductance fluctuations are more specific and sensitive for pain stimuli than blood pressure and heart rate during surgery. However, this paper only uses one physiological signal which is less accurate than other systems.

Figure 2.1: Placement of Electrodes [25]

9

Furthermore, María Viqueira Villarejo et al used wireless stress detection system to detect stress from human body and display it on the PC monitor as shown in Figure 2.2 [23]. The work in [23] used Jennic JN-5148 boards to implement the hardware but their system is incapable of differentiating between a user who is stressed and one who is making effort.

Figure 2.2: GSR Stress Detection System using JN-5148 [23]

The work presented by Sanjay A. Patil and John H.L. Hansen in 2009 proposed to use the contact sensor which can detect the heart beat of a car driver [5]. The nonacoustic sensor has to be connected to the skin of the driver directly in order to capture speed via skin vibrations near carotid and thyroid cartilage. This project’s purposewas to detect the driver stress while driving. However, normally drivers would be reluctant to attach the device around their neck every time they drive. So, they came up with alternative designs like in Figure 2.3 with contact sensors attached at the seatbelt and car seat. Besides, the proposal was not meant to measure the exact stress level of stress level but just to show whether the driver was stressed or not [5].

10

Figure 2.3: a) Sensor on Driver’s neck (b) Sensor on Seat-belt (c) Sensor on Back Rest Design with Contact Sensor for Vehicle Safety [5].

In addition, Dhvani Parekh (2010) proposed mobile on-call system for senior citizens using three physiological signals: heart rate, blood pressure and body temperature. Eventhough the device is low cost and easy to use but this device is limited to only people who are above the ages of 65 years old [6]. In fact, the ECG part can be improved by using electrode sticks rather than using the sensors connected to the chest.

On the other hand, there are many previous works related to stress detection based on physiological signals. Research presented by Jacqueline Wijsman et al presents a mental stress detection system using wearable physiological sensors based on Electrocardiogram (ECG) wireless chest belt, respiration, skin conduction and EMG [3]. The research uses the principal components and three different stress tasks (calculation, puzzle and logical) to extract features of the human body. Four classifiers : Linear Bayes Normal, Quadratic Bayes Normal, K-Nearest Neighbor and Fisher’s Least Square, were used by the researchers to compare the results and analyze the data. Since the researchers use the normal approaches to capture information from human body, long data collection period was needed and is not suitable for real-time applications [3].

11

In contrast, a paper by Alberto de Santos Sierra et al (2011) was a stress detection system based on physiological signals of GSR and heart rate (HR) together with fuzzy logic system. The authors use two implementations which are manual implementation using Mamdani fuzzy system and automatic implementation based on Sugeno-type fuzzy inference system [4]. Two types of task were analyzed to identify stress level values which are hyperventilation and talk preparation task.

Focusing on stress detection by means of physiological signals, it is necessary to describe which possible signals can be related to stress and their extent. It is not common to focus only on one certain physiological feature as done by many researchers, in order to obtain further and more precise information about the state of mind. A multi bio-signals system was created by Feng Tsao Sun et al using ECG, GSR and accelerometer to detect the stress in human body [7]. The stress detection system used a wireless system and SHIMMER sensors for ECG, GSR and accelerometer as shown in Figure 2.4. The experiment was conducted using classifiers such as Decision Tree, Bayes Net and Support Vector Machine (SVM).

Figure 2.4: SHIMMER Sensors There are other physiological signals of different nature that can indicate stress levels like pupil diameter (PD) providing precise information about frame stress. When an individual is under stress, the PD is wider. Research works were presented by F. Mokhayeri et al that contained not only PD but also ECG \using the Fuzzy SVM [8]. The main requirement for this system is to have a high performance system [8]. Table 2.1 gathers a summary on the signals involved in stress detection within recent literature.

12

Reference

Physiological Signals Galvanic

Pupil

Electro

Body

Electromyo

Blood

Accelero

Skin

Diamet

cardiog

Tempera

graphy

Volume

meter

Response

er

raphy

ture (BT)

(EMG)

Pressure

(ACC)

(GSR)

(PD)

(ECG)

(BVP)

Jorn Bakker et al [2] Hanne Storm



[22] María Viqueira Villarejo et al [24] H. STORM et al [25] Jacqueline











Wijsman et al [3] Alberto de Santos Sierran et al [4] 

Dhvani Parekh





[6] Feng-Tso Sun







et al [7] 

F. Mokhayeri



et al [8] Jing Zhai et al







[21] Santhosh K V





et al [23] Table 2.1: Literature Review on Physiological Signals Involved in Stress Detection

13

2.2

Stress Detection System

The decision making module is responsible to process the information from the stress detection system and produce results. Since the bio-signals data read from the human body has a large range, a suitable decision making module is needed in order to evaluate the current value of each bio-signals and collectively decide whether the individual is under stress or not. In addition, this system is oriented for real-time application which in most cases causes a reduction in stress detection accuracy. Together with signal processing and feature extraction, decision making module is of great importance in order to give accurate results. A few approaches have been proposed, based on different techniques like SVM, k-NN and Fuzzy classifiers.

2.2.1

Support Vector Machine

Support vector machine (SVMs) have been widely applied to pattern classifications problems and non-linear regressions. SVM also known as “kernel induced feature space” which find the optimal hyper-plane that can minimize the margin between two groups of samples [16]. It is known as regression task which means that the system is trained for value [16]. There are two types of SVM which are linear and non-linear as shown in the Figure 2.5.

14

Figure 2.5: Support Vector Machine Types [16]

These two types of SVM handle the process in a different way based on equation and situation. After SVM classifiers are trained, they can be used to predict future trends. In the stress detector system, it separates the testing data into two classes: SVM is trained as a classifier with a part of the data in a specific data set and then the classifier is trained and used to classify the rest of the data in data set. SVM can deal with classification problem well [7]. However, SVM is ineffective as it needs more elaboration of kernels.

2.2.2

K-Nearest Neighbor

K- Nearest neighbor (k-NN) algorithm is one of the artificial neural networks as shown in Figure 2.6. It is a simple method used to measure the distance between the cases [17]. K-Nearest Neighbor classifier is computationally most demanding during the classification. The key issues involved in training this model includes setting are the variable K and the type of distant metric (Euclidean measure) as shown in Equation (1)

15

[17]. The number of nearest neighbors (K) should be based on cross validation over a number of K settings. A good rule-of-thumb is that the number k should be less than the square root of the total number of training patterns.

Dist ( X , Y ) 

D

 ( Xi  Yi)

2

(1)

i 1

Figure 2.6: Artificial Neural Network

The process of k-NN starts from storing all input data into two sets which are the training set and the test set. Then, it will search for the K nearest patterns to the input pattern using a Euclidean distance measure. As for classification, the confidence for each class is computed as 𝐶𝑖 𝐾

(2)

where Ci is the number of patterns among the K nearest patterns belonging to class i

The classification for the input pattern is the class with the highest confidence. Disadvantages of k-NN are extensive use of memory and classification is slow compared to others classifications.

16

2.2.3

Fuzzy Logic

Fuzzy is a modeling of imprecise concepts. That’s why it is called fuzzy. An automatic decision algorithm must elucidate a certain output accordingly to specific inputs. Fuzzy decision algorithm allowed a definite output to be produced. Given fuzzy input, it is the modeling of expert system or knowledge. Fuzzy logic allows intermediate values to be defined between conventional evaluations like true/false, yes/no, high/low, etc [19]. The possible interferometric coherence g values are the set X of all real numbers between 0 and 1. Fuzzy logic gives a decision based on the rules. Figure 2.7 shows the difference between two systems which are fuzzy and distinct.

Figure 2.7: Example of A Distinct Function (above) and A Fuzzy Function (below)

Fuzzy logic has two characteristics of sets which are crisp sets and fuzzy sets [18-19, 25]. Crisp set can be described by character of function meanwhile fuzzy sets are described by membership of function as shown in Figure 2.8.

17

(a) Crisp Function

(b) Fuzzy Function Figure 2.8: Characteristic of Fuzzy Logic.

Fuzzy logic using membership function was chosen for this project because it is suitable for the stress detection system. There are four types of membership functions: Trapezoid, Gaussians, triangular and singleton as shown in Figure 2.9 [25]. Basically, trapezoid is the most popular type of function. This is because it is easy to implement in most software available today. Inside each of membership, they have four basic concepts too. They are support, core, a-cut and height. This will be further discussed in chapter 3.

18

Figure 2.9: Type of Membership Function.

As a conclusion, Table 2.2 shows the summary of algorithms used by researchers in this chapter.

Algorithm Bayes

k-NN

Reference

Fisher

Fuzzy

Support

Decision

Least

Logic

Vector

Tree

Square

Machine

Linear

(SVM)

Classifier Jacqueline







Wijsman et al [3] 

Alberto de Santos Sierran et al [4] Feng-Tso Sun et al





[7] F. Mokhayeri et al



[8] Table 2.2: Summary of Decision Making Algorithm used by Researchers



19

CHAPTER 3

RESEARCH METHODOLOGY

3.1

Introduction

This project has six main sections in order to build the prototype of the stress detector. The six sections are literature review, design and build the sensors prototype, testing the operation of each sensor as well as the combination of three sensors to make a stress detection system, the calibration process to gather the results, presentation and demonstration of the project. These elements are very crucial to make sure that the objectives of this project are achieved.

This project discusses about what is psychological determinants of a stress response in humans, how it can be measured and the result that is obtained from analysis. The detector has three sensors which are pulse rate, galvanic skin resistance and temperature sensor. And it detects the signal from human body based on measuring the three physiological signals which are body temperature, galvanic skin resistance and pulse rate at the fingertip.

These three biological signals for each individual are processed for noise removal, amplification etc and combined to be saved as a stress template for that

20

individual. Each participant’s biological signals are measured as the participant undergoes a few psychological tests to measure their anxiety level and store as stress template. This system inherits several characteristics from biometric system such as feature extraction.

Feature extraction is required so that the system can create a profile in order to contrast whether a user is actually under stress. This template is based on specific characteristics extracted and adjusted for unique physiological characteristics of each participant. The implementation involves an adaptive-network based on fuzzy inference system. The data from the sensor will be sent to the Analog Digital Converter (ADC). Fuzzy logic algorithm is carried out to provide a fuzzy decision making system adapted to the specific data. Lastly, the Arduino Uno board is connected to the monitor using USB blaster to show the output of the system. The block diagram is shown in Figure 3.1.

Figure 3.1: Block Diagram of Stress Detection System

The first prototype of the stress detector was built using just one sensor which was the temperature sensor. This prototype was built to work with the temperature data

21

being sent for processing to an AVR board connected directly to the sensor. The second version of the prototype combined the temperature sensor with the Arduino Uno board while the third prototype used Altera’s DE1 FPGA Development Kit. The fourth prototype of the stress detector collected data from the temperature sensor and pulse rate sensor to be processed by the Arduino Uno board without GSR. The fifth prototype integrated fuzzy logic decision making module with the bio-signal sensors’ readings.

3.2

Sensor Operating Principles

3.2.1 Temperature Sensor (LM35)

LM35 as shown in Figure 3.2 was used as it has precision integrated-circuit temperature sensors, whose output voltage is linearly proportional to the Celsius (Centigrade) temperature. The LM35 thus has an advantage over linear temperature sensors calibrated in ° Kelvin, as the user is not required to subtract a large constant voltage from its output to obtain convenient Centigrade scaling.

The LM35 does not require any external calibration or trimming to provide typical accuracies of ±¼°C at room temperature and ±¾°C over a full -55 to +150°C temperature range. Low cost is assured by trimming and calibration at the wafer level. The LM35's low output impedance, linear output, and precise inherent calibration make interfacing to readout or control circuitry especially easy. It can be used with single power supplies, or with plus and minus supplies. As it draws only 60 µA from its supply, it has very low self-heating, which less than 0.1°C in still air. The LM35 is rated to operate over a -55° to +150°C temperature range, while the LM35C is rated for a -40° to +110°C range (-10° with improved accuracy).

22

Figure 3.2: Temperature Sensor

3.2.1.1

Temperature Sensor with ADC Chip

The temperature sensor consists of generic thermistor and additional circuitry. In order to build a temperature sensor, an ADC is needed to convert the analog temperature input to digital output and display it on the LCD panel. As shown in Figure 3.3, to build this sensor, it also has a few phases. Phase one, temperature sensor which is LM35 is connected to ADC0804 and the result will be displayed on the DE1 Board as shown in Figure 3.5.

Figure 3.3: LM35 with ADC0804

23

The ADC0804 is an 8 bit successive approximation analog to digital converter. The pin configuration of the ADC0804 is shown in Figure 3.4. As shown the package type is the 20 pin dual in line (DIP) package. The analog input voltage range is 0 to VCC volts. The supply voltage input is represented by VCC. It’s maximum is 6.5 volts. The ADC0804 has two grounds: analog ground (A GRD) and digital ground (D GRD). These two separate grounds ensure that noise from analog circuits does not leak into the digital circuits within the chip. It consists of 4 digital control inputs: CS, WR, INT and RD. The analog inputs, Vin+ and Vin, are differential. When the analog to digital conversion of the analog input is complete, the results can be read from the outputs, D0, D1 …D7. These are the tri-state buffered and the converted data is accessed only when CS and RD is forced low. The output voltage:

𝐷𝑜𝑢𝑡 =

𝑉𝑖𝑛 𝑆𝑡𝑒𝑝 𝑆𝑖𝑧𝑒

(3)

An ADC0804 has a resolution of 8 bits, the range is divided into 2^8=256 steps (from 0 – 255). But there are 255 quantization levels. Figure 3.4 shows the architecture of the ADC0804. 𝑉

𝑆𝑡𝑒𝑝 𝑆𝑖𝑧𝑒 = 2𝑛𝑐𝑐 −1

(4)

Where the Vcc is the reference voltage of ADC with n-bit resolution. Below is Table 3.3 in which Resolution versus Step Size for ADC (if Vcc = 5V) is provided

n-bit

Number of Steps

Step Size(mV)

8

2^8 = 256

5/255= 19.61

10

2^10 = 1024

5/1023 = 4.89

12

2^12 = 4096

5/ 4095 = 1.22

16

2^16 =65536

5/65535 = 0.076

Table 3.3: Resolution versus Step Size of ADC0804

24

Figure 3.4: Architecture of ADC0804

Output from the ADC will be connected to GPIO in DE1 and then the results are displayed at the seven segment display. For the first prototype of this system, the temperature sensor along with ADC0804 was connected to the General Purpose Input Output (GPIO) of the DE1 Board and the LEDs were blinking if it was in room temperature as shown in Figure 3.5.

Figure 3.5: First Prototype of Stress Detector with Temperature Sensor on DE1 FPGA board

25

3.2.1.2

Temperature Sensor with AVR Board

The temperature sensor was first built with microcontroller ATMEGA32 to verify the functionality of the circuit and the calculations. The architecture of the Atmega32 chip is shown in Figure 3.6.

Figure 3.6: Atmega32 Architecture

There are mainly two types of output displays which are the Seven Segment Displays and Liquid Crystal Displays (LCD). Even though LCD is more sophisticated than Seven Segment Display, it is easier to use and program. In this project, the 20 x 4 LCD is used with Atmega32 microcontroller to build temperature sensor using the LM35 chip. C Programming language was chosen as the programming language for LCD as it is more powerful and easier to use compared to Assembly Language. The findings underscore the advantages of using LCD and the correct method to display character, number or symbol on LCD.

Atmega32 Microcontroller has a built-in ADC which is located on PORT A. The ADC in Atmega32 has 10-bit resolution which provides a smaller step size. For a 10-bit

26

ADC, the step size shown in equation 3. In order to stabilize Vref and increase the precision of ADC, an additional circuit is required as shown in Figure 3.7..

Figure 3.7: ADC Recommended Connection

The input temperature reading was displayed on the 20x4 LCD panel as shown in Figure 3.8

Figure 3.8: First Prototype Stress Detector with Atmega32 and LCD Panel

A long process of debugging and troubleshooting was done to achieve the best result. One of the problem faced was the AVR software did not stop debugging the software as long as the computer was connected with the AVR target board and JTAGICE MKII debugger. This problem caused the board to be unable to function

27

correctly. Another example was that, the wire of male to male connection between the LCD and the board has to be checked to ensure precise connection or else it will lead to error in the results.

3.2.1.3 Temperature Sensor with ARDUINO UNO board

The temperature sensor has three pins that were connected directly to the Arduino Uno board. They are the 5V, GND and analog output pins as shown in Figure 3.9. In the project, the output pin from temperature sensor was connected to the A1 pin of the Arduino Uno board.

Figure 3.9: LM35 Connected to Arduino Uno board

28

3.2.2

Pulse Sensor

The Arduino Uno pulse rate sensor shown in Figure 3.10 was chosen for this project because it can be used to monitor heart rate of patient and athlete. The result can be displayed on a screen via the serial port and can be saved for analysis. The entire system has high sensitivity, low power consumption and is very portable. It has three wires which are red, black and purple wire. The red wire is used as voltage supply for the sensor. This sensor needs wide power DC supply which is 3 to 5 Volts. For this project, the voltage will be 5 Volts for the entire sensor. Black wire is for the ground and purple wire for the output signal.

The sensor works with current of 6 to 7 mA and has high sensitivity. It can also be used at the earlobe and the length of ear clip wire to the sensor is 120cm. This sensor has better noise filter than other sensors in the same price range available in the market.

Figure 3.10: Arduino Pulse Rate Sensor

29

3.2.3.1

Pulse Sensor with Arduino Uno Board

The Arduino Uno is a microcontroller board based on the ATmega328. It has 14 digital input/output pins (of which 6 can be used as PWM outputs), 6 analog inputs, a 16 MHz ceramic resonator, a USB connection, a power jack, a header, and a reset button. It contains everything needed to support the microcontroller and works by simply connecting it to a computer with a USB cable or by supplying power it to with an AC-to-DC adapter or battery to get started. Its operating voltage is 5V or 3.3V based on the project. For recommended power supply, the input voltage can be in the range of 7V to 12V but the limit is a maximum of 20V [31]. The ATmega328 has 32 KB memory (with 0.5 KB used for the boot loader). It also has 2 KB of SRAM and 1 KB of EEPROM (which can be used fro read and write process using with the EEPROM library). The board layout and schematic design of Arduino Uno Board is shown in Figure 3.11 and 3.12 respectively.

Figure 3.11: Arduino Uno Board

30

Figure 3.12: Schematic of Arduino Uno

First and foremost, two separate IDE’s are required in order to properly use the pulse sensor which is the Arduino IDE and Processing IDE. The Arduino IDE is used to write and verify the code and to download the code to the board while the Processing IDE is used to display the output visually [30]. The schematic circuit of pulse sensor is shown in Figure 3.13.

Figure 3.13: Schematic of Pulse Sensor

31

The previously mentioned sensors are able to detect the bio-signals from the human body, filter and amplify the signals and display the reading correctly. The stress detector then runs a stress evaluation algorithm to measure the stress level score of the patient and display the results on the monitor.

3.2.3 Galvanic Skin Resistance (GSR)

The skin conductance sensor is measured from the galvanic skin response which measures skin conductivity and amplifies the signal before feeding it to the system. Early stage to build this sensor was to blink the LED first at the DE1 Board. The circuit is show in the Figure 3.14.

Figure 3.14: GSR Circuit Prototype

The LED was blinking as it should be. The next stage is to take the real measurement of GSR and display it on the DE1 Board. Unfortunately, the GPIO inside the board is very complex to use and difficult to interface it between the board and the sensor.

32

Then, to make GSR sensor work, Arduino Uno board was used to get the data of the user. The circuit was built and interfaces it with Arduino. Since Arduino already have ADC inside it, therefore the GSR circuit was purely op amp to enhance the signal from the user. The circuit is shown in Figure 3.15.

Figure 3.15: GSR Circuit using LM324N

3.3

Fuzzy Logic Stress Detection System

A fuzzy set theory corresponds to fuzzy logic and the semantics of fuzzy operators can be understood using a geometric model. The geometric visualization of the fuzzy logic will give us a hint as to the possible connection with neural networks. Fuzzy logic can be used as an interpretation model for the properties of neural networks, as well as for giving a more precise description of their performance. Fuzzy logic can also be used to specify networks directly without having to apply a learning algorithm. An

33

expert in a certain field can sometimes produce a simple set of control rules for a dynamic system with less effort than the work involved in training a neural network.

Fuzzy logic-based control system is an expert system that utilizes fuzzy logic algorithm to manipulate qualitative variables. The characteristics of the system are usually expressed in the form of expression language with logical implications such as an if-else statement. The decision making module for the stress detection system is created using fuzzy logic with twenty-seven rules to measure the user’s stress level. It has different value of the sensor to indicate stress from the user. For example, if the body temperature is less than or equal to 30 degree Celsius, pulse rate is greater than or equal to 110 bpm, GSR is greater than or equal to 800 microSiemens, the user is classified as under stress. Three levels of stress are labeled as Low stress, Medium stress and Stress. Each level can be overlapped with another level and create fuzziness in the system. Therefore, the rules are important to make sure the system can overcome the fuzziness and come up with the correct output.

3.3.1

Fuzzy Logic in Matlab

Fuzzy inference is the process of formulating the mapping from a given input to an output using fuzzy logic. The mapping then provides a basis from which decisions can be made, or patterns discerned. The process of fuzzy inference involves all of the pieces that are described in membership functions, logical operations, and rules. First step was to do the membership function for the stress detection system. The Membership Function Editor is used to define the shapes of all the membership functions associated with each variable. In the stress detection system, temperature, heart rate and galvanic skin resistance are the variables and need the membership function to get the rules of the system like shown in Figure 3.16.

34

Low

Low

Low

Medium

High

Medium

Medium

High

High

Figure 3.16: Membership Function for Fuzzy Logic

The membership functions for the output variable is shown in Figure 3.17, stress indicator was also created. The output scale was set to be a point between 0 and 1.0. For example, if the output is 0.5, it will become medium stress while 0.5 above will be labelled as stress. Initially, the not_stress membership function will have the parameters [0 0.165 0.33], the medium_stress membership function will be [0.3 0.5 0.7], and the stress membership function will be [0.66 0.816 1.0]. Each level of stress has its own level too. For example, it has low, medium and high. It describes the level of each stress less than one and the accuracy has two decimal points.

35

Figure 3.17: Output Variable of Stress Indicator

Then, the fuzzy rules of the system need to be created in the next step. The Rule Editor is for editing the list of rules that defines the behavior of the system. It uses IF ELSE rule based system. The stress detection system used twenty seven rules to indicate the stress level as shown in Table 3.4.

HR L

M

H

L

NS

MS

S

M

NS

NS

MS

H

NS

NS

MS

TEMP

Table 3.4: Rules of Stress Detection System

36

3.3.2

Fuzzy Logic Decision Making Module on Arduino IDE

The Arduino software has evolved from a standard hardware description language to a full-featured Integrated Development Environment (IDE). It offers many useful features for hardware design. One of its useful feature is that it allows different levels of abstraction to be mixed in terms of artificial intelligence or behaviour code and it also has stimulus module to create trigger signals to test the design. Implementation of the fuzzy logic decision making module on Arduino IDE is different from implementation on Matlab. In Matlab, the membership function was done first, followed by the creation of the rules of the system. On the other hand, in Arduino IDE the rules must be set up first by writing the code in Arduino. Simulation can be done to see correctness based on the output.

In conclusion, three sensors were interfaced with Arduino Uno to get the data of the bio-signals. Since physiological signals in human body have a lot of noise, this caused interference and there were major obstacles in the integration of the three sensors due to high sensitivity of the pulse sensor and to make sure these three sensors can be read simultaneously when connected to the Aduino Uno Board.

37

CHAPTER 4

RESULT AND DISCUSSION

4.1

Introduction

In this chapter, the results obtained in the project are discussed in details. Pulse rate and temperature measurement was displayed using serial connection on PC monitor. However, GSR readings cannot be captured as the problem will discuss in Problem section.

4.2

Results and Analysis

Figure 4.1 below shows the serial monitor function processed by the Arduino IDE. It can be separated into three sections; the first part is reading for beat per minute (BPM) , second part is reading for temperature and last part is for value of stress.

38

Pulse Rate in bpm

Temperature in Celsius

Level of stress in decimal point

Figure 4.1: The Serial Monitor of the PC Showing the Result

4.2.1

Prototype Design

Full prototype for the pulse rate sensor is successfully developed. This prototype is responsible to receive the date from the user simulator as shown in Figure 4.2.

Figure 4.2: Prototype Design for Stress Detector

39

4.2.2

Body Temperature Sensor Result’s

Body temperature measurement is displayed in the box. However, the body measurement differs among different people because it depends on the individual activities, metabolism and conditions. Figure 4.3 shows the body temperature measurement as measured by the temperature sensor and displayed on monitor. Meanwhile Figure 4.4 shows the body temperature measurement output displayed in the serial monitor continuously.

Figure 4.3: Body Temperature Displayed

40

Figure 4.4: Temperature Displayed in Serial Monitor of Arduino Uno board

4.2.3

Pulse Rate Sensor

Once the pulse sensor is functioning, the pulse data can be observed by running the source code that was opened in the processing IDE. So, the code will be split into two: arduino for getting the data from the sensor and processing to make the GUI as shown in Figure 4.5. Text file also can be saved by creating a code to keep all the previous and current output values in a .txt file as shown in Figure 4.6.

41

Figure 4.5: Processing of Pulse Rate

Figure 4.6: Text File (.txt) of the BPM

42

4.3

Problem and Challenges

Although the readings from the pulse sensor already was already amplified and filtered by the developers, the signal still needs to be filtered again in the programming part. This is due to human pulse rate consists of a few signals that indicate the pulse rate. Therefore, the noise produced can be slightly reduced by grounding all the connections properly.

For the body measurement, LM35 cannot measure body temperature accurately because it takes time to respond with the heat produced by the human body. However, LM35 is a suitable component to use in the project in order to reduce the cost in hardware implementation. Besides, LM35 is a temperature sensor used in various projects because it measures the temperature in degree Celsius.

As for GSR, there were difficulties to integrate it with Arduino. This is due to some problems which is the value parameter of GSR quite small (microSiemens), therefore, it need to have special amplifier that can amplify the signal from human body. Besides, the prototype of GSR itself also causes the PC and Arduino to hang after 5 minutes of being connected.

4.4

Discussion

Several tests were conducted in order to change the emotional state and stress level of the subjects. Knowing the test situations when the person should be stressed and the ones where he / she should not, each kind of data has to be analyzed separately. Four

43

subjects aged between 21 and 24 (2 women and 2 men) were subjected to the tests. Individuals attached the sensors to their fingers acquiring at the same time body temperature, pulse rate and GSR signals to be recorded by the stress detector system.

All the users have done the following tests: mathematical operations, breathing deeply and reading as fast as possible. The task is to provoke positive stress stimuli on individuals. Each experiment was divided into three tasks which are described below: a) Breathing deeply: User was required to breathe deeply for 2 to 5 seconds. It is in this moment when the parameters are sampled during 90 seconds representing an obvious behavior of bio-signals under non-stress situation. b) Mathematical operations: User was required to solve mathematical problems involving integral operation. The parameters were sampled in 5 minutes for two times. c) Reading a loud as fast as possible: Sample of the user’s bio-signal was taken in 2 to 3 minutes depending on the sentence that the user was reading.

Mathematical

Breathing Deeply

Reading a loud as fast

Operation User

Temperature

Pulse

as possible GSR

Temperature

Rate

Pulse

GSR

Rate

Tempera

Pulse

GS

ture

Rate

R

A

30.0

121

816

31.0

91

700

29.9

147

853

B

29.5

114

733

31.2

88

665

28.8

155

888

C

29.8

103

801

30.1

73

720

30.1

161

799

D

32.8

133

689

31.1

81

650

29.4

138

847

Table 4.1: Result of User’s Bio-signals

The main part of this project involved the design of a device which is able to detect body temperature and pulse rate in different situations. It also includes an initial threshold between being stressed and being relaxed. With the different data, it can be

44

observed that signals increase or decrease depending on the mental effort and the situation of the user.

Each signal, mean and standard deviation was calculated for each set. So, it will create a template for each user. This mean and standard deviation will be calculated by the fuzzy logic module to indicate the stress level of user.

For the pulse rate is set to 200 beat per minutes (bpm) for maximum because for Malaysian’s citizens, they cannot reach 200 bpm but the value can be changed according to the situations. Pulse sensor is always in positive value range thus Arduino Uno can read the data effectively.

The output of pulse sensor and temperature sensor is connected to A0 and A1 pins respectively at Arduino Uno board. The data from the pulse and temperature measurement is read by the Arduino Uno and the result also can be also displayed on the serial monitor. Serial monitor is a monitor that is already attached to the Arduino software and that is the reason why Arduino can be a stand-alone system without interfacing with other graphical user interface (GUI).

Temperature sensor (LM35) is used in the project to replace generic body temperature sensor because they are very expensive compared to the LM35 sensor. Also, LM35 is easily available in market while body temperature sensor is hard to find and takes extra time for ordering and delivery. However, LM35 cannot measure the body temperature accurately because the measurement is just made by touching the head of the LM35 sensor with fingertips only and ambient temperature has an effect here.

45

CHAPTER 5

CONCLUSION

5.1

Conclusion

Stress detection system can be used in medical applications since it can provide long term, real time and non-obstructive medical supervision to the user. Therefore, stress detector enhances the quality of life and while reducing the cost of expensive health monitoring practices. The user can also be monitored continuously even though they stay at home or travel to other places away from the doctors, nurses or caregivers.

As a conclusion, a prototype of stress detector has been successfully developed. Based on the results obtained from the project, it showed that the project achieved the proposed objective. Pulse rate, GSR and body temperature measurement can be monitored through laptop or personal computer. The user’s pulse rate, GSR and body temperature can be monitored remotely anywhere and anytime. The development of intelligent decision making system using fuzzy logic has been successfully designed. It is designed to collect the data from the user and process it to give the value of the stress level. Fuzzy logic is capable of recognizing whether the subject is under stress or not based on the readings from the physiological sensors. Furthermore, the signals provided by the stress detection system contain real time information on the state of mind of the

46

individual. This algorithm automatically helps the user to get their stress level under control and take a proactive action to seek medical attention in case of danger of health risks. Finally, the current status of patient can be seen easily anytime, anywhere by the medical professionals. So, this project has successfully implemented the fuzzy logic as decision making module. Apart from that, the device is designed to use low cost equipment and create a real time application.

Besides, one of the main contributions of this work consists of the proposal of a stress template that can predict the stress level of an individual based on analysis and calculations carried out on the previously collected database of user physiological signals. This stress template enables the system to accurately predict the stress level of all new users based on their physiological readings from the same bio-signals.

5.2

Future Work and Recommendations

In order to commercialize the device for public usage, some improvements need to be considered. Therefore, for the future works, more vitals parameters should be added to make it more accurate and valuable to the user. For example, pulse oximeter and blood pressure can be added to make the device more precise and accurate.

Another improvement that can be made in this project is replacing LM35 with the specific temperature sensor for human body. This might help to make it more functional since it has reduced noise and instant capture of the temperature.

Besides, an alarm sensor can be implemented on the device to give a warning to the users if their condition is critical and dangerous to the health. Thus, special attention can be given to the user.

47

REFERENCES

1. Fernand-Sequin Research Centre of Louis-H. Lafontaine Hospital Quebac, Canada. Centre for Studies on Human Stress, 2007 2. Jorn Bakker, Mykola Pechenzkiy and Natalia Sidorova,. What’s your current stress level?Detection of stress pattern from GSR sensor data. Department of Computer Science Eindhoven University of Technology 3. Jacqueline Wijsman, Bernard Grundlehner, Hao Liu, Hermens and Julien Penders, Towards Mental Stress Detection Using Wearable Physiological Sensors. 33rd Annual International Conference of the IEEE EMBS. 2011 4. Alberto de Santos Sierra, Carmen Sanchez Avila, Javier Guerra Casanova and Gonzalo Bailador del Pozo, A Stress-Detection System Based on Physiological Signals and Fuzzy Logic. IEEE Transactions on Industrial Electronics. VOL. 58, NO. 10, OCTOBER 2011 5. Sanjay A. Patil and John H. L. Hansen, Enhancing In-Vehicle Safety via Contact Sensor for Stress Detection. ICVES 2009 6. Dhvani Parekh, Designing Heart Rate, Blood Pressure and Body Temperature Sensors for Mobile On-Call System. EE 4BI6 Electrical Engineering Biomedical Capstones. Paper 39,2010 7. Feng-Tsao Sun, Cynthia Kuo, Heng-Tze Cheng, Senaka Buthpitiya, Patricia Collins and Martin Griss, Activity-aware Mental Stress Detection Using Physiological Sensors. Carnegie Mellon University 8. F. Mokhayeri, M-R. Akbarzadeh-T and S.Toosizadeh, Mental Stress Detection using Physiological Signals based on Soft Computing Techniques. 18th Iranian Conference on BioMedical Engineering, 14-16 December 2011

48

9. Christine Belinda, The basics for Caring fir Children In Your Home, Penn State Extension, 2011 10. Understanding and managing stress, Australian Psychological Society, 2012 11. Explain. Manging stress. The Patient Education Institute. 1995-2010\ 12. Eric Zander. An Introduction to autism. Stockholms lans sjukvardsomrade, 2004 13. Louisa M. T. Silva and Mark Schalock, Autism parenting Stress Index: Initial Psychometric Evidence. Springer Science + Business Meadia, 2011 14. Calvin J. Hobel, Amy Goldsten and Emily Barret,, Psychological Stress and Pregnancy Outcome. Clinical Obstertrics and Gynecology, vol 51, Number 2, 333- 348, 2008 15. Christine dunkel Schetter. Psychological Science on Pregnancy: Stress Processes, Biopsychosocial Models and Emerging Research Issues. Annu Rev Psychol, 2011 16. Dustin Bowell. Introduction to Support Vector Machine, 2002 17. Paul lammertsma. K-nearest-neighbour algorithm 18. R. Rojas. Fuzzy Logic. Springer-Verlag, Berlin, 1996 19. Fuzzy Logic Fundemental, 2001 20. Jing Zhai and Armando B. Bareto, Instrumentation for Automatic Monitoring of Affective State in Human-Computer Interaction. Electrical and Computer Engineering Department Florida International University 21. Hanne Storm, Changes in skin conductance as a tool to monitor nociceptive stimulation and pain. Wolters Kluwer Health ,Lippincott Williams & Wilkins, 2008 22. Santhosh K V and Gopaliah, A Low Cost Human Body Parameters Measuring Device. Electrical Engineering, National Institute of Technology, Silchar, India 23. Maria Viqueira Villarejo, Begona Garcia Zapirain and Amaia Mendez Zorilla, A Stress Sensor based on GSR controlled by ZigBee. ISSN 1424-8220, 2012 24. H. Storm, K. Myre, M. Rostrup, O. Stokland, M. D. Lien and J. C. Reader, Skin Conductance correlates with Perioperative Stress. Acta Anaesthesiol Scand 2002; 46: 887–895 25. Micheal R. Berthold, Tutorial: Fuzzy Logic, Konstanz University, June 2005

49

APPENDIX

Programming Source Code

// VARIABLES int pulsePin = 0;

// Pulse Sensor purple wire connected to analog pin 0

int blinkPin = 13;

// pin to blink led at each beat

int fadePin = 5;

// pin to do fancy classy fading blink at each beat

int fadeRate = 0; // used to fade LED on with PWM on fadePin

int tempPin = 1;

// lm35

float temp;

// these variables are volatile because they are used during the interrupt service routine! volatile int BPM;

// used to hold the pulse rate

volatile int Signal;

// holds the incoming raw data

volatile int IBI = 600;

// holds the time between beats, the Inter-Beat Interval

volatile boolean Pulse = false;

// true when pulse wave is high, false when it's low

volatile boolean QS = false;

// becomes true when Arduoino finds a beat.

volatile int sample_number = 0; void setup(){

50

pinMode(blinkPin,OUTPUT);

// pin that will blink to your heartbeat!

pinMode(fadePin,OUTPUT);

// pin that will fade to your heartbeat!

Serial.begin(115200); // we agree to talk fast! interruptSetup();

// sets up to read Pulse Sensor signal every 2mS

} ISR(TIMER1_COMPB_vect) { if(sample_number < 100 ) { if(sample_number & 0x01) { ADMUX = 0x41; } else { ADMUX = 0x40; BPM = analogRead(pulsePin); } sample_number++; } } void loop(){ sendDataToProcessing('S', Signal); if (QS == true){ fadeRate = 255;

// send Processing the raw Pulse Sensor data

// Quantified Self flag is true when arduino finds a heartbeat // Set 'fadeRate' Variable to 255 to fade LED with pulse

sendDataToProcessing('B',BPM); // send heart rate with a 'B' prefix sendDataToProcessing('Q',IBI); // send time between beats with a 'Q' prefix QS = false; }

// reset the Quantified Self flag for next time

51

ledFadeToBeat(); analogRead(0); delay(100); Serial.println(BPM); delay(100); // take a break analogRead(1); temp = analogRead(tempPin); temp = (5.0 * temp * 100.0)/1024.0; Serial.print(temp); Serial.print(" Celsius, ");//send the data to the computer delay(100); //wait one second before sending new data if (Serial.available() > 0) { int BPM = Serial.read(); temp = Serial.read(); } delay(10000); } void ledFadeToBeat(){ fadeRate -= 15;

// set LED fade value

fadeRate = constrain(fadeRate,0,255); // keep LED fade value from going into negative numbers! analogWrite(fadePin,fadeRate); }

// fade LED