Project REPORT

Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 50

Real Time Detection of Human Stress using Sensors and Machine

Learning Techniques

ABSTRACT
Stress may be defined as the reaction of the body to regulate itself to
changes within the environment through mental, physical, or emotional
responses. Recurrent episodes of acute stress can disturb the physical and mental
stability of a person. This subsequently can have a negative effect on work
performance and in the long term can increase the risk of physiological disorders
like hypertension and psychological illness such as anxiety disorder.
Psychological stress is a growing concern for the worldwide population across
all age groups. A reliable, cost efficient, acute stress detection system could
enable its users to better monitor and manage their stress to mitigate its long-
term negative effects. In this article, we will review and discuss the literature
that has used machine learning based approaches for stress detection. We will
also review the existing solutions in the literature that have leveraged the
concept of edge computing in providing a potential solution in real-time
monitoring of stress.

INTRODUCTION
Stress is one of the main factors that are affecting millions of lives. Mental
stress needs to be in control as it results in different dangerous suffering. Timely
mental stress detection can help to prevent stress related health problems. It is
important to inform the person about his/her unhealthy life style and even alarm
him/her before any acute condition occurs. Stress detection technology could
help people better understand and relieve stress by increasing their awareness of
heightened level of stress that would otherwise go undetected. For this objective,
we design a smart device that has the capability of monitoring stress level
continuously in everyday activities. It not only sends alert to users via
smartphone but allows them to manage stress and share health data with doctors
and family. Remote patient monitoring using this device may increase access to
efficient caring and decrease health care delivery cost.

LITERATURE SURVEY

1.Title: New Avenues in Opinion Mining and Sentiment Analysis


Author: E. Cambria, B. Schuller, Y. Xia, and C. Havasi
Abstract: Others’ opinions can be crucial when it’s time to make a decision or
choose among multiple options. When those choices involve valuable resources
(for example, spending time and money to buy products or services) people
often rely on their peers’ past experiences. Until recently, the main sources of
information were friends and specialized magazine or websites. Now, the “social
web” provides new tools to efficiently create and share ideas with everyone
connected to the World Wide Web. Forums, blogs, social networks, and content-
sharing services help people share useful information. This information is
unstructured, however, and because it’s produced for human consumption, it’s
not something that’s “machine process able.” Capturing public opinion about
social events, political movements, company strategies, marketing campaigns,
and product preferences is garnering increasing interest from the scientific
community (for the exciting open challenges), and from the business world (for
the remarkable marketing fallouts and for possible financial market prediction).
The resulting emerging fields are opinion mining and sentiment analysis.
Disadvantages:
In existing opinion-mining systems need to be improve to broader and deeper
common and commonsense knowledge bases. More complete knowledge must
be combined with reasoning methods that are more deeply inspired by human
thought and psychology. This will lead to a better understanding of natural
language opinions and will more efficiently bridge the gap between
(unstructured) multimodal information and (structured) machine-process able
data.

2. Title: New avenues in knowledge bases for natural language processing


Author: E. Cambria, B. Schuller, Y. Xia, and and B. White
Abstract: Between the birth of the Internet and 2003, year of birth of social
networks such as Myspace, Delicious, LinkedIn, and Facebook, there were just a
few dozen Exabyte’s of information on the Web. Today, that same amount of
information is created weekly. The advent of the Social Web has provided
people with new content sharing services that allow them to create and share
their own contents, ideas, and opinions, in a time- and cost-efficient way, with
virtually millions of other people connected to the World Wide Web. This huge
amount of information, however, is mainly unstructured (because it is
specifically produced for human consumption) and hence not directly machine-
process able. The automatic analysis of text involves a deep understanding of
natural language by machines, a reality from which we are still very far off.
Hitherto, online information retrieval, aggregation, and processing have mainly
been based on algorithms relying on the textual representation of web pages.
Such algorithms are very good at retrieving texts, splitting them into parts,
checking the spelling and counting the number of words. When it comes to
interpreting sentences and extracting meaningful information, however, their
capabilities are known to be very limited, as most of the existing approaches are
still based on the syntactic representation of text, a method that relies mainly on
word co-occurrence frequencies. Such algorithms are limited by the fact that
they can process only the information that they can ‘see’. As human text
processors, we do not have such limitations as every word we see activates a
cascade of semantically related concepts, relevant episodes, and sensory
experiences, all of which enable the completion of complex natural language
processing (NLP) tasks – such as word-sense disambiguation, textual entailment,
and semantic role labeling – in a quick and effortless way.
Disadvantages:
This doesn't take context and content information for analyzing sentiments.
Accuracy is too low.

3. Title: Affective Computing and Sentiment Analysis


Author: E. Cambria
Abstract: Emotions play an important role in successful and effective human–
human communication. In fact, in many situations, emotional intelligence is
more important than IQ for successful interaction. There is also significant
evidence that rational learning in humans is dependent on emotions.2 Affective
computing and sentiment analysis, hence, are key for the advancement of AI3
and all the research fields that stem from it. Moreover, they find applications in
various scenarios and companies, large and small that include the analysis of
emotions and sentiments as part of their mission. Sentiment-mining techniques
can be exploited for the creation and automated upkeep of review and opinion
aggregation websites, in which opinionated text and videos are continuously
gathered from the Web and not restricted to just product reviews, but also to
wider topics such as political issues and brand perception.
Disadvantages:
So far, sentiment-mining approaches from text or speech have been based
mainly on the bag-of-words model because, at first glance, the most basic unit of
linguistic structure appears to be the word.

4. Title: A time-varying propagation model of hot topic on BBS sites and


Blog networks
Author: B. Zhang, X. Guan, M. J. Khan, and Y. Zhou
Abstract: Modeling the propagation of hot online topic is a preliminary
requirement of predicting the trend of hot online topic. We propose a time-
varying hot topic propagation model in online discussion context based upon the
collective behavior of users who are in different social subgroups on blog
networks and bulletin board system (BBS) sites. By analyzing the stability of the
equilibrium of our model, we search for the threshold to be watershed of the
trend of hot online topic and generalize about two theorems from the results of
analysis, they exposit two sufficient conditions under which the trend of hot
online topic will die out or remain uniformly weakly persistent. Furthermore, we
propose methods to predict the trend of hot online topic on the strength of our
model and theorems. For different motivation, we design two methods: Method
(I) is mainly served as a way of theoretical research for predicting long trend of
single-peak hot online topic by the thresholds of theorems; and for application,
we design method (II) to predict the number of users writing or commenting
upon article posts with respect to multi-peak hot online topic and single-peak
one in the following two days with the help of Method (I). Experiments of two
methods are performed on widely-discussed topics on the Sina Blog and the
famous Liang Quan Qi Mei (LQQM) BBS and Xi'an Jiao tong University
(BMY) BBS in China. The experimental results show that our methods predict
the trend of hot online topic efficiently not only for theoretical motivation but
also for applicable motivation, and reduce the computational complexity. Hence,
our model can serve as basis for predicting trends in hot online topic
propagation.
Disadvantages: There is no Sentiment analysis done in social network.
OBJECTIVES:
1. To build an efficient IOT and ML based system for accurate classification of
stress.
2. To identify the stress of the user based on various parameters.
3. To alert or notify the user if there is variation in the stress and asking them to
take the necessary precautions.
4. To notify the user’s family and his/her doctors in case of major changes or if
there is chance for an heart attack to occur.

METHODOLOGY

In this project, the data is collected using IOT sensors such as temperature
sensor, skin conductance sensor and accelerometer. Skin conductance sensor is
used as physical activities stimulate sweat glands which can bring variation in
skin conductance. There is a data collection phase to collect the training
examples needed for the Logical regression algorithm. The collected data is
then fed into the appropriate Logical regression algorithm, which classifies
these set of parameters along with the user, into one of the stress levels. If any
abnormality in the stress level is detected, the user is notified on his smart phone
text message and is asked to take the necessary precautions. If there are major
changes in the stress level that can cause harm to the user’s health, or if any
chance of heart attack is predicted, the user, his emergency contacts and his
doctor are notified.
EXISTING SYSTEM

 The existing system for detection of stress is Perceived Stress Scale(PSS).


 It is a measure of the degree to which situations in ones life are appraised
as stressful.
 The scale also includes a number of direct queries about current levels of
experienced stress.

PROPOSED SYSTEM

 The proposed system will attempt to create a device that monitors stress in
a continuous manner where the heart beat rate (using pulse sensor) and
skin conductance are used to determine the stress level.
 The accelerometer sensor is a device that is used to measure acceleration
forces. Such forces maybe static or dynamic to sense movements or
vibrations.
 These sensor information are collectively stored in the cloud.
 Now, using an appropriate ML algorithms (like Logistic Regression), we
do the prediction on the data that is stored and the predicted results falls
into various classes such as undertrained, over trained etc.
BLOCK DIAGRAM

SMPS 12V DC LM317 5V DC


230V AC
ADAPTOR SUPPLY SUPPLY

LCD

Accelerometer RENESAS Skin conductance

MICROCONTROLLER
Smoke sensor Buzzer

PYTHON Temperature
LAPTOP
(LM35)

HARDWARE REQUIREMENTS:
 Computer – Processor, high speed is preferred. 64 - bit
 Hard disk – Free space of 5GB
 Laptop built-in Camera
 Renesas Microcontroller
 LCD display for Microcontroller
 Temperature sensor(LM35)
 Accelerometer
 Smoke Sensor
 Skin Conductance Sensor
 Buzzer
SOFTWARE’S USED:

1. Python 3.7
2. Open CV tool
3. OS – Windows 8 / 10, 64 – bit.
4. Embedded C
5. Cube Suite+ Compiler
6. Renesas Flash Programmer V2.0

STRESS DATASET:

Attributes in the dataset

Userid  dataset collected from multiple users.

Acceleration  0 – user Normal condition, 1 – user in active condition like


jogging, steps climbing, doing more physical work.

Temperature 30’C above is normal, 25’C below is stress

Heartrate  74 below in normal, 75 above is stress

Skin conductance  100 above in normal, 200 above is stress

Label  0- Normal, 1 – stress.


IMPLEMENTATION
1.HARDWARE IMPLEMENTATION

Renesas Microcontroller:

R5F100LEA microcontroller from Renesas RL78 series which is a 16-bit


microcontroller is used to implement this project. Microcontroller acts as the
heart of the project, which controls the whole system. It contains of Flash ROM
64KB, RAM 4KB and Data Flash 4KB, and it has High speed on-chip oscillator,
Self-reprogrammable under software control, 58 GPIO’s, 3 UART’s, Simplified
I2C, 10 bit resolution ADC, 28 Interrupt Sources, ISP programming support etc.

Features
 General-purpose register: 8 bits × 32 registers (8 bits × 8 registers × 4
banks)

 ROM: 512 KB, RAM: 32 KB, Data flash memory: 8 KB

 On-chip high-speed on-chip oscillator


 On-chip single-power-supply flash memory (with prohibition of block
erase/writing function)

 On-chip debug function

 Ports  Total 11 ports with 58 Input/Output Pins

o Port 0  0 to 6  Total 7 pins in port 0

o Port 1  0 to 7  Total 8 pins in port 1

o Port 2  0 to 7  Total 8 pins in port 2

o Port 3  0 to 1  Total 2 pins in port 3

o Port 4  0 to 3  Total 4 pins in port 4

o Port 5  0 to 5  Total 6 pins in port 5

o Port 6  0 to 3  Total 4 pins in port 6

o Port 7  0 to 7  Total 8 pins in port 7

o Port 12  0 to 4  Total 5 pins in port 12

o Port 13  0, 7  Total 2 pins in port 13

o Port 14  0, 1, 6, 7  Total 4 pins in port 14

 On-chip power-on-reset (POR) circuit and voltage detector (LVD)

 On-chip watchdog timer (operable with the dedicated low-speed on-chip


oscillator)

 I/O ports: 16 to 120 (N-ch open drain: 0 to 4)

 Timer  16-bit timer: 8 to 16 channels, Watchdog timer: 1 channel

 Different potential interface: Can connect to a 1.8/2.5/3 V device

 8/10-bit resolution A/D converter (VDD = EVDD =1.6 to 5.5 V): 6 to 26


channels

 Power supply voltage: VDD = 1.6 to 5.5 V


Pin Diagram:
Architecture Diagram
Memory Space
Processor Registers
The RL78/G13 products incorporate the following processor registers.

Control registers

The control registers control the program sequence, statuses and stack memory.
The control registers consist of a

program counter (PC), a program status word (PSW) and a stack pointer (SP).

Program counter (PC)

The program counter is a 20-bit register that holds the address information of the
next program to be executed.

In normal operation, PC is automatically incremented according to the number


of bytes of the instruction to be fetched.

When a branch instruction is executed, immediate data and register contents are
set.

Reset signal generation sets the reset vector table values at addresses 0000H and
0001H to the program counter.

Program status word (PSW)

The program status word is an 8-bit register consisting of various flags set/reset
by instruction execution.

Program status word contents are stored in the stack area upon vectored interrupt
request is acknowledged or PUSH

PSW instruction execution and are restored upon execution of the RETB, RETI
and POP PSW instructions. Reset

signal generation sets the PSW register to 06H.


Interrupt enable flag (IE)

This flag controls the interrupt request acknowledge operations of the CPU.

When 0, the IE flag is set to the interrupt disabled (DI) state, and all maskable
interrupt requests are disabled.

When 1, the IE flag is set to the interrupt enabled (EI) state and interrupt request
acknowledgment is controlled with an in-service priority flag (ISP1, ISP0), an
interrupt mask flag for various interrupt sources, and a priority specification flag.

The IE flag is reset (0) upon DI instruction execution or interrupt


acknowledgment and is set (1) upon EI

instruction execution.

Zero flag (Z)

When the operation result is zero, this flag is set (1). It is reset (0) in all other
cases.

Register bank select flags (RBS0, RBS1)

These are 2-bit flags to select one of the four register banks.

In these flags, the 2-bit information that indicates the register bank selected by
SEL RBn instruction execution is stored.

Auxiliary carry flag (AC)

If the operation result has a carry from bit 3 or a borrow at bit 3, this flag is set
(1). It is reset (0) in all other cases.

In-service priority flags (ISP1, ISP0)

This flag manages the priority of acknowledgeable maskable vectored interrupts.


Vectored interrupt requests specified lower than the value of ISP0 and ISP1 flags
by the priority specification flag registers (PRn0L, PRn0H, PRn1L, PRn1H,
PRn2L, PRn2H) (see 16.3 (3)) cannot be acknowledged. Actual request
acknowledgment is controlled by the interrupt enable flag (IE). Remark n = 0, 1

Carry flag (CY)

This flag stores overflow and underflow upon add/subtract instruction execution.
It stores the shift-out value upon rotate instruction execution and functions as a
bit accumulator during bit operation instruction execution.

Why the use of Renesas Microcontroller in your project?

 Renesas microcontroller surpasses its predecessor i.e. 8051 family of


microcontrollers, with various in-built features.
 A few of the many features are mentioned below.
- Renesas is a 16 bit microcontroller
- Minimum instruction time can be changed from ultra-low speed
(30.5us) to high speed (0.03125us).
- 16 to 512KB of ROM and 2 to 32KB of RAM are available
depending upon the series and number of pins.
- On-chip high-speed (32 MHz to 1 MHz) as well a low-speed (15
KHz) oscillator is present.
- 10 bit resolution A/D converter (6 to 26 channels depending upon
the series)
- Totally 3 UART for Serial Interface
- Totally 0-7 channels for timer with built in PWM features.
- Most of the pins of Renesas have multi-task features.
- Cost of Renesas microcontroller is comparatively less.
- Rigid body of microcontroller hence less prone to damages due to
electrostatic charge.
- Operates with 5v power supply.
Why CubeSuite+ IDE?

 Integrated Development Environment (IDE) CubeSuite offers the ultimate


in simplicity, usability, and security for the repetitive editing, building and
debugging of codes.
 Easy to Install and operate.
 CubeSuite offers a highly user-friendly development
 Environment featuring significantly shorter build times. The robust lineup
of expanded functions and user support functions ensures a dependable
environment for all users.

BUZZER
 A "piezo buzzer" is basically a tiny speaker that you can connect directly to
an Arduino.
 "Piezoelectricity" is an effect where certain crystals will change shape when
you apply electricity to them. By applying an electric signal at the right
frequency, the crystal can make sound.

 5V Supply.

Figure: Buzzer

ACCELEROMETER SENSOR (ADXL335):

 Accelerometer is an electromechanical device that measures the force of


acceleration due to gravity in g unit.
 It can be used in applications requiring tilt sensing.
 The ADXL335 measures acceleration along X, Y and Z axes and gives
analog voltage output proportional to the acceleration along these 3 axes.
 Microcontrollers can process these voltages by converting them to digital
signals using ADC.
 VCC: Power supply pin i.e. connect 5V here.
 X_OUT: X axis analog output.
 Y_OUT: Y axis analog output.
 Z_OUT: Z axis analog output.
 GND: Ground pin i.e. connect ground here.
 ADXL335 accelerometer provides analog voltage at the output X, Y, Z pins;
which is proportional to the acceleration in respective directions i.e. X, Y, Z.

Figure: ADXL345 Sensor

SMOKE SENSOR

Smoke alarms detect fires by sensing small particles in the air using a couple of
different kinds of technologies. Once they detect those particles above a certain
threshold, they signal the alarm to sound so that you and your family can get to
safety.Smoke alarms save lives
TEMPRETURE SENSOR – LM35:

A temperature sensor is a device, usually an RTD (resistance temperature


detector) or a thermocouple, that collects the data about temperature from a
particular source and converts the data into understandable form for a device or
an observer. Temperature sensors are used in many applications like HV and AC
system environmental controls, food processing units, medical devices, chemical
handling and automotive under the hood monitoring and controlling systems,
etc.
The most common type of temperature sensor is a thermometer, which is used to
measure temperature of solids, liquids and gases. It is also a common type of
temperature sensor mostly used for non-scientific purposes because it is not so
accurate.
LCD
The figure 4 shows 16*2 LCD Display. LCD stands for Liquid Crystal Display.
By using the LCD, all the outputs are displayed. LCD doesn’t know about the
content (data or commands) supplied to its data bus. It is the user who has to
specify whether the content at its data pins are data or commands.

Figure 4: LCD Display


For this, if a command is inputted then a certain arrangement of 0s and 1s has to
be applied to the Control lines so as to specify it is a command on the other hand
if a data is inputted at the data lines then an another combination of 0s and 1s has
to be applied to the control lines to require it is Data.

ALPHA-NUMERIC LCD DISPLAY

A liquid crystal display (LCD) is a flat panel display, electronic visual


display, based on on Liquid Crystal Technology.

A liquid crystal display consists of an array of tiny segments (called pixels) that
can be manipulated to present an information. Liquid crystals do not emit light
directly instead they use light modulating techniques.

LCDs are used in a wide range of applications, including computer monitors,


television, instrument panels, aircraft cockpit displays, signage, etc. They are
common in consumer devices such as video players, gaming devices, clocks,
watches, calculators, and telephones.

LCDs are preferred to cathode ray tube (CRT) displays in most applications
because

1. The size of LCDs come in wider varieties .


2. They do not use Phosphor, hence images are not burnt-in.

3. Safer disposal

4. Energy Efficient

5. Low Power Consumption

It is an electronically modulated optical device made up of any number of


segments filled with liquid crystals and arrayed in front of a light source
(backlight) or reflector to produce images in color or monochrome.
INCLUDEPICTURE
"http://upload.wikimedia.org/wikipedia/commons/thumb/d/dc/LCD_layers.svg/
250px-LCD_layers.svg.png" \* MERGEFORMATINET INCLUDEPICTURE
"http://upload.wikimedia.org/wikipedia/commons/thumb/d/dc/LCD_layers.svg/
250px-LCD_layers.svg.png" \* MERGEFORMATINET INCLUDEPICTURE
"http://upload.wikimedia.org/wikipedia/commons/thumb/d/dc/LCD_layers.svg/
250px-LCD_layers.svg.png" \* MERGEFORMATINET

Reflective twisted nematic liquid crystal


display.

1. Polarizing filter film with a vertical axis to polarize light as it enters.


2. Glass substrate with ITO electrodes. The shapes of these electrodes will
determine the shapes that will appear when the LCD is turned ON.
Vertical ridges etched on the surface are smooth.

3. Twisted nematic liquid crystal.

4. Glass substrate with common electrode film (ITO) with horizontal ridges
to line up with the horizontal filter.

5. Polarizing filter film with a horizontal axis to block/pass light.

6. Reflective surface to send light back to viewer. (In a backlit LCD, this
layer is replaced with a light source.)

JHD162A is one such LCD which is used here.

It has a Panel with 2 rows and 16 column and with blocks as shown below with
5x7 pixel-selection pattern.
Operating Voltage

Pin Details
Timing Diagram
Write Mode
Read Mode

Pixel selection pattern


Interfacing JHD162A with Microcontroller

Alpha Numeric displays form an integral part of the Embedded Systems.


The Data displayed here is controlled by the Microcontroller.
The Control pins like Read Strobe, Read/Write and Enable are controlled
through the Microcontroller Ports as per the waveforms above.
The 8 data is also provided through a Microcontroller Port.

General Circuit and settings of jhd162a

10K VR 1
3 1 +5 V

U1
2

VSS
VD D
V0
A LC D _R S RS
ALC D _R /W R /W
A LC D _E E
D B0 D B0
D B1 D B1
D B2 D B2
D B3 D B3
D B4 D B4
D B5 D B5
D B6 D B6
D B7 D B7
LED A
LED K
16x 2 ALP H A LC D

ALPHA NUMERIC LCD

Make sure that 5V and GND lines are properly connected otherwise you may
end up in damaging parallel port.

If you want backlight than connect pin 15 of LCD to 5V and pin 16 of LCD
to GND. By adjusting 10k resistor make pin 3 of LCD at 0V. If connections are
proper you will see this after power on.

INCLUDEPICTURE "http://lcdinterfacing.googlepages.com/lcdok.bmp/lcdok-
medium;init:.jpg" \* MERGEFORMATINET INCLUDEPICTURE
"http://lcdinterfacing.googlepages.com/lcdok.bmp/lcdok-medium;init:.jpg" \*
MERGEFORMATINET INCLUDEPICTURE
"http://lcdinterfacing.googlepages.com/lcdok.bmp/lcdok-medium;init:.jpg" \*

MERGEFORMATINET

Flow Chart

Connect VDD, VSS, LEDA, LEDK Pins for


Power and Contrast Adjustments

RS , EN, R/W And data Pins Assigned to


Ports

EN=1, RS=1 , R/W=0 for data write

Data in DB0-7 is sent through Port Pins

Data is Displayed on the Panel

ALCD_Comm( 0x38 ); Command transmitted


serially to LCD through data lines, This
command will select 2lines,5x7matrix

LCD initialization
ALCD_Comm( 0x0E ); This command will make
the display
void on, cursor
ALCD_Init( void ) blinking

ALCD_Comm( 0x01 ); This command will clear


the LCD display

ALCD_Comm( 0x06 ); This command will shift


the cursor to right
LCD message function
void ALCD_Message( unsigned char addr, unsigned char *data_ptr )

ALCD_Comm( addr ); Address location of LCD is


transmitted to LCD through data lines

while( *data_ptr != '\0' ) Data_ptr points to the


starting character of the message, until it is
equal to null character loop will be repeated

ALCD_Data( *data_ptr ); Data to be displayed is


transmitted to the LCD through the data lines

data_ptr++; Data pointer will be incremented


after each character is displayed

P1 = comm_data; comm_data present on port


P1 is transmitted to the LCD through datalines
LCD command function
void ALCD_Comm( char comm_data )

ALCD_RS = 0; Command register will be selected

ALCD_Enable = 1; ALCD_Enable = 0; in order to


access the data present on data lines enable pin
should have high to low pulse
ALCD 16x2 ADDRESS LINES:
1 16

0x 0x 0x 0x 0x 0x 0x 0x 0x 0x 0x 0x 0x 0x 0x 0x
80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F

0x 0x 0x 0x 0x 0x 0x 0x 0x 0x 0x 0x 0x 0x 0x 0x
C0 C1 C2 C3 C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF

2. SOFTWARE IMPLEMENTAION

Cubesuite

TO CREATE PROJECT USING CUBE SUITE


 First appearance of cube suite page CLICK OK
 CLICK GO option of “Create New Project”
 Select Controller, give a project name and folder will be created with the
same name and CLICK CREATE
 Select “code generator” and CLICK “Fix settings”
 Select “Watchdog Timer” and make it as “Unused”

 Select required peripherals


 After Selecting required peripherals CLICK ON “Generate Code”

 Files generated with Main file


 Build Project

FLASH PROGRAM USING RENESAS FLASH


PROGRAMMER
 Select device
 Select emulator

 CLICK NEXT
 Select voltage reference “5V”

 Browse for .hex file


 After selecting .hex file CLICK ON “Start”
PROCEDURE TO CHECK COM PORT SELECTION
STEP 1: Right click on My computer icon select “manage”
STEP 2: click on “Device manager”
STEP 3: Click on “Ports”confirm USB to Serial comm Port
PYTHON:
Python is an interpreted, object-oriented, high-level programming language with
dynamic semantics. Its high-level built in data structures, combined with
dynamic typing and dynamic binding, make it very attractive for Rapid
Application Development, as well as for use as a scripting or glue language to
connect existing components together. Python's simple, easy to learn syntax
emphasizes readability and therefore reduces the cost of program
maintenance. Python supports modules and packages, which encourages
program modularity and code reuse. The Python interpreter and the extensive
standard library are available in source or binary form without charge for all
major platforms and can be freely distributed. Often, programmers fall in love
with Python because of the increased productivity it provides. Since there is
no compilation step, the edit-test-debug cycle is incredibly fast. Debugging
Python programs is easy: a bug or bad input will never cause a segmentation
fault. Instead, when the interpreter discovers an error, it raises an exception.
When the program doesn't catch the exception, the interpreter prints a stack
trace.
A source level debugger allows inspection of local and global variables,
evaluation of arbitrary expressions, setting breakpoints, stepping through the
code a line at a time, and so on. The debugger is written in Python itself,
testifying to Python's introspective power. On the other hand, often the quickest
way to debug a program is to add a few print statements to the source: the fast
edit-test-debug cycle makes this simple approach very effective. The figure
shows the symbol of python.

Figure : Python
NUMPY
NumPy is an open source library available in Python that aids in mathematical,
scientific, engineering, and data science programming. It works perfectly well
for multi-dimensional arrays and matrices multiplication. NumPy is a
programming language that deals with multi-dimensional arrays and matrices.
On top of the arrays and matrices, NumPy supports a large number of
mathematical operations.
NumPy is memory efficiency, meaning it can handle the vast amount of data
more accessible than any other library. Besides, NumPy is very convenient to
work with, especially for matrix multiplication and reshaping. On top of that,
NumPy is fast. In fact, TensorFlow and Scikit learn to use NumPy array to
compute the matrix multiplication in the back end.
During the Google I/O Conference in June 2016, Jeff Dean stated that 1,500
repositories on GitHub mentioned TensorFlow, of which only 5 were from
Google. Unlike other numerical libraries intended for use in Deep Learning like
Theano, TensorFlow was designed for use both in research and development and
in production systems, not least RankBrain in Google search and the fun
DeepDream project.It can run on single CPU systems, GPUs as well as mobile
devices and large scale distributed systems of hundreds of machines.

OpenCV
OpenCV (Open Source Computer Vision Library) is an open source computer
vision and machine learning software library. OpenCV was built to provide a
common infrastructure for computer vision applications and to accelerate the use
of machine perception in the commercial products. Being a BSD-licensed
product, OpenCV makes it easy for businesses to utilize and modify the code.
The library has more than 2500 optimized algorithms, which includes a
comprehensive set of both classic and state-of-the-art computer vision and
machine learning algorithms. These algorithms can be used to detect and
recognize faces, identify objects, classify human actions in videos, track camera
movements, track moving objects, extract 3D models of objects, produce 3D
point clouds from stereo cameras, stitch images together to produce a high
resolution image of an entire scene, find similar images from an image database,
remove red eyes from images taken using flash, follow eye movements,
recognize scenery and establish markers to overlay it with augmented reality,
etc. OpenCV has more than 47 thousand people of user community and
estimated number of downloads exceeding 18 million. The library is used
extensively in companies, research groups and by governmental bodies .Along
with well-established companies like Google, Yahoo, Microsoft, Intel, IBM,
Sony, Honda, Toyota that employ the library, there are many startups such as
Applied Minds, Video Surf, and Zeitera, that make extensive use of OpenCV.
OpenCV’s deployed uses span the range from stitching street view images
together, detecting intrusions in surveillance video in Israel, monitoring mine
equipment in China, helping robots navigate and pick up objects at Willow
Garage, detection of swimming pool drowning accidents in Europe, running
interactive art in Spain and New York, checking runways for debris in Turkey,
inspecting labels on products in factories around the world on to rapid face
detection in Japan.
It has C++, Python, Java and MATLAB interfaces and supports Windows,
Linux, Android and Mac OS. OpenCV leans mostly towards real-time vision
applications and takes advantage of MMX and SSE instructions when available.
A full-featured CUDA and OpenCL interfaces are being actively developed right
now. There are over 500 algorithms and about 10 times as many functions that
compose or support those algorithms. OpenCV is written natively in C++ and
has a template interface that works seamlessly with STL containers. The figure
shows the symbol of opencv library.
Figure : OpenCV
FUTURE WORK
Most of the works on stress detection are oriented towards psychological
stress detection. Although there have been few works on physiological stress
detection, there is further need for research towards detecting physiological
stress. Research should be conducted to design robust classification models that
can generalize classifications irrespective of the signal acquisition device and
configuration. This will ensure the applicability of a framework in any setting
irrespective of the type of edge devices and the configuration in which the data is
collected.
Another interesting research direction that could be explored is the use of
an edge-cloud framework which will distribute the process of pre-processing,
feature extraction and classification across different layers of edge and cloud.
This might be useful when integrating multiple end users to a single platform. In
this context, there are other research scopes such as dealing with the massive
amount of data that might be generated at the edge with time. Works are being
done in this field to enhance the quality of data storing and retrieval mechanisms
in an edge cloud settings. Ensuring privacy, security, and confidentiality of the
data streams generated is also another exciting research direction. Another
direction that would be interesting to explore is to study the effectiveness of
different intervention mechanisms in mediating acute stress responses. This will
be a critical step towards developing a ubiquitous stress detection and
management system which has the potential to further develop into a smart
health monitoring system. Finally, real-time monitoring of stress can be
integrated in a smart home environment to assist older adults and persons with
dementia or cognitive impairment.
RESULTS AND CONCLUSIONS
1. A dataset containing the stress classifications for a set of parameters.
2. Predicting the stress levels using ML algorithms with good accuracy.
3. A system that monitors changes in stress levels of a user in their everyday
activities and notifying them on these changes.

REFERENCES
[1] S. Cohen, R. C. Kessler, and L. U. Gordon, Strategies for measuring stress in
studies of psychiatric and physical disorders. Oxford University Press, 1995.
[2] B. Mcewen, “Protective and damaging effects of stress mediators: Central
role of the brain,” Dialogues in clinical neuroscience, vol. 8, no. 02, pp. 367–81,
2006.
[3] P. Adams, M. Rabbi, T. Rahman, M. Matthews, A. Voida, G. Gay, T.
Choudhury, and S. Voida, “Towards personal stress informatics: Comparing
minimally invasive techniques for measuring daily stress in the wild,” in
Proceedings of the 8th International Conference on Pervasive Computing
Technologies for Healthcare, 2014, pp. 72– 79.
[4] S. Greene, H. Thapliyal, and A. Caban-Holt, “A survey of affective
computing for stress detection: Evaluating technologies in stress detection for
better health,” IEEE Consumer Electronics Magazine, vol. 5, no. 4, pp. 44–56,
Oct 2016.
[5] H. Thapliyal, V. Khalus, and C. Labrado, “Stress detection and management:
A survey of wearable smart health devices,” IEEE Consumer Electronics
Magazine, vol. 6, no. 4, pp. 64–69, Oct 2017.
[6] J. Bakker, M. Pechenizkiy, and N. Sidorova, “What’s Your Current Stress
Level? Detection of Stress Patterns from GSR Sensor Data,” in Proceedings
IEEE 11th International Conference on Data Mining Workshops, 2011, pp. 573–
580.
[7] A. de Santos Sierra, C. Sanchez Avila, J. Casanova, and G. Bailador, “A
Stress-Detection System Based on Physiological Signals and Fuzzy Logic,”
IEEE Transactions on Industrial Electronics, vol. 58, pp. 4857–4865, November
2011.
[8] C. Setz, B. Arnrich, J. Schumm, R. La Marca, G. Trà ˝uster, and U. Ehlert,
“Discriminating Stress From Cognitive Load Using a Wearable EDA Device,”
IEEE Transactions on Information Technology in Biomedicine, vol. 14, no. 2,
pp. 410–417, 2010.
[9] S. Yoon, J. Kyoung Sim, and Y.-H. Cho, “A flexible and wearable human
stress monitoring patch,” Scientific Reports, vol. 6, p. 23468, 03 2016.

You might also like