You are on page 1of 20

Vitals Monitor

PRESENTED BY:
Mustafa Zia
Haider Badr
Abdul Latif Hisham
2ND STAGE (EVENING STUDY)
DR. OMAR YOUSSEF 16
TABLE OF CONTENTS:

INTRODUCTION…………………………………………….2-5

FEATURES……………………………………………………….6

SUPPLIES…………………………………………………....…….7

ASSEMBLE ……………….…………………………………....8-12

Schematic ……………………………………12

PROGRAMING …………………………………….……….13-14

CONCLUSION……………………………………………….14-15
CODE……………………………………………….…………16-18

2
VITALS MONITOR

INTRODUCTION:

Wearable health monitoring technologies, including

smartwatches and fitness trackers, have attracted

considerable consumer interest over the past few years. Not

only has this interest has been mainly encouraged by the

rapid demand growth in the wearable technology market for

the ubiquitous, continuous, and pervasive monitoring of vital

signs, but it has been leveraged by the state-of-the-art

technological developments in sensor technology and wireless

communications. The wearable technology market was valued

at over $13.2 billion by the end of 2016 and its value is

forecast to reach $34 billion by the end of 2020. There are

many sensors for measuring vitals of the human body which

are essential for a doctor or a medic to know the health

problems. We all know that doctor first checks Heart Rate to

3
know Heart Rate Variability (HRV) and body temperature. But

the current wearable bands and devices fail in the accuracy

and repeatability of the measured data. This mostly happens

due to miss alignment of fitness tracker and erroneous

reading etc. Most use the LED and Photodiode based Photo

Plethysmography (PPG) sensors for the heart rate

measurement. In today’s world, the maximum use of resource

is always complimented. So, the use of wireless technology is

enhanced to meet the need of remote control and monitoring.

Remote patient monitoring (RPM) is a technology that helps

us to monitor patient even when the patient is not in the clinic

or hospital. It may increase access to health services and

facilities while decreasing cost. Remote Patient Monitoring

saves time of both patient and doctor, hence increasing

efficiency and reliability of health services. Heartbeat and

body temperature are the major signs that are routinely

measured by physicians after the arrival of a patient. Heart

rate refers to how many times a heart contracts and relaxes in

4
a unit of time (usually per minute). Heart rate varies for

different age groups. For a human adult of age 18 or more

years, a normal resting heart rate is around 72 beats per

minute (bpm). The functioning of heart can be called as

efficient if it is having lower heart rate when the patient is at

rest. Babies have a much higher rate than adults around 120

bpm and older children have heart rate around 90 bpm. If the

heart rate is lower than the normal heart rate, it is an

indication of a condition known as bradycardia and if the

heart rate is higher than the normal heart rate, it is an

indication of a condition known as tachycardia. Like heart

rate, normal body temperature also varies from person to

person and changes throughout the day. The body

temperature is lowest in the early morning and highest in the

early evening. The normal body temperature is about 37° C or

98.6 ° F. However, it can be as low as 36.1° C (97°F) in the

early morning and as high as 37.2° C (99° F) and still be

considered normal. Thus, the normal range for body

5
temperature is 97 to 100 degrees Fahrenheit or 36.1 to 37.8

degrees Celsius. Temperature can be measured by using

different types of sensors. These sensors come in different

forms such as thermocouples, thermistors, resistance

temperature detectors (RTD), and integrated circuit (IC)

sensors. The temperature sensor produces analog output

voltage which is proportional to the temperature. The

temperature sensor requires analog to digital (A/D) converter

so that the analog output voltage can be converted to digital

form. The output of the temperature sensor is connected to

the Port A of AT MEGA328R-PU Arduino Uno. The Arduino

Uno processes this data and displays it in LCD as well as

sends it to the receiving end for displaying at the remote

place. This paper describes the design of a very low-cost

remote patient monitoring system which measures heart rate

and body temperature of a patient and sends the data to a

remote end where the data will be displayed and physician or

doctor will be able to examine him/her. This device will be

6
much needed during emergency period or for saving time of

both patient and doctor.

FEATURES:

 Battery-powered wearable

 Measures real-time heart rate and inter-beat Interval

(IBI)

 Measures real-time body temperature

 Plots real-time graph on the display

 Sends data over Bluetooth to mobile phone

 Data can be recorded and sent to the doctor directly for

further analysis.

 Good battery management with included sleep.

7
 By sending the data to the cloud it creates a huge

database for researchers working on medical solutions

to COVID-19.

SUPPLIES:

Hardware Needed:

 SparkFun Arduino Pro Mini 328 - 5V/16MHz×1

 pulse sensor×1

 thermistor 10k×1

 Rechargeable Battery, 3.7 V×1

 HC-05 Bluetooth Module×1

Software apps and online services

 Arduino IDE

8
Hand tools and fabrication machines

 3D Printer (generic)

 Soldering iron (generic)

ASSEMBLE:

Currently, modern wearable devices are no longer only

focused on simple fitness tracking measurements such as the

number of steps taken in a day, they also monitor important

physiological considerations, such as Heart Rate Variability

(HRV), glucose measures, blood pressure readings, and much

additional health-related information. Among the numerous

vital signs measured, the heart rate (HR) calculation has been

one of the most valuable parameters. For many years, file

Electrocardiogram (ECG) has been used as a dominant cardiac

9
monitoring technique to identify cardiovascular abnormalities

and to detect irregularities in heart rhythms. The ECG is a

recording of the electrical activity of the heart. It shows the

variations in the amplitude of the ECG signal versus time. This

recorded electrical activity originates from the depolarization

of the conductive pathway of the heart and the cardiac muscle

tissues during each cardiac cycle. Even though traditional

cardiac monitoring technologies using the ECG signals has

undergone continuous improvements for decades to address

the ever-changing requirements of their users, specifically in

terms of measurement accuracy. These techniques, up to

now, have not been enhanced to the point of offering the user

flexibility, portability, and convenience. For instance, for the

ECG to operate effectively, several bio-electrodes must be

placed at certain body locations; this procedure greatly limits

the moving flexibility and mobility of the users. In addition,

PPG has shown itself to be an alternative HR monitoring

technique. By using detailed signal analysis, the PPG signal

10
offers excellent potential to replace ECG recordings for the

extraction of HRV signals, especially in monitoring healthy

individuals. Therefore, to overcome the ECG limitations, an

alternative solution based on PPG technology can be used. By

all these data we can conclude that measuring the heart rate

and body temperature and analyzing them to know to check

whether there is abnormal body temperature raises and lower

SpO2 oxygen levels in hemoglobin will help in early detection

of COVID-19. Since this device is a wearable this can help

front line workers such as doctors, nurses, police officers and

sanitation workers who are doing day and night service to

fight against COVID-19.

Get the required parts we can change displays and sensor

type based on the requirement. There is one more good

sensor MAX30100 or MAX30102 for the heart rate

measurement using PPG technique. I'm using a 10k

thermistor for temperature measurement, one can use any

temperature sensor such as LM35 or DS1280 etc.

11
In order to wear a wearable gadget, it should be enclosed in a

proper case in order to protect from damages, so I went

ahead and designed a case which can fit all my sensors and

MCUs.

12
Now we need to connect all the required components, earlier I

had a plan of choosing ESP12E as MCU but since it has only

one 1 ADC pin and I wanted to interface 2 analog devices I

reverted back to Arduino with a Bluetooth configuration.

With ESP one can directly send the data to the cloud may be a

personal server or website like thing speak and shared

directly to the concerned personnel from there.

Schematic

13
The earlier cable-based connection had a lot of issues with

wire getting broken due to twist and turn in constrained

space, later I moved to insulated copper wire from the

armature of a DC motor.

PROGRAMING:

14
The basic idea is like this.

The working principle of PPG sensors is basically by

illuminating Light on the fingertip and measuring the intensity

of light by using photo-diode. I have mentioned other

alternatives in the parts section. We will measure the analog

voltage variation at the analog pin 0 which is, in turn, a

measurement of blood flow at the fingertip or at the wrist by

which we can measure the heart-rate and the IBI.

For temperature measurement we are using a 10k NTC

thermistor, mine is extracted from a laptop battery pack.

Here, an NTC type thermistor of 10kΩ is used. NTC of 10kΩ

means that this thermistor has a resistance of 10kΩ at 25°C.

The voltage across the 10kΩ resistor is given to the ADC of

pro-mini-board. The temperature can be found out from

thermistor resistance using the Steinhart-Hart equation.

Temperature in Kelvin = 1 / (A + B[ln(R)] + C[ln(R)] ^3) where

A = 0.001129148, B = 0.000234125 and C = 8.76741*10^-8

15
and R is the thermistor resistance. Note that log () function in

Arduino is actually a natural log.

FUTURE ENHANCEMENTS AND CONCLUSION:

Future enhancements:

 I would like to add the following features:

 Using Tiny ML and Tensor flow lite to detect the

anomaly.

 Optimizing battery by using BLE

 Android application for the personalized notifications

and suggestions regarding the health

 Adding a vibration motor for alerting

Conclusion:

With the help of open source sensors and electronics, we can

really make changes in the lives of frontline workers by

detecting the COVID-19 symptoms i.e., variation in HRV and

Body temperature one can detect the changes and suggest

them to get quarantined to stop the spread of the disease.

16
The best part of this device is, it is under 15$ which is a lot

cheaper than any available fitness tracker etc. And hence

government

can make these and protect the front line workers.

CODE:
#include <math.h> const int LENGTH = WIDTH; void drawY()
#include <SPI.h> int blinkPin = LED_BUILTIN; {display.drawPixel(0, y[0],
#include <Wire.h> volatile int BPM; WHITE);
#include <Adafruit_GFX.h> volatile int Signal; for (int i = 1; i < LENGTH; i+
#include volatile int IBI = 600; +)
<Adafruit_SSD1306.h> volatile boolean Pulse = false; {
#define pulsePin A0 volatile boolean QS = false; if (y[i] != -1)
#define OLED_RESET 0 int x; {display.drawLine(i - 1, y[i -
Adafruit_SSD1306 int y[LENGTH]; 1], i, y[i], WHITE);
display(OLED_RESET); void clearY() } else
const int thermistor_output = { {break;}}}
A1; for (int i = 0; i < LENGTH; i+ volatile int rate[10];
const int WIDTH = 128; +) volatile unsigned long
const int HEIGHT = 64; {y[i] = -1;}} sampleCounter = 0;

17
volatile unsigned long QS = true;}} thermistor_resistance =
lastBeatTime = 0; if (Signal < thresh && Pulse thermistor_resistance * 1000 ;
volatile int P = 512; == true) { therm_res_ln =
volatile int T = 512; digitalWrite(blinkPin, LOW); log(thermistor_resistance);
volatile int thresh = 525; Pulse = false; temperature = ( 1 /
volatile int amp = 100; amp = P - T; ( 0.001129148 + ( 0.000234125
volatile boolean firstBeat = true; thresh = amp / 2 + T; * therm_res_ln ) +
volatile boolean secondBeat = P = thresh; ( 0.0000000876741 *
false; T = thresh; therm_res_ln * therm_res_ln *
void interruptSetup() { } therm_res_ln ) ) ); /*
TCCR2A = 0x02; if (N > 2500) { Temperature in Kelvin */
TCCR2B = 0x06; thresh = 512; temperature = temperature -
OCR2A = 0X7C; P = 512; 273.15;
TIMSK2 = 0x02; T = 512; display.clearDisplay();
sei();} lastBeatTime = display.setTextSize(1);
ISR(TIMER2_COMPA_vect) { sampleCounter; display.setTextColor(WHITE
cli(); firstBeat = true; );
Signal = secondBeat = false;} display.setCursor(0, 0);
analogRead(pulsePin); sei(); display.print(" Heart Rate =
sampleCounter += 2; }// end isr ");
int N = sampleCounter - void setup() display.print(BPM);
lastBeatTime; { display.println(" BPM");
if (Signal < thresh && N > display.begin(SSD1306_SWIT Serial.write(BPM);
(IBI / 5) * 3) { CHCAPVCC, 0x3C); display.setTextSize(0);
if (Signal < T) {T = Signal;}} delay(20); display.setCursor(0, 52);
if (Signal > thresh && Signal display.clearDisplay(); display.print("IBI:");
> P) { x = 0; display.print(IBI);
P = Signal;} clearY(); display.print("mS");
if (N > 250) { pinMode(blinkPin, OUTPUT); display.setCursor(60, 52);
if ( (Signal > thresh) && Serial.begin(115200); display.print("Temp:");
(Pulse == false) && (N > (IBI / interruptSetup(); display.print(temperature);
5) * 3) ) { display.clearDisplay(); display.print("C");
Pulse = true; display.setTextSize(2); x = 0;
digitalWrite(blinkPin, display.setCursor(0,28); clearY();}
HIGH); display.print("Raksha"); display.display();
IBI = sampleCounter - display.display(); delay(10);}
lastBeatTime; delay(500);} #include <Wire.h>
lastBeatTime = void loop() #include <math.h>
sampleCounter; {y[x] = map(Signal, 0, 1023, #include <Adafruit_GFX.h>
if (secondBeat) { HEIGHT + 10, 0); #include
secondBeat = false; drawY(); <Adafruit_SSD1306.h>
for (int i = 0; i <= 9; i++) { x++; #define pulsePin A0
rate[i] = IBI;}} if (x >= WIDTH) #define OLED_RESET 0
if (firstBeat) { { int thermistor_adc_val; Adafruit_SSD1306
firstBeat = false; double output_voltage, display(OLED_RESET);
secondBeat = true; thermistor_resistance, const int WIDTH = 128;
sei(); therm_res_ln, temperature, const int HEIGHT = 64;
return;} tempf; const int LENGTH = WIDTH;
word runningTotal = 0; thermistor_adc_val = const int thermistor_output =
for (int i = 0; i <= 8; i++) { analogRead(thermistor_output); A1;
rate[i] = rate[i + 1]; output_voltage = int blinkPin = LED_BUILTIN;
runningTotal += rate[i];} ( (thermistor_adc_val * 3.301) / #define btnPin 2
rate[9] = IBI; 1023.0 ); volatile int BPM;
runningTotal += rate[9]; thermistor_resistance = volatile int Signal;
runningTotal /= 10; ( ( 3.301 * ( 10 / volatile int IBI = 600;
BPM = 60000 / output_voltage ) ) - 10 ); volatile boolean Pulse = false;
runningTotal; volatile boolean QS = false;

18
enum fcnMode { if (Signal < thresh && N > pinMode(btnPin,
OFF, (IBI / 5) * 3) { INPUT_PULLUP);
LOGO, if (Signal < T) { display.begin(SSD1306_SWIT
Beat, T = Signal;}} CHCAPVCC, 0x3C);
TEMP, if (Signal > thresh && Signal delay(20);
NBSTATE > P) { display.clearDisplay();
}; P = Signal;} x = 0;
unsigned long buttonState = 0; if (N > 250) { clearY();
int funcState = 0; if ( (Signal > thresh) && pinMode(blinkPin, OUTPUT);
unsigned long currentMillis1, (Pulse == false) && (N > (IBI / Serial.begin(38400);
currentMillis2, currentMillis3; 5) * 3) ) { interruptSetup();
unsigned long previousMillis1, Pulse = true; display.setCursor(0, 0);
previousMillis2, digitalWrite(blinkPin, display.print(" Calculating
previousMillis3; HIGH); BPM ");
const long interval1 = 100; IBI = sampleCounter - Serial.println(" ");
const long interval2 = 300; lastBeatTime; Serial.println(" Calculating
const long interval3 = 500; lastBeatTime = BPM ");
int x; sampleCounter; display.display();
int y[LENGTH]; if (secondBeat) { }
void clearY() secondBeat = false; void loop() {
{for (int i = 0; i < LENGTH; i+ for (int i = 0; i <= 9; i++) { buttonPressed();
+) rate[i] = IBI;}} setMode();}
{y[i] = -1; }} if (firstBeat) { void buttonPressed() {
void drawY() firstBeat = false; buttonState = pulseIn(btnPin,
{ display.drawPixel(0, y[0], secondBeat = true; HIGH, 1000000);
WHITE); sei(); if (buttonState > 50) {
for (int i = 1; i < LENGTH; i+ return;} funcState += 1;
+) word runningTotal = 0; Serial.print("Button state n:
{ if (y[i] != -1) for (int i = 0; i <= 8; i++) { ");
{ display.drawLine(i - 1, y[i - rate[i] = rate[i + 1]; Serial.println(funcState);
1], i, y[i], WHITE); } else runningTotal += rate[i];} }
{ break;}}} rate[9] = IBI; funcState = funcState %
volatile int rate[10]; runningTotal += rate[9]; NBSTATE;
volatile unsigned long runningTotal /= 10; }
sampleCounter = 0; BPM = 60000 / void setMode() {
volatile unsigned long runningTotal; Serial.print("Function : ");
lastBeatTime = 0; QS = true;}} Serial.println(funcState);
volatile int P = 512; if (Signal < thresh && Pulse switch (funcState) {
volatile int T = 512; == true) { case OFF:
volatile int thresh = 525; digitalWrite(blinkPin, LOW); break;
volatile int amp = 100; Pulse = false; case LOGO:
volatile boolean firstBeat = true; amp = P - T; display.clearDisplay();
volatile boolean secondBeat = thresh = amp / 2 + T; display.setTextSize(2);
false; P = thresh; display.setTextColor(WHIT
void interruptSetup() { T = thresh;} E);
TCCR2A = 0x02; if (N > 2500) { display.setCursor(30, 28);
TCCR2B = 0x06; thresh = 512; display.print("Raksha");
OCR2A = 0X7C; P = 512; break;
TIMSK2 = 0x02; T = 512; case Beat:
sei();} lastBeatTime = bpm();
ISR(TIMER2_COMPA_vect) { sampleCounter; break;
cli(); firstBeat = true; case TEMP:
Signal = secondBeat = false; temp();
analogRead(pulsePin); } break;}}
sampleCounter += 2; sei();} void bpm()
int N = sampleCounter - void setup() {
lastBeatTime; {

19
y[x] = map(Signal, 0, 1023, thermistor_adc_val = display.setCursor(0, 52);
HEIGHT + 10, 0); analogRead(thermistor_output); display.print("Temperature in
drawY(); output_voltage = Farenheit = ");
x++; ( (thermistor_adc_val * 3.301) / tempf = 9 * (temperature / 5) +
if (x >= WIDTH) 1023.0 ); 32;
{ thermistor_resistance = display.print(tempf);
display.clearDisplay(); ( ( 3.301 * ( 10 / delay(4000);
display.setTextSize(1); output_voltage ) ) - 10 ); }
display.setTextColor(WHITE thermistor_resistance = int ThermistorPin = A1;
); thermistor_resistance * 1000 ; int Vo;
display.setCursor(0, 0); therm_res_ln = float R1 = 10000;
display.print(" Heart Rate = log(thermistor_resistance); float logR2, R2, T;
"); temperature = ( 1 / float c1 = 1.009249522e-03, c2
display.print(BPM); ( 0.001129148 + ( 0.000234125 = 2.378405444e-04, c3 =
display.println(" BPM"); * therm_res_ln ) + 2.019202697e-07;
Serial.print(" BPM = "); ( 0.0000000876741 * void setup() {
Serial.println(BPM); therm_res_ln * therm_res_ln * Serial.begin(9600);
display.setTextSize(0); therm_res_ln ) ) ); /* }
display.setCursor(0, 52); Temperature in Kelvin */ void loop() {
display.print(" IBI= "); temperature = temperature - Vo =
display.print(IBI); 273.15; analogRead(ThermistorPin);
display.print("mS"); display.clearDisplay(); R2 = R1 * (1023.0 / (float)Vo -
x = 0; display.setTextSize(1); 1.0);
clearY(); } display.setTextColor(WHITE); logR2 = log(R2);
display.display(); display.setCursor(0, 0); T = (1.0 / (c1 + c2*logR2 +
delay(10); display.print("Temperature in c3*logR2*logR2*logR2));
} Celsius = "); T = T - 273.15;
void temp() display.print(temperature); T = (T * 9.0)/ 5.0 + 32.0;
{ Serial.print(temperature); Serial.print("Temperature: ");
int thermistor_adc_val; y[x] = map(temperature, 0, Serial.print(T);
double output_voltage, 1023, HEIGHT + 10, 0); Serial.println(" F");
thermistor_resistance, drawY(); delay(500);
therm_res_ln, temperature, x++; }
tempf; display.setTextSize(0);

20

You might also like