Arduino Stress Dectector Seminar Report
Arduino Stress Dectector Seminar Report
submitted
Bachelor of Technology
in
Electronics and Communication Engineering
( JNTUA, Anantapuramu)
by
S Malik Basha 192N5A0406
BRINDAVAN
INSTITUTE OF TECHNOLOGY & SCIENCE (BITS-KNL)
NH-7, PEDDATEKUR, KURNOOL - 518218
CERTIFICATE
This is to certify that the Technical Seminar entitled Arduino Stress Detector is
the bonafide record of the Technical Seminar carried out under my Guidance and
Supervision by
Stress detector, is a system that measures stress level of a human being who is known to be
under stress. This method has the potential to be precise and smoother. Stress brings negative
consequences such as decreases in level of concentration, mental health issues such as anxiety and
depression as well as ineffective ways of coping, such as substance abuse. In the market, there are
smart phone’s apps where people can hold a finger to the camera, which will then detect slight changes
in color related to blood flow. If a person is able to recognize when they get stress and what they get
stress from, it will be helpful for them to find ways to relieve it. It is our intention to address these gaps
in the market and create a system that will be beneficial to a great many patients and health care
practitioners by better assisting them by taking control of an elevated physiological response that has
many negative health consequences. Through this project we aim to understand the various conditions
that lead to stress, find suitable parameters to measure and detect it using arduino and then immediately
present it to the user through an android app. This project describes our efforts and results in answering
these questions. The most popular physiological markers of stress are as follows: Galvanic skin
response (GSR); Electromyogram (EMG); Skin temperature; ECG; HRV.
I
INDEX
TABLE OF CONTENTS
NAME OF CONTENTS PAGE NO.
ABSTRACT I
TABLE OF CONTENTS II
LIST OF FIGURE IV
CHAPTER -1
1. INTRODUCTION 1
1.1 Project Overview 1
1.1.1 Purpose 1
1.1.2 Objectives 1
1.1.3 System Overview 2
CHAPTER-2 4
2. DESIGN
2.1 Design Procedure 4
2.1.1 Stress Detector 4
CHAPTER-3 10
3. DESIGN VERIFICATION
CHAPTER-4 13
4. SURVEY OF EXISTING SYSTEM
II
4.1 Stress detection in working people 13
CHAPTER-5 14
5. IMPLEMENTATION PLAN
5.1 Block Diagram 14
CHAPTER-6 17
6. HARDWARE USED
CHAPTER-7 21
7. FUTURE SCOPE N
CHAPTER-8 22
8. CONCLUSION
CHAPTER-9 23
9. REFERENCES
III
LIST OF FIGURES
IV
INTRODUCTION
CHAPTER 1
1. INTRODUCTION
1.1.1 Purpose :
Certain amount of stress is necessary for our lives, but too much stress
brings negative consequences such as decreases in level of concentration, mental
health issues such as anxiety and depression as well as ineffective ways of coping,
such as substance abuse. Most people do not know when and what situations they get
stress from. Therefore, we are designing a system that can daily record a person’s
stress level and time and help the user with regulated breathing as a way of reducing
their momentary stress. On the market, there are smart phone’s apps where people can
hold a finger to the camera, which will then detect slight changes in color related to
blood flow. With these apps, users can purchase other apps that direct the user
towards stress reduction techniques. These solutions, however, do not continuously
record stress level. If a person able to recognize when they get stress and what they
get stress from, it will be helpful for them to find ways to relieve it. There are also
continuous stress detection devices, such as stress dots but they don’t provide the user
with a way of relieving there momentary stress. It is our intention to address these
gaps in the market and create a system that will be of benefits to a great many patients
and health care practitioners by better assisting them by taking control of an elevated
physiological response that has many negative health consequence.
1.1.2 Objectives :
Our goal is to create and combine a continuous monitoring device and stress
management device into one system. Our continuous monitoring device will be
responsible for monitoring the user’s stress level, so that the user will be able to
concentrate on his/her tasks throughout the day and be assured that stress levels are
accounted for. We will also help the user regulate his breathing to relieve any stress
that is detected.
We are making two different devices for detecting stress and one controlling
device. The first device is detecting changed color from stress dots and second device
is detecting user’s heartbeat rate. The stress dots use liquid crystals to detect any
change in skin temperature. A decrease in blood flow from the extremities is a result
from a stressed state. This decreased blood flow causes a temperature drop. Since
stress dots, however, can get affected by room conditions, such as temperature, and
may change the color, we built a heartbeat detecting device to give more accurate
results to users. This is a small and portable device, so user can check their stress
anytime and anywhere.
The controlling device, our Arduino, decides whether user is on stress level or
not. If a stressed state is detected by the photodetecting circuit the vibrator will turn
on, alerting the user of a stressed state. The second device detects heartbeat and it will
be applied by the user to confirm that a stressed state is apparent, if the heartbeat is
above 90 beats per minute the metronome will turn on, providing the user with means
to regulate his breathing. When user is in the stress level, it will record the time that
the stressed state is detected. Also, it sends heartbeat rate output to 7-segments and
shows on the screen.
On the first device, the photodetector, when a user gets stressed the stress dot
will change color and the LED light will magnify the changing of color of stress dots.
The resulting color change will be detected by the photodiode. Each color has
different voltage, so photodiode will send an output voltage dependent on the color to
the microcontroller (Arduino). The microcontroller will send an output voltage to the
vibrator to let the user know that he/she is stressed. Also, it will record a specific time
and stress level inside the memory in microcontroller.
For more accurate results, we will built a second device, which detects stress
by heartbeat rate. When the user’s heartbeat is over certain amount number (90 beats
per minute), it will let user know by rhythmic fixed interval metronome sounds. A
microcontroller(Arduino) will activate the assisted stress management device, when
elevated levels of stress are detected. The user can check their heartbeat rate anytime
they want even though they are not on the stressed level. The microcontroller has
USB connections so it can transport recorded data from device to user’s computer.
CHAPTER 2
2. DESIGN
We use a photodiode and LED light to magnify the color of stress dots and detect the
color. Stress dots change color when a user is stressed. We will use LED light to
magnify the color and photodiode will detect the changed color. Since we use 9V
battery, we will use voltage regulator to regulate to the 5v, to power the LED diode.
When the photodiode detects different voltage levels depending on the color, it will
send the analog output to the microcontroller.
Power Supply :
For our design, we are going to use an alkaline battery, which supplies 9V.
Since the microcontroller’s input voltage range is 7~12V, we decided that 9V alkaline
battery is the most reasonable choice. Other hardware components in our circuit
require 5V, so we stepped down the 9V battery with an LM7805 voltage regulator to
5V.
The stress detecting circuit includes stress dots, an LED, and photodiode. When
the user gets stressed, the stress dot will change color (green = relaxed, red = stressed).
We will magnify the intensity of color by LED, so photodiode can detect changing
color. Red has wavelength about 650nm with 0.225 V across our 1.2Mohm resistor
and green has about 450nm with 0.164V (Results from color detection test). The
photodiode has a breakdown voltage 120V, which is much larger than any voltage we
will be providing. The photodiode analog output sends a signal to microcontroller’s
analog input. Since each analog input of Arduino has 1024 steps from 0 to 5V, both
color voltages can be handled. The amount of voltage needed to operate the
photodiode is 5V. However, our power supply provides 9V. Therefore, we are going
to use a +5V voltage regulator (LM7805) to regulate the voltage.
Figure 2:LM7805
Figure 3: TCRT5000L
a ) Microcontroller
We are going to use “Arduino nano 3.0” for the microcontroller. It has
operation voltage of 5V and input voltage 7~12V. There are total 14 digital input and
output pins and six of them provide PWM (pulse width modulation) output. It has 8
analog input pins, but do not have any analog output pins. It has 40mA of DC current
per input and output pins. It also has 32KB of flash memory with 2KB of SRAM and
1KB EEPROM, which we can read and write with the EEPROM library. It has clock
speed of 16MHZ. When photodiode detects color change of stress dots, each color has
different wavelength and voltage. According to our color detection test, red has about
0.225V and green has 0.164V. When it gets analog signals from photodiode, we need
PWM digital outputs send signal to BJT (bipolar junction transistor) Since Arduino
does not have analog outputs. At the same time, micro controller receives a voltage
signal from the stress detector block and outputs data to the EEPROM. For the time,
we are going to use RTC (real time clock), so microcontroller can record correct time
on the memory. Microcontroller is the most important component in the device. It
decides whether user got stress or not. When user got stressed, it turns on metronome
and vibrator. It also sends heartbeat rate to the 7-segments and showing the average
heartbeat rate to the user. Microcontroller can get power from power supply or from
the computer through USB cable.
b ) Metronome
c ) Vibrator
CHAPTER 3
3. DESIGN VERIFICATION
Power Supply
The power supply was tested to make sure it supplied a regulated 5V from a 9V
battery at varying loads. The 9V battery supplied the input power to the LM7805
voltage regulator. The output pin of the regulator was connected to a 150 ohm
resistor. We varied the resistance in 150 ohm intervals up to a max of 1k ohms and we
used a Digital Multimeter (DMM) to record the voltage across each new resistor. The
voltage stayed at around 5V while the current varied from about 5mA to 50mA.
Photo-detector Circuit
The white LED was first tested. We supplied 5V to the anode of the LED and
observed that sufficient intensity white light was being radiated with forward current.
The complete circuit was then tested to make sure it provided voltages for Green and
Red detection. We tested in a dark room and covered the photodiode sides, so that
most of the light detected would be the light reradiated from the object above. The
objects were placed 1mm above for each trial. The photodiode has a 1.2 Mohm
resistor in series with it so that photo-current rise when a specific color is detected
causes a higher voltage drop across the resistor. A DMM was used to observe the
voltages across the 1.2 Mohm resistors. The average difference between the voltages
of the two colors detected was 0.0618V, which is well within the 0.004V resolution of
the Arduino inputs. Test results are included on Appendix D.
For the heartbeat detecting circuit we sent the output from pin 7 of the
op-amp to the Arduino. Any time a pulse was detected by the LED in the circuit the
Arduino also detected it. The LCD was tested by sending the beats-per-minute from
the Arduino to the display. We found that the same beats-per- minute shown in the
serial monitor of the computer was displayed by the LCD. The actual heartbeat was
checked by counting the number of pulses on our wrist for sixty seconds. The counter
was blind to the LCD display and we found that the number of counted pulses and
that shown on the display only differed by an average of 0.43 beats-per-minute. Test
results are included on Appendix D
Arduino
The Arduino was tested for correct functionality using a grounded input as a
stressed state and voltage high (5V) as a relaxed state input. We wrote a program on
the Arduino to store the time when the user is stressed, and in this measure the RTC
was also tested to make sure it outputs the correct time to the Arduino. When we
grounded the input, the time stored in the EEPROM was written to the serial monitor,
showing that the Arduino was getting the correct time from the RTC and the correct
data was being written and read. When we sent the input high, to simulate a relaxed
state, nothing was being written into memory, proven by a blank serial monitor.
Next we tested the Arduino to make sure it provides the correct output to the
vibrator and speaker. Again ground and 5V were used as inputs to simulate a stressed
state and relaxed state respectively. We observed that as written in our program, the
vibrator buzzed for 1sec with a wait time of 2 sec in between buzzes and our speaker
made 10 beeps every second (to manage a fixed ratio of 4:1:5 sec in:hold:out breaths).
This happened only when the input voltage went low, to simulate a stressed state.
Next we did the same tests, but used the output from our photodetector
circuit as input to test the resolution of the Arduino. Changing the color in a dark
room, showed the correct output, namely when the stressed state was detected the
vibrator and speaker turned on behaving correctly and the correct time was read from
memory and written to the serial monitor.
These tests were done with the Arduino powered by our 5V regulated voltage.
Once the tests were run through the Arduino was again connected to the laptop
through a mini USB to check for correct time storage.
CHAPTER 4
4. SURVEY OF EXISTING
From this research paper it is learnt that even a simple low cost heart rate
monitor device can detect features that change significantly under the influence of
mental stress. Using these results we created a simple stress detection algorithm that is
being integrated in the Lavinia lifestyle counseling mobile application for further
testing and refinement in real-life stress situations. If stress detection proves to be
reliable for larger samples, it will be used in the blood glucose prediction models
developed for diabetics.
4.3 Stress detection using physiological sensors :
CHAPTER 5
5. IMPLEMENTATION PLAN
For the transmittance heart rate sensor a light source is emitted in to the tissue and a
light detector is placed in the opposite side of the tissue to measure the resultant light.
Because of the limited penetration depth of the light through organ tissue the
transmittance heart rate sensor is applicable to a restricted body part such as the
finger or the ear lobe. However in the reflectance heart rate sensor the light source
and the light detector are both placed on the same side of a body part. The light is
emitted into the tissue and the reflected light is measured by the detector. As the light
doesn’t have to penetrate the body the reflectance heart rate sensor can be applied to
any parts of human body. In either case the detected light reflected from or
transmitted through the body part will fluctuate according to the pulsatile blood
flow caused by the beating of the heart.
This module allows you to detect when sound has exceeded a set point you select.
Sound is detected via a microphone and fed into an LM393 op amp. The sound level
set point is adjusted via an on board potentiometer. When the sound level exceeds
the set point, an LED on the module is illuminated and the output is sent low.
CHAPTER 6
6. HARDWARE USED
The hardware tools used include Arduino UNO, Pulse sensor, Temperature sensor
(LM35), moisture sensor. The software tool used in the project is Arduino IDE which
is an open source tool.
Arduino uno
This sensor can be used to test the moisture of human body, when stress is
increased then sweating of human also increased. When sweating is high then level of
stress will be high else stress is low level. Module triple output mode, digital output is
simple, analog output more accurate, serial output with exact reading.
Buzzer
Pulse Sensor
Heart rate can be measured using the sensor which works on the principle of
Photophlethymography. pulse sensor is a well designed plug-and-play heart rate
sensor for arduino. The sensor clips onto a fingertip or earlobe and plugs right into
arduino with some jumper cables.
It also includes an open source monitoring the levels of your pulse in real
time. It can be used by students, artists, athletes, makers and game mobiles
develssopers who want to easily incorporate live heart rate data into their project.
Temperatue Sensor
The LM35 series are precision integrated circuit temperature device with an output
voltage linearly proportional to the centigrade temperature. The LM35 device has an
advantage over linear temperature sensors calibrated in Kelvin, as the user is not
required to subtract a large constant voltage from the output to obtain convenient
centigrade scaling. The LM35 device does not require any external calibration or
trimming to provide typical accuracies of c at room temperature and cover a full 55C
to 150C temperature range.
Lower cost is assured by trimming and calibration at the wafer level.
LCD
A LCD is an electronic display module which uses liquid crystal to produce visible
image. The 16*2 translates a display 16 characters per line in 2 such lines. In this
LCD each character is displayed in 5*7 pixel matrix. This is powered by 5v DC, 92
special characters and 8 custom characters. A LCD is used in computers, calculators,
television set.
CHAPTER 7
7. FUTURE SCOPE
We could fulfilled the all the requirements and verifications that we proposed.
We could successfully magnify the color changed from stress dots. We could detect
accurate heartbeat rate of user. We could send output signals from each device to
microcontroller, and it could store the right current time. When stress is detected,
metronome and vibrator was turn on. As we designed, device is small and portable
size, so user can carry it around to anywhere at any time.
Our future work for this project would be using wireless communication
between each device.
Instead of using wire, we think it will be much useful to use wireless
communication to send output signal to controlling device. To get more accurate
results from first device, we should find a better way to isolate the photodiode from
LED light, since photodiode also get interfered by other visible lights besides
LED.
CHAPTER 8
8. CONCLUSION
Research was done to decide the best physiological signals to use in stress
detection, how these signals can be detected, how these signals are affected by stress
and what would be the best model or system to use in stress detection. Data were
gathered to present the appropriate physiological signals to be considered as inputs to
the algorithm. The sensors were validated in order to confirm that they could
accurately detect the physiological signals. The algorithm was then developed to
determine the level of stress. Physiological signals served as inputs to the algorithm.
The signals were fuzzified and passed through the inference engine before they were
defuzzified to produce an output that corresponds with a level of stress. The algorithm
was then tested and evaluated to prove the efficiency and capability of the system; it
was statistically proven that the system can accurately detect stress level. The system
can be used to increase awareness of stress among mouse users which can help them
better manage their stress levels and do what is needed to improve their performance.
This system has been developed to find levels of stress. When stress reaches
maximum, it is immediately informed to the respective doctor .The patient
needs proper treatment to reduce stress. For reducing stress, doctors provide
treatments such as a musical therapy or medicine. In musical therapy the level of
stress can de decreased and the same can bemonitored by using the stress level
detector this will also monitored by this stress level system.
CHAPTER 9
9. REFERENCES
3. Moisture sensor-www.researchdesignlab.com
4. PIEZO-PKM22EPPH4001-BO