Obat aborsi Jakarta Timur Wa 081225888346 Jual Obat aborsi Cytotec asli Di Ja...
Capstone project report (final) (1)
1. i
CAPSTONE PROJECT REPORT
(Project Term July-November 2019)
(Smart Health Care)
Submitted by
(D.Dinesh Kumar) Registration Number :11606738
(V.Shiva Srikanth) Registration Number :11601464
(P.Vinay Kumar) Registration Number :11601606
(M.Anish Kumar) Registration Number :11604949
Project Group Number : CSERGC0411
Course Code : CSE439
Under the Guidance of
(Ms. Shaina Gupta, Assistant Professor)
School of Computer Science and Engineering
3. iii
DECLARATION
We hereby declare that the project work entitled (“Smart Health Care”) is an authentic record of
our own work carried out as requirements of Capstone Project for the award of B.Tech degree in
Computer Science & Engineering from Lovely Professional University, Phagwara, under the
guidance of Ms. Shaina Gupta , during July to November 2019. All the information furnished in
this capstone project report is based on our own intensive work and is genuine.
Project Group Number: CSERGC0411
Name of Student 1: D. Dinesh Kumar
Registration Number: 11606738
Name of Student 2: V. Shiva Srikanth
Registration Number: 11601464
Name of Student 3: P. Vinay Kumar
Registration Number: 11601606
Name of Student 4: M. Anish Kumar
Registration Number: 11604949
(Signature of D. Dinesh Kumar)
Date:
(Signature of V. Shiva Srikanth)
Date:
(Signature of P.Vinay Kumar)
Date:
(Signature of M. Anish Kumar)
Date:
4. iv
CERTIFICATE
This is to certify that the declaration statement made by this group of students is correct to the
best of my knowledge and belief. They have completed this Capstone Project under my guidance
and supervision. The present work is the result of their original investigation, effort and study.
No part of the work has ever been submitted for any other degree at any University. The
Capstone Project is fit for the submission and partial fulfillment of the conditions for the award
of B.Tech degree in Computer Science & Engineering from Lovely Professional University,
Phagwara.
Signature of the Mentor :
Name of the Mentor : Ms . Shaina Gupta,
Designation : Assistant Professor,
School of Computer Science and Engineering,
Lovely Professional University,
Phagwara, Punjab.
Date :
5. v
ACKNOWLEDGEMENT
We humbly take this opportunity to present our votes to thanks to all those guidepost who really
acted as lightening pillars to enlighten our way throughout this has led to successful and
satisfactory completion of this study.
We are really grateful to our mentor Ms. Shaina Gupta for providing us with an opportunity to
undertake this project in this university and providing us with all the bright and innovative ideas
for making our project a really worthwhile of running in an organization. We are highly thankful
for her active support, valuable time and advice, whole hearted guidance, sincere cooperation
and pains taking involvement during the study and in completing the capstone project within the
time stipulated.
We are thankful to all those people who guided us to complete the project, particularly our
friends, who have been instrumental in creating proper, healthy and conductive environment and
including new and fresh innovative ideas for us during the project, without their help it would
have been extremely difficult for us to prepare the project in a time bound framework.
D. Dinesh Kumar
V. Shiva Srikanth
P. Vinay Kumar
M. Anish Kumar
6. vi
TABLE OF CONTENTS
INNER FIRST PAGE .......................................................................................................................i
PAC FORM .....................................................................................................................................ii
DECLARATION ............................................................................................................................ iii
CERTIFICATE ...............................................................................................................................iv
ACKNOWLEDGEMENT ...............................................................................................................v
TABLE OF CONTENTS................................................................................................................vi
1.INTRODUCTION ........................................................................................................................1
1.1.OBJECTIVE...........................................................................................................................1
1.2.PROJECT DESCRIPTION....................................................................................................2
2.SCOPE OF THE PROJECT .........................................................................................................3
3.EXISTING SYSTEM ...................................................................................................................4
3.1.DFD FOR PRESENT SYSTEM ............................................................................................4
3.1.1. LEVEL 0 DFD...........................................................................................................4
3.1.2. LEVEL 1 DFD...........................................................................................................5
3.2. WHAT’S NEW IN THE SYSTEM TO BE DEVELOPED .................................................5
4.PROBLEM ANALYSIS ...............................................................................................................6
4.1. PRODUCT DEFINITION ....................................................................................................6
4.2. FEASIBILITY ANALYSIS..................................................................................................7
4.3. PROJECT PLAN ..................................................................................................................7
5. SOFTWARE REQUIREMENT ANALYSIS..............................................................................8
5.1. SYSTEM ANALYSIS AND DESIGN.................................................................................8
5.2. SOFTWARE REQUIREMENTS .........................................................................................8
5.3. SPECIFIC REQUIREMENTS............................................................................................11
6. DESIGN .....................................................................................................................................14
6.1. SYSTEM DESIGN..............................................................................................................14
6.2. DESIGN NOTATIONS ......................................................................................................15
6.3. FLOW CHARTS ................................................................................................................16
6.3.1. FLOW CHART FOR PULSE SENSOR .................................................................16
7. vii
6.3.2. FLOW CHART FOR TEMPERATURE SENSOR ................................................17
6.4. PSEUDO CODE.................................................................................................................18
7. TESTING...................................................................................................................................19
7.1. FUNCTIONAL TESTING .................................................................................................19
7.2. STRUCTURAL TESTING.................................................................................................19
7.3. LEVELS OF TESTING......................................................................................................19
8. IMPLEMENTATION................................................................................................................21
9. PROJECT LEGACY .................................................................................................................23
9.1. CURRENT STATUS OF THE PROJECT .........................................................................23
9.2. REMAINING AREAS OF CONCERN .............................................................................23
9.3. TECHNICAL AND MANAGERIAL LESSONS LEARNT..............................................23
10. USER MANUAL: A COMPLETE DOCUMENT(HELP GUIDE) ........................................24
11. SOURCE CODE......................................................................................................................25
11.1. CODE FOR PULSE SENSOR .........................................................................................25
11.2. CODE FOR TEMPERATURE SENSOR ........................................................................33
11.3. IFTTT WEBSITE .............................................................................................................36
11.4. THINGSPEAK PLATFORM ...........................................................................................39
12. BIBLIOGRAPHY....................................................................................................................51
9. 1
1. INTRODUCTION
1.1 OBJECTIVE
The main aim of the project is to provide good care for patients by monitoring their Heart rate
and Oxygen Levels with help of IoT device and intimating doctor and caretaker about patient
health condition. These are some of the following objectives.
Analyzing and studying the iot healthcare applications
Proposing the fog based iot health care application
Analyzing the results of the proposed framework
1.2 PROJECT DESCRIPTION
Now a days, The internet used by more than two billion customers around the world, to browse
contents, send and receive email, access multimedia resources, play online games, social
networking. Moreover, the internet also expected to serve as a global platform to inter connect
physical Things, thus, creating new ways of working, interacting, entertaining and living
Internet Technology has become appearing within our society which is infiltrating all aspects of
our lives
We regularly neglect the significance of one minute in real life. In minutes lot can change . The
same goes for internet, we repeatedly spend our time surfing the web and we didn’t realize how
fast time flies. However, it is important to know about the events that come to light in just a
minute in the world of internet.
With each day passing , the way the world Interact Changes. From the past few years usage of
Cloud Computing for a large number of application.IoT discussing new dimensions of patient
care through real-time health monitoring system and access to patients' health data. This data is a
goldmine for healthcare stakeholders to improve patient's health and experiences while making
revenue opportunities and improving healthcare operations. Before Internet of Things, patients
interactions with doctors were limited to visits, and tele and text communications. There was no
10. 2
way doctors or hospitals could monitor patients’ health continuously and make recommendations
accordingly.
Internet of Things enabled devices to make remote monitoring in the health care , unleash the
potential to keep patients safe and healthy, and empower physicians to deliver excellent care. It
has also increased patient engagement and satisfaction as interactions with doctors have become
easier and more efficient. Furthermore, remote monitoring of patient’s health helps in reducing
the length of hospital stay and prevents re-admissions. IoT also has a major impact on reducing
healthcare costs significantly and improving treatment outcomes.
IoT is undoubtedly transforming the healthcare industry by redefining the space of devices and
people interaction in delivering healthcare solutions. Internet of things has applications in
healthcare that can advantage patients, families, hospitals and insurance companies.This is the
future architecture for this project.
11. 3
2. SCOPE OF THE PROJECT
The main difficulty in establishing smart cities are the scarcity of broadband bandwidth and
connectivity. Modern cities have multiple cellular networks and coverage. These networks have
the ability and highest bandwidth limits that is not enough to meet the needs of the existing
customers. Though, deploying fog computing architecture, allow fog nodes to offer home storage
and processing. So, optimizing the network usage. IOT or Internet of Things is a burning topic
these days. Like every fresh concept, the masses are not too familiar with this novel idea.
Iot explains a situation where everything in our nearby environment is made able of
automatically communicating with each other without any inter human or human to machine
communication. Apart from the fact that it is a path breaking find, it can also show to be
extremely beneficial in facilitate our lives to manifolds.This project scope involves the studying
of an IoT application and devices and Understanding Fog nodes and Cloud services. Patients in
hospital are continuosly monitored with help of this application, monitoring health condition
24/7 and when any patient health is in abnormal condition immediately alerting Doctor and
Nurse by alarm or message. With this they tend to respond quickly and provide care for patient.
12. 4
3. EXISTING SYSTEM
Smart Health Care is idea of our project to calculates a person heart beat and temperature
levels with the use of sensors and analysing the results to alert the doctor about patient condition
via message. The existing systems under the category of non iot technologies like BPM meter ,
thermometer which we have to use man power to check the results of a person and there is no
particular alert system to intimate doctor when doctor is in remote location. Each has its own
unique pros and cons, which you’ll want to be aware of before settling on one over the other.
Coming to bpm meter it will shows the patient heart beat and blood pressure values there it self.
Not possible to check values when we are in remote location. Same for thermometer . But here in
smart health care using sensors any person can view the values of patient through authorized
access. The existing technologies are a lot complex to normal to use without any prior
knowledge of them.
3.1. DFD FOR PRESENT SYSTEM
3.1.1. LEVEL 0 DFD
Node
MCU
Sensor will gather the
data from patient of
heart beat and blood
oxygen level
Transfer data from
sensor data to
computing
device(Nodemcu) it
will analyse
information of patient
Thingspeak will store
the data of patient and
redirect to doctor
when data needs
Thing
Speak
Senso
r Data
Figure 1 : Level 0 DFD
13. 5
3.1.2. LEVEL 1 DFD
3.2. WHAT’S NEW IN THE PROJECT
To talk about the system its an smart health care using sensors. Here we are try to make
patient monitoring easier. Our concept is the fusion of Iot and medical . with the internet of
things (IoT) allowing for massive instrumentation of the healthcare experience regardless of the
location of the patient and the provider. With the use of machine learning and other deep
analytics capabilities to increase the quality of care. Most of the healthcare organizations begin
to look into smart technologies, these shifts provide great opportunities never before seen in the
industry of the Iot world.
At the same time, analytics capabilities involving public, government and private datasets
confirms to provide a complete view of the patient details and analytics. The style of recording
especially in personal health information has been quickly rising from many years with the idea
of the quantify Self. The present state of Smart Health Care is advanced but still in its virtual
early life. Smart Health Care make both real time and historic health data available to the normal
people and healthcare personnel.
Abnormal
Normal
Patient
Condition
Sensing
Function
ality
Data
Aggregat
ion
Data
Analysis
Decision
Making
Intimatin
g Doctor
Storing
Data
Figure 2 : Level 1 DFD
14. 6
4. PROBLEM ANALYSIS
4.1. PRODUCT DEFINITION
New technologies have influenced many parts of our daily life. Now a days healthcare
system tells the benefits of using information and communication technology for improving the
value of smart healthcare. Smart Health care is defined by the technology that helps to improve
better tools for treatment of patients, and devices which helps to improve quality of life for
anyone. The main goal of this includes eHealth and mHealth services, electronic record, smart
home services and some of the connected medical devices.
One of the key concepts for improving today’s healthcare is eHealth, i.e. the habit of ICT
in care. This is how the we can defines the term: eHealth is the use of information and
communication technology (ICT) for health. Some of the examples are treating patients,
performing research, educating the health work force, tracking diseases around the world and
analyzing public health.
The term mHealth is short for mobile health. This terms mHealth has defined by the
world health organization as “a component of eHealth”. Since there is no consistent definition of
mHealth, the Global Observatory of eHealth has defined mHealth as medical and health of
public can be view in mobile devices, patient monitoring devices, personal digital assistants ,
and wireless devices.
Here in our project we use mHealth to perform our operations. As mHealth means mobile
health we use mobile widgets to check the patient heart beat and temperature values which we
got from sensors attached to patient which are connected to nodemcu.
We can see the patient complete report in cloud server where the data is stored. Any one
can access the server through an authorized access to check the patient reports and monitoring
them from any remote location. And also when patient condition is critical we can get a message
to phone number which we set for sending the alert notification.
15. 7
4.2. FEASIBILITY ANALYSIS
This project is feasible to make as it is made using simple technologies and are easy
to implement , it is easy to implement and yet the project is so effective that it covers all the
objectives of project. Even a person who is not having any Iot and medical knowledge can able
to setup the device to make the readings work and can analysis the data.
4.3. PROJECT PLAN
Figure 3: Scheduling of the Project
0 1 2 3 4 5 6 7
Final Tests
Implementation
Coding
Information Gathering
Chart Title
6weeks 3weeks 2 weeks
16. 8
5. SOFTWARE REQUIREMENTS ANALYSIS
5.1. SYSTEM ANALYSIS AND DESIGN
System analysis is a method of problem-solving that deals with the breaking downof a
system into components parts in order to study how well the individual parts work and interact to
accomplish their purpose. It involves the process of enumeration of the existing problems, and
analyzing the proposed system for the costs and benefits, and analyze the system ,user
requirements and considering the another system.
System analysis is main thing in the design of subsequent systems. System design
consists of many actions that make system qualifications which assure the functional
requirements that has been developing in the system analysis process. System design is mainly
look on the structural implementation of analysis. Our project designed in such a way that it
provide proper care for patients by monitoring their Heartbeat rate and Temperature Levels with
help of IoT device and intimating doctor and caretaker about patient health condition.
5.2. SOFTWARE REQUIREMENTS
Arduino IDE
IDE is software which is an open source.
Used for the coding purpose for writing and compiling .
It is an official Arduino software, making code compilation too easy that even a common
public with no technical knowledge can able to cope up with the learning process.
It is easily available for operating systems like MAC, Windows, Linux and runs on the
Java Platform that comes with inbuilt functions and commands that play a vital role for
debugging, editing and compiling the code in the environment.
Each of them contains a microcontroller on the board that is actually programmed and
accepts the information in the form of code.
The main code, also known as a sketch, created on the IDE platform will ultimately
produce a Hex File which is transferred and uploaded in the micro controller on the
board.
17. 9
This environment mainly contains two parts thay are fist one is Editor and second one
is Compiler where former is used for writing the required code and later is used for
compiling and uploading the code into the given nodemcu.
This environment supports both C and C++ languages
The IDE environment is mainly divided into three sections:
1. Menu Bar
2. Text Editor
3. Output Pane
When we go to the option preference and check for the section compilation, then the
Output window will show you the code compilation when you click the upload button.
Figure 4: Arduino Ide
18. 10
The IDE is incredibly minimalistic, yet it provides a near-complete environment for
most Arduino-based projects. The top menu bar has the basic options like including
File for new, load save, etc., Edit fro font, copy, paste, etc., Sketch (for compiling and
programming), Tools (useful options for testing projects), and Help.
The middle section of the Arduino IDE is a simple text editor that where you can enter
the program code. The bottom section of the ArduinoIDE is dedicated to an output
window that is used to see the output of the collection, number of memory has been
used and are there any errors that were found in the program.
Projects made using the IDE are called sketches, and such sketches are usually written
in a cut-down version of C++. Because programming a microcontroller is somewhat
different from programming a computer, there are a number of device specific libraries
Figure 5: IDE Sketch
19. 11
5.3. SPECIFIC REQUIREMENTS
For getting Heart beat and Temperature values of patients .We have to place the
specified sensors to patient body for getting readings.
Application In order to get the notification about patient health condition doctors and
nurses have to install the application.
Storing All the collected information is stored in a cloud service in order to make
analysis about the patient health condition.
Monitor After the installation of sensors to patient all the time the patient is being
monitored and making analysis with the help of previous recorded data.
Analysis The collected information in the cloud being analyzed with the conditions
whether the patient’s heartbeat and oxygen levels normal or not.
Alert After the complete analysis if the patient is in critical condition then the data
transfers from iot device and sends notification in the android application
LM35 TEMPERATURE SENSOR
In LM35 The LM series originated with integrated circuits made by National
Semiconductor.
The prefix LM stands for linear monolithic, referring to the analog components integrated
onto a single piece of silicon.
This temperature sensor that outputs an analog signal which is proportional to the
immediate temperature
Features
Output in Celsius (Centigrade).
It is I dLinear + 10-mV/°C Scale Factor.
0.5°C Accuracy (at 25°C).
LM35 has −55°C to 150°C Range value.
Remote applications can be applicable.
It is operate from 4 V to 30 V.
20. 12
This is Less than 60-µA Current Drain.
LM35 is Low Self Heating; 0.08°C in Still Air.
LM35 is Non Linearity Only; ±¼°C Typical.
It shows Low Impedance Output; 0.1 Ω for 1mA Load.
Figure 6: LM35 Temperature Sensor
Figure 7: Circuit Diagram of LM35 sensor and Nodemcu
21. 13
PUSLE SENSOR
A 24-inch Color-Coded Cable, with male header connectors.
An Ear Clip, perfectly sized to the sensor. We searched many places to find just the right
clip. It can be Hotglued to the back of the sensor and easily worn on the earlobe.
2 Velcro Dots. Used to attach a strap for fitting into hand.
Velcro strap to wrap the Pulse Sensor around your finger.
3 Transparent Stickers. Helps to protect sensor.
Figure 8: Circuit Diagram of Pulse Sensor with Nodemcu
23. 15
6.2. DESIGN NOTATIONS
High High/low
Input of
patient
Pulse Sensor
Temperature
sensor
Wi-module
Nodemcu
ESP32
Thingspeak
platform to
store the
values
Alert Heart Beat
Temperature
Intimation
Figure 10: Design Notation
24. 16
6.3. FLOW CHARTS
6.3.1. FLOW CHART FOR PULSE SENSOR
YES
Start
Initialize Nodemcu
Initialize Pulse
Sensor
Wait to get signal
from sensors
DETE
CT
SIGNA
L
Send to thingspeak
website to
analyse the live stream
Stores the sensors data
in thinspeak
Generate alert
IF
SENSO
R
DATA
NO
Figure 11: Flow chart of Pulse Sensor
25. 17
6.3.2. FLOW CHART FOR TEMPERATURE SENSOR
Start
Initialize Nodemcu
Initialize Temperature
Sensor
Wait to get signal from
sensors
IF
DETEC
T
SIGNAL
Send to thingspeak website
to analyse the
live stream
Stores the sensors data in
thinspeak
Generate alert
IF
SENSO
R
DATA
Y
E
S
NO
Figure 12: Flow Chart of Temperature Sensor
27. 19
7. TESTING
7.1 FUNCTIONAL TESTING
To get alert about patient condition for doctor or any correspondent they have to
install the application and even they get message.
Storing: All the collected information is stored in a cloud service in order to
make analysis about the patient health condition.
Monitor: After the installation of sensors to patient all the time the patient is
being monitored and making analysis with the help of previous recorded data.
Analysis: The collected information in the cloud being analyzed with the
conditions whether the patient’s heartbeat and oxygen levels normal or not.
Alert: After the complete analysis if the patient is in critical condition.
7.2. STRUCTURAL TESTING
Uesd to test the structure of code.
understanding and knowing of code is required, so, it is mostly done by the developers
7.3. LEVEL OF TESTING
UNIT/COMPONENT TESTING
The most basic type of testing is unit testing.
Unit or component testing aims to verify each part of the software by
isolating it and then perform tests to demonstrate that each
individualcomponent is correct in terms of fulfilling requirements anthe
desired functionality.
28. 20
INTEGRATION TESTING
This type of testing is used to test different parts of the system.
By testing the units in the groups, any fault in the way then they
interact together can be acknowledged.
SYSTEM TESTING
All the components of the software are tested as a whole in order to ensure
that the overall product meets the requirements specified.
ACCEPTANCE TESTING
Acceptance testing is the level in the software testing process to check quality
of the product. The aim of this type of testing is to evaluate whether the system
complies with the end-user requirements and see this is ready for to deployment or
not.
Figure 13: Testing Levels
29. 21
8. IMPLEMENTATION
Implementation of the project:
pulse and temperature sensor values are calculated with Node MCU .
Conversion plan:
We used Nodemcu as it is a micro controller. The Node MCU is an open
source software and hardware development environment that is built
around a very inexpensive System-on-a-Chip called the ESP8266.
Contains all crucial elements of the today’s computer: CPU, RAM,
networking, routing and even a modern operating system and SDK.
Connecting Pulse sensor to Nodemcu based on the circuit diagram:
Pulse Sensor has 3 pins one is signal pin second is VCC and third is ground
Signal Pin is Connected to A0 of Nodemcu
Nodemcu VCC and Ground are connected to VCC(+) and Ground(-)
To get the output we have to upload the code to Nodemcu using Arduino IDE.
Using Nodemcu we can send the sensor data to cloud/server or platform In this project
we are using ThingSpeak an IoT platform to Store the sensor data.
We are using IFTTT creating applets and events to send an alert to the Doctor about
Patient Health Condition.
After creating event we will copy the event link and paste it in thingHttp for the event
to be triggered and we will create the react for thingHttp for the event to be happened.
When react section is over the alert or messaging happen to the mobile number
provided in IFTTT .
Same procedure we have to follow with LM35 temperature sensor
Temperature Sensor has 3 pins one is signal pin second is VCC and third is ground
A0 of Nodemcu is Connected to Signal Pin
Nodemcu VCC and Ground are connected to VCC(+) and Ground(-)
To get the output we have to upload the code to Nodemcu using Arduino IDE.
Using Nodemcu we can send the sensor data to cloud/server or platform In this project
we are using ThingSpeak an IoT platform to Store the sensor data.
30. 22
We are using IFTTT creating applets and events to send an alert to the Doctor about
Patient Health Condition.
After creating event we will copy the event link and paste it in thingHttp for the event
to be triggered and we will create the react for thingHttp for the event to be happened.
After this the doctor gets message or an alert as we are providing the doctor mobile
number in IFTTT so it sends an alert when the event happened.
Post-Implementation and Software maintenance:
After Implementation we have taken the readings and given the condition
to generate alert and informing doctor about patient health.
31. 23
9. PROJECT LEGACY
9.1. CURRENT STATUS OF THE PROJECT
Smart Health Care using sensors to detect the pulse and temperature of the patient and
intimating to Doctor about patient health condition as per the objectives of our capstone
project the work is done.But for future service we need to work on the accurate values and
reduce noise of the sensor and we need to send the values of pulse and temperature to
Doctor.Be specific about the patient like his name and ID should be mentioned in the alert
Message.
9.2. REMAINING AREAS OF CONCERN
As we said the only concern of the project is related toits future but not regarding the
capstone.
9.3. TECHNICAL AND MANAGERIAL LESSON LEARNT
We have Learned about microcontrollers like Nodemcu and arduino and we have learned
about ESP8266 wifi module and arduino IDE and it’s libraries, and how to use ThingSpeak
platform for storing the values and generating alert by creating applets and events with help
of IFTTT.
32. 24
10. USER GUIDE
In this project we are having sensors like pulse and temperature to show results of patient
heartbeat and temperature levels.
For this patient have to connect the micro controller unit which is basically a nodemcu
connect to a power source through usb either to a power bank or a system.
Then patient have to place sensor on his/her body to see the values.
If the temperature and pulse values of patient exceeds then they will get a alert message
regarding same.
If patient or any volunteer wants to check the entire analysis of the patient then they have
login to a website which is basically a cloud platform ( www.thingspeak.com ) using
login credentials to view the data.
33. 25
11. SOURCE CODE
Here in our project we have to make two separate codes for two different sensors pulse
sensor and LM35 temperature sensor. We have to integrate specific Api keys of thingspeak
channels for uploading the sensing data to cloud server for analysis.
11.1. CODE FOR PULSE SENSOR
#define pulsePin A0
// A0 is a data pin in nodemcu
#include <ESP8266WiFi.h>
const char* ssid = "Srikanth";
// Have to enter WiFi ssid name
const char* password = "12345678";
//Have to enter WiFi password
WiFiClient client;
const int channelID = 883037;
//Insert the thingspeak channelID
String writeAPIKey = "MQUZ1XPK3EESIAI0";
//API key of channel for data transmission
const char* server = "api.thingspeak.com";
// server name
const int postingInterval = 10 * 1000;
//Interval time of sensing data to share
int rate[10];
38. 30
}
}
void detectSetHighLow() {
if (Signal < thresh && N > (IBI / 5) * 3) {
//avoid noise by waiting 3/5 of last
if (Signal < T) {
T = Signal;
//keep track of lowest in pulse wave
}
}
if (Signal > thresh && Signal > P) {
//thresh condition helps to avoid noise
P = Signal;
//p is the peak
}
}
void pulseDetected() {
Pulse = true;
IBI = sampleCounter - lastBeatTime;
lastBeatTime = sampleCounter;
if (firstBeat) {
39. 31
//if this is the first beat
firstBeat = false;
//clear first beat flag
return;
}
if (secondBeat) {
//if there is a second beat
secondBeat = false;
//clear second beat flag
for (int i = 0; i <= 9; i++) {
//seed the running total to get a realistic BPM at startup
rate[i] = IBI;
}
}
word runningTotal = 0;
//clear the running total variable
for (int i = 0; i <= 8; i++) {
//shift the data in rate array
rate[i] = rate[i + 1];
//drop the latest IBI value
runningTotal += rate[i];
41. 33
client.println("Content-Length: " + String(body.length()));
client.println("");
client.print(body);
}
client.stop();
delay(15);
//Delay time for uploading data in thingspeak server
}
11.2. CODE FOR TEMPERATURE SENOSOR
#include <ESP8266WiFi.h>
String apiWritekey = "PJKM7XMQ7QOPE42O";
// replace with your THINGSPEAK WRITEAPI key here
const char* ssid = "Srikanth";
// your wifi SSID name
const char* password = "12345678" ;
// wifi pasword
const char* server = "api.thingspeak.com";
float resolution=3.3/1023;
// 3.3 is the supply volt & 1023 is max analog read value
44. 36
11.3. IFTTT WEBSITE
IFTTT is an automation platform, it interacts and helps for communication between
different apps, web services, and devices to trigger user-specifications through Applets.
IFTTT is free service allows you to connect your favorite services that you use everyday
such as Amazon Alexa or Drop box for sharing files with colleagues. FTTT is also an easy
way to introduce automation into your life so that you can skip the tedious daily tasks and
get more important things done.
For alert the patient we have to use IFTTT website to send message to the correspondent
of the patient. For that we have to create an applet of webhooks
For creating webhook we have to go to create option and then have to click on THIS
option then select webhook then in THAT option we have to select clicksend sms service
for message receiving.
Acronym for IFTTT is “If This Then That”
45. 37
click on the “receive a web request” option.
Then we will get a trigger option to create an event like shown in below figure.
After entering event name we have to click on the create button to move to next step.
Then we have to click on THAT option to select another service clicksend to sending a
message of the receiving data.
In click send we will get a option like “Send sms” we have to select that option to set our
credentials whom to send the message.
After filling the details we simply have to click on create action button.
Figure 14: IFTTT Create Page
47. 39
11.4 THINGSPEAK
ThingSpeak is an IoT platform service that allows you to visualize, aggregate, and analyze live
data streams in the cloud.
Sending data to thingspeak is possible from your devices and creating instant visualization of
data and helps to send alerts.
Collect the data - Send Sensor Data Privately to cloud
Analyze and Visualize The data with MATLAB
Trigger a Reaction
Data collection is possible in thingspeak from various sources.
Click New Channel to create a new ThingSpeak channel.
Figure 17: ThingSpeak Platform
48. 40
Channels store all the data that a ThingSpeak application collects. Speak apps to analyze
and visualize it. Once you collect data in a channel, you can use Thing
Channel Settings
o Percentage complete: Calculated based on data entered into the various fields of
a channel. Enter the name, description, location, URL, video, and tags to complete
your channel.
o Channel Name: Enter a unique name for the ThingSpeak channel.
o Description: Enter a description of the ThingSpeak channel.
o Field#: Check the box to enable the field, and enter a field name. 8 fields
maximum for a channel is possible.
o Metadata: Have to enter information about channel data, including JSON, XML,
or CSV data.
Figure 18: ThingSpeak Create Channel
49. 41
o Tags: keywords are used to identify the channel. For Separate tags have to use
commas.
o Link to External Site: If you have a website that contains information about your
ThingSpeak channel, specify the URL.
o Show Channel Location:
o Latitude: Enter latitude position in decimal degrees.
o Longitude: Enter the longitude position in decimal degrees.
o Elevation: Enter the elevation position meters.
o Video URL: If you have a YouTube™ or Vimeo® video that displays your
channel information, specify the full path of the video URL
.
Save the channel and now channel was created.
Figure 19: ThingSpeak Create Channel
50. 42
These are the channels we created to store the values of Temperature and BPM from
Sensors
Here is the BPM of the patient stored in Thingspeak Platform.
Figure 20: ThingSpeak Channels View
Figure 21: ThingSpeak Channel Private View
51. 43
While creating a channel API keys are auto generated.
Write data to a channel or read data from a private channel can possible wirh API keys
API Keys Settings
Write API Key: To write data to channel . If you feel your key has been compromised,
click Generate New Write API Key
Read API Keys: For public view of our private channel have to Use this key to view
your private channel feeds and charts. Click Generate New Read API Key to generate a
fresh key for the channel.
ThingSpeak allows you to control who can view the data in your channel. Irrespective of
the settings on this tab, reading data from or writing data to the fields of a channel
requires the appropriate API key for the channel.
Figure 22: ThingSpeak Channel API KEY
52. 44
Similarly,This is the channel for Temperature to store temperature of the patient.
Click on Apps in The menu Bar and Select ThingHTTP
Figure 23: ThingSpeak Channel Sharing
Figure 24: ThingSpeak Channel Private View (Temperature)
53. 45
ThingHTTP enables communication among websites, devices, and web services without
having to apply the protocol on the device level. You specify actions in ThingHTTP,
which you activate using other ThingSpeak apps such as TimeControl, TweetControl,
and React.
Click New ThingHTTP to create a new HTTP request.
Figure 25: ThingSpeak Channel Private View
54. 46
You can now send your ThingHTTP request and view the response.
Give Name and URL in their particular fields.
Here we have to go to IFTTT website the process which we shown you earlier.
Login to IFTTT then go to my services have to select webhook and on the top right
corner you can see documentation button by clicking on that you can set the url of the
event in thinghttp.
Figure 26: ThingSpeak ThingHTTP
55. 47
Similarly for temperature sensor also we havo to create IFTTT service and then thinghttp
and react.
For Temperature
Click on Apps in the Menu Bar and Select React
Figure 27: ThingSpeak Create ThingHTTP
Figure 28: ThingSpeak ThingHTTP
56. 48
React works with ThingHTTP, ThingTweet, and MATLAB Analysis apps to perform
actions when channel data meets a certain condition.
To create a new reaction, click New React.
Figure 29: ThingSpeak Create React
57. 49
We are creating Alert with help of React
Where we are giving the condition if the BPM is greater than 100 the alert is generated
Figure 30: ThingSpeak React
Figure 31: ThingSpeak React view
58. 50
We are giving the condition if the BPM is less than 60 the alert is generated.
React For Temperature if temperature is greater than 99.4 F generating Alert.
Figure 32: ThingSpeak React View
Figure 33: ThingSpeak React View
59. 51
12.BIBLIOGRAPHY
Books
[1] Sharma S. “Evolution of as-a-Service Era in Cloud”. arXiv preprint arXiv:1507.00939. 2015
Jun 29.
[2] T.A.Rao. (2014)." Cloud computing and Internet of Things based Cloud Manufacturing
service system". India: Akash Series Publisher.
Websites
[1] FitBit Inc., “flex: Wireless activity + sleep wristband,” accessed October 2019. [Online].
Available: https://www.fitbit.com/flex
[2] Apple Inc., “Apple watch,” accessed October 2019. [Online]. Available:
https://www.apple.com/watch
[3] ThingSpeak."User Guide of ThingSpeak" accessed September 2019 [Online]ThingSpeak
service: http://www.thingspeak.com
[4] IFTTT ."To create web based services" accessed September 2019 [Online].Available :
http://www.ifttt.com
[5] ClickSend Inc., “Clicksend SMS,”accessed October 2019 [Online]
Available:http://clicksend.com/in/