0% found this document useful (0 votes)
342 views38 pages

Report

This document presents a mini project report on an Arduino-based system for monitoring temperature and pulse rate. The system aims to develop a compact device for non-invasively measuring these vital health parameters through a fingertip using light sensors and an Arduino board. The project involves designing hardware circuits using appropriate sensors, interfacing them with Arduino and developing software code to estimate temperature and pulse readings. The outputs are displayed on an LCD screen. The system aims to facilitate remote monitoring of a person's health status, especially in rural areas with limited medical equipment availability.

Uploaded by

vaishnavi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
342 views38 pages

Report

This document presents a mini project report on an Arduino-based system for monitoring temperature and pulse rate. The system aims to develop a compact device for non-invasively measuring these vital health parameters through a fingertip using light sensors and an Arduino board. The project involves designing hardware circuits using appropriate sensors, interfacing them with Arduino and developing software code to estimate temperature and pulse readings. The outputs are displayed on an LCD screen. The system aims to facilitate remote monitoring of a person's health status, especially in rural areas with limited medical equipment availability.

Uploaded by

vaishnavi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 38

Mini Project Report

On

ARDUINO BASED VIGILANT DETECTION OF


TEMPERATURE AND PULSE RATE
Submitted in partial fulfilment of the requirements for the award of the degree of Bachelor of
Technology
In
Electronics and Communication Engineering
By

Mr. Sariki Karthik 16011A0412


Ms. Niharika Rasthapuram 16011A0428
Ms. Vaishnavi Suryapeta 16011A0449

Department of Electronics and Communication Engineering

Jawaharlal Nehru Technological University Hyderabad,


College of Engineering Hyderabad

Kukatpally, Hyderabad – 500085


Jawaharlal Nehru Technological University Hyderabad, College of
Engineering Hyderabad.

Department of Electronics and Communication Engineering

CERTIFICATE

This is to certify that the Mini Project entitled “Arduino Based Vigilant
Detection of Temperature and Pulse Rate” is submitted by

Mr. Sariki Karthik 16011A0412

Ms. Niharika Rasthapuram 16011A0428

Ms. Vaishnavi Suryapeta 16011A0449

In partial fulfilment for the award of degree in Bachelor of Technology in


Electronics and Communication Engineering during academic year 2019-2020.

Internal Guide Head of the Department

Dr. M. Asha Rani Dr. K. Anitha Sheela

Professor Professor

Head of the Department


ACKNOWLEDGEMENTS:

Along with our individual efforts in this project, we are grateful to be receiving continuous
support from our mentor and the organization. We would like to extend my sincere thanks to
all of them.
We would like to express our gratitude towards Jawaharlal Nehru Technological University
Hyderabad- College of Engineering, Hyderabad (JNTUH-CEH) for introducing mini project
as a part of the curriculum, bestowing us with an opportunity to apply our skills in practical
applications.
We would like to express our sincere thanks to Dr. K. Anitha Sheela, HOD, Department of
ECE, JNTUH-CEH for providing the facilities to complete the dissertation.

We are highly indebted to our mentor, Dr. M. Asha Rani, Professor, Department of
Electronics and Communication Engineering, for the kind co-operation and encouragement
which has helped us immensely in the completion of this project.
Our thanks and appreciations also go to people who have willingly helped us out with their
abilities.

i
DECLARATION

We hereby declare that the mini project entitled “Arduino Based Vigilant Detection of
Temperature and Pulse rate” is the work done during the period from May 2019 to October
2019 and is submitted in the partial fulfilment of the requirements for the award of degree of
Bachelor of Technology in Electronics and Communication Engineering from JNTUH College
of Engineering Hyderabad. The results embodied in this project have not been submitted to any
other university or Institution for the award of any degree or diploma.

Mr. Sariki Karthik 16011A0412


Ms. Niharika Rasthapuram 16011A0428
Ms. Vaishnavi Suryapeta 16011A0449

ii
LIST OF CONTENTS:
Page no.
Acknowledgements i

Declaration ii

Abstract iii

Chapter 1: Introduction 1-3


1.1 Significance of Heart
1.2 Need of Monitoring

1.3 Heart Rate and Temperature Monitoring System


1.4 Project Scope
Chapter 2: Existing Methodologies for 4-5

Monitoring System

2.1 Motivation
2.2 Problem Statement

Chapter 3: Design Method of Proposed 6-17


Project

3.1 High Level Design

3.2 Detailed Level Project Design


3.3 Hardware Design
3.4 Design and Working
Chapter 4: Software Development 18-27

4.1 About Arduino IDE

4.2 The source code developed for the outcome

Chapter 5: Results 28-29


Chapter 6: Conclusions 30-31

References iv
ABSTRACT:

Technological innovations and their need in the field of disease prevention and maintenance
of human health have enabled the evolution of monitoring systems. Heart rate and body
temperature are two vital health parameters to detect a primary or a major underlying illness.
Heart rate, the number of times the heart beats per minute, reflects different physiological
conditions such as biological workload, stress at work and concentration on tasks, drowsiness
and the active state of the autonomic nervous system. Concurrently, the body changes its
normal temperature to support the body’s defence mechanisms. A substantial number of
diseases are characterized by a change in body temperature. While pulse rate is directly
related to the soundness of the human cardiovascular system, with other illnesses, the course
of the disease can be followed by measuring body temperature. In general, a cardiac monitor,
also known as a heart monitor, is used to continuously monitor the heart's activity through
electrocardiography. It can also be carried out by sensing the pulse - the rhythmic expansion
and contraction of an artery as the blood is forced through it by the regular contractions of the
heart. The pulse can be felt from those areas where the artery is close to the skin. This project
proposes the development of a flexible and compact device to measure the heart rate and
body temperature. It describes a technique of estimating these through a fingertip and
Arduino. It is a non-invasive method of measuring the variation in blood volume in tissue
using a light source and detector. While the heart is beating, it is actually pumping blood
throughout the body, and that makes the blood volume inside the finger artery to change too.
This fluctuation of blood can be detected through an optical sensing mechanism placed
around the fingertip. The outputs from the sensors are conveyed to Arduino, which performs
the required action to estimate the parameter values. This project aims at using advanced
technologies to keep track of a person’s health status, keeping in view the remote areas where
the possibility to accommodate larger equipment is difficult.

This project is developed with simple sensors, Arduino interfaced with liquid crystal display
(LCD) facilitates the display of the pulse count and temperature.

iii
CHAPTER 1
INTRODUCTION

In today’s world, the maximum use of resource is always complimented. The advance
technology of the present time opens a new way to deliver health care services when the
distance between the doctor and patient is significantly away. Bearing in the mind, the
difficulties to remit these services in rural areas, this application aims at benefiting these
areas. Patient monitoring is one of the telemedicine, which always needs improvement to
make it better. It is vital to care in operating and emergency rooms, intensive care and critical
care units. It is also important for respiratory therapy, recovery rooms, out-patient care,
radiology, ambulatory, home and sleep screening applications. The advantages of a patient
monitoring system are it can reduce the risk of infection and other complication in order to
make the patients comfortable. Furthermore, implement of patient monitoring in hospitals
might reduce the costs in terms of installation and also maintenance of wiring.

1.1 Significance of Heart:

The heart acts as a pump that circulates oxygen and nutrient carrying blood around the body
in order to keep it functioning. When the body is exerted the rate at which the heart beats will
vary proportional to the amount of effort being exerted. By detecting the voltage created by
the beating of the heart, its rate can be easily observed and used for a number of health
purposes. Heart pounds to pump oxygen-rich blood to your muscles and to carry cell waste
products away from your muscles. The heartrate gives a good indication during exercise
routines of how effective that routine is improving your health.

1.2 Need of Monitoring:

More than 2 million people are at high risk of having heart attack. It would be helpful if there
was a way for these people to monitor their heart. So, we have a problem. That is the way our
project focuses on how we can overcome this problem and find a solution. Heart rate means
the number of heartbeats per unit of time, usually expressed as beats per minute (bpm). Heart
rate can vary according to the demand of muscles to absorb oxygen and excrete carbon
dioxide changes, such as during exercise or sleep.

1
It also varies significantly between individuals based on fitness, age and genetics. That means
heart must beat faster to deliver more oxygen-rich blood. During exercise routines, the heart
rate gives a strong indication of how effective that routine is improving health. Normal heart
rate of a resting person is about 70 bpm for adult males and 75 bpm for adult females. A heart
rate monitor is simply a device that takes a sample of heartbeats and computes the beats per
minute so that the information can easily track heart condition. Medical professionals use heart
rate for tracking of patient’s physical conditions. Individuals, such as athletes, who are
interested in monitoring their heart rate to gain maximum efficiency from their training, also
use it. Body temperature means measurement of the body’s ability to generate and get rid of
heat. It is one of chief indicators of normal functioning and health. The nature of the human
body is to keep its temperature within a narrow, safe range in spite of large variations in
temperatures outside the body.

1.3 Heart rate and Temperature Monitoring System:

A heart rate and temperature monitor are a personal monitoring device that allows a subject
to measure their heart rate in real time. The goal of this thesis is to design a low-cost device
which measures the heart rate of the subject by clipping sensors on one of the fingers and
then displaying the result on the liquid crystal display (LCD). Miniaturized heart rates
monitor system based on a microcontroller offers the advantage of portability over tape-based
recording systems. The thesis explains how a single-chip microcontroller can be used to
analyse heart beat rate signals in real-time. The hardware and software design are oriented
towards a single-chip microcontroller-based system, hence minimizing the size.

1.4 Project Scope:

 The scopes in this project include the hardware and software parts. For the hardware
part, ECG circuits have been designed in order to interpret data from ECG simulator,
which act as a patient. Then, a temperature sensor was developed to measure the
temperature of human being. Both systems are controlled by Arduino Uno board,
which when connected to the Bluetooth module, facilitates in sending the data to
personal devices with the aid of some programming works.

2
 Monitoring device that could be used to detect the heart beat anomalies of physically
challenged Individuals without hands.

 Also, a graphical LCD can be used to display a graph of the change of heart rate over
time.

 It could be integrated with mobile technology for e-health cloud transmission to health
care providers.

3
CHAPTER 2

EXISTING METHODOLOGIES FOR MONITORING SYSTEMS

Early models consisted of a monitoring box with a set of electrode leads which attached to
the chest. The first wireless EKG heart rate monitor was invented in 1977 by Polar Electro as
a training aid for the Finnish National Cross Country Ski team. As "intensity training"
became a popular concept in athletic circles in the mid-80s, retail sales of wireless personal
heart monitors started in 1983.

Modern heart rate monitors commonly use one of two different methods to record heart
signals (electrical and optical). The electrical monitors consist of two elements: a
monitor/transmitter, which is worn on a chest strap, and a receiver. When a heartbeat is
detected a radio signal is transmitted, which the receiver uses to display/determine the current
heart rate. This signal can be a simple radio pulse or a unique coded signal from the chest
strap. More recent devices use optics to measure heart rate by which measures changes in
blood flow by shining a light from an LED through the skin and measuring how it scatters off
blood vessels. In addition to measuring the heart rate, some devices using this technology are
able to measure blood oxygen saturation (SpO2).

Newer devices such as cell phones or watches can be used to display and/or collect the
information. Some devices can simultaneously monitor heart rate, oxygen saturation, and
other parameters. These may include sensors such as accelerometers, gyroscopes, and GPS to
detect speed, location and distance.

In recent years, it has been common for smartwatches to include heart rate monitors, which
has greatly increased popularity. Some smart watches, smart bands and cell phones often
use PPG sensors.

2.1 Motivation:

Cardiovascular disease is one of the main causes of death in the many countries, it accounted
for over 15 million deaths worldwide. In addition, several million people are disabled by
cardiovascular disease. The delay between the first symptom of any cardiac ailment and the
call for medical assistance has a large variation among different patients and can have fatal
consequences. One critical inference drawn from epidemiological data is that deployment of
resources for early detection and treatment of heart disease has a higher potential of reducing

4
fatality associated with cardiac disease than improved care after hospitalization. Hence new
strategies are needed in order to reduce time before treatment. Monitoring of patients is one
possible solution. This project can be used in hospitals (Calling Ambulance.) and also for
patients who can be under continues monitoring while traveling from place to place (using
heart rate band). Since the system is continuously monitoring the patient and in case of any
abnormal in the heart beat rate of the patient the system will immediately send message to the
concerned doctors and relatives about the condition of the patient and abnormal details.

2.2 Problem Statement:

One of the increasing popular public concerns is human health. One is also familiar with the
requirement of monitoring the health conditions at areas where, access to many medical
equipment is inconvenient and expensive. Heart rate and body temperature are the most vital
ones among the notable indexes of the human health, and they have the advantage of easy
access. This project focuses on developing a portable and a flexible prototype which can
continuously monitor the heart rate and temperature of human body.

5
CHAPTER 3
DESIGN METHOD OF PROPOSED PROJECT

The project design is considered the most important stage in the development process of each
project and hence this step takes considerable time of the overall project lifecycle. In this
chapter, the high-level design followed by the detailed design of the project is being the
centre of attention for detailed discussion. Both hardware and software designs are being
discussed here intensively, describing their components, algorithms and their circuit
diagrams. As well as specifying the detailed functions of the project’s units and interfaces
implemented between them.

3.1 High-level Design:

The overall project aims at continuous measurement of pulse rate and temperature. This
Health Monitoring System is done with modules of data sensing, processing and
communication. Two sensors are contained in data sensing module namely, temperature
sensor and heart rate sensor/ pulse sensor. The output of each sensor is interfaced with
Analog to Digital circuit (ADC) pins of microcontroller. The pulse sensor converts the blood
pulse into electrical signals which will be next processed using the Arduino board according
to the algorithm applied to it. The Arduino board is interfaced with Liquid Crystal Display
(LCD) and hence the results are displayed on it. The outline structure of the project design is
as shown below.

Pulse
Sensor

Arduino Liquid
Uno Crystal
LM 35 Display
Temperature (LCD)

Sensor

Fig 3.1: Block Schematic of the monitoring system

6
3.2 Detailed Level Project Design:

If we consider the project as a system containing several parts, the proposed system can be
divided into two main units, the hardware and the software units.

Project Design

Software Design Hardware Design

 Arduino IDE  Pulse Sensor


 Temperature Sensor
 Arduino Uno Board
 Liquid Crystal Display
 Potentiometer
 Bread Board
 Connecting Wires

Fig 3.2: Main units of the project design

3.3 Hardware Design:

The following are the various components utilized in building this project.

3.3.1 Sensors:

Sensors are devices that detect the variations and mainly are two types of them, optical and
solid-state sensors. An optical sensor converts light rays into an electronic signal. The
purpose of an optical sensor is to measure a physical quantity of light and, depending on the
type of sensor, then translates it into a form that is readable by an integrated measuring
device. Whereas solid-state sensors have no mobile parts and they must not be confused with
transducers or actuators which react depending on the sensor response.

The two sensors used here are pulse sensor and the temperature sensor.

7
Pulse Sensor:

It is an Open Source heart rate monitor which considered as a device used to monitor the non-
invasive heart rate. It measures the real-time heart beats and calculates BPM with the aid of
algorithms implemented by Arduino. This sensor has two sides, the front one which has a
heart shape is the side to be attached to the skin.

LED

Noise
Elimination

Circuitry
Fig 3.3: Front and Back view of the pulse sensor

If the frond side is facing you, then the most left pin is the GND while the middle one is the
input voltage which will be connected to the +5v of the Arduino. The last one is for the
output and will be wired with the analog pins of the Arduino.

Fig 3.4: Pin diagram of the pulse sensor

The Pulse sensor converts the physical output into electrical signals. The sensor outputs a raw
analog signal with voltage fluctuations, amplifies it and normalize the wave at half the
voltage. With every beat of the heart, a pulse wave travel along all arteries to the tissues

8
where the Pulse Sensor is attached. When this pulse wave goes under the sensor, the signal
experiences a rapid upward rise in its value. It falls back down toward the normal point and
before the next pulse sensor goes under the sensor, the signal stabilizes to the ambient noise.
Due to the repetitive characteristic of the pulse wave, the peak is chosen as a reference point
because it’s recognizable. By applying calculation algorithm on the time between each two
successive peaks the heart rate is measured. Ideally, we want to find the instantaneous
moment of the heart beat for accurate measurements. According to heart researchers, the
instantaneous moment is when the signal gets 25% or 50% of its amplitude. This pulse sensor
first measures the IBI(Interbeat Interval) when the signal gets 50% of the amplitude, which
from the BPM is derived from average of 10 IBI times. This is implemented by interfacing
the pulse sensor with the Arduino board as shown in the Fig 3.5.

Fig 3.5: Pulse sensor connections to Arduino

The specifications of the pulse sensor are as follows.

Parameter Value
VCC +5v dc with good regulation
I Max (Current) 100mA
Output Data Level 5V TTL Level
Heart Beat Detection Output Led

9
Light Source 660nm Super Red Led

Table 3.1: Specifications of pulse sensor

Some of the main features of the sensor are as follows.

 Biometric Pulse Rate or Heart Rate detecting sensor.


 Plug and Play type sensor.
 Operating Voltage: +5V or +3.3V.
 Current Consumption: 4mA.
 Inbuilt Amplification and Noise cancellation circuit.
 Diameter: 0.625”.
 Thickness: 0.125” Thick.

LM35 Temperature Sensor:

It is considered as a solid-state sensor. The precision integrated-circuit temperature sensor


output a voltage linearly proportional to the centigrade temperature. With LM35, temperature
is measured more accurately than using a thermistor. For accurate readings, the sensor’s
package required to be in contact directly with the patient arm tissues along with the Pulse
Sensor. It comes as a moulded package or plastic package which is used in this project.

As the pulse sensor, LM35 three has three pins except that the left pin is for the input voltage,
while the middle one output the signal. Therefore, the pin on the right is the GND as shown
in Fig 3.6.

The LM35 device does not require any external calibration or trimming to provide typical
accuracies of ±¼°C at room temperature and ±¾°C over a full −55°C to 150°C temperature
range. Lower cost is assured by trimming and calibration at the wafer level. The low-output
impedance, linear output, and precise inherent calibration of the LM35 device makes
interfacing to readout or control circuitry especially easy. The device is used with single
power supplies, or with plus and minus supplies. As the LM35 device draws only 60 µA from
the supply, it has very low self-heating of less than 0.1°C in still air. The LM35 device is
rated to operate over a −55°C to 150°C temperature range, while the LM35C device is rated
for a −40°C to 110°C range (−10° with improved accuracy).

10
0
Some of the main features of the sensor as follows.

 Calibrated Directly in Celsius (Centigrade).


 Linear + 10-mV/°C Scale Factor.
 5°C Ensured Accuracy (at 25°C).
 Rated for Full −55°C to 150°C Range.
 Suitable for Remote Applications.
 Low-Cost Due to Wafer-Level Trimming.
 Operates From 4 V to 30 V.
 Less Than 60-µA Current Drain.
 Low Self-Heating, 0.08°C in Still Air.
 Non-Linearity Only ±¼°C Typical.
 Low-Impedance Output, 0.1 Ω for 1-mA Load.

Fig 3.6: Pin diagram of LM35

3.3.2 Arduino Uno Board:

The Arduino Uno is an open-source microcontroller board the Microchip ATmega328P


microcontroller and developed by Arduino.cc. The board is equipped with sets of digital and
analog input/output (I/O) pins that may be interfaced to various expansion boards (shields)
and other circuits. The board has 14 Digital pins, 6 Analog pins, and programmable with
the Arduino IDE (Integrated Development Environment) via a type B USB cable. It can be
powered by the USB cable or by an external 9-volt battery, though it accepts voltages
between 7 and 20 volts. It is also similar to the Arduino Nano and Leonardo. The hardware
reference design is distributed under a Creative Commons Attribution Share-Alike 2.5 license

11
0
and is available on the Arduino website. Layout and production files for some versions of the
hardware are also available.

Some of its specifications are as follows.

 Microcontroller: Microchip ATmega328P


 Operating Voltage: 5 Volts
 Input Voltage: 7 to 20 Volts
 Digital I/O Pins: 14 (of which 6 provide PWM output)
 Analog Input Pins: 6
 DC Current per I/O Pin: 20 mA
 DC Current for 3.3V Pin: 50 mA
 Flash Memory: 32 KB of which 0.5 KB used by bootloader
 SRAM: 2 KB
 EEPROM: 1 KB
 Clock Speed: 16 MHz
 Length: 68.6 mm
 Width: 53.4 mm
 Weight: 25g
z

Fig 3.7: Arduino Uno

12
General Pin Functions:

 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's off.
 VIN: The input voltage to the Arduino/Genuino board when it's 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.
 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.
 GND: Ground pins.
 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 which block the one on the board.

Special pin functions:

Each of the 14 digital pins and 6 analog pins on the Uno can be used as an input or output,
using pinMode(), digitalWrite(), and digitalRead() functions. They operate at 5 volts. Each
pin can provide or receive 20 mA as recommended operating condition and has an internal
pull-up resistor (disconnected by default) of 20-50k ohm. A maximum of 40mA is the value
that must not be exceeded on any I/O pin to avoid permanent damage to the microcontroller.
The Uno has 6 analog inputs, labelled A0 through A5, each of which provide 10 bits of
resolution (i.e. 1024 different values). By default, they measure from ground to 5 volts,
though is it possible to change the upper end of their range using the AREF pin and the
analogReference() function.

In addition, some pins have specialized functions:

13
 Serial / UART: pins 0 (RX) and 1 (TX). Used to receive (RX) and transmit (TX) TTL
serial data. These pins are connected to the corresponding pins of the ATmega8U2 USB-
to-TTL serial chip.
 External interrupts: pins 2 and 3. These pins can be configured to trigger an interrupt on a
low value, a rising or falling edge, or a change in value.
 PWM (pulse-width modulation): 3, 5, 6, 9, 10, and 11. Can provide 8-bit PWM output
with the analogWrite() function.
 SPI (Serial Peripheral Interface): 10 (SS), 11 (MOSI), 12 (MISO), 13 (SCK). These pins
support SPI communication using the SPI library.
 TWI (two-wire interface) / I²C: A4 or SDA pin and A5 or SCL pin. Support TWI
communication using the Wire library.
 AREF (analog reference): Reference voltage for the analog inputs.

3.3.3 Liquid Crystal Display:

An LCD is an electronic display module which uses liquid crystal to produce a visible image.
The 16×2 translates a display 16 characters per line in 2 such lines. In this LCD each
character is displayed in a 5×7 pixel matrix.

Fig 3.8: Pin diagram of LCD

14
Table 3.2: Pin descriptions of LCD

3.3.4 Potentiometer:

A potentiometer(also known as a pot or potmeter) is defined as a 3 terminal variable resistor


in which the resistance is manually varied to control the flow of electric current. A
potentiometer acts as an adjustable voltage divider.

Fig 3.9: Potentiometer

15
A potentiometer is connected between the appropriate power supply rails(Vdd and Vss for
single supply, and Vee and Vdd for higher voltage LCD modules). The wiper of the pot is
connected to LCD bias voltage input(V0). The LCD is then positioned at the normal viewing
position, and the pot is adjusted to obtain the desired LCD appearance. Depending in the
optimum contrast requirement, and the ability to use more than one vendors LCD module,
you can either leave the potentiometer in the design, or measure the voltage on the on the V0
pin and select pair of resistors to produce this voltage in the prodution units.

3.4 Design and Working:

The output pins of the heart rate and temperature sensor are given to the analog pins A0 and
A1 which implies its output is given to the Arduino. The LCD is interfaced with connections
made from its data pins of Liquid Crystal to the digital pins of Arduino.

When the circuit is powered by the battery, the Arduino starts reading the pulse rate from the
pulse sensor and the ambient temperature from the LM-35 temperature sensor. The pulse
sensor has an infrared LED and a photo transistor which help detect pulse at the tip of the
finger or earlobe. Whenever it detects pulse, its IR LED flashes. The flash of the IR LED is
detected by the phototransistor and its resistance changes when the pulse is changed. The
heartbeat of a normal adult ranges from 60 to 100 per minute.

Fig 3.10: Circuit Diagram for the prototype

16
For detecting beats per minute (BPM), first an interrupt is set which triggers in every 2
Milliseconds. So, the sampling rate by the Arduino to detect pulse is 500 Hz. This sampling
rate is sufficient to detect any pulse rate. So, at every 2 Milliseconds, the Arduino reads analog
voltage output from the pulse sensor. The analog output from the pulse sensor is converted to
a digital value using in-built ADC channel. The Arduino has 10-bit long ADC channel, so the
digitized value can range from 0 to 1024. The middle value for this range is 512. Initially, the
first beat is set to true and the second beat is counted when the condition that analog output
from the pulse sensor is greater than the middle point i.e. 512 is satisfied. Then, onwards,
every next beat is counted when the analog output from the pulse sensor is greater than the
middle point i.e. 512 and 3/5 of the time between the beats recorded in previous cycle has
passed. Every time, the beat is detected, a variable representing BPM is updated. This value in
this variable is pushed to an array in every minute and is used to represent the actual Beats Per
Minute or Heart Rate. The Arduino code developed uses a function to provide an LED fading
effect on every beat. The inbuilt capability of the sensor to amplify the received signal and
noise cancellation makes it optimum to use.

The LM-35 is used to detect the body temperature here. The range of human body temperature
is 97.9 °F- 99 °F which falls in the temperature range of LM-35 which is, -67 °F to 302 °F.
The output voltage varies by 10 mV in response to every degree Celsius rise/fall in ambient
temperature, i.e., its scale factor is 0.01 V/ oC. The LM-35 IC does not require any external
calibration or trimming to provide typical accuracies of ±31.55 °F at room temperature and
±30.65 °F over temperature range from , -67 °F to 302 °F. Under normal conditions, the
temperature measured by the sensor won’t exceed or recede the operational range of the
sensor. Typically, in the temperature range from , -67 °F to 302 °F, the voltage output of the
sensor increases by 10 mV per degree Celsius.

With the appropriate logic dumped into this hardware prototype, the output is obtained. The
software implementation is discussed in the further chapter.

17
CHAPTER 4

SOFTWARE DEVELOPMENT

4.1 About Arduino IDE:

The Arduino Integrated Development Environment - or Arduino Software (IDE) - contains a


text editor for writing code, a message area, a text console, a toolbar with buttons for
common functions and a series of menus. It is a cross-platform application
(for Windows, macOS, Linux) that is written in the programming language Java. The
Arduino IDE supports the languages C and C++ using special rules of code structuring. It
connects to the Arduino and Genuino hardware to upload programs and communicate with
them. Programs written using Arduino Software (IDE) are called sketches. These sketches are
written in the text editor and are saved with the file extension .ino. The message area gives
feedback while saving and exporting and also displays errors. The console displays text
output by the Arduino Software (IDE), including complete error messages and other
information. The bottom righthand corner of the window displays the configured board and
serial port. The Arduino IDE supplies a software library from the Wiring project, which
provides many common input and output procedures.

4.2 The source code developed for the outcome:

//Including LCD library

#include <LiquidCrystal.h>

//Initializing LCD pins to interface with the Arduino Board

const int rs = 12, en = 11, d4 = 5, d5 = 4, d6 = 3, d7 = 2;

LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

Void setup(){

Serial.begin(9600);

lcd.begin(16,2);

lcd.setCursor(0,0);

//Assigning Sensor output pins to Arduino Board

18
int pulsePin = A0; // Pulse Sensor purple wire connected to analog pin A0

int blinkPin = 13;

int tempPin=1; // pin to blink led at each beat

//Logic to sense heart beat

// Volatile Variables, used in the interrupt service routine

volatile int BPM; // int that holds raw Analog in 0. updated every 2mS

volatile int Signal; // holds the incoming raw data

volatile int IBI = 600; // int that holds the time interval between beats

volatile boolean Pulse = false; // "True" when User's live heartbeat is detected. "False"
when not a "live beat".

volatile boolean QS = false; // becomes true when Arduino finds a beat.

static boolean serialVisual = true; // Set to 'false' by Default. Re-set to 'true' to see Arduino
Serial Monitor ASCII Visual Pulse

volatile int rate[10]; // array to hold last ten IBI values

volatile unsigned long sampleCounter = 0; // used to determine pulse timing

volatile unsigned long lastBeatTime = 0; // used to find IBI

volatile int P = 512; // used to find peak in pulse wave, seeded

volatile int T = 512; // used to find trough in pulse wave, seeded

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

volatile boolean secondBeat = false; // used to seed rate array so we startup with
reasonable BPM

void setup()

19
{

pinMode(blinkPin,OUTPUT); // pin that will blink to your heartbeat.

Serial.begin(115200);

interruptSetup(); // sets up to read Pulse Sensor signal every 2ms

lcd.begin(16, 2);

lcd.clear();

void loop()

serialOutput();

if (QS == true) // A Heartbeat Was Found

cnt=1;

// BPM and IBI have been Determined

// Quantified Self "QS" true when arduino finds a heartbeat

serialOutputWhenBeatHappens(); // A Beat Happened, Output that to serial.

QS = false; // reset the Quantified Self flag for next time

delay(20); // take a break

void interruptSetup()

// Initializes Timer2 to throw an interrupt every 2mS.

20
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

void serialOutput()

{ // Decide How To Output Serial.

if (serialVisual == true)

arduinoSerialMonitorVisual('-', Signal); // goes to function that makes Serial Monitor


Visualizer

else

sendDataToSerial('S', Signal); // goes to sendDataToSerial function

void serialOutputWhenBeatHappens()

if (serialVisual == true) // Code to Make the Serial Monitor Visualizer Work

21
{

Serial.print(" Heart-Beat Found "); //ASCII Art Madness

Serial.print("BPM: ");

Serial.println(BPM);

//Logic to detect temperature

int val=analogRead(tempPin);

float mv=(val/1024.0)*5000; // Conversion of output to readable values

float cel=mv/10; // Output in Celsius

float far=(cel*1.8)+32; // Converting Celsius to Fahrenheit units

// Printing output on LCD

lcd.setCursor(0,0);

lcd.print("Temp:");

lcd.print(cel);

delay(2000);

lcd.setCursor(0,1);

lcd.print("BPM: ");

lcd.print(BPM);

delay(2000)

lcd.clear();

else

sendDataToSerial('B',BPM); // send heart rate with a 'B' prefix

sendDataToSerial('Q',IBI); // send time between beats with a 'Q' prefix

22
}

// Printing output on the serial monitor

void arduinoSerialMonitorVisual(char symbol, int data )

const int sensorMin = 0; // sensor minimum, discovered through experiment

const int sensorMax = 1024; // sensor maximum, discovered through experiment

int sensorReading = data; // map the sensor range to a range of 12 options:

int range = map(sensorReading, sensorMin, sensorMax, 0, 11);

void sendDataToSerial(char symbol, int data )

Serial.print(symbol);

Serial.println(data);

ISR(TIMER2_COMPA_vect) //triggered when Timer2 counts to 124

cli(); // disable interrupts

Signal = analogRead(pulsePin); // read the Pulse Sensor

sampleCounter += 2; // keep track of the time in mS with this variable

int N = sampleCounter - lastBeatTime; // monitor the time since the last beat to avoid
noise

// find the peak and trough of the pulse wave

if(Signal < thresh && N > (IBI/5)*3) // avoid dichrotic noise by waiting 3/5 of last IBI

23
if (Signal < T) // T is the trough

T = Signal; // keep track of lowest point in pulse wave

if(Signal > thresh && Signal > P)

{ // thresh condition helps avoid noise

P = Signal; // P is the peak

} // keep track of highest point in pulse wave

// signal surges up in value every time there is a pulse

if (N > 250)

{ // avoid high frequency noise

if ( (Signal > thresh) && (Pulse == false) && (N > (IBI/5)*3) )

Pulse = true; // set the Pulse flag when we think there is a pulse

digitalWrite(blinkPin,HIGH); // turn on pin 13 LED

IBI = sampleCounter - lastBeatTime; // measure time between beats in mS

lastBeatTime = sampleCounter; // keep track of time for next pulse

if(secondBeat)

{ // if this is the second beat, if secondBeat == TRUE

secondBeat = false; // clear secondBeat flag

for(int i=0; i<=9; i++) // seed the running total to get a realisitic BPM at startup

24
{

rate[i] = IBI;

if(firstBeat) // if it's the first time we found a beat, if firstBeat == TRUE

firstBeat = false; // clear firstBeat flag

secondBeat = true; // set the second beat flag

sei(); // enable interrupts again

return; // IBI value is unreliable so discard it

// keep a running total of the last 10 IBI values

word runningTotal = 0; // clear the running Total variable

for(int i=0; i<=8; i++)

{ // shift data in the rate array

rate[i] = rate[i+1]; // and drop the oldest IBI value

runningTotal += rate[i]; // add up the 9 oldest IBI values

rate[9] = IBI; // add the latest IBI to the rate array

runningTotal += rate[9]; // add the latest IBI to runningTotal

runningTotal /= 10; // average the last 10 IBI values

BPM = 60000/runningTotal; // Beats per Minute

25
QS = true; // set Quantified Self flag

// QS FLAG IS NOT CLEARED INSIDE THIS ISR

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;

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

26
sei(); // enable interrupts

}// end isr

27
CHAPTER 5
RESULTS

The proposed temperature and heart beat sensors are interfaced to an Arduino Uno. The
processed output of the heart rate sensor and temperature sensor for different age groups
shown in the following Table 5.1.

AGE HEART BODY RECORDED RECORDED


RATE TEMPERATURE HEART BODY
(BPM) (CELSIUS) RATE TEMPERATURE
(BPM) (CELSIUS)
8 110-160 (94.46 –100.4°F) 154 95.36 °F
months
1 year 100-150 (94.46 –100.4°F) 139 94.8°F

6 years 80-120 (95.9 –100.4°F) 100 96.8°F

13 60-100 (95.36 –100.5°F) 76 96.8°F


years
17 60-90 (95.36 –100.5°F) 91 98.7°F
years
21 60-90 (95.36 –100.5°F) 74 99.3°F
years
42 80 to 100 (95.36 –100.5°F) 89 99.3°F
years
68 82 to 100 (95.36 –100.5°F) 97 100.4°F
years
Table 5.1 Optimum values of heart rate and temperature vs recorded values of the sensors

The heart rate at different conditions are recorded as follows:

CONDITION OPTIMUM HEART RECORDED HEART


RATE(BPM) RATE(BPM)
Athletes (30-70) 51

After 20min of brisk walk (95-124) 98


(Men)
After 20min of brisk walk (98-127) 101
(Women)

Table 5.2 Optimum values of heart rate under different conditions vs recorded values of the
sensor

28
Fig 5.1 The above picture shows the output for a 21-year old person.

Discussion:

The heart rate for infants is high, whereas it is comparatively lower as the age increases. For
an age above 50 years, the heart rate is high. Heart rate is lower for people who undergo
continuous physical activity. For a brief activity, the heart rate first increases then, falls back
to the normal range.

The temperature was found to be near to the optimum values, however, the values are
difficult to obtain since the sensor takes longer duration to detect the changes in the
surroundings. It is hence required to hold the sensor for a substantial amount of time.

29
CHAPTER 6

CONCLUSIONS

A pulse sensor which considered as an infrared sensor that has a response to variations in light
intensity has been used. The key objective of developing this project with the help of Android
Open Source platform is to easily determine the health condition of patient. We are developing
prototype of this application using the continuous monitoring of parameters which can help us
predict the further health emergencies. This objective is met with measuring the heart rate and
body temperature. It is helpful where continuous monitoring is required under critical
condition. In addition it is very usable device due to its portability which means the patients
can carry it with him therefore no need to stay at hospitals because the Heart Rate and
Temperature Monitor is applicable almost everywhere.

It is economical to develop this prototype, which can most importantly be carried to places
such as mining areas, where monitoring the workers’ health is of prime cruciality.

6.1 Challenges and Limitations:

Several challenges were faced throughout the entire life cycle of the project. The first one was
with the pulse sensor. It didn’t detect accurate readings if it was placed with excessive or loose
pressure on the body.

Although the pulse sensor amplifies and filters the signal, there are noise disturbances. This
noise can be slightly reduced by grounded all the connection properly.

Similar challenge was with the temperature outputs inaccurate measures because it takes time
to respond with the heat produced by the human body. However, LM35 is a suitable component
to use in the project to reduce the cost in hardware implementation. In order to have accurate
data to some extent, a number of repeated measurements are required. Hence both challenges
were overcome.

The next challenge we faced is the fluctuating output values. This can be improved to a certain
extent, by taking repetitive values or by including a measure of the time for which the sensors
are in contact with the human body.

30
6.2 Future Work:

Further improvements can be applied to this project to enhance its performance:

 Design robust system to improve measuring efficiency even in the presence of noise.
 Propose a new method for efficient transmission of data between the sensors and the
Android application.
 To ensure the accuracy of heart rate monitor device, more testing can be performed to
larger number of people with different ages and weights.
 Replace the LM35 with specific temperature sensor of body measurement in order to
make it more accurate and more functional to use.
 More vital signs parameters should be added to increase the value of the project to the
patients. These can include: Blood Pressure, Respiratory Rate and other parameters.
 Implement pulse and other parameters measurements using the mobile phone camera
along with other built-in sensors in order to obtain these parameters on demand if the
patient started experiencing some symptoms or abnormalities.
 The device should be miniaturized into a PCB making its weight lighter in order to
make the device commercial for public use.
 Portable battery unit for the device to provide required power for the sensors and the
controller unit.

31
REFERENCES

[1] Joyce Smith, Rachel Roberts, Vital Signs for Nurses: An Introduction to Clinical
Observations, WILEY-BLACKWELL, June 2011

[2] Arrthur c Guyton ,Text Book of Medical Physiology, ELSEVER SAUNDERS

[3]Medical Instrumentations, available [online], http://ww.webmed.com, October 2016

[4] American Heart Association, available [online], http://ww.heart.org, November 2016

[5] Measuring Heart Rate, available [online], http://ww.ACS.co.uk, November 2016

[6 ] Sudanese Association for Heart Diseases, available [online], http://ww.heart.org, February


2017

[7] Rana Biswarup ,Analysis of PPG and ECG, LAP Lambert Academic Publishing, September
2015

[8] Braunwald’s, heart disease a text book of cardiovascular medicine, ELSEVER


SAUNDERS

[9] World Health Organization, available [online], http://ww.who.int, May 2017 48

[10] Pulse Sensors, available [online], http://www.pulsesensor.com, June 2017

[11] LM35 datasheet, available [online], http://www.alldatasheets/lm35.com, Ju

iv

You might also like