Documente Academic
Documente Profesional
Documente Cultură
GROUP MEMBERS:
Syed Faraz Naeem Bacha Reg. No: 15JZELE00036
Muhammad Asim Khan Reg. No: 15JZELE0006
Aizaz Ali Shah Reg. No: 15JZELE0062
Assistant Professor
Assistant to Dean
2
DECLERATION
We, hereby declare that the content of this thesis are
original and the results obtained are our own.
PLAGIARISM REPORT
Following is the plagiarism report generated
through turnitin, which is 13%.
3
TABLE OF CONTENTS
CHAPTER 1 INTRODUCTION
1.1 Abstract
1.2 Introduction
1.3 Project overview
1.4 Aims / Objectives
1.5 Literature review
CHAPTER 2 METHODOLOGY
2.2 Methodology
3.2 Arduino
4
4.2 Flow Diagram for hardware implementation
4.5 Results
4.6 Conclusion
CHAPTER 5 PROGRAMMINNG
References
5
CHAPTER 01
INTRODUCTION
1.1)ABSTRACT
The IOT (internet of things) have large numbers of applications and
implementations. IOT is serving every field of life, but the most important and attractive one in
the present era is in health care. Here implementation of IOT in health care is based on
biomedical sensors, which measures different physiological activities. The activities include
ECG, temperature, blood pressure, pulse rate, blood glucose level, body movements etc. are
monitored through different electronics sensors. The sensors give data to controller in the form
electrical signals that is digitized in order to be processed /transmitted by microcomputer.
The different physiological sensors reflect the overall health of individual. Monitoring these
sensors can be very useful. The presence of information regarding these sensors data, brings
change in current method of diagnoses and prognosis. It helps in personalization, costs
efficiency, and provides good result.
1.2) INTRODUCTION
Due to huge expenses on health caring center and medical staff
for patient caring, Government have to setup health caring center in specific part of the country.
The goal of our project is to lay the foundation of a system which is cost efficient for
Government and people.
To gain such system we have to make use of IOT (internet of thing) where different sensor
connected to patient body, monitor and measure different physiological activities of patient body
like ECG, Pulse rate, Temperature etc.
The outcomes of these sensors cannot give exact diagnosis for given patient but it can predicts
the occurrence of certain diseases like cardiovascular diseases, Parkinson disease, diabetes etc.
Further this project can also be implemented in ICU (intensive care unit) where patient care is
needed intensively.
A time in near future where patient can be treated by monitoring continuously there
physiological activities, and on the basis of that information treatment could be done. Here the
6
Physician is not only given with conventional lab assessments but also with detail aspect of
diseases for particular patient. On the basis of above information a patient can get personalized
treatment which is highly effective.
Such technological development can bring change in the field of medicine by introducing new
ways which are not only cost effective but also helpful in improving the speed and accuracy of
the diagnosis and treatments.
1.3)PROJECT OVERVIEW
The people of all ages will be benefited from our project
especially ICU (intensive care unit) patients or having well known diseases like cardio vascular
diseases, pulmonary obstruction diseases, Parkinson diseases and diabetes. For a person having
one or more diseases from the above can be monitored and treated through use of our project.
Patient can be monitored through use of ECG, pulse rate and temperature sensors. The use of
sensors depends on the patient condition and also on its diseases. The data collected from the
sensor is uploaded to the server (things speak) in text messages form, where the data is
automatically converted into graphical form, where analysis and visualization could be done.
In short our aim is to provide such a system having high accuracy and low cost.
7
PROJECT OVERVIEW IN BLOCK DIAGRAM
PULSE LCD
SENSOR DISPLAY CLOUD
ECG NODE
PATIENT
SENSOR ARDUINO MCU
TEMPERAT SERIAL
URE
SENSOR MONITOR
POWER ADOPTER
Figure: 1.1
8
1.4)AIMS/OBJECTIVES
1.4.1) PORTABLE
The product or device is to be small in size and light in weight and can be
handled easily as it store and show record by just using the internet.
9
1.4.7) LINKING DOCTOR AND PATIENT
In fact most patient feel uncomfortable to go
to hospital and some are very far away from hospital. In these cases our project provides an
active link between doctors and patients
1.5)LITERATURE REVIEW
Due to advancement in technology, health experts now
in great advantageous, due to large number of invention in electronics gadgets that sensors of
different kinds were introduced. Now a day any kind of biomedical sensor can be found in
market which is highly cost effective and accurate. IOT devices are highly used in health sector
due to its immense advantages. In this article we discuss the project which is related to health
monitoring and management system.
Especially cardiac patient, pulmonary obstruction patient, Parkinson patient, diabetic patient,
blood pressure patient, blood sugar patient etc. this project is of immense importance for people
having such kind of diseases especially in the rural area where the number of physician is less
than number of physicians in urban area. In the rural area the medical instruments are not
available everywhere due its costly nature, and probably in some cases if the instruments are
available then it is either expired or damaged, while in certain cases the number of patients are
greater than the number of available instruments. So in short in these circumstances our project is
of great helpful.
Of many chronic diseases, hypertension is the route of all cardio vascular diseases which remain
the cause for large other chronic diseases. In present condition for health in Pakistan and in
general all over the world, no remote HRV machine (Heart Rate Variability) for hypertension
patient available to help the doctors in analysis and to track down the patient's condition. So for
chronic heart diseases we use ECG sensors which can handle effectively the function perform by
HRV machine. An advantage of using ECG sensor is that it is web based, that the result can be
analyzed anywhere in the world by physician as well as by patient relatives.
For a person having mild vascular diseases there heart rate can be monitor using pulse sensor,
which indirectly measure the condition of heart. It measures the heart activity from the blood
flowing in capillaries (the smallest part of the blood vascular system). It can be used by athletes
and sports man to constantly monitor their vascular activity and to help them to plan their
exercise intensity. The advantage of pulse sensor over other equipment is that, it is small and
10
light and can be wear on the tip of finger like watch on wrest. Temperature sensor can be used to
measure and monitor body temperature constantly. An increase or decrease in temperature can be
used by physician for analysis and treatment of patient. Technologies are expanded day by day
by providing an efficient tool for sending data to web (thing speak) from these sensors (pulse
sensor, ECG and temperature sensors). When the patient is in critical condition, and patients
discharged from hospital, he or she needs to check up in regular basis. That is why IOT based
heath monitoring system is best option for rural area Collecting and storing real life data has so
much importance in artificial intelligence and in data sciences, so by implementing our project
around the world can result a collection of huge amount of data which is to accurate and
favorable in analyzing and classifying human behaviors for particular diseases. So in short it
provide backbone for data science
Our project can also be implemented using raspberry pi but in fact using raspberry pi can
increase the cost and the output accuracy remain same as that for Arduino, so we consider
Arduino for our implementation.
11
CHAPTER 02
DESIGN AND METHODOLOGY
2.2)METHODOLOGY
The process of methodology consists of two stages
1) WEARABLE SENSORS
2) NETWORKING AND COMMUNICATION
2.2.1)WEARABLE SENSORS
The wide body network composed up sensor which can
collect data and stored it on cloud. There are a number of sensors depending on patient and on its
condition. Normally the sensors used in our project for patient monitoring are ECG, pulse and
temperature sensor. These sensors are helpful in the very beginning of diseases, as it show the basic
symptoms which are common among all the diseases. Besides that it can also be used for particular
diseases, for example ECG for cardio vascular diseases for patient to be in chronic condition. Similarly
pulse and temperature sensor can also be used. Using sensor in such manner can increase personalization
of products, which is of great interests. Now a day due to partial implementation of such each and every
one can get personalized treatment. Here we will explain working of three sensors in detail
12
2.2.1.1) ECG( electrocardiograph)
ECG is the measure of electrical activity of the heart
over a periodic duration of time by placing electrode on body in specialized position. ECG
monitoring and measuring electrodes have passed through the numbers of changes or evaluation.
In 1883, Carlo Matteucci’s first time showed the electrical activity in human body by using
sensor. Later in 1887, Augustus D.Waller’s has invented and published the first human
Electrocardiogram. In 1901 Willem Einthoven made infrastructure of Waller’s technology. He
invented a device called string galvanometer made from fine quartz coated with silver. Einthoven
was awarded with noble prize for electrocardiogram. In present time the electrode of ECG made
from plastic substrate covered with ionic compound that is silver chloride (AgCl). These
electrodes make the use of electrical potential generated in the living cell due to ionic activity
These two are responsible for electrical activity of heart. The heart start pumping at sino-atrical
node which is built to produced heart rate at frequency of 70 cycles per minute. The pumping
activity generated in left and right muscular tissues of the heart. There is short duration of time
called delay which is use to fill the ventricles with blood from atrial contraction in the
ventricular node. This pumping of heart help to pump the blood to the aorta and to remaining
parts of the body. The cardiac cycle consist of two phases that is contraction and relaxation.
During contraction the heart full the blood against the wall of the blood vessels of the vascular
system with great force and during relaxation the heart receive the blood from the blood vessels
of vascular system. So in this way the blood circulate throughout the body. During each cycle of
heart polarization and de polarization of vascular system happen that is the cell membrane
potential of the vascular system changes during each contraction and relaxation of the heart.
When the cycle take place the trans membrane potential develop that is internal and external part
of the membrane are at different potential, due to which voltage develop across the membrane,
here the electrode are used to measure this generated voltage. The voltages detected by these
electrodes have different peaks. These different peaks are P, Q, R, S, T and U. which are shown
in figure
13
2.2.1.1) Normal ECG Rhythm
14
2.2.1.1) ECG MODULE PINS CONFIGURATION
15
Front Side (to skin) Back Side
16
2.2.1.2) Pulse sensor pin configuration
17
intensity of reflected light. If the heart is in state of contraction there will be more blood in the
vein and more incense light would be reflected and if the heart is in state of relaxation then
there will be no blood in veins, so reflection of light will be not as much as in the case of
contraction. To use the pulse simply connect the power pin (Vcc) with +5 or +3 volt supply, the
input pin is connected to ADC (analog to digital converter), which convert analog input to digital
output. Finally the ground pin is connected to zero potential.
The pull up resister is used to maintain the line at high state when the bus is not used. The
temperature value are measured and stored in two bytes register. The data can be then read
through use of line.
19
CHAPTER 03
20
Node MCU is microcontroller which has built in Wi-Fi offering a bridge from existing microcontroller to
Wi-Fi, and is capable of running self-contained applications. Node MCU is rich in pin configurations and
also has USB cable that provides connection to laptop just like Arduino.
21
NODE MCU PIN DESCRIPTION
3.2)ARDUINO
Arduino is an open source electronics prototype providing a flexible
hardware and software interface. It is basically well develop microcontroller based on ATmega
328 MCU. The Arduino mega is shown in figure
22
Figure: 3.3 Arduino MEGA Pins Layout
23
WORKING FLOW DIAGRAM
POWER ON
TEMPERATURE
SENSOR
CONNECTED
ARDUINO WITH BODY ARDUINO
COLLECT ECG COLLECT PULSE
DATA AND SEND SENSOR DATA
TO NODEMCU AND SEND TO
NODEMCU
ARDUINO
COLLECT
DATA SEND TO DATA TRANSFER
TEMPERATURE
CLOUD TO CLOUD
DATA AND SEND
THROUGH THROUGH
TO CLOUD
NODEMCU NODEMCU
THROUGH
NODEMCU
SYSTEM ARCHITECTURE
4.1.3.1) Storage
4.1.3.2) Analytics
4.1.3.3) Visualization
25
4.1.3.1) STORAGE
Information stored on the web server in their respective field allocated
by the user.
4.1.3.2) ANALYTICS
Analysis is carried out on recorded data considering patient health.
4.1.3.3) VISUALIZATION
Visualization is important element for most system which are
based on data because it is not easier for physician to considered such high volumetric data.
Visualization process converts data into interpretable and understandable form which is
necessary for diagnosis.
TEMPERATURE PULSE
NODE MCU ECG SENSOR
SENSOE SENSOR
26
4.3) DESIGNED HARDWARE
4.5)RESULTS
After programming and connecting different components together, we carried
out experiment. According to proposed model we have designed a system prototype that is IOT
based patient monitoring system.
27
Following are the results.
When the lead is connected and pad is in proper contact with body it display the value of ECG at
that instant of time. Similar observation can be made from the graph of things speak which is
shown below.
29
temperature and when it comes in contact with body it shows body temperature at that instant of
time.
Similar observations can be made from things speak graph which is shown below
Figure 4.6 shows the graph of temperature Vs date and time. Here the temperature is in celsius
scale.
30
4.5.3)Result for pulse sensor connected with body
Similar observation can be made from the graph of things speak which is shown below
31
Figure 4.8 Snip of thing speak for Pulse Sensor
Figure 4.8 shows the graph of pulse rate Vs date and time
4.6)CONCLUSION
IOT provide a smart platform to connect sensors with patient body
for regular checkup. Our project is giving special opportunities to old age people and people
living rural area, being far away from health care center. Our project helps in saving time and
cost at same time.
4.7)FUTURE WORK
1) Our project provides base for those which are purely based on data
that is on data collections. Here the data recorded are pure and free from human error
2) `The recorded data is available for cloud processing which will lead to machine atomization.
3) By connecting different sensors which is of good quality patient in serious condition can also
be treated.
4) Our project can be used to replace bulky hardware in ICU, where same function can be done
by using these small components.
32
CHAPTER 05
PROGRAMMING
ARDUINO PROGRAMMING
Following are the code for the Arduino to collect data from
sensors and send to Node MCU
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27,16,2); // set the LCD address to 0x27 for a 16 chars and 2 line
display
#include <Adafruit_Sensor.h>
#include <SoftwareSerial.h>
#include <ArduinoJson.h>
SoftwareSerial s(5,6);
// for Temperature
#include <OneWire.h>
#include <DallasTemperature.h>
#define ONE_WIRE_BUS 2
OneWire oneWire(ONE_WIRE_BUS);
DallasTemperature sensors(&oneWire);
float tempC = 0;
int ecg = 0;
// for BMP
33
// Variables
int pulsePin = A2; // Pulse Sensor purple wire connected to analog pin 0
int BPM =0; // BPM=0;// int that holds raw Analog in 0. updated every 2mS
volatile int IBI = 600; // int that holds the time interval between beats! Must be seeded!
volatile boolean Pulse = false; // "True" when User's live heartbeat is detected. "False" when
not a "live beat".
static boolean serialVisual = true; // Set to 'false' by Default. Re-set to 'true' to see Arduino
Serial Monitor ASCII Visual Pulse
volatile int thresh = 525; // used to find instant moment of heart beat, seeded
volatile int amp = 100; // used to hold amplitude of pulse waveform, seeded
volatile boolean firstBeat = true; // used to seed rate array so we startup with reasonable
BPM
34
volatile boolean secondBeat = false; // used to seed rate array so we startup with reasonable
BPM
void setup()
lcd.init();
lcd.backlight();
s.begin(9600);
pinMode(startPin, INPUT);
// analogReference(EXTERNAL);
sensors.begin();
StaticJsonBuffer<1000> jsonBuffer;
35
JsonObject& root = jsonBuffer.createObject();
void loop()
sensors.requestTemperatures();
tempC = sensors.getTempCByIndex(0);
Serial.print(tempC);
Serial.println(" C: ");
lcd.setCursor(0,0);
lcd.print("T ");
lcd.print(tempC);
else{
Serial.println(analogRead(A0));
ecg=analogRead(A0);
lcd.setCursor(7,0);
lcd.print("ECG ");
36
lcd.print(ecg);
root["ECG"]=ecg;
root["temp"]=tempC;
root.printTo(s);
serialOutput();
void interruptSetup()
TCCR2A = 0x02; // DISABLE PWM ON DIGITAL PINS 3 AND 11, AND GO INTO CTC
MODE
37
OCR2A = 0X7C; // SET THE TOP OF THE COUNT TO 124 FOR 500Hz SAMPLE RATE
void serialOutput()
if (serialVisual == true)
else
void serialOutputWhenBeatHappens()
if(!(digitalRead(startPin)))
38
{
Serial.print("BPM: ");
Serial.println(BPM);
lcd.setCursor(2,1);
lcd.print(" ");
lcd.setCursor(0,1);
lcd.print("HB ");
lcd.print( BPM );
root["pulse"]=BPM;
root.printTo(s);
if(digitalRead(startPin))
BPM=0;
lcd.setCursor(2,1);
lcd.print(" ");
lcd.setCursor(0,1);
39
lcd.print("HB ");
lcd.print( BPM );
root["BPM"]=BPM;
root.printTo(s);
else
// range value:
40
switch (range)
case 0:
break;
case 1:
// Serial.println("---");
break;
case 2:
// Serial.println("------");
break;
case 3:
// Serial.println("---------");
break;
case 4:
// Serial.println("------------");
break;
case 5:
// Serial.println("--------------|-");
break;
case 6:
// Serial.println("--------------|---");
41
break;
case 7:
// Serial.println("--------------|-------");
break;
case 8:
// Serial.println("--------------|----------");
break;
case 9:
// Serial.println("--------------|----------------");
break;
case 10:
// Serial.println("--------------|-------------------");
break;
case 11:
// Serial.println("--------------|-----------------------");
break;
42
Serial.print(symbol);
Serial.println(data);
int N = sampleCounter - lastBeatTime; // monitor the time since the last beat to avoid noise
if(Signal < thresh && N > (IBI/5)*3) // avoid dichrotic noise by waiting 3/5 of last IBI
43
} // keep track of highest point in pulse wave
if (N > 250)
Pulse = true; // set the Pulse flag when we think there is a pulse
if(secondBeat)
for(int i=0; i<=9; i++) // seed the running total to get a realisitic BPM at startup
rate[i] = IBI;
44
{
BPM = 60000/runningTotal; // how many beats can fit into a minute? that's BPM!
45
}
T = thresh;
if (N > 2500)
. .
46
NODE MCU (Node Micro Microcontroller Unit)
Following are the code for Node
MCU which is used to get data from Arduino and send it to cloud (things speak)
#include <ESP8266WiFi.h>
#include <Adafruit_Sensor.h>
#include <SoftwareSerial.h>
SoftwareSerial s(D6,D5);
#include <ArduinoJson.h>
#include "ThingSpeak.h"
//#include <ESP8266WiFi.h>
WiFiClient client;
void setup() {
Serial.begin(9600);
s.begin(9600);
Serial.print("Connecting to ");
Serial.println(ssid);
47
WiFi.begin(ssid, password);
delay(500);
Serial.print(".");
Serial.println("");
Serial.println("WiFi connected");
Serial.println(WiFi.localIP());
Serial.print("Netmask: ");
Serial.println(WiFi.subnetMask());
Serial.print("Gateway: ");
Serial.println(WiFi.gatewayIP());
ThingSpeak.begin(client);
void loop() {
StaticJsonBuffer<1000> jsonBuffer;
if (root == JsonObject::invalid())
Serial.println("Object Invalid");
return;
48
}
root.prettyPrintTo(Serial);
Serial.println("");
Serial.print("Temperature ");
int data1=root["temp"];
Serial.println(data1);
Serial.print("ECG ");
int data2=root["ECG"];
Serial.println(data2);
int data3=root["pulse"];
Serial.println(data3);
Serial.println("");
ThingSpeak.setField(1, data1);
ThingSpeak.setField(2, data2);
ThingSpeak.setField(3, data3);
ThingSpeak.writeFields(myChannelNumber, myWriteAPIKey);
//delay(20000);
delay(10000);
Serial.println("---------------------xxxxx--------------------");
Serial.println("");
49
References
[1] A. Benharref and M. Serhani, “Novel cloud and SOA-based framework for
E-Health monitoring using wireless biosensors,” IEEE Journal of Biomed. and Health Inf., vol.
18, no. 1, pp. 46–55, Jan 2014.
[2] S. Babu, M. Chandini, P. Lavanya, K. Ganapathy, and V. Vaidehi,“Cloud-enabled remote
health monitoring system,” in Int. Conf. on
Recent Trends in Inform. Tech. (ICRTIT), July 2013, pp. 702–707.
[3] C. Rolim, F. Koch, C. Westphall, J. Werner, A. Fracalossi, and G. Salvador, “A cloud
computing solution for patient’s data collection in health care institutions,” in Second Int. Conf.
on eHealth, Telemedicine, and Social Medicine, ETELEMED ’10., Feb 2010, pp. 95–99.
[4] M. Lan, L. Samy, N. Alshurafa, M.-K. Suh, H. Ghasemzadeh, A. Macabasco-O’Connell, and
M. Sarrafzadeh, “Wanda: An end-to-end remote health monitoring and analytics system for heart
failure patients,” in Proc. of the Conf. on Wireless Health, ser. WH ’12. New York, NY,
USA: ACM, 2012, pp. 9:1–9:8.
[5] L. Wei, N. Kumar, V. Lolla, E. Keogh, S. Lonardi, C. Ratanamahatana, and H. Van Herle,
“A practical tool for visualizing and data mining medical time series,” in Proc. 18th IEEE
Symposium on Computer-Based Med. Sys., June 2005, pp. 341–346.
[6] Y. Mao, Y. Chen, G. Hackmann, M. Chen, C. Lu, M. Kollef, and T. Bailey, “Medical data
mining for early deterioration warning in general hospital wards,” in IEEE 11th Int. Conf. on
Data Mining Workshops (ICDMW), Dec 2011, pp. 1042–1049..
[7] Iman Azimi, Arman Anzanpour, Amir M. Rahmani, Pasi Liljeberg, Tapio Salakoski,
“Medical Warning System Based on Internet of Things Using Fog Computing”.
[8] Vivek Pardeshi, Saurabh Sagar, Swapnil Murmurwar, Pankaj Hage, “Health
Monitoring Systems using IoT and Raspberry Pi – A Review”.
[9] S.Lavanya, G.Lavanya, J.Divyabharathi, “REMOTE PRESCRIPTION AND IHOME
HEALTHCARE BASED ON IoT”.
[10] https://ac.els-cdn.com/S18770506301260/1-s2.0-S1877050916301260-
main.pdf?_tid=dcbc873b-3c7a-4fea-8d41-
f4c25d549727&acdnat=1521015990_964ce32f5ddee49a5b9eb8f73c99179f
[11] R.N. Kirtana, Y.V. Lokeswari, “An IoT Based Remote HRV Monitoring System
For Hypertensive Patients”.
[12] Ruhani Ab. Rahman, Nur Shima Abdul Aziz, Murizah Kassim, Mat Ikram Yusof,
“IoTbased Personal Health Care Monitoring Device for Diabetic Patients”.
[13] https://www.mdtmag.com/article/2011/08/brief-look-ecg-sensor-technology
[14] Dhvani Parekh, “Designing Heart Rate, Blood Pressure and Body Temperature Sensors
for Mobile On-Call System”.
[15] https://www.livescience.com/42081-normal-heart-rate.html
50
[16] Yuhua Hu, Wirelessly Connected Sensor Acquisition System for Remote
Nursing Applications. [11] Ovidiu Apostu, Bogdan Hagiu, Sever Paşca, Wireless ECG
Monitoring and Alarm System
Using ZigBee”2011 The International Symposium on ADVANCED TOPIC INELECTRICAL
ENGINEERING2068-7966/ATEE 2011.
[17] Goutam Motika, Abinash Prusty,” Wireless Fetal Heartbeat Monitoring System Using
ZigBee & IEEE 802.15.4 Standard”, 2011 Second International Conference on Emerging
Applications of Information Technology, 978-0-7695-4329-1/11 $26.00 © 2011 IEEE
DOI 10.1109/EAIT.2011.89
51