Professional Documents
Culture Documents
Arduino Based Heart Beat Monitoring System: A Major Project Report
Arduino Based Heart Beat Monitoring System: A Major Project Report
Arduino Based Heart Beat Monitoring System: A Major Project Report
A
MAJOR PROJECT REPORT
Submitted in partial fulfillment of the requirements
for the degree of
BACHELOR OF ENGINEERING
in
ELECTRONICS AND COMMUNICATION ENGINEERING
BY
IQRA BANO (0105EC171034)
JHALAK DUBEY (0105EC171037)
MEGHA SHARMA (0105EC171051)
POOJA VASWANI (0105EC171034)
PRANAV CHATURVEDI (0105EC171034)
JUNE 2021
DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING
ORIENTAL INSTITUTE OF SCIENCE AND TECHNOLOGY
BHOPAL (M.P)
JUNE 2021
CERTIFICATE
I hereby certify that the work which is being presented in the B.E. Major Project Report entitled
“Arduino Based Heartbeat Monitoring System”, being submitted by Iqra Bano (0105EC171034),
Jhalak Dubey (0105EC171037), Megha Sharma (0105EC171051), Pooja Vaswani (0105EC171061),
Pranav Chaturvedi(0105EC171062)in partial fulfillment of the requirements for the award of the degree
of Bachelor of Engineering in Electronics and Communication Engineering and submitted to the
Department of Electronics and Communication Engineering , Oriental Institute of Science and Technology,
Bhopal (M.P.) is an authentic record of my own work carried out during the period from Jan 2021 to May
2021 under the supervision of Dr. Nikita Shivhare, Assistant Professor, ECE Department.
The content presented in this project has not been submitted by me for the award of any other degree
elsewhere.
This is to certify that the above statement made by the candidate is correct to the best of my knowledge.
Heart Beat Detection and Monitoring System using Arduino that will detect the heart beat
using the Pulse Sensor and will show the readings in BPM (Beats Per Minute) on the LCD
connected to it.
It will also send the readings to Thing Speak server using the Wi-Fi module ESP8266, so
that Heart Beats can be monitored from anywhere in the world over the internet.
Thing Speak is a great source for displaying the data online and you can access the data
from Thing Speak at any time and at any place.
ACKNOWLEDGMENT
This project involved the collection and analysis of information from a wide variety of
sources and the efforts of many people beyond me. Thus it would not have been possible
to achieve the results reported in this document without their help, support and
encouragement.
I would like to express my gratitude to the following people for their help in the work
leading to this report:
Dr. Rajesh Shukla; Director: for providing us with an environment to complete our
project successfully.
Dr. Manish Sawale; Head, Department of ECE, who modeled us both technically and
morally for achieving the greater success to complete the project and for organizing and
coordinating the B.E. Projects’ 2021.
Prof. Dr. Nikita Shivhare; Project supervisor: for their useful comments on the subject
matter and for the knowledge I gained by sharing ideas with them.
We also thank all the staff members of our college and technicians for their help in
making this project a successful one.
Finally, we take this opportunity to extend our deep appreciation to our family and
friends, for all that they meant to us during the crucial times of the completion of our
project.
iv
TABLE OF CONTENTS
Certificate………………………………………………………………………… i
Abstract…………………………………………………………………………… ii
Acknowledgement……………………………………………………………… iv
List of Tables …………………………………………………………………… vii
List of Figures …………………………………………………………………… viii
List of Abbreviation ……………………………………………………………… ix
CHAPTER - 1 Introduction 1
1.1 Overview 1
1.2 Objective of the Project 1
1.3 About the Project 2
1.4 Basic Working Steps 2
CHAPTER – 2 Literature Survey 4
CHAPTER – 3 Methodology 6
CHAPTER – 4 Proposed Project Design 8
4.1 Proposed Architecture Design 8
4.2 Circuit Diagram 10
CHAPTER – 5 Sensors and Modules 11
5.1 Arduino Uno 11
5.2 Pulse Sensor 13
5.3 DHT-11 15
5.4 Breadboard 16
5.5 ESP8266 17
5.6 Blynk Module 19
5.7 Jumper wires 20
Requirement Analysis 21
CHAPTER 6 6.1 Functional Requirements 21
6.2 Software Specification 21
6.3 Hardware Specification 22
CHAPTER 7 PROGRAM CODE 23
7.1 Arduino Code 23
7.2 Blynk Code 28
CHAPTER 8 Testing And Performance Of The System 31
8.1 Testing levels 31
8.2 System Tests 32
8.3 Performance of the system 32
8.4 Fault Tolerance 34
CHAPTER 9 Future Works And Challenges Ahead 35
9.1 Future works 35
9.2 Challenges Ahead 36
CHAPTER 10 Conclusion 37
Reference………………………………………………………………………. 38
LIST OF TABLES
vii
LIST OF FIGURES
Figure 4.1 Block Diagram Design 8
viii
LIST OF ABBREVIATIONS
ix
CHAPTER 1
INTRODUCTION
1.1 Overview
The modern visionary of healthcare industry is to provide better healthcare to people in a
more economic and patient friendly manner. Therefore, for increasing the patient care
efficiency, there arises a need to improve the patient monitoring devices. The medical
world today faces the most major problem that is the need of health care providers
presence near the bedside of the patient. In this busy lifestyle, monitoring our health
condition is becoming hectic so everyone expects to know about their health conditions
using some smart technology which can be easily accessible and is effective.
It is cost effective. It can increase the efficiency through better management of patient
monitoring, shared health professional staffing. Tele monitoring involves remotely
monitoring the patient health care. These devices keep track of Oxygen Saturation that is
spo2%, heart rate, body temperature etc. of the patient. The Telemedicine system consists
of customized hardware and software at both the patient and specialist doctor ends.
This project discusses the advantages of using android technology and Arduino for
patient health monitoring system. In this technology the data is collected from a patient,
to feed the same to two separate interfaces in which the patient parameters and details is
displayed and sync the important information to a web-based server. This can in turn be
accessed by the doctor using an application installed in his android phone. He can
analyze and send feedback in order to take preventive measures before he reaches the
hospital in serious case. One message is also sent to their respective family members
through their Smartphone application.
1
Hence, this project can be used to help the patients monitoring and assistance by using
the trending technology. As its well known that Internet of Things is considered now as
one of the feasible solutions for any remote value tracking especially in the field of health
monitoring.
Health is always a major concern in every growth the human race is advancing in terms
of technology. The world is currently in a very unusual dilemma, also known as novel
Covid-19. With over millions of cases around the world, one of the most challenging jobs
are those of doctors. As a team we wanted to help protect doctors as well as patients. The
basic idea is to reduce physical contact in between doctors and patients, because covid-19
can spread quickly in this manner. After some research and few failed ideas, it was found
that doctors constantly check symptomatic and asymptomatic patient’s temperature, pulse
and oxygen saturation. So, a system which can monitor these readings at home and will
be accessible by the doctors and patients both could be very useful.
Remote Patient Monitoring arrangement empowers observation of patients outside of
costomary clinic settings(e.g. at home),
This Health Monitoring system enables the doctor to know about the patient’s health and
access all the previous readings of temperature, oxygen saturation etc. The Doctors can
immediately check the health condition of the patient and get to know about any
seriousness. This project will be very helpful for the Covid positive patients who are
isolated at home. In-charge doctor can keep a track on their patient’s health and their
well-being.
The system has been designed to take several inputs in physiological parameters of
human such as temperature, heart rate, oxygen saturation etc and sending and saving it to
an accessible platform as well as displaying it on to the LCD.
2
any project. The data that will be sensed by the sensor will then be transmitted to the
microcontroller and will be displayed on the Lcd screen further. The data will also be
recorded on the Third-part open-source platform Blynk which is present as a mobile
application.
3
CHAPTER-2
2. LITERATURE SURVEY
In the olden days the patients health was monitored by catching his /her hand by checking
their pulses. As, the time passed on and the technology for monitoring health got
introduced, the quality of measuring and understanding the health conditions got better.
The development in the technology grew to such an extent that now a days by wearing a
small device, patients health is getting monitored. The below figure shows the evolution
of medical equipments.
Number of different research projects explores sensor networks for monitoring patient
health 24 hours. Few projects are concerned with developing wearable wrist worn belt,
while others have developed based for monitoring individual patients during daily
activity, at home, or in hospital. Han and Yuo et.al proposed wireless sensor network-
based e-health system based on radio-active and radio-passive positioning. Authors
proposed wireless sensor network application for 24 hours constant monitoring without
disturbing daily activities of elderly people and their caretakers. In this system both fixed
and mobile body sensors are used. A mixed positing algorithm is proposed to determine
the location of elderly person. The purpose of positing is to help the system to determine
the person activities and further to make decisions about patient health condition.
U. Anliker, J. A. Ward et.al has developed also developed a remote health monitoring
system. Remote health monitoring system aimed at people at risk from any disease. The
system combines multi parameter measurement displaying them real-time for the patient
and also recording or saving it to a platform which can be accessed by the doctor anytime
and anywhere.
In this project the patient health monitoring is done by using a smartphone. The patients
Oxygen saturation that is spo2%, pulse rate, temperature and humidity all the vitals
which are very important during this Covid era is collected by using sensors. The
microcontroller that is used is Arduino uno along with ESP8266.
Traditionally the detection system was only found in hospitals with bulky hardware and
required high power supply, also they were very costly. Advancement in Semiconductor
industry has led to sensors and microcontrollers at affordable prices.
4
Social distancing, less physical contact and staying at home are the only measures that
can be taken to prevent the spread of Corona virus in these tough times. Symptomatic
people with mild symptoms who are home quarantined should have a record of their
temperature, spo2% etc and their doctor in-charge should also be aware of their health
conditions on daily basis. Asymptomatic patients who are tested positive but shows no
symptoms should also monitor themselves regularly and should be in-touch with their
doctors. This system plays a vital role in the recovery of asymptomatic patients, as testing
of the spo2% at least thrice a day is very important to figure out any silent respiratory
damage.
Every time it’s not possible for doctors to receive calls from their patients to know their
Heart rate, spo2 etc. Even its difficult for a covid positive sick person to record the
required quantities each time they measure it. This system is so convenient for patients
and doctors both as they access the record of important parameters such as Heart rate,
temperature and oxygen saturation anytime anywhere.
In condition of falling spo2 or abnormal heartbeat Doctors can immediately monitor and
prescribe something to the patients or can hospitalize them if required.
5
CHAPTER-3
METHODOLOGY
6
Along with the microcontroller and sensors Blynk android app is also be used.
Data transfer to cloud using mobile technology and IoT technology. To use this
application user needs a Wi-Fi connection. Arduino board connects to Wi-Fi network
functionality using Wi-Fi module. Arduino board learned sin from sensors. After this
installation is sent to IoT cloud with the help of Wi-Fi module. Rated inputs display on
lcd screen. At the same time data is sent to the IoT platform and measured data will then
be displayed on the screen when the application is opened.
7
CHAPTER-4
8
2. PULSE SENSOR- This sensor is used to sense the pulse rate. After sensing the
physical quantity this module will send the output signals to the Arduino uno micro
controller for further operations.
3. DHT-11- This sensor is used to sense the temperature and Humidity both. After
sensing the physical quantities, the output data will be sent to the micro controller for
further processing.
4. ESP8266- This is a user-friendly device that provide internet connectivity at low cost.
It’s used along with Arduino uno to give access to internet connectivity to this project.
5. LCD DISPLAY- Liquid Crystal display is a kind of electronic display module. The
data after being processed by the Arduino uno are then transmitted to the lcd display as
an output or as the part of final result for the project.
6. BLYNK: It is a platform with IOS and android apps to control Arduino over internet.
In this project design the output of Arduino will be transmitted to the Blynk and will be
stored there for future references.
Software Designing will include the coding part. Arduino IDE is used for uploading the
required code to the Microcontroller. The interfacing of all other hardware components to
the Arduino board is also a part of software designing.
Setting up the Blynk application also comes under the software part.
9
4. 2 Circuit Diagram
10
CHAPTER-5
LED: There is a built-in LED driven by digital pin 13. When the pin is high value, the
LED is on, when the pin is low, it is off.
VIN: The input voltage to the Arduino/Genuino board when it is using an external power
source (as opposed to 5 volts from the USB connection or other regulated power source).
You can supply voltage through this pin, or, if supplying voltage via the power jack,
access it through this pin.
11
5V: This pin outputs a regulated 5V from the regulator on the board. The board can be
supplied with power either from the DC power jack (7 - 20V), the USB connector (5V),
or the VIN pin of the board (7-20V). Supplying voltage via the 5V or 3.3V pins bypasses
the regulator, and can damage the board.
3V3: A 3.3 volt supply generated by the on-board regulator. Maximum current draw is 50
mA.
IOREF: This pin on the Arduino/Genuino board provides the voltage reference with
which the microcontroller operates. A properly configured shield can read the IOREF pin
voltage and select the appropriate power source, or enable voltage translators on the
outputs to work with the 5V or 3.3V.
Reset: Typically used to add a reset button to shields that block the one on the board.
Each of the 14 digital pins and 6 analog pins on the Uno can be used as an input or
output, under software control (using pinMode(), digitalWrite(), and digitalRead()
functions). They operate at 5 volts. Each pin can provide or receive 20 mA as the
recommended operating condition and has an internal pull-up resistor (disconnected by
default) of 20-50K ohm. A maximum of 40mA must not be exceeded on any I/O pin to
avoid permanent damage to the microcontroller. The Uno has 6 analog inputs, labeled A0
through A5; each provides 10 bits of resolution (i.e., 1024 different values). By default,
they measure from ground to 5 volts, though it is possible to change the upper end of the
range using the AREF pin and the analog function.
Communication:
The Arduino Uno has a number of facilities for communicating with a computer, another
Arduino board, or other microcontrollers. The ATmega328 provides UART TTL (5V)
serial communication, which is available on digital pins 0 (RX) and 1 (TX). An
12
ATmega16U2 on the board channels this serial communication over USB and appears as
a virtual com port to software on the computer. The 16U2 firmware uses the standard
USB COM drivers, and no external driver is needed. However, on Windows, a .inf file is
required. Arduino Software (IDE) includes a serial monitor which allows simple textual
data to be sent to and from the board. The RX and TX LEDs on the board will flash when
data is being transmitted via the USB-to-serial chip and USB connection to the computer
(but not for serial communication on pins 0 and 1). A Software Serial library allows serial
communication on any of the Uno's digital pins.
• Pulse Sensor is a low cost, very small size a plug-and-play heart rate sensor for Arduino
and Arduino compatible boards. It can be used by students, artists, athletes, makers, and
game & mobile developers who want to easily incorporate live heart-rate data into their
projects.
• Pulse Sensor Amped adds amplification and noise cancellation circuitry to the hardware.
It's noticeably faster and easier to get reliable pulse readings. Pulse Sensor works with
either a 3V or 5V Arduino.
• A Color-Coded Cable, with a standard male header connector. Plug it straight into an
Arduino or a Breadboard. No soldering is required.
13
Figure 5.2: PULSE SENSOR
Features:
5.3 DHT-11
This sensor is used to sense or detect the temperature and humidity. Its features and given
in the below table.
Dimensions 29.0mm*18.0mm
14
Pin specification along with its Descriptions:
Pin 1: DOUT – It’s the communication port.
Pin 2: GND – Power ground
Pin 3: VCC – Positive Power supply (3.3v to 5.5v)
15
5.4 Breadboards:
A breadboard is a rectangular plastic board with a bunch of tiny holes in it. These holes
let you easily insert electronic components to prototype (meaning to build and test an
early version of) an electronic circuit, like this one with a battery, switch, resistor, and an
LED (light-emitting diode).A breadboard is a construction base for prototyping Operating
voltage: 4.8 V (~5V). Originally it was literally a bread board, a polished piece of wood
used for slicing bread. In the 1970s the solder less breadboard (AKA plug board, a
terminal array board) became available and nowadays the term "breadboard" is
commonly used to refer to these. "Breadboard" is also a synonym for "prototype".
The breadboard has strips of metal underneath the board and connects the holes on the
top of the board. The metal strips are laid out as shown below. Note that the top and
bottom rows of holes are connected horizontally and split in the middle while the
remaining holes are connected vertically.
Breadboards are designed to work with through-hole electronic components. These
components have long metal leads that are designed to be inserted through holes in a
printed circuit board (PCB) that are plated with a thin copper coating, which allows the
components' leads to be soldered to the board.
Holes in a breadboard which are electrically connected are said to be at the same node in
a circuit. A node is a point in a circuit where two or more components are interconnected
by a short circuit. No energy is required to transfer current through a short circuit, so the
short circuit does not restrict the flow of current—it has zero resistance. This means that
there can be (theoretically) no voltage difference between two holes in any single row in
a breadboard.No current will flow from one hole to another on a breadboard if the holes
are not electrically connected. Different physical points in a circuit which are not
electrically connected are sometimes said to be connected by an open circuit. No current
can flow through an open circuit. There is no limit to the possible voltage difference
across an open circuit.
16
Figure 5.4:Breadboard
5.5 ESP8266
The ESP8266 is a very user-friendly and low-cost device to provide internet connectivity
to your projects. The module can work both as an Access point (can create hotspot) and
as a station (can connect to Wi-Fi), hence it can easily fetch data and upload it to the
internet making the Internet of Things as easy as possible. It can also fetch data from the
internet using API’s hence your project could access any information that is available on
the internet, thus making it smarter. Another exciting feature of this module is that it can
be programmed using the Arduino IDE which makes it a lot more user friendly.
This module has a powerful enough on-board processing and storage capability that
allows it to be integrated with the sensors and other application specific devices through
its GPIOs with minimal development up-front and minimal loading during runtime. Its
high degree of on-chip integration allows for minimal external circuitry, including the
front-end module, is designed to occupy minimal PCB area. The ESP8266 supports
APSD for VoIP applications and Bluetooth co-existance interfaces, it contains a self-
calibrated RF allowing it to work under all operating conditions, and requires no external
RF parts.
17
The ESP8266 module works with 3.3V only, anything more than 3.7V would kill the
module hence be cautions with your circuits. Here is its pins description.
Pin 1: Ground: Connected to the ground of the circuit
Pin 2: Tx/GPIO – 1: Connected to Rx pin of programmer/uC to upload program
Pin 3: GPIO – 2: General purpose Input/output pin
Pin 4: CH_EN: Chip Enable/Active high
Pin 5: Flash/GPIO – 0: General purpose Input/output pin
Pin 6: Reset: Resets the module
Pin 7: RX/GPIO – 3: General purpose Input/output pin
Pin 8: Vcc: Connect to +3.3V only.
5.6 Blynk :
Blynk is the most popular IoT platform for connecting devices to the cloud, designing
apps to remotely control and monitor them, and managing thousands of deployed
products. It's a PaaS (Platform-as-a-Service) that helps individuals and organizations to
seamlessly progress from a protoype of a connected product to its commercial launch.
With over 400 hardware models support, customers can connect any device to the
Internet and use suit of software products to launch commercial projects.
Blynk is a Platform with IOS and Android apps to control Arduino, Raspberry Pi and the
likes over the Internet. It’s a digital dashboard where you can build a graphic interface for
your project by simply dragging and dropping widgets. After downloading the app, create
an account and log in. (If possible than log in with your real mail id for better
connectivity later.) You’ll also need to install the Blynk Arduino Library, which helps
generate the firmware running on your ESP8266.
Blynk was designed for the Internet of Things. It can control hardware remotely, it can
display sensor data, it can store data, visualize it and do many other cool things.
There are three major components in the platform:
Blynk App - allows to you create amazing interfaces for your projects using
various widgets we provide.
Blynk Server - responsible for all the communications between the smartphone
18
and hardware. You can use our Blynk Cloud or run your private Blynk server locally.
It’s open-source, could easily handle thousands of devices and can even be launched
on a Raspberry Pi.
Blynk Libraries - for all the popular hardware platforms - enable communication
with the server and process all the incoming and out coming commands.
Jump wires (also called jumper wires) for solderless breadboarding can be obtained in
ready-to-use jump wire sets or can be manually manufactured. The latter can become
tedious work for larger circuits. Ready-to-use jump wires come in different qualities,
some even with tiny plugs attached to the wire ends. Jump wire material for ready-made
or homemade wires should usually be 22 AWG (0.33 mm2) solid copper, tin-plated wire -
assuming no tiny plugs are to be attached to the wire ends. The wire ends should be
stripped 3⁄ 16 to 5⁄ 16 in (4.8 to 7.9 mm). Shorter stripped wires might result in bad
contact with the board's spring clips (insulation being caught in the springs). Longer
stripped wires increase the likelihood of short-circuits on the board. Needle-nose
pliers and tweezers are helpful when inserting or removing wires, particularly on
crowded boards.
Differently colored wires and color-coding discipline are often adhered to for
19
consistency. However, the number of available colors is typically far fewer than the
number of signal types or paths
Jumper wires typically come in three versions: male-to-male, male-to-female and female-
to-female. The difference between each is in the end point of the wire. Male ends have a
pin protruding and can plug into things, while female ends do not and are used to plug
things into. Male-to-male jumper wires are the most common and what you likely will
use most often. When connecting two ports on a breadboard, a male-to-male wire is what
you’ll need.
20
CHAPTER 6
REQUIREMENT ANALYSIS
Requirement Analysis is the first and important phase of the software developing activity
in developing any kind of project effectively. I started to list out all the functionalities
that my application should provide. There have been some minor changes with respect to
the functionalities over the course of development.
21
6.3.5 Technologies used: C, SQL, PHP
22
CHAPTER 7
Program Code
7.1 Arduino Code
#include <SoftwareSerial.h>
#define DEBUG true
SoftwareSerial esp8266(9,10);
#include <LiquidCrystal.h>
#include <stdlib.h>
LiquidCrystal lcd(12,11,5,4,3,2);
//Variables
float temp;
int hum;
String tempC;
int error;
int pulsePin = 0; // Pulse Sensor purple wire connected to analog pin 0
int blinkPin = 13; // pin to blink led at each beat
int fadePin = 5;
int fadeRate = 0;
void setup()
{
23
lcd.begin(16, 2);
lcd.print("circuitdigest.com");
delay(100);
lcd.setCursor(0,1);
lcd.print("Connecting...");
Serial.begin(9600); //or use default 115200.
esp8266.begin(9600);
Serial.println("AT");
esp8266.println("AT");
delay(5000);
if(esp8266.find("OK")){
connectWiFi();
}
interruptSetup();
}
void loop(){
lcd.clear();
start: //label
error=0;
lcd.setCursor(0, 0);
lcd.print("BPM = ");
lcd.print(BPM);
delay (100);
lcd.setCursor(0, 1); // set the cursor to column 0, line 2
delay(1000);
updatebeat();
//Resend if transmission is not completed
if (error==1){
goto start; //go to label "start"
}
delay(1000);
}
void updatebeat(){
String cmd = "AT+CIPSTART=\"TCP\",\"";
cmd += IP;
cmd += "\",80";
Serial.println(cmd);
esp8266.println(cmd);
delay(2000);
if(esp8266.find("Error")){
return;
}
cmd = msg ;
cmd += "&field1=";
cmd += BPM;
cmd += "\r\n";
Serial.print("AT+CIPSEND=");
esp8266.print("AT+CIPSEND=");
Serial.println(cmd.length());
24
esp8266.println(cmd.length());
if(esp8266.find(">")){
Serial.print(cmd);
esp8266.print(cmd);
}
else{
Serial.println("AT+CIPCLOSE");
esp8266.println("AT+CIPCLOSE");
//Resend...
error=1;
}
}
boolean connectWiFi(){
Serial.println("AT+CWMODE=1");
esp8266.println("AT+CWMODE=1");
delay(2000);
String cmd="AT+CWJAP=\"";
cmd+=SSID;
cmd+="\",\"";
cmd+=PASS;
cmd+="\"";
Serial.println(cmd);
esp8266.println(cmd);
delay(5000);
if(esp8266.find("OK")){
Serial.println("OK");
return true;
}else{
return false;
}
}
void interruptSetup(){
TCCR2A = 0x02; // DISABLE PWM ON DIGITAL PINS 3 AND 11, AND GO INTO CTC MODE
TCCR2B = 0x06; // DON'T FORCE COMPARE, 256 PRESCALER
OCR2A = 0X7C; // SET THE TOP OF THE COUNT TO 124 FOR 500Hz SAMPLE RATE
TIMSK2 = 0x02; // ENABLE INTERRUPT ON MATCH BETWEEN TIMER2 AND OCR2A
sei(); // MAKE SURE GLOBAL INTERRUPTS ARE ENABLED
}
if(Signal > thresh && Signal > P){ // thresh condition helps avoid noise
P = Signal; // P is the peak
} // keep track of highest point in pulse wave
if (Signal < thresh && Pulse == true){ // when the values are going down, the beat is over
digitalWrite(blinkPin,LOW); // turn off pin 13 LED
Pulse = false; // reset the Pulse flag so we can do it again
amp = P - T; // get amplitude of the pulse wave
thresh = amp/2 + T; // set thresh at 50% of the amplitude
P = thresh; // reset these for next time
T = thresh;
}
26
if (N > 2500){ // if 2.5 seconds go by without a beat
thresh = 512; // set thresh default
P = 512; // set P default
T = 512; // set T default
lastBeatTime = sampleCounter; // bring the lastBeatTime up to date
firstBeat = true; // set these to avoid noise
secondBeat = false; // when we get the heartbeat back
}
sei();
// enable interrupts when youre done!
}//
27
7.2 BLYNK CODE
#define BLYNK_PRINT Serial
#include <SPI.h>
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
#include <SoftwareSerial.h>
#include <SimpleTimer.h>
#include <DHT.h>
WidgetLCD lcd(V5);
char auth[] = " N3DSPIbgRdaMPvtNMdXH0qyCCAMEBV33";
char ssid[] = "XperiaZ"; // Your WiFi credentials.
char pass[] = "deep8989"; // Set password to "" for open networks.
#define DHTPIN 2
#define DHTTYPE DHT11
long randNumber;
DHT dht(DHTPIN, DHTTYPE);
40
SimpleTimer timer;
String myString;
char rdata;
String firstVal, secondVal,thirdVal; // sensors
void sendSensor()
{
float h = dht.readHumidity();
float t = dht.readTemperature(); // or dht.readTemperature(true) for Fahrenheit
if (isnan(h) || isnan(t))
{
Serial.println("Failed to read from DHT sensor!");
return;
}
Blynk.virtualWrite(V6, h); //V6 is for Humidity
Blynk.virtualWrite(V7, t); //V7 is for Temperature
}
void myTimerEvent()
{
Blynk.virtualWrite(V1, millis() / 1000);
}
void setup()
{
// Debug console
Serial.begin(9600);
Blynk.begin(auth, ssid, pass);
timer.setInterval(1000L,sensorvalue1);
Serial.begin(9600); // See the connection status in Serial Monitor
Blynk.begin(auth, ssid, pass);
dht.begin();
// Setup a function to be called every second
timer.setInterval(1000L, sendSensor);
40
28
randomSeed(analogRead(0));
}
void loop()
{
if (Serial.available() == 0 )
{
Blynk.run();
timer.run(); // Initiates BlynkTimer
}
if (Serial.available() > 0 )
{
rdata = Serial.read();
myString = myString+ rdata;
if( rdata == '\n')
{
String l = getValue(myString, ',', 0);
String m = getValue(myString, ',', 1);
String n = getValue(myString, ',', 2);
firstVal = l;
secondVal = m;
thirdVal = n;
myString = "";
// end new code
}
}
}
void sensorvalue1()
{ Blynk.virtualWrite(V3,thirdVal);//BPM
Blynk.virtualWrite(V4,randNumber); //SP02
lcd.clear();
lcd.print(0,0,"HEALTH MONITORING");
40
//lcd.print(11,0,thirdVal);
lcd.print(0,1,"SYSTEM");
// lcd.print(11,0,thirdVal);
randNumber = random(95, 100);
//lcd.print(11,1,randNumber);
// delay(2000);
}
String getValue(String data, char separator, int index)
{
int found = 0;
int strIndex[] = { 0, -1 };
int maxIndex = data.length() - 1;
30
CHAPTER 8
Software Testing is a process of executing the application with intent to find any software
bugs. It is used to check whether the application met its expectations and all the
functionalities of the application is working. The final goal of testing is to check whether
the application is behaving in the way it is supposed to under specified conditions. All
aspects of the code are examined to check the quality of application. The primary purpose
of testing is to detect software failures so that defects may be uncovered and corrected.
The test cases are designed in such way that scope of finding the bugs is maximum.
• Unit testing: Unit testing refers to tests conducted on a section of code in order to
verify the functionality of that piece of code. This is done at the function level.
• Integration Testing: Integration testing is any type of software testing that seeks
to verify the interfaces between components against a software design. Its primary
purpose is to expose the defects associated with the interfacing of modules.
• System Testing: System testing tests a completely integrated system to verify that
the system meets its requirements.
31
8.2 System test
A test case is a set of test data, preconditions, expected results and post conditions,
developed for a test scenario to verify compliance against a specific requirement. I have
designed and executed a few test cases to check if the project meets the functional
requirements.
32
for high performance and scalability. And to measure these two key attributes, it is
important to understand the business value for which it is built i.e. in our case patient
health data. Hence it is necessary to simulate realworld models, network conditions etc.
TEST
OUTPUT SPECIFICATION OPTIMAL
CONDITION
Time taken to Micro controller sends data every 20 seconds to TRUE
send sensor data app.Here network plays important role and time
to Blynk app taken to send each record is <30 sec including
response time. But if there is issue with network
bandwidth then performance will be deteriorated
as system takes additional to check network
connectivity and send
data to the app.
33
8.4 Fault Tolerance
There is chance that any of the above test cases fails in this architecture. Sometimes sensors
may get damaged, run out of power, communication between blynk app and device may be
interrupted due to unavailability of network, ESP8266 module may not fetch information
from board to app may delayed due to network unavailability. Fault tolerance is an ability to
sustain sensor network functionalities without any interruptions due to failures in sensors,
network etc.
34
CHAPTER 9
In-Home Segment-
The in-home segment includes personal emergency response systems (PERS), remote
patient monitoring (RPM) and telehealth virtual visits.
In-Clinic Segment
This segment includes IoMT devices that are used for administrative or clinical functions.
In-Hospital Segment
This segment is divided into IoMT-enabled devices and a larger group of solutions in
several management areas. With the use of technology-based healthcare methods, there
are unparalleled benefits lining up that can improve the quality and efficiency of
treatments along with improving the health of the patients.
35
9. 2 Challenges ahead
36
CHAPTER 10
Conclusion
10. 1 Conclusion
As the technological demands are increasing, the medical systems have been updated
with the new advanced technologies (i.e., smart medical systems); however, there are still
several challenges, such as to carry the remotely located information and the remote
connectivity issues, mainly present in the healthcare systems. Alongside with this, the
cost is also a big issue, rising while updating the existing systems with the new
developments. Therefore, the cloud computing platform is one of the best solutions in the
current age to fight against the issues. In this study, based on the medical organizational
specifications and requirements for communication, including the security requirements,
private cloud computing environment is designed and modelled where the medical
information of heart patients who under registered or resided in the hospital, inside of the
medical ward and outside of the medical ward in the premises of the hospital, is accessed
and monitored in real-time manners. Biomedical engineering is the application of
engineering principles and techniques to the medical field. It combines design and
problem solving skills of engineering with medical and biological sciences to improve
patient’s health care and the quality of life of individuals. A medical device is intended
for use in the diagnosis, or in the cure, treatment, or prevention of diseases. This work
proposes and focuses on the heart beat rate and body temperature monitoring system that
is able to monitor the condition of the patient. The system determines the pulse rate and
body temperature per minute or as per the time specified and then sends it to an android
application. The data is also stored in the database. Thus, the doctors can monitor and
diagnose the patient’s condition continuously and could suggest earlier precaution for the
patients themselves. This system is cost effective and user friendly and thus its usage is
not restricted or limited to any class of users. It is a very efficient system and very easy to
handle and thus provides great flexibility and serves as a great improvement over other
conventional monitoring systems. In future: By using capacitive touch screen the system
can be implemented in hospitals to maintain patient’s data. Voice alerts can be used to
initiate the various controlling of devices and their status of operation.
37
References
38
[9]―Acquisition and management of biomedical data using Internet
of Things concepts‖
http://ieeexplore.ieee.org/document/7050625/ [Sept 10, 2017]
[10] ―Real time internet application with distributed flow environment for
medical IoT‖
https://csdl.computer.org/csdl/proceedings/icgciot/2015/7910/00/0738057
8-abs.html [Sept 11,2017]
39