0% found this document useful (0 votes)
12 views

IOT Based ICU Patient Health Monitoring System

The document outlines the development of an IoT-based patient health monitoring system designed to continuously track vital signs such as temperature, heartbeat, and blood pressure. It aims to enhance patient care by providing real-time health data to healthcare professionals, thereby facilitating timely medical interventions and reducing unexpected mortality rates. The system integrates various sensors and cloud technology to ensure accessible and efficient monitoring of patients, particularly in critical care settings like ICUs.

Uploaded by

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

IOT Based ICU Patient Health Monitoring System

The document outlines the development of an IoT-based patient health monitoring system designed to continuously track vital signs such as temperature, heartbeat, and blood pressure. It aims to enhance patient care by providing real-time health data to healthcare professionals, thereby facilitating timely medical interventions and reducing unexpected mortality rates. The system integrates various sensors and cloud technology to ensure accessible and efficient monitoring of patients, particularly in critical care settings like ICUs.

Uploaded by

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

IOT Based ICU Patient Health Monitoring System

1
2
3
4

ABSTRACT

The fundamental element of people’s needs is health .Humans face a haul of surprising death and
plenty of diseases because of varied diseases that are a result of lack of treatment to the patients at
right time. The main objective of this project is to develop a reliable sensible patient health
observance system victimization IoT so the attention professionals will monitor their patients. The
sensors will be either worn or be embedded into the body of the patients, to unendingly monitor
their health. the knowledge collected in such a fashion will behold on, analyzed, and well-mined
to try and do the first prediction of diseases. A mobile device-based attention observance system
is developed which may offer period on-line data regarding physiological conditions of a patient
primarily consists of sensors, the information acquisition unit, Arduino, and programmed with
code. The patient’s temperature, heartbeat rate, pressure level, graph knowledge square measure
monitored, displayed, and hold on by the system and sent to the doctor’s and patient's mobile
containing the appliance. The sensible Health observance System monitors health standing and
saves it on the online page.
5
6

TABLE OF CONTENT
CHAPTER NO TITLE PAGE NO
1 ABSTRACT
LIST OF FIGURE

INTRODUCTION
1.1 BACKGROUND
1.2 MOTIVATION
1.3 IOT DEFINITION
2 AIM AND SCOPE
2.1 AIM
2.2 OBJECTIVE
2.3 SCOPE

3 SYSTEM DESIGN
3.1 EXISTING SYSTEM
3.2 PROBLEM STATEMENT
3.3 PROPOSED SYSTEM
3.4 ADVANTAGE
3.5 BLOCK DIAGRAM
3.6 PROJECT IMPLEMENTATION
3.7 HARDWARE REQUIREMENT
3.8 SOFTWARE REQUIREMENT

4 HARDWARE DESIGN
4.1 ARDUINO UNO AND ITS PROGRAMMING
4.2 OVERVIEW
4.3 SUMMARY
4.4 PIN CONFIGURATION
7

4.5 TEMPERATURE SENSOR


4.6 PULSE SENSOR
4.7 ESP8266 WIFI MODULE
4.8 OLED DISPLAY
4.9 BMP280 SENSOR
4.10 ECG SENSOR
4.11 MQ135 SENSOR

5 RESULT AND CONCLUSION


5.1 Conclusion
REFERENCES
APPENDIX
A.SOURCE
8

LIST OF FIGURES

FIGURE NO. FIGURE NAME PAGE NO.

1.3 IOT ARCHITECTURE


3.5 BLOCK DIAGRAM
3.7 STRUCTURE DIAGRAM
4.1 ARDUINO
4.8 OLED DISPLAY
4.9 BMP280 SENSOR
4.5 LM35 TEMPERATURE SENSOR
4.6 PULSE SENSOR
4.7 ESP8266 WIFI MODULE
4.10 ECG SENSOR
4.11 MQ135 SENSOR
5 STRUCTURE OF PROJECT
5 OUTPUT CONSOLE
9

CHAPTER 1

INTRODUCTION

The total population is expanding day by day. Clinic and medical services are not adequate for this
increasing population.So the administration always feels great pressure on different types of issues
like patient monitoring, air quality etc. The gigantic weight towards the administration of
medicinal services in urban areas has stopped the progression in advancements. With the expanded
pace of medicinally tested individuals, remote human services have become an essential element
of our lives. Lately, we observe the expanded enthusiasm for wearable sensors and such gadgets
are accessible in showcases for less expensive rate for individual medicinal services and movement
mindfulness. Scientists are considering the usage of such propelled gadgets for the clinical
applications for information recording and executives.
In most cases, patients are confronting risky circumstances because of coronary failure and diverse
sort of issues which creates an immediate effect for the shortness of good clinical help to patients
at the emergency time. ICU is the spot, where the patients with critical conditions are yielded for
treatment. For such fundamental conditions the Doctors need to have an immaculate updates
regarding the patient’s prosperity related
boundaries like their circulatory strain, heartbeat and temperature. To successfully screen the
wellbeing of patients Iot based Patient’s health observing framework is quite necessary. For such
conditions this IoT based framework can comprehend a computerization system that can keep the
masters resuscitated unparalleled over the web. This framework is likewise for checking the ICU
patients, educating specialists and nurturing friends and family. Here a creative task is proposing
to decrease such unexpected passing rates by utilizing the Patient Health Monitoring system that
utilizes sensor innovation and utilizations of the web. This framework utilizes Temperature and
heartbeat sensors for the following patient’s wellbeing. This framework additionally shows
patients’ temperature and heartbeat followed by live information
with timestamps over the Internet.
10

Quiet Monitoring frameworks are the most significant analytic frameworks in the serious
consideration units (ICU) of emergency clinics, giving consistent presentation and understanding
of the patient's fundamental capacities. The patient observing system uses media transmission
innovation for clinical finding, treatment and patient consideration. It may be isolated into two
methods of tasks: i) The ongoing mode-where persistent information is accessible at the remote
terminal and ii) The store-and-forward mode, which includes getting information sometime for the
future. Quiet checking frameworks managed different estimation procedures and low level sign
preparing calculations. In any case, the nature of such continuous frameworks were controlled by
numerous different variables, as well. They were applied for Programming innovation,
correspondence innovation, information portrayal strategies, and significant level sign preparing
calculations and computerization of sign portrayal to help human Health have prime importance
in everyone’s life. Currently, attention and eudaimonia management is one of the foremost
promising applications of knowledge technology. Among the applications that the Internet of
Things (IoT) beyond any doubt reworking the attention trade, In general, IoT has been widely
accustomed to interconnect advanced medical resources and to supply sensible and effective
attention services to the individuals. In recent years the Internet of Things(IoT) play.This
framework attempts to facilitate this issue through persistent checking of some fundamental
factors that oversees a patient's wellbeing condition. The factors that this framework screens are:
ECG sensor utilizing ad8232, Pulse rate from fingertip utilizing beat rate sensor and temperature
utilizing
temperature sensor lm35, measure room temperature utilizing dht11 sensor. The data is then spared
to the cloud server and then using a neighborhood site persistent wellbeing condition can be
observed where the information that will be appeared by operating API key information process
which can be seen by the specialist, medical caretakers or family members remotely The data is
then spared to the cloud server and then using a neighborhood site persistent wellbeing condition
can be observed where the information that will be appeared by operating API key information
process which can be seen by the specialist, medical caretakers or family members remotely. It
may be accessible
from any places and any gadgets, by means of the cloud.
11

a key role in the healthcare industry. The world population is increasing continuously. In many parts
of our country, people are not getting medical facilities at right time. Due to covid 19, many people
unable to go to the hospital because of that people are unable to do their routine check-ups for their
blood pressure and body temperature. Also, many peoples are not going because of a lot of lengthy
processes or because of not availability of doctors. So, we are doing this project for reducing

time consumption. In recent years the application of IoT in healthcare is increasing.

so, having a smart patient health monitoring system is observed that it will reduce time, cost, and
reduce efficiency. People can easily monitor themselves and can get the report at the same time.
Because of that, it is easy for the early prediction of diseases. The body temperature, heartbeat
rate, blood pressure are the main factors or parameters to diagnose the disease. This project gives
temperature, pulse rate, and Ecg data.

1.1 Background

The Future Internet goal is to provide an infrastructure to have an immediate access to information
about the physical world and its objects. Physical objects can be applicable to different application
domains, such as e-health, warehouse management, etc. Each application domain may have
different types of physical devices. Each physical device can have its own specifications, which is
required to use in order to interact with it. To achieve the future Internet goal, a layered vision is
required that can facilitate data access. Internet of Things (IoT) is a vision that aims to integrate
the virtual world of information to the real world of devices through a layered architecture.

The term „Internet of Things‟ consists of two words, namely Internet and Things. Internet refers
to the global network infrastructure with scalable, configurable capabilities based on interoperable
and standard communication protocols. Things are physical objects or devices, or virtual objects,
devices or information, which have identities, physical attributes and virtual personalities, and use
intelligent interfaces . For
12

contains metadata to identify and discover its corresponding sensor nodes. Therefore, IoT refers
to the things that can provide information from the physical environment through the Internet.

Middleware is as an interface between the hardware layer and the application layer, which is
responsible for interacting with devices and information management . The role of a
middleware is to present a unified programming model to interact with devices. A middleware
is in charge of masking the heterogeneity and distribution problems that we face when
interacting with devices .

1.2 Motivation

IoT-based system is in charge of providing knowledge from an environment to an non-expert user.


IoT-based system can be used in different environments, so it needs to be able to address many
heterogeneous devices. Thus, a major concern within developing an IoT-based system is how to
handle the interaction with the heterogeneous devices for non-expert users. This concern can be
addressed by a middleware layer between devices and non-expert users. This layer is responsible
to hide the diversity of devices from the user perspective, and provides access transparency to the
devices for the end users.
The idea of creating abstractions of devices been addressed in the literature. The middleware we
found in the literature can provide satisfaction by facilitating the interaction with devices, but they
do not support low-level device configuration .
Modern health care system introduces new technologies like wearable devices or cloud of things.
It provides flexibility in terms of recording patients monitored data and send it remotely via IOT.
In storage stage, data is stored, updated for future use. In data retrieving stage, retrieve data from
cloud.

1.3. IoT definition


13

In this section, we explain some of the IoT definitions. Also, we explain the layered
architecture for IoT.The Internet of Things (IoT) has increasingly gained attention in industry to
interact with different types of devices. IoT can have influence on industry and society by
integrating physical devices into information networks . IoT impacts can be on different
perspectives, namely for private and business users. From the perspective of a private user, IoT
has effect on both working and personal fields, such as smart homes and offices, e-health and
assisted living. From the aspect of a business user the impacts would be in fields such as
automation and industrial manufacturing, logistics, business process management, intelligent
transportation of people and goods.IoT integrates physical things into information networks. IoT
covers the overall infrastructure, including software, hardware and services, which is used to
support these information networks. The integrated physical things can exchange data about the
physical properties and information that they sense in their environment. To identify devices, we
can use identification technologies like for example RFID, which allow each device be uniquely
identified.International Telecommunication Union (ITU) defines IoT as “A global
infrastructure for the Information Society, enabling advanced services by
interconnecting (physical and virtual) things based on, existing and evolving,
interoperable information and communication technologies”.

IoT has a layered architecture designed to answer the demands of various industries, enterprises
and society. It shows a generic layered architecture for IoT that consist of five layers, which are
discussed, in the following:
● Edge Technology layer

This is a hardware layer that consists of embedded systems, RFID tags, sensor networks and all
of the other sensors in different forms. This hardware layer can perform several functions, such
as collecting information from a system or an environment, processing information and
supporting communication.
14

FIG 1.3 IOT ARCHITECTURE


● Access Gateway layer
This layer is concerned with data handling, and is responsible for publishing and subscribing the
services that are provided by the Things, message routing, and hovelling the communication
between platforms.
● Middleware layer
This layer has some critical functionalities, such as aggregating and filtering the received data
from the hardware devices, performing information discovery and providing access control to the
devices for applications.
15

● Application layer

This layer is responsible for delivering various application services. These services are
provided through the middleware layer to different applications and users in IoT-based

CHAPTER 2

AIM AND SCOPE

2.1 AIM OF PROJECT

The primary goal of this project is to develop a smart patient health monitoring

system in such a way that we can get all the necessary and detailed information of the disease. The
proposed system measures the body temperature, pulse rate and ECG data. Health is always a
major concern in every growth the human race is advancing in terms of technology. Like the recent
coronavirus attack that has ruined the economy of China to an extent is an example how health
care has become of major importance. In such areas where the epidemic is spread, it is always a
better idea to monitor these patients using remote health monitoring technology. Remote Patient
Monitoring arrangement empowers observation of patients outside of customary clinical settings
(e.g. at home), which expands access to human services offices at bring down expenses. The
fundamental element of people’s needs is health .Humans face a haul of surprising death and plenty
of diseases because of varied diseases that are a result of lack of treatment to the patients at right
time. The
16

main objective of this project is to develop a reliable sensible patient health observance system
victimization IoT so the attention professionals will monitor their patients. The sensors will be
either worn or be embedded into the body of the patients, to unendingly monitor their health. the
knowledge collected in such a fashion will behold on, analyzed, and well-mined to try and do the
first prediction of diseases. The concept of Internet of things is recent and is defined as the
integration of all devices that connect to the network, which can be managed from the web and in
turn provide information in real time, to allow interaction with people they use it5 . Another
concept of IoT "is the general idea of things, especially everyday objects, which are readable,
recognizable, locatable, addressable and controllable via the Internet - either through RFID,
wireless LAN, wide area network, or by other means "6 . IoT The term itself was first mentioned
by Kevin Ashton in 1998 and aims at the exchange of information7 . On the other hand8 , the
Internet of things can be seen from three paradigms, which are Internet-oriented middleware,
things sensors oriented and knowledge-oriented semantics. Therefore, it is appropriate, such
delimitation because the interdisciplinary nature of the subject. However the usefulness of the IoT
is reflected when crossing between the three paradigms in the development of applications9 . The
Internet of Things has a number challenges that are still working . IoT driven Fog Computing is
developed in the healthcare industry that can expedite facilities and services among the mass
population and help in saving billions of lives. The new computing platform, founded as fog
computing paradigm may help to ease latency while transmitting and communicating signals with
remote servers, which can accelerate medical services in spatial-temporal dimensions. The latency
reduction is one of the necessary features of computing platforms which can enable completing
the healthcare operations, especially in large-size medical projects and in relation to providing
sensitive and intensive services. Reducing the cost of delivering data to the cloud is one of the
research objectives.

2.1.1 OBJECTIVES
• To develop a reliable patient health monitoring system.
• To measure the body temperature, heartbeat rate and ecg.
17

• To design a system to store patient data.


• To do analysis of collected data of sensors.
• To get health related information in understandable format.

2.2 SCOPE
This project will help in monitoring the patient’s health which will be helpful for doctors
and patients both. It will help in reducing and early prediction of disease. The core objective of
this project is the design and implementation of a smart patient health tracking system that uses
Sensors to track patient health and uses internet to inform their loved ones in case of any issues.
The objective of developing monitoring systems is to reduce health care costs by reducing
physician office visits, hospitalizations, and diagnostic testing procedure Each of our bodies
utilizes temperature and also pulse acknowledging to peruse understanding wellbeing. The sensors
are linked to a microcontroller to track the status which is thus interfaced to a LCD screen and
additionally remote association with have the capacity to exchange alarms. If framework finds any
sudden changes in understanding heart beat or body temperature, the framework consequently
alarms the client about the patients status over IOT and furthermore indicates subtle elements of
pulse and temperature of patient live in the web. In this manner IOT set up tolerant wellbeing
following framework viably utilizes web to screen quiet wellbeing measurements and spare
persists time. The increased use of mobile technologies and smart devices in the area of health has
caused great impact on the world. Health experts are increasingly taking advantage of the benefits
these technologies bring, thus generating a significant improvement in health care in clinical
settings and out of them. Likewise, countless ordinary users are being served from the advantages
of the MHealth (Mobile Health) applications and E-Health (health care supported by ICT) to
improve, help and assist their health. Applications that have had a major refuge for these users, so
intuitive environment. The Internet of things is increasingly allowing to integrate devices capable
of connecting to the Internet and provide information on the state of health of patients and provide
information in real time to doctors who assist. It is clear that chronic diseases such as diabetes,
heart and pressure among others, are remarkable in the world economic and social level problem.
The aim of this article is to develop an architecture based on an ontology capable of monitoring
the health and workout routine recommendations to patients with chronic diseases. Through
connected devices, it becomes easy for doctors and physicians to monitor patients’ health. Also,
real-time monitoring can save lives in a medical emergency like diabetic attacks, heart failure,
18

asthma attacks, etc.


By means of a smart medical device connected to the smartphone app, collecting medical and
other required health data will not be challenging. IoT devices collect and transfer health data like-
blood pressure, oxygen, and blood sugar levels, weight, and ECGs.
Data collected from these devices are stored in the cloud and can be used by an authorized person,
who could be a physician, insurance company, a participating health firm or an external consultant,
regardless of their place, time, or device. Another objective of IoT in healthcare enables
operability, machine-to-machine communication, information exchange, and data movement that
ultimately makes the healthcare facility delivery effective and efficient.
Through connectivity protocols like Bluetooth LE, Wi-Fi, Z-wave, ZigBee, and other modern
protocols, healthcare personnel can change the way they spot illnesses and ailments in patients
and also innovating the ways of treatment.
Consequently, a technology-driven setup can cut regular visits to the health personnel while
lowering the cost factor. Without the cloud, it is impossible to store a vast amount of data collected
from healthcare mobile applications and devices. Also, for healthcare personnel, it is quite tough
to acquire data originating from various devices and sources.
In such a situation, IoT devices can collect, report and analyze the data in real-time while cutting
the need to store the raw data. In life-threatening circumstances, on-time alerts become quite
critical.
To combat such situations, medical IoT devices and applications can gather vital data and transfer
it to doctors and health personnel for real-time tracking. conditions irrespective of place, time. By
using IoT enabled devices, doctors can monitor patients
19

CHAPTER 3

SYSTEM DESIGN

3.1 EXISTING SYSTEM

● The system used before in health observance is that the fastened observance system, which
might be detected only the patient is within the hospital or bed. It takes abundant time for
doctors additionally as patients. within the existing system, the patient has to get
hospitalized for normal observance or routine medical.
● The systems are mensuration the health parameter of the patient and send by it
through totally different platform like Bluetooth protocol many more.

● These are used for under short-range communication to transfer the information. The
doctor cannot fetch all the small print in the slightest degree times.

3.2 PROBLEM STATEMENT

● In rural hospitals, the facilities for health caring are limited. The poor quality of health
management enables issues in health care system.

● In developing countries there is lack of resources and management to reach out the
problems of individuals.

● . A common man cannot afford the expensive and daily check up for his health.

3.3 PROPOSED SYSTEM


● In our proposed system,we are using the Arduino Uno, Temperature Sensor, Pulse, oled
display, BMP280 Sensor,mq135 Sensor ,ECG Sensor,esp8266, Web IoT platform, wifi
Module, Power supply.
20

● An Smart patient health Monitoring System will not only help in maintaining health but
also reducing the work of doctors and saving the time of patients.

● The proposed method of patient monitoring system monitors patient’s health parameters
using Arduino Uno. After connecting internet to the Arduino uno, it is connected to cloud
database system which acts as a server. Then the server automatically sends data to the
receiver system. Hence, it enables continuous monitoring of the patient’s health parameters
by the doctor. Any abrupt increase or decrease in these parameter values can be detected
at the earliest and hence necessary medications can be implemented by the doctor
immediately.

● Various varieties of sensors are interfaced with the microcontroller Arduino Uno to create
the system smart. The info will display on both oled and in their webpage.

● The most ideal of the system is to transmit the knowledge through the webpage to
continuous monitoring of the patient over the internet. Such a system would constantly
detect the important body parameters like temperature, vital signs and would compare it
against a predetermined range set and if these values cross the particular limit, it will
immediately alert the doctor, during this system, a microcontroller is employed to transmit
the info.

● The doctor will simply access the patients health anytime from anyplace. An LCD is
additionally connected to the microcontroller for the patients to look at their health
status live.

3.4 ADVANTAGES

● Simple system to monitor the health parameters


● Response time is too good
● Immediately update in the IOT cloud web server
● Easy to implement
● Cost effective system
21

3.5 BLOCK DIAGRAM 1 and 2

FIG
3.5

3.6 Project Implementation


22

The system is implemented using the combination of hardware components. The smart patient
health monitoring system will have sensors to detect body temperature, pulse rate and ECG data.
The health monitoring sensors are used to collect health related data i.e. for data acquisition.
Communication can be done by controller for sending data on internet wirelessly. Data processing
has been done at server. All data collected and aggregated at server point. To get health related
information in understandable format it can be shown on web page using Thing Speak IOT. All
these data will be accessible in real time scenario for continuous monitoring. Health monitoring is
the major problem in today’s world. Due to lack of proper health monitoring, patient suffer from
serious health issues. There are lots of IoT devices now days to monitor the health of patient over
internet. Health experts are also taking advantage of these smart devices to keep an eye on their
patients. With tons of new healthcare technology start-ups, IoT is rapidly revolutionizing the
healthcare industry.

Here in this project, we will make an IoT based Health Monitoring System which records
the patient heart beat rate and body temperature and also send an Web alert whenever those
readings goes beyond critical values. Pulse rate and body temperature readings are recorded over
ThingSpeak and Google sheets so that patient health can be monitored from anywhere in the world
over internet. A panic will also be attached so that patient can press it on emergency to send
email/sms to their relatives.
23

FIG-3.6 CIRCUIT DIAGRAM

3.7 HARDWARE REQUIREMENTS

● Arduino uno Board


● ESP8266-01 WiFi Module
● OLED Display
● BMP280 Sensor
● ECG Sensor
● MQ135 Sensor
● Potentiometer 10K
● Pulse Sensor
● LM35 Temperature Sensor
● Two Relay
● Fan
● Bulb
● 2K Resistor
● 1K Resistor
24

● Connecting Wires
● Breadboard

3.8 SOFTWARE REQUIREMENTS

● Arduino IDE

● Language: C

● Local Web Server (IOT Cloud Serve)

CHAPTER4

HARDWARE DESIGN

4.1 ARDUINO UNO AND ITS PROGRAMMING

Arduino is a tool for making computers that can sense and control more of the physical world than
your desktop computer. It's an open-source physical computing platform based on a simple
microcontroller board, and a development environment for writing software for the board.

Arduino can be used to develop interactive objects, taking inputs from a variety of switches or
sensors, and controlling a variety of lights, motors, and other physical outputs. Arduino projects
can be stand-alone, or they can be communicate with software running on your computer.
The boards can be assembled by hand or purchased preassembled; the open-source IDE can be
downloaded for free. The Arduino programming language is an implementation of Wiring, a
similar physical computing platform, which is based on the Processing multimedia programming
environment. The USB connection with the PC is necessary to program the board and not just to
power it up. The Uno automatically draw power from either the USB or an external power supply.
Connect the board to your computer using the USB cable. The green power LED (labelled PWR)
should go on. The Arduino platform has become quite popular with people just starting out with
electronics, and for good reason. Unlike most previous programmable circuit boards, the Arduino
does not need a separate piece of hardware (called a programmer) in order to load new code onto
25

the board -- you can simply use a USB cable. Additionally, the Arduino IDE uses a simplified
version of C++, making it easier to learn to program. Finally, Arduino provides a standard form
factor that breaks out the functions of the micro-controller into a more accessible package. Arduino
is a great tool for people of all skill levels. However, you will have a much better time learning
along side your Arduino if you understand some basic fundamental electronics beforehand. We
recommend that you have at least a decent understanding of these concepts before you dive in to
the wonderful world of Arduino.

Arduino Uno:
26

Fig 4.1 ARDUINO UNO

4.2 Overview

The Arduino microcontroller is an easy to use yet powerful single board computer that has gained
considerable traction in the hobby and professional market. The Arduino is open-source, which
means hardware is reasonably priced and development software is free. This guide is for students
in ME 2011, or students anywhere who are confronting the Arduino for the first time. For advanced
Arduino users, prowl the web; there are lots of resources.
The Duemilanove board features an Atmel ATmega328 microcontroller operating at 5 V with 2
Kb of RAM, 32 Kb of flash memory for storing programs and 1 Kb of EEPROM for storing
parameters. The clock speed is 16 MHz, which translates to about executing about 300,000 lines
of C source code per second. The board has 14 digital I/O pins and 6 analog input pins. There is a
USB connector for talking to the host computer and a DC power jack for connecting an external
6-20 V power source, for example a 9 V battery, when running a program while not connected to
the host computer. Headers are provided for interfacing to the I/O pins using 22 g solid wire or
header connectors.
The Arduino programming language is a simplified version of C/C++. If you know C,
programming the Arduino will be familiar. If you do not know C, no need to worry as only a few
commands are needed to perform useful functions.

An important feature of the Arduino is that you can create a control program on the host PC,
download it to the Arduino and it will run automatically. Remove the USB
27

cable connection to the PC, and the program will still run from the top each time you push the
reset button. Remove the battery and put the Arduino board in a closet for six months. When you
reconnect the battery, the last program you stored will run. This means that you connect the board
to the host PC to develop and debug your program, but once that is done, you no longer need the
PC to run the program.

The Arduino Uno is a microcontroller board based on the ATmega328.It has 14 digital input/output
pins (of which 6 can be used as PWM outputs), 6 analog inputs, a 16 MHz ceramic resonator, a USB
connection, a power jack, an ICSP header, and a reset button. It contains everything needed to
support the microcontroller; simply connect it to a computer with a USB cable or power it with a
AC-to-DC adapter or battery to get started.

The Uno differs from all preceding boards in that it does not use the FTDI USB-to-serial driver
chip. Instead, it features the Atmega16U2 (Atmega8U2 up to version R2) programmed as a USB-
to-serial converter.

4.3 Summary:

Microcontroller ATmega328

Operating Voltage 5V

Input Voltage (recommended) 7-12V Input

Voltage (limits) 6-20V

Digital I/O Pins 14 (of which 6 provide PWM output)

Analog Input Pins 6

DC Current per I/O Pin 40 mA

DC Current for 3.3V Pin 50mA


28

Flash Memory 32 KB (ATmega328) of which 0.5 KB used by bootloader SRAM 2

KB (ATmega328)

EEPROM 1 KB (ATmega328)

Clock Speed 16 MHz

4.4 Pin Configuration

The Arduino Uno can be powered via the USB connection or with an external power supply. The
power source is selected automatically.

External (non-USB) power can come either from an AC-to-DC adapter (wall- wart) or battery.
The adapter can be connected by plugging a 2.1mm center-positive plug into the board's power
jack. Leads from a battery can be inserted in the Gnd and Vin pin headers of the POWER
connector.

The board can operate on an external supply of 6 to 20 volts. If supplied with less than 7V,
however, the 5V pin may supply less than five volts and the board may be unstable. If using more
than 12V, the voltage regulator may overheat and damage the board. The recommended range is
7 to 12 volts.

The power pins are as follows:

• VIN. The input voltage to the Arduino 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 - 12V), the USB connector (5V), or the
VIN pin of the board (7-12V). Supplying voltage via the 5V or 3.3V pins bypasses the regulator,
and can damage your board.
29

• 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 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 for working with the 5V
or 3.3V.

FIG-4.4 PIN DIAGRAM

4.5 Temperature Sensor


30

21

FIG-4.5 TEMPERATURE SENSOR PIN DIAGRAM

The LM35 is one kind of commonly used temperature sensor that can be used to measure
temperature with an electrical o/p comparative to the temperature (in °C). It can measure
temperature more correctly compare with a thermistor. This sensor generates a high output voltage
than thermocouples and may not need that the output voltage is amplified. The LM35 has an output
voltage that is proportional to the Celsius temperature. The scale factor is .01V/°C.

FIG 4.5 LM35


Temperature Sensor

The LM35 does not need any exterior calibration and maintains an exactness of
31

+/-0.4°C at room temperature and +/-0.8°C over a range of 0°C to +100°C.One more significant
characteristic of this sensor is that it draws just 60 microamps from its supply and acquires a low
self-heating capacity. The LM35 temperature sensor available in many different packages like T0-
46 metal can transistor-like package,

TO-92 plastic transistor-like package, 8-lead surface mount SO-8 small outline package.

Pin Configuration

Pin Name Description

1 Vcc Input voltage is +5V for typical applications

There will be the increase in 10mV for raise of every 1°C. Can
2 Analog Out
range from -1V(-55°C) to 6V(150°C)

3 Ground Connected to ground terminal of the circuit

LM35 Temperature Sensor Circuit Diagram

The LM35 temperature sensor is used to detect precise centigrade temperature. The output of this
sensor changes describes the linearity. The o/p voltage of this IC sensor is linearly comparative to
the Celsius temperature. The operating voltage range of this LM35 ranges from-55˚ to +150˚C and
it has low-self heating. This is operated under 4 to 30 volts. The most extensively used electronic
devices are operational amplifiers, which are certain kind of differential amplifiers. Temperature
sensor circuit has terminals such as two inputs like non-inverting (+) and inverting (-) and only
output pin. IC741 is used as a non-inverting amplifier. The variation between the i/p terminals
amplifies the circuit.
32

FIG.4.6 LM35 Circuit Diagram

The amount produced by IC2 amplifies in an amount to the temperature by 10 mV per degree.
This unstable voltage is supply to a comparator IC 741. OP Amplifier is the most generally used
electronic devices today. The IC 741 op-amp is one sort of differential amplifier. We have used
IC741 as a non-inverting amplifier which means pin-3 is the input and the output is not inverted.
This LM35 temperature sensor circuit amplifies the difference between its input terminals. The
advantages of temperature sensor include It has no effect on the medium, more accurate, It has an
easily conditioned output and It responds instantly.

4.6 MAX30102 Pulse Oximeter Sensor

The MAX30102 sensor is the further optimized version of MAX30100 sensor; used as both a heart
rate monitor and a pulse oximeter. These features are enabled by constructing this sensor which
consists of two LEDs, a photodetector, optimized optics, and low noise signal processing
components. It is easily used with microcontrollers such as Arduino, ESP32, ESP8266 NodeMCU,
etc. to build an efficient heartbeat and oxygen saturation device.minute (BPM), is the heart beat
rate and the beat of the heart that can be felt in any artery that lies close to the skin is the pulse.
33

Pulse Sensor is a well designed plug and play hear rate sensor for Arduino. It can be used by
students, artists, athletes, makers and game & mobile developers who want
34

FIG.4.6 PULSE SENSOR

As you may notice the MAX30102 IC lies at the center of the module. The module consists of two different
types of LEDs (Red and IR) and a photodetector. Blood oxygen saturation and heart rate are found using these
two key features. We will later learn how the sensor actually works to obtain the BPM and SpO2 readings.

Another important feature you may notice is that the MAX30102 sensor module consists of two LDO regulators.
This is because the MAX30100 IC requires 1.8V and the LEDs require 3.3V to function properly. With the
addition of the voltage regulators, we can safely use microcontrollers that use 5/3.3/1.8V level input/outputs.

Moreover, if you view the module from the back, you can view a solder jumper to select the voltage logic level.
By default, it is set to 3.3V but you can also change it to 1.8V according to your microcontroller’s logic
requirements.

Key Features

● The MAX30102 sensor module has an ultra low power operation, uses 600μA (measurement
mode and 0.7μA(standby mode). Therefore a great choice to use in wearable devices such as
smart watches etc.
● It has a high sample rate capability along with fast data output capability.
● Additionally, the sensor features integrated ambient light cancellation as well.
● One additional feature that the MAX30102 sensor module possess is the inclusion of an on-
chip temperature sensor. This gives us the die temperature (-40˚C to +85˚C) which is ± 1˚C
accurate.
● For communicating with microcontrollers, the sensor uses the I2C pins SCL and SDA.
● Another feature of this sensor is that it uses a 32 sample FIFO buffer to store data as
compared to MAX30100 which has only 16 sample FIFO buffer. In other words, it further
reduces power consumption as it already holds a maximum of thirty-two heart rate and SPO2
values.
● The MAX30102 can also be used with interrupts which can be enabled for several sources
such as power ready, new data ready, ambient light cancellation, temperature ready and
FIFO almost full. With the generation of interrupts, the microcontroller can perform other
35

events which do not happen during the sequential execution of a program while the sensor
keeps obtaining new data samples.

Features

● 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

MAX30102 Pulse Oximeter Sensor Pinout

Pin Description

VIN This pin is used to supply power to the sensor. This sensor is powered on at 3.3-5V.

SCL This is the I2C serial clock pin.

SDA This is the I2C serial data pin.

INT This is the active low interrupt pin. It is pulled HIGH by the onboard resistor but when
an interrupt occurs it goes LOW until the interrupt clears.

IRD IR LED Cathode and LED Driver Connection Point

RD Red LED Cathode and LED Driver Connection Point

GND This is used for supplying ground to this sensor and it is connected to the source ground
pin.
36

Two Ways to Measure a Heartbeat

● Manual Way: Heart beat can be checked manually by checking one’s pulses at two
locations- wrist (the radial pulse) and the neck (carotid pulse). The procedure is to place
the two fingers (index and middle finger) on the wrist (or neck below the windpipe) and
count the number of pulses for 30 seconds and then multiplying that number by 2 to get
the heart beat rate. However pressure should be applied minimum and also fingers should
be moved up and down till the pulse is felt.
● Using a sensor: Heart Beat can be measured based on optical power variation as light is
scattered or absorbed during its path through the blood as the heart beat changes.

Working

To find the blood oxygen concentration (%), it is first important to know that inside our blood hemoglobin is
responsible for carrying oxygen. When a person holds a pulse oximeter, light from the device passes through the
blood in the fingers. This is used to detect the amount of oxygen by measuring the changes in light absorption
in both oxygenated and deoxygenated blood.

As we already mentioned before, the MAX30102 sensor consists of two LEDs (Red and IR) and a
photodiode. Both of these LEDs are used for SpO2 measurement. These two LEDs emit lights at
different wavelengths, ~660nm for the red led and ~880nm for the IR LED. At these particular
wavelengths, the oxygenated and deoxygenated hemoglobin have vastly different absorption
properties.
The diagram below is taken from the datasheet of MAX30100 IC. You may notice the difference
shown in the graph between HbO2 which is oxygenated hemoglobin and Hb which is deoxygenated
hemoglobin at two different wavelengths.

The oxygenated hemoglobin absorbs more infrared light and reflects back the red light whereas the
deoxygenated hemoglobin absorbs more red light and reflects back the infrared light. The reflected
light is measured by the photodetector. The MAX30102 sensor reads these different absorption
levels to find the blood oxygen concentration (SpO2). The ratio of IR and RED light received by the
photodetector gives us the blood oxygen concentration.
37

Applications
● Sleep Tracking
● Anxiety monitoring
● Remote patient monitoring/alarm system
● Health bands
● Advanced gaming consoles

4.7 Wifi Module


38

The ESP8266 is a low-cost Wi-Fi microchip, with a full TCP/IP stack and microcontroller
capability. The chip first came to the attention of Western makers in August 2014 with the
ESP-01 module, made by a third-party manufacturer
Ai-Thinker. This small module allows microcontrollers to connect to a Wi-Fi network and make
simple TCP/IP connections using Hayes-style commands. However, at first there was almost no
English-language documentation on the chip and the commands it accepted. The very low price
and the fact that there were very few external components on the module, which suggested that it
could eventually be very inexpensive in volume, attracted many hackers to explore the module,
the chip, and the software on it, as well as to translate the Chinese documentation. The ESP8285
is an ESP8266 with 1 MiB of built-in flash, allowing the building of single chip devices capable
of connecting to Wi-Fi. These microcontroller chips have been succeeded by the ESP32 family
of devices, including the pin-compatible ESP32-C3. The ESP8266 WiFi Module is a self
contained SOC with integrated TCP/IP protocol stack that can give any microcontroller access to
your WiFi network. The ESP8266 is capable of either hosting an application or offloading all
WiFi networking functions from another application processor. Each ESP8266 module comes
pre-programmed with an AT command set firmware, meaning, you can simply hook this up to
your Arduino device and get about as much WiFi-ability as a WiFi Shield offers (and that's just
out of the box)! The ESP8266 module is an extremely cost effective board with a huge, and ever
growing, community.

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.
39

FIG.4.7 Wifi Module

ESP8266-01 Module Pin Description

3V3: - 3.3 V Power Pin.

GND: - Ground Pin.

RST: - Active Low Reset Pin.

EN: - Active High Enable Pin.

TX: - Serial Transmit Pin of UART.

RX: - Serial Receive Pin of UART.

GPIO0 & GPIO2: - General Purpose I/O Pins. These pins decide what mode (boot or normal) the
module starts up in. It also decides whether the TX/RX pins are used for Programming the module
or for serial I/O purpose.

To program the module using UART, Connect GPIO0 to ground and GPIO2 to VCC or leave it
open. To use UART for normal Serial I/O leave both the pins open (neither VCC norGround).

ESP8266 comes with capabilities of

● 2.4 GHz Wi-Fi (802.11 b/g/n, supporting WPA/WPA2),


40

● general-purpose input/output (16 GPIO),


● Inter-Integrated Circuit (I²C) serial communication protocol,
● analog-to-digital conversion (10-bit ADC)
● Serial Peripheral Interface (SPI) serial communication protocol,
● I²S (Inter-IC Sound) interfaces with DMA(Direct Memory Access) (sharing pins with
GPIO),
● UART (on dedicated pins, plus a transmit-only UART can be enabled on GPIO2), and
● pulse-width modulation (PWM).

It employs a 32-bit RISC CPU based on the Tensilica Xtensa L106 running at 80 MHz (or
overclocked to 160 MHz). It has a 64 KB boot ROM, 64 KB instruction RAM and 96 KB data
RAM. External flash memory can be accessed through SPI.

ESP8266 module is low cost standalone wireless transceiver that can be used for end-point IoT
developments.

To communicate with the ESP8266 module, microcontroller needs to use set of AT commands.
Microcontroller communicates with ESP8266-01 module using UART having specified Baud rate.

Working

The ESP8266 is a very user friendly and low cost device to provide internet connectivity to your
projects. The module can work both as a 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 Internet of
Things as easy as possible. It can also fetch data from internet using API’s hence your project
could access any information that is available in 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. However this version of the module has only 2 GPIO pins (you can
hack it to use upto 4) so you have to use it along with another microcontroller like Arduino, else
you can look onto the more standalone ESP-12 or ESP-32 versions. So if you are looking for a
module to get started with IOT or to provide internet connectivity to your project then this module
41

is the right choice for you. The ESP8266 is a very user friendly and low cost device to provide
internet connectivity to your projects. The module can work both as a 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 Internet of Things as easy as possible. It can also fetch data from internet using
API’s hence your project could access any information that is available in 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. However this version of the module has only 2 GPIO
pins (you can hack it to use upto 4) so you have to use it along with another microcontroller like
Arduino, else you can look onto the more standalone ESP-12 or ESP-32 versions.
So if you are looking for a module to get started with IOT or to provide internet connectivity
to your project then this module is the right choice for you. There are so many methods and IDEs
available to with ESP modules, but the most commonly used on is the Arduino IDE. So let us
discuss only about that further below.
The ESP8266 module works with 3.3V only, anything more than 3.7V would kill the
module hence be cautions with your circuits. The best way to program an ESP-01 is by using the
FTDI board that supports 3.3V programming. If you don’t have one it is recommended to buy one
or for time being you can also use an Arduino board. One commonly problem that every one faces
with ESP-01 is the powering up problem. The module is a bit power hungry while programming
and hence you can power it with a 3.3V pin on Arduino or just use a potential divider. So it is
important to make a small voltage regulator for 3.31v that could supply a minimum of 500mA.
One recommended regulator is the LM317 which could handle the job easily

Applications

● IOT Projects
● Access Point Portals
● Wireless Data logging
● Smart Home Automation
● Learn basics of networking
42

● Portable Electronics
● Smart bulbs and Sockets
43

4.8 I2C OLED Display

This article shows how to use the SSD1306 0.96 inch I2C OLED display with the Arduino. We’ll
show you some features of the OLED display, how to connect it to the Arduino board, and how to
write text, draw shapes and display bitmap images. Lastly, we’ll build a project example that
displays temperature and humidity readings.

On the other hand, there are “thin-film transistor (TFT) oled” used in television sets, laptops,
smartphones and complex electronic devices. They utilize pixel algorithms to provide fast
response times, wide viewing angles, high contrast and accurate color schemes.

“Dot-matrix oled” lies somewhere in the middle of the basic and the most advanced
OLEDtechnologies. They are useful in displaying alphabets, numbers and upper and lower cases
of letters.

One of the most common dot matrix OLED displays is the 2×16 module which refers to two rows
and sixteen columns of OLED display pins. This is what we will be using in our connections with
the Arduino board. The Arduino website offers a detailed example of an assembly. It is
compatible with the built-in library example available for Arduino IDE.

While the circuit may look complex at first glance, here is a simple step-by-step explanation of
the various stages.

First, all sixteen pins of the OLED should be connected to the bottom positive rail of the
breadboard.
44

The first and last pins of OLED are then connected to the negative rail on the top. Arduino’s GND
and 5 V pins on the power-source side are connected to the positive rail contrasting with the OLED
connections.

FIG.4.8 PIN DIAGRAM OF LCD DISPLAY

The model we’re using here has only four pins and communicates with the Arduino using I2C
communication protocol. There are models that come with an extra RESET pin. There are also
other OLED displays that communicate using SPI communication.
45

with Arduino or Mega or Nodemcu esp8266 wifi module is really a hectic job, as it needs a lot of
soldering and needs many IO pins to control a OLED Display

FIG.4.8- LCD DISPLAY


46

4. BME280 Pressure, Temperature & Humidity Sensor

Bosch BME280 Humidity, Temperature & Pressure Sensor is an integrated


environmental sensor which is very small-sized with low power consumption.This
BME280 Atmospheric Sensor Breakout is the easy way to measure barometric pressure,
humidity, and temperature readings all without taking up too much space. Basically,
anything you need to know about atmospheric conditions you can find out from this tiny
breakout.

This module uses an environmental sensor manufactured by Bosch with temperature,


barometric pressure sensor that is the next generation upgrade to the popular
BMP085/BMP180/BMP183 Sensor. This sensor is great for all sorts of weather sensing
and can even be used in both I2C and SPI! This precision sensor from Bosch is the best
low-cost, precision sensing solution for measuring barometric pressure with ±1 hPa
absolute accuracy, and temperature with ±1.0°C accuracy. Because pressure changes
with altitude and the pressure measurements are so good, you can also use it as an
altimeter with ±1 meter accuracy.

Features of BME280

1. Interface: I2C & SPI


2. Supply Voltage: 1.71V to 3.6V
3. Temperature Range: -40 to +85°C
47

4. Humidity Range: 0% to 100% rel. humidity


5. Pressure Range: 300hPa to 1100hPa

Applications

1. Context awareness, e.g. skin detection, room change detection


2. Health monitoring/well-being
3. Home automation control
4. Control heating, ventilation, air conditioning (HVAC)
5. Internet of things
6. GPS enhancement & Indoor/Outdoor navigation
7. Weather forecast
8. Vertical velocity indication (rise/sink speed)

BME280 Pinout

The BME280 I2C interface uses the following pins:


1. VCC: 1.71V to 3.6V
2. GND: Connect to GND
3. SCL: serial clock (SCK)
4. SDA: Serial data (SDI)
5. CSB: Must be connected to VDDIO to select I2C interface.
6. SDO: The I2C address decides the pin. If SDO connects to GND(0), the address is
0x76, if it connects to VDDIO(1), the address is 0x77. In this module, we have
connected it to VDDIO, so the address should be 0x77.

I2C Interface

The module features a simple two-wire I2C interface which can be easily interfaced with
any microcontroller I2C Pins. The default I2C address of the BME280 module is 0x76
and can be changed to 0x77 easily.

There are two different BME280 available in the market whose I2C address can be
changed. For the module below if you remove a connection from SDO to GND, the
address will change to 0x77.
48

There is another module available in the market which has only 4 pins. To change its
I2C address Locate the solder jumper besides chip.

By default, the middle copper pad is connected to the left pad. So you need to scratch
the connection between the middle and the left copper pad to disconnect them. Then
you can add a solder blob between the middle and the right copper pad to join them. It
allows you to set the I2C address 0x77.

MQ135 Air Quality Sensor


The MQ-135 gas sensor senses the gases like ammonia nitrogen, oxygen, alcohols,
aromatic compounds, sulfide and smoke. The MQ-3 gas sensor has a lower
conductivity to clean the air as a gas sensing material. In the atmosphere, we can find
polluting gases, but the conductivity of the gas sensor increases as the concentration of
polluting gas increases. MQ-135 gas sensor can be implemented to detect the smoke,
benzene, steam and other harmful gases. It has the potential to detect different
harmful gases. It is with low cost and particularly suitable for Air quality monitoring
application.
49

The MQ135 sensor is a signal output indicator instruction. It has two outputs: analog
output and TTL output. The TTL output is low signal light which can be accessed
through the IO ports on the Microcontroller. The analog output is an concentration, i.e.
increasing voltage is directly proportional to increasing concentration. This sensor has a
long life and reliable stability as well.

Air Quality Index

The AQI is an index for reporting daily air quality. It tells you how clean or polluted your
air is, and what associated health effects might be a concern for you. The AQI focuses
on health effects you may experience within a few hours or days after breathing polluted
air.

EPA calculates the AQI for five major air pollutants regulated by the Clean Air Act:
ground-level ozone, particle pollution (also known as particulate matter), carbon
monoxide, sulfur dioxide, and nitrogen dioxide. For each of these pollutants, EPA has
established national air quality standards to protect public health. Ground-level ozone
and airborne particles are the two pollutants that pose the greatest threat to human
health in this country.

Think of the AQI as a yardstick that runs from 0 to 500. The higher the AQI value, the
greater the level of air pollution and the greater the health concern. For example, an
50

AQI value of 50 represents good air quality with little potential to affect public health,
while an AQI value over 300 represents hazardous air quality.

AD8232 ECG Sensor


This sensor is a cost-effective board used to measure the electrical activity of the
heart. This electrical activity can be charted as an ECG or Electrocardiogram and
output as an analog reading. ECGs can be extremely noisy, the AD8232 Single Lead
Heart Rate Monitor acts as an op-amp to help obtain a clear signal from the PR and QT
Intervals easily.

The AD8232 is an integrated signal conditioning block for ECG and other biopotential
measurement applications. It is designed to extract, amplify, and filter small
biopotential signals in the presence of noisy conditions, such as those created by
motion or remote electrode placement.
51

The AD8232 module breaks out nine connections from the IC that you can solder pins,
wires, or other connectors to. SDN, LO+, LO-, OUTPUT, 3.3V, GND provide essential
pins for operating this monitor with an Arduino or other development board. Also
provided on this board are RA (Right Arm), LA (Left Arm), and RL (Right Leg) pins to
attach and use your own custom sensors. Additionally, there is an LED indicator light
that will pulsate to the rhythm of a heartbeat.

Note: This product is NOT a medical device and is not intended to be used as such or
as an accessory to such nor diagnose or treat any conditions.

Circuit Diagram: Interfacing AD8232 ECG Sensor with NodeMCU ESP8266

Here is a circuit digram for Interfacing AD8232 ECG Sensor with NodeMCU
ESP8266. There are 6 pins in AD8232 Breakout Board. SDN is not connected.

Connect the OUTPUT to analog A0 of Nodemcu. Connect the LO+ & LO- to D5 & D6 of
NodeMCU respectively. Supply the AD8232 kit with 3.3V VCC & Connect its GND to
GND.
52

ECG Leads/Electrode Placement

It is recommended to snap the sensor pads on the leads before application to the
body. The closer to the heart the pads are, the better the measurement. The
cables are color-coded to help identify proper placement.

Red: RA (Right Arm)


Yellow: LA (Left Arm)
Green: RL (Right Leg)

I have connected by ESP8266 with AD8232 to a Patient Chest or simply you can
place it in your chest as shown in the figure below.
53
54

CHAPTER 5
RESULT AND CONCLUSION

Our goal is to implement a smart patient health monitoring system that can monitor the heartbeat
and body temperature. The smart patient health care monitoring system developed by us has
numerous applications. These types of healthcare systems can be implemented in hospitals as well
as at home places where a person needs to have immediate medical attention whenever his/her
health goes unstable. As we are using the Thing Speak IoT platform with the help of Thing Speak
we can easily capture sensor data. This allows to keep a track of patients' heartbeat and body
temperature value with change in time. This would give the doctor a more wide perspective of
treating the patient in a much effective way within less time. The system developed patient
monitoring based on Internet of things, is an alternative that can be used to help patients with
chronic diseases. Likewise with this set of solutions the aim is to improve the quality of life of
patients, not just monitoring them, but also to enable direct them to improve their eating habits
and workout routines. The context model developed for the system proved to be efficient when
making inferences related to the context, such as recommendations for taking measures through
sensors, as well as recommendations and workout routines tips to improve the eating habits of
patients.

5.1 Conclusion

The Internet of Things is considered now as one of the feasible solutions for any remote value
tracking especially in the field of health monitoring. It facilitates that the individual prosperity
parameter data is secured inside the cloud, stays in the hospital are reduced for conventional
routine examinations and most important that the health can be monitored and disease diagnosed
by any doctor at any distance. In
55

this paper, an IoT based health monitoring system was developed. The system monitored body
temperature, pulse rate and room humidity and temperature using sensors, which are also displayed
on a LCD. These sensor values are then sent to a medical server using wireless communication.
These data are then received in an authorized personals smart phone with IoT platform. With the
values received the doctor then diagnose the disease and the state of health of the patient. The main
objective of the experiment was successfully achieved. All the individual modules like Heartbeat
detection module, fall detection module etc. and remote viewing module gave out the intended
results. 55 The designed system modules can further be optimized and produced to a final single
circuit. More important fact that came up during project design is that all the circuit components
used in the remote health detection system are available easily.
In this paper, we found the importance and fruitful benefits of implementation of IoT in remote
health monitoring systems.The compact sensors with IoT will make a huge impact on every
patient’s life, that even though they are away from home and physician, this helps them to reduce
the fear of danger. The sensory data can be acquired in home or work environments. Also, the
challenges in sensing, analytics and prediction of the disease are also highlighted and those can be
addressed to provide a seamless integraton.. The fundamental element of people’s needs is health
.Humans face a haul of surprising death and plenty of diseases because of varied diseases that are
a result of lack of treatment to the patients at right time. The main objective of this project is to
develop a reliable sensible patient health observance system victimization IoT so the attention
professionals will monitor their patients. The sensors will be either worn or be embedded into the
body of the patients, to unendingly monitor their health. the knowledge collected in such a fashion
will behold on, analyzed, and well-mined to try and do the first prediction of diseases
56

FIG.5.1 SERIAL MONITOR

FIG.5.1 SERIAL MONITOR


57

FIG.5.2 STRUCTURE OF PROJECT


58

Out put image


59

CHAPTER 6
WORK SCHEDULE FOR PHASE II

● In recent years, there has been a growing demand for innovative and efficient healthcare
solutions, especially in critical care environments such as Intensive Care Units (ICUs).
This project proposes an Internet of Things (IoT)-based ICU Patient Health Monitor
System that integrates multiple sensors, including the DHT11 for temperature and
humidity, an ECG sensor for monitoring heart activity, and the MQ135 Air Quality Gas
Sensor Module for assessing air quality within the patient's vicinity.

● The system aims to provide real-time monitoring of vital parameters to ensure prompt
medical intervention and improve overall patient care. The DHT11 sensor is employed
to measure ambient temperature and humidity, providing crucial information for
maintaining a comfortable and safe environment for the patient.

● The ECG sensor captures the patient's electrocardiogram, allowing healthcare


professionals to monitor heart activity and detect any abnormal patterns. The data is
transmitted wirelessly to a central monitoring station, where it can be analyzed and
displayed in a user-friendly interface.

● Additionally, the MQ135 Air Quality Gas Sensor Module is utilized to measure various
air pollutants, including carbon dioxide (CO2), ammonia (NH3), methane (CH4), and
other harmful gases. Monitoring air quality is vital in preventing respiratory
complications and ensuring a sterile environment for patients, especially in critical care
settings.
60

● The proposed system employs IoT technology to enable remote monitoring and real-
time data transmission. This allows healthcare professionals to receive instant alerts in
case of abnormal readings or emergencies, facilitating timely intervention and improving
the overall quality of care.

● The system is designed to be scalable and adaptable, allowing for easy integration with
existing healthcare infrastructure. It also incorporates security measures to ensure the
confidentiality and integrity of patient data, complying with healthcare privacy
standards.

● Keywords: IoT, ICU, Patient Health Monitoring, DHT11, ECG Sensor, MQ135 Air
Quality Gas Sensor, Real-time Monitoring, Wireless Communication, Healthcare,
Internet of Things
61

FIG.5.4 OUTPUT CONSOLE

REFERENCE PAPERS:

● Mohammad M. Masud, Mohamed Adel Serhani, and Alramzana Nujum Navaz “Resource-Aware
MobileBased Health Monitoring”, 2168-2194 (c) 2015 IEEE.

● M.A. Miah et al., “Continuous heart beat and body temperature monitoring system using Arduino
UNO and Android device, International Conference on Electrical Information and Communication
Technology (EICT), pp. 189-194, 2015.

● Maradugu Anil Kumar, Y.Ravi Sekhar, “Android Based Health Care Monitoring System” IEEE
Sponsored 2nd International Conference on Innovations in Information Embedded and
Communication Systems ICIIECS'1.

● Hamid Al-Hamadi and Ing-Ray Chen, “Trust-Based Decision Making for Health IoT Systems” DOI
10.1109/JIOT.2017.2736446, IEEE Internet of Things Journal.

● Gulraiz J. Joyia, Rao M. Liaqat, Aftab Farooq, and Saad Rehman, Internet of Medical Things
(IOMT): Applications, Benefits and Future Challenges in Healthcare Domain, Journal of
Communications Vol. 12, No. 4, April 2017.

● . Shubham Banka, Isha Madan and S.S. Saranya, Smart Healthcare Monitoring using IoT.
International Journal of Applied Engineering Research ISSN 0973-4562 Volume 13, Number 15, pp.
11984-11989, 2018. 4.

● K. Perumal, M. Manohar, A Survey on Internet of Things: Case Studies, Applications, and Future
Directions, In Internet of Things: Novel Advances and Envisioned Applications, Springer
International Publishing, (2017) 281-297.
● R.Jain, https://circuitdigest.com/, 2018. [Online]. Available:
https://circuitdigest.com/microcontroller-projects/iot-based-patient-
monitoring-system-using-esp8266-and-arduino. [Accessed: 18- Dec- 2019].
62

● M. Sathya, S. Madhan and K. Jayanthi, "Internet of things (IoT) based


health monitoring system and challenges", International Journal of
Engineering & Technology, vol. 7, no. 17, p. 175, 2018. Available:
10.14419/ijet.v7i1.7.10645 [Accessed 10 June 2019].
● M. Muqeet and M. Quadri, "IoT based Patient Monitoring System Using
Raspberry Pi", IJRECE VOL. 7 ISSUE 2 (APRIL- JUNE 2019) ISSN: 2393-
9028 (PRINT) | ISSN: 2348-2281 (ONLINE) INTERNATIONAL JOURNAL
OF RESEARCH IN ELECTRONICS AND COMPUTER ENGINEERING,
vol. 7, no. 2, pp. 2976-2978, 2019.
● DHT11 Sensor Pinout, Features, Equivalents & Datasheet. (2018).
Retrieved 9 October 2019, from https://components101.com/dht11-
temperature-sensor.
● "DHT11 Sensor Definition, Working and Applications", ElProCus -
Electronic Projects for Engineering Students. [Online]. Available:
https://www.elprocus.com/a-brief-on-dht11-sensor/.
● A. Azizulkarim, M. Abdul Jamil and R. Ambar, "Design and Development
of Patient Monitoring System", IOP Conference Series: Materials Science
and Engineering, vol. 226, p. 012094, 2017. Available: 10.1088/1757-
899x/226/1/012094.
● "Pulse Sensor Pinout, Configuration & How Pulse Sensor
Works", Components101.com,2018.[Online].Available:https://components1
01.com/sensors/pulse-sensor. [Accessed: 13- Apr- 2019].
● M. Rashidul, S. Khan and M. Osmani, "IoT-based Low Cost Healthcare
System for Cardiac patient of Bangladesh using Bio-sensors", 2019.
● "ADS1115 analog-to-digital converter and ESP8266-esp8266
learning", esp8266learning.[Online].Available:http://www.esp8266learning.
com/ads1115-analog-to-digital-converter-and-esp8266.php.[Accessed: 08-
Apr- 2019].
● Priyanka, R., and M. Reji. 2019. "IOT Based Health Monitoring System
Using Blynk App". International Journal Of Engineering And Advanced
Technology 8 (6): 78-81. doi:10.35940/ijeat.e7467.088619.
● T. Shaown, I. Hasan, M. M. R. Mim and M. S. Hossain, "IoT-based
63

Portable ECG Monitoring System for Smart Healthcare," 2019 1st


International Conference on Advances in Science, Engineering and
Robotics Technology (ICASERT), Dhaka, Bangladesh, 2019, pp. 1-5, doi:
10.1109/ICASERT.2019.893462

SOURCE CODE:

#include <LiquidCrystal.h>
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
#include <SoftwareSerial.h>
float pulse = 0;
float temp = 0;
SoftwareSerial ser(9,10);
String apiKey = "OO707TGA1BLUNN12";

// Variables
int pulsePin = A0; // Pulse Sensor purple wire connected to analog pin 0 int blinkPin
= 7 ; // pin to blink led at each beat
int fadePin = 13; // pin to do fancy classy fading blink at each beat int
fadeRate = 0; // used to fade LED on with PWM on fadePin

// 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! Must be seeded!
volatile boolean Pulse = false; // "True" when User's live heartbeat is detected. "False" when nota
"live beat".
volatile boolean QS = false; // becomes true when Arduoino finds a beat.

// Regards Serial OutPut -- Set This Up to your needs


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

Monitor ASCII Visual Pulse


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

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()
{
lcd.begin(16, 2);
pinMode(blinkPin,OUTPUT); // pin that will blink to your heartbeat!
pinMode(fadePin,OUTPUT); // pin that will fade to your heartbeat!
Serial.begin(115200); // we agree to talk fast!
interruptSetup(); // sets up to read Pulse Sensor signal every 2mS

// IF YOU ARE POWERING The Pulse Sensor AT VOLTAGE LESS THAN THE BOARD
VOLTAGE,

// UN-COMMENT THE NEXT LINE AND APPLY THAT VOLTAGE TO THE A-REF PIN

// analogReference(EXTERNAL);

lcd.clear(); lcd.setCursor(0,0);
lcd.print(" Patient Health");
lcd.setCursor(0,1); lcd.print("
Monitoring ");
66

delay(4000);
lcd.clear();
lcd.setCursor(0,0);
lcd.print("Initializing. ");
delay(5000);
lcd.clear();
lcd.setCursor(0,0);
lcd.print("Getting Data. ");

ser.begin(9600);
ser.println("AT");
delay(1000);
ser.println("AT+GMR");
delay(1000);
ser.println("AT+CWMODE=3");
delay(1000); ser.println("AT+RST");
delay(5000);
ser.println("AT+CIPMUX=1");
delay(1000);

String cmd="AT+CWJAP=\"Alexahome\",\"98765432\""; ser.println(cmd);


delay(1000);
ser.println("AT+CIFSR");
delay(1000);
}

// Where the Magic Happens void


loop(){

serialOutput();
if (QS == true) // A Heartbeat Was Found
{
67

// BPM and IBI have been Determined


// Quantified Self "QS" true when arduino finds a heartbeat
fadeRate = 255; // Makes the LED Fade Effect Happen, Set 'fadeRate' Variable to 255 to fade
LED with pulse
serialOutputWhenBeatHappens(); // A Beat Happened, Output that to serial. QS =
false; // reset the Quantified Self flag for next time
}
ledFadeToBeat(); // Makes the LED Fade Effect Happen
delay(20); // take a break
read_temp();
esp_8266();
}
void ledFadeToBeat()
{
fadeRate -= 15; // set LED fade value
fadeRate = constrain(fadeRate,0,255); // keep LED fade value from going into negative
numbers!
analogWrite(fadePin,fadeRate); // fade LED
}
void interruptSetup()
{
// Initializes Timer2 to throw an interrupt every 2mS.
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 ENABLE

}
void serialOutput()
68

{ // 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
{
Serial.print("*** Heart-Beat Happened *** "); //ASCII Art Madness
Serial.print("BPM: ");
Serial.println(BPM);
}
else
{
sendDataToSerial('B',BPM); // send heart rate with a 'B' prefix
sendDataToSerial('Q',IBI); // send time between beats with a 'Q' prefix
}
}
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);


69

// do something different depending on the


// range value:
switch (range)
{case 0:
Serial.println(""); /////ASCII Art Madness
break;
case 1: Serial.println("-
--"); break;
case 2: Serial.println("
");
break;
case3:
Serial.println(" ");
break;
case4:
Serial.println(" ");
break;
case5:
Serial.println(" |-");
break;
case6:
Serial.println("--------------| ");
break

case7:
Serial.println("--------------| ");
break;
case8:
Serial.println("--------------| ");
Break;
70

case 9:
Serial.println("--------------| ");
break; case
10:
Serial.println("--------------| ");
break; case
11:
Serial.println("--------------| ");
break;
}
}

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 while we do this
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
{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 =
71

Signal; // P is the peak


} // keep track of highest point in pulse wave
// NOW IT'S TIME TO LOOK FOR THE HEART BEAT
// 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
{
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 runningTotal variable for(int
72

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 valuesBPM = 60000/runningTotal; // how
many beats can fit into a minute? that's BPM! QS = true; // set
Quantified Self flag// QS FLAG IS NOT CLEARED INSIDE
THIS ISR pulse = BPM;}

}
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;
}
heartbeat back the
lastBeatTime up to date
firstBeat = true; //
set these to avoid
noisesecondBeat = false; //
when we get the heartbeat
back
}

sei(); // enable interrupts when youre done!


73

}// end isr


void esp_8266()
{
// TCP connection AT+CIPSTART=4,"TCP","184.106.153.149",80 String
cmd = "AT+CIPSTART=4,\"TCP\",\"";
cmd += "184.106.153.149"; // api.thingspeak.com cmd
+= "\",80";
ser.println(cmd);
Serial.println(cmd);
if(ser.find("Error"))
{
Serial.println("AT+CIPSTART error");
return;
}
String getStr = "GET /update?api_key="; getStr
+= apiKey;
getStr +="&field1="; getStr
+=String(temp); getStr
+="&field2="; getStr
+=String(pulse); getStr +=
"\r\n\r\n";
// send data length
cmd = "AT+CIPSEND=4,";
cmd += String(getStr.length());
ser.println(cmd);
Serial.println(cmd); delay(1000);

}
void read_temp()
{
int temp_val = analogRead(A1); float mv
74

= (temp_val/1024.0)*5000; float cel =


mv/10;
temp = (cel*9)/5 + 32;
Serial.print("Temperature:");
Serial.println(temp); lcd.clear();
lcd.setCursor(0,0);
lcd.print("BPM :");
lcd.setCursor(7,0);
lcd.print(BPM);
lcd.setCursor(0,1);
lcd.print("Temp.:");
lcd.setCursor(7,1);
lcd.print(temp);
lcd.setCursor(13,1);
lcd.print("F");
}

You might also like