Professional Documents
Culture Documents
Determination of Spo2 and Heart Rate
Determination of Spo2 and Heart Rate
CHAPTER 1
OVERVIEW OF THE PROJECT
In this chapter, Overview of the project, Motivation, Objectives, Literature survey, tools
used and organization of the report are discussed.
1.1 INTRODUCTION
An Embedded System is a combination of computer hardware and software, and perhaps
additional mechanical or other parts, designed to perform a specific function. A good example
is the microwave oven. Almost every household has one, and tens of millions of them are used
every day, but very few people realize that a processor and software are involved in the
preparation of their lunch or dinner.
Frequently, an embedded system is a component within some larger system. For
example, modern cars and trucks contain many embedded systems. One embedded system
controls the anti-lock brakes, other monitors and controls the vehicle's emissions and a third
displays information on the dashboard. In some cases, these embedded systems are connected by
some sort of a communication network, but that is certainly not a requirement.
At the possible risk of confusing, it is important to point out that a general-purpose
computer is itself made up of numerous embedded systems. For example, my computer consists
of a keyboard, mouse, video card, modem, hard drive, floppy drive, and sound card-each of
which is an embedded system. Each of these devices contains a processor and software and is
designed to perform a specific function. For example, the modem is designed to send and receive
digital data over analog telephone line. That's it and all of the other devices can be summarized
in a single sentence as well.
If an embedded system is designed well, the existence of the processor and software
could be completely unnoticed by the user of the device. Such is the case for a microwave oven,
alarm clock. In some cases, it would even be possible to build an equivalent device that does not
contain the processor and software. This could be done by replacing the combination with a
custom integrated circuit that performs the same functions in hardware. However, a lot of
flexibility is lost when a design is hard-cooled in this way. It is much easier, and cheaper, to
change a few lines of software than to redesign a piece of custom hardware.
Department of ECE,MRITS 1
Determination of SPO2 and Heart Rate using Arduino
Department of ECE,MRITS 2
Determination of SPO2 and Heart Rate using Arduino
1.6.2 HARDWARE
1. AT mega 328 MC
2. Power supply
3. OLED display
4. Buzzer
5. Bluetooth module
6. Heartbeat sensor(MAX30102)
Chapter 2 deals with the Arduino board with microcontroller. Chapter 3 deals with the
description of hardware modules which are used in the system. Chapter 4 deals with the
implementation of heart beat sensor working and interfacing with Arduino. Chapter 5 deal with
the results obtained. Chapter 6 ends with Conclusion and future scope followed by references.
Department of ECE,MRITS 3
Determination of SPO2 and Heart Rate using Arduino
CHAPTER 2
LITERATURE SURVEY
PATIENT MONITORING SYSTEM
A number of patient monitoring systems have been proposed by many researchers to
monitor the patient at the bedside and also at a central monitoring system. The literature survey
presented in this section includes a variety of patient monitoring systems, ranging from simple
pulse monitors, activity monitors, and portable Holter monitors, to sophisticated and expensive
implantable sensors. The history of physiological monitors looks at the technical evolution of
physiologic monitors, which incorporate a cathode ray tube (CRT) or a flat panel display.
Himmelstein and Scheiner (1952) reported that in the 1950s an instrument called
“Cardiotachoscope” found useful during surgery, featured the fundamental attributes that most
monitoring systems would eventually have. These attributes include a CRT to view the ECG, a
heart rate indicator, alarms for high and low heart rates, and a connection to a conventional
electrocardiograph for printouts. The devices of this era had monochrome displays and the
persistence of the wave was generally not sufficient to cover the screen. This meant that the ECG
waveform would show only a second or two of new data. The old data would fade away and the
trace has been described as a bouncing ball with a comet’s tail. There were no numeric
parameters or annotations on the screen. This device does not appear to have entered into
production and the “Cardiotachoscope” term is not used anymore.
Systems of the 1950s and early 1960s made less of a distinction between the equipment roles of
monitoring and defibrillation or pacing, and were often intended to be used together as a
diagnostic and, especially, therapeutic tools at the bedside or in the operating room on a mobile
cart. Most devices had an output connector to allow direct printing on a standard
electrocardiograph. Most bedside type monitors often had round screens of about 5 inches in
diameter that limit to one or two waveform traces. Controls on these monitors generally allowed
for lead selection, focus adjustment, intensity or brightness control, sensitivity or gain control,
vertical trace position control, and sweep rate adjustment.
The 1960s featured monitoring systems whose intended functions and configurations
were surprisingly similar to more modern systems. The approach of having central monitors and
bedside monitors was common even from the early part of the decade. Numerous parameters
were technically available to be monitored including ECG, EEG, invasive pressures, and
Department of ECE,MRITS 4
Determination of SPO2 and Heart Rate using Arduino
temperatures. In the mid 1960s, several vendors offered a magnetic tape "memory-loop" feature
that served to continuously record the last 15 or more seconds of data so that alarm events could
be interpreted based on the preceding data. Automatic printing of stored data following an alarm
could occur.
The decade of the 1970s saw some significant improvements in the presentation of the
displayed waveforms and information. This was the result of the incorporation of digital
electronics and, eventually, microprocessors. Real time arrhythmia analysis appeared at the
beginning of the decade and evolved over the duration of the 1970s.
Healy et al (1977) described a hospital patient monitoring and display system employing
a number of bedside consoles, concealable from the patient and including input for various
patient sensors such as ECG, pulse rate, patient temperature and blood pressure. The central
station includes signal processing and display apparatus to allow the patient data to be displayed
on a conventional commercial black and white or color television set along with alpha numerics
related to each respective patient. The display is coupled to the hospitals normal entertainment
television distribution network, if any, allowing the patient data to be displayed on any television
set throughout the hospital. A remote control operation via a radio frequency link may be carried
by a patient's doctor and may be operated at any time or place within reception range of the
central control to freeze the display for better examination and automatic printout of a
reproduction. After a preset period, the display resumes.
The 1980s witnessed further significant evolution in patient monitors. Arrhythmia
analysis became available at the bedside. Monitors began using color displays, monitoring.
Neonatal and pediatric Pulse Oximeter-The pulse oximeter has become a vital instrument in the
care of infants and children with cardiopulmonary disease. Recent advances in pulse oximetry
technology have improved some aspects of pulse oximeter performance. However, the reliability,
accuracy, and clinical utility of pulse oximetry remain problematic in some types of patients
under certain conditions. Improved signal processing technology has substantially improved the
ability of certain oximeters to work reliably under conditions of poor perfusion and motion
artifact.
System architecture of a wireless body area sensor network for ubiquitous health monitoring:
One of the most promising applications of sensor networks is for human health monitoring.
Department of ECE,MRITS 5
Determination of SPO2 and Heart Rate using Arduino
A number of tiny wireless sensors, strategically placed on the human body, create a
wireless body area network that can monitor various vital signs, providing real-time feedback to
the user and medical personnel. The wireless body area networks promise to revolutionize health
monitoring. However, designers of such systems face a number of challenging tasks, as they
need to address often quite conflicting requirements for size, operating time, precision, and
reliability.
Wireless Sensor Networks in Structural Health Monitoring Based on Bluetooth Technology:
Wireless sensor networks for structural health monitoring
Structural health monitoring (SHM) using wireless sensor networks (WSNs) has gained
research interest due to its ability to reduce the costs associated with the installation and
maintenance of SHM systems. ... The high data collection rate of WSNs for SHM pose
unique network design challenges.
2.3 CONCLUSION:
In this chapter, reference links have been referred and the analysis of the literature review
was discussed.
Department of ECE,MRITS 6
Determination of SPO2 and Heart Rate using Arduino
CHAPTER 3
ARDUINO BOARD WITH MICROCONTROLLER
3.1 INTRODUCTION
In this chapter, Arduino Board with ATmega328 microcontroller will be discussed.
3.2 ARDUINO WITH MICRO CONTROLLER
Arduino is an open source computer hardware and software company, project and user
community that designs and manufactures kits for building digital devices and interactive objects
that can sense and control the physical world. Arduino boards may be purchased pre-assembled,
at the same time the hardware design information is available for those who would like to
assemble an Arduino from scratch. An Arduino board consists of an Atmel 8-16 or 32-bit AVR
microcontroller with complementary components that facilitate programming and incorporation
into other circuits. An important aspect of the Arduino is its standard connectors, which lets
users connect the CPU board to a variety of interchangeable add on modules known as shields.
Some shields communicate with the Arduino board directly over various pins, but many shields
are individually addressable via an I²C serial bus so many shields can be stacked and used in
parallel. Official Arduino’s have used the mega AVR series of chips, specifically the ATmega8,
ATmega168, ATmega328, ATmega1280 and ATmega2560. A handful of other processors have
been used by Arduino compatibles. Most boards include a 5 volt linear regulator and a 16 MHz
crystal oscillator (or ceramic resonator in some variants), although some designs such as the Lily
Pad run at 8 MHz and dispense with the onboard voltage regulator due to specific form-factor
restrictions. An Arduino's microcontroller is also preprogrammed with a boot loader that
simplifies uploading of programs to the on chip flash memory, compared with other devices that
typically need an external programmer. This makes using an Arduino more straightforward by
allowing the use of an ordinary computer as the programmer.
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 arduino board with micro controller is shown in fig
3.1
Department of ECE,MRITS 7
Determination of SPO2 and Heart Rate using Arduino
Department of ECE,MRITS 8
Determination of SPO2 and Heart Rate using Arduino
f) The ATmega328 has 32 KB (with 0.5 KB used for the bootloader). It also has 2 KB of
SRAM and 1 KB of EEPROM (which can be read and written with the EEPROM
library).Each of the 14 digital pins on the Uno can be used as an input or output, using
pin Mode (), digital Write () and digital Read () functions. They operate at 5 volts. Each
pin can provide or receive a maximum of 40 mA and has an internal pull up resistor
(disconnected by default) of 20-50 kilo ohm.
g) In addition, some pins have specialized functions:
h) Serial: 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.
i) External Interrupts: 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. See the attach Interrupt () function for
details.
j) PWM: 3, 5, 6, 9, 10 and 11. Provide 8-bit PWM output with the analog Write () function.
k) SPI: 10 (SS), 11 (MOSI), 12 (MISO), 13 (SCK). These pins support SPI communication
using the SPI library.
l) LED: 13. There is a built-in LED connected to digital pin 13. When the pin is
HIGH value, the LED is on, when the pin is LOW, it's off.
m) The Uno has 6 analog inputs, labeled 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
analog Reference () function.
n) Additionally, some pins have specialized functionality:
o) TWI: A4 or SDA pin and A5 or SCL pin. Support TWI communication using the
Wire library. There are a couple of other pins on the board:
p) AREF. Reference voltage for the analog inputs. Used with analog Reference ().
q) Reset. Bring this line LOW to reset the microcontroller. Typically used to add a
reset button to shields which block the one on the board.
The Arduino Uno has a number of facilities for communicating with a computer, another
Arduino or other microcontrollers. The ATmega328 provides UART TTL (5V) serial
communication, which is available on digital pins 0 (RX) and 1 (TX). An ATmega16U2 on the
Department of ECE,MRITS 9
Determination of SPO2 and Heart Rate using Arduino
board channels this serial communication over USB and appears as a virtual com port to
software on the computer. The '16U2 firmware uses the standard USB COM drivers and no
external driver is needed. However, on Windows, an information file is required. The Arduino
software includes a serial monitor which allows simple textual data to be sent to and from the
Arduino board. The RX and TX LEDs on the board will flash when data is being transmitted via
the USB to serial chip and USB connection to the computer (but not for serial communication on
pins 0 and 1).
A Software Serial library allows for serial communication on any of the Uno's digital
pins. The ATmega328 also supports I2C (TWI) and SPI communication. The Arduino software
includes a Wire library to simplify use of the I2C bus, see the documentation for details. For SPI
communication, use the SPI library.
The Arduino Uno can be programmed with the Arduino software (download). Select
"Arduino UNO from the Tools Board menu (according to the microcontroller on board). The
ATmega328 on the Arduino Uno comes pre-burned with a bootloader that allows to upload new
code to it without the use of an external hardware programmer. It communicates using the
original STK500 protocol (reference, C header files).It can also bypass the boot loader and
program the microcontroller through the ICSP (In-Circuit Serial Programming) header using
Arduino ISP or similar; see these instructions for details.
The ATmega16U2 (or 8U2 in the rev1 and rev2 boards) firmware source code is
available. The ATmega16U2/8U2 is loaded with a DFU boot loader, which can be activated by
below commands.
a) On Rev1 boards: connecting the solder jumper on the back of the board (near the map of
Italy) and then resetting the 8U2.
b) On Rev2 or later boards: there is a resistor that pulling the 8U2/16U2 HWB line to ground,
making it easier to put into DFU mode.
The use Atmel's FLIP software (Windows) or the DFU programmer (Mac OS X and
Linux) to load a new firmware or use the ISP header with an external programmer (overwriting
the DFU boot loader).
Rather than requiring a physical press of the reset button before an upload, the Arduino
Uno is designed in a way that allows it to be reset by software running on a connected computer.
One of the hardware flow control lines (DTR) of the ATmega8U2/16U2 is connected to the reset
line of the ATmega328 via a 100 Nano farad capacitor. When this line is asserted (taken low),
the reset line drops long enough to reset the chip. The Arduino software uses this capability to
allow to upload code by simply pressing the upload button in the Arduino environment. This
means that the boot loader can have a shorter timeout, as the lowering of DTR can be well
coordinate with the start of the upload.
This setup has other implications. When the Uno is connected to either a computer
running Mac OS X or Linux, it resets each time a connection is made to it from software (via
USB). For the following half second or so, the boot loader is running on the Uno. While it is
programmed to ignore malformed data (i.e. anything besides an upload of new code), it will
intercept the first few bytes of data sent to the board after a connection is opened. If a sketch
running on the board receives one time configuration or other data when it first starts, make sure
that the software with which it communicates waits a second after opening the connection and
before sending this data.
The UNO contains a trace that can be cut to disable the auto-reset. The pads on either
side of the trace can be soldered together to renewable it. It's labeled "RESET-EN". It may also
be able to disable the auto-reset by connecting a 110 ohm resistor from 5V to the reset line.
The Arduino UNO has a resettable poly fuse that protects the computer's USB ports from shorts
and over current. Although most computers provide their own internal protection, the fuse
provides an extra layer of protection. If more than 500 mA is applied to the USB port, the fuse
will automatically break the connection until the short or overload is removed. The maximum
length and width of the UNO PCB are 2.7 and 2.1 inches respectively, with the USB connector
and power jack extending beyond the former dimension. Four screw holes allow the board to be
attached to a surface or case. Note that the distance between digital pins 7 and 8 is 160 mil
(0.16"), not an even multiple of the 100 mil spacing of the other pins.
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 an AC to DC adapter or battery to get started.
Department of ECE,MRITS 11
Determination of SPO2 and Heart Rate using Arduino
3.2.2 ATmega328
The ATmega328 is a single chip microcontroller created by Atmel and belongs to the
mega AVR series. The ATmega328 is shown in Fig 3.2
Department of ECE,MRITS 12
Determination of SPO2 and Heart Rate using Arduino
Department of ECE,MRITS 13
Determination of SPO2 and Heart Rate using Arduino
CHAPTER 4
DESCRIPTION OF HARDWARE MODULES
4.1 INTRODUCTION
In this chapter, description of hardware peripherals or equipment’s like sensors and
modules are discussed.
4.2 SENSORS
HEART BEAT SENSOR(MAX30102)
A heart beat monitor is a personal monitoring device that allows one to measure one's
heart beating real time or record the heart beat for later study. It is largely used by performers of
various types of physical exercise. heart beat sensor is shown in fig 4.1
Department of ECE,MRITS 14
Determination of SPO2 and Heart Rate using Arduino
Department of ECE,MRITS 15
Determination of SPO2 and Heart Rate using Arduino
Features:
a) Tiny 12.7mm x 12.7mm (0.5in x 0.5in) Board Size
b) Free Algorithm
c) Highly-integrated, small-size sensor
d) Non-chest based heart-rate/SpO2 detection
e) Ultra-low power consumption
Application:
Department of ECE,MRITS 16
Determination of SPO2 and Heart Rate using Arduino
It's like the ATmega168, with double the flash space. 32K of program space.23 I/O
lines, 6 of which are channels for the 10-bit ADC.Runs up to 20MHz with external crystal.
Package can be programmed in circuit. 1.8V to 5V operating voltage.
The Uno differs from all preceding boards in that it does not use the FTDI USB-to-
serial driver chip. Instead, it features the Atmega8U2 programmed as a USB-to-serial converter.
"Uno" means "One" in Italian and is named to mark the upcoming release of Arduino 1.0. The
Uno and version 1.0 will be the reference versions of Arduino, moving forward. The Uno is the
latest in a series of USB Arduino boards, and the reference model for the Arduino platform for a
comparison with previous versions, Arduino boards Atmega328 is shown in fig 4.3
Features:
Department of ECE,MRITS 17
Determination of SPO2 and Heart Rate using Arduino
k) USART: Yes
l) External Oscillator: up to 20MHz
Specification:
a) Microcontroller ATmega328
b) Operating Voltage 5V
c) Supply Voltage (recommended) 7-12V
d) Maximum supply voltage (not recommended) 20V
e) Digital I/O Pins 14 (of which 6 provide PWM output)
f) Analog Input Pins 6
g) DC Current per I/O Pin 40 mA
h) DC Current for 3.3V Pin 50 mA
i) Flash Memory 32 KB (ATmega328) of which 0.5 KB used by boot loader
j) SRAM 2 KB (ATmega328)
k) EEPROM 1 KB (ATmega328)
l) Clock Speed 16 MHz
4.4 BUZZER:
A buzzer or beeper is an audio signaling device, which may be mechanical,
electromechanical, or piezoelectric. Typical uses of buzzers and beepers include alarm devices.
Sound emitter may be extremely low or ear piercing.
Types of buzzers:
Electromechanical:
Early devices were based on an electromechanical system identical to an electric bell
without the metal gong. Similarly, a relay may be connected to interrupt its own actuating
current, causing the contacts to buzz. Often these units were anchored to a wall or ceiling to use
it as a sounding board. The word "buzzer" comes from the rasping noise that electromechanical
buzzers made. Electromechanical buzzer is shown in 4.4
Department of ECE,MRITS 18
Determination of SPO2 and Heart Rate using Arduino
Mechanical:
A joy buzzer is an example of a purely mechanical buzzer. They require drivers
mechanical buzzer is shown in fig 4.5
Piezoelectric:
Department of ECE,MRITS 19
Determination of SPO2 and Heart Rate using Arduino
Applications:
While technological advancements have caused buzzers to be impractical and
undesirable, there are still instances in which buzzers and similar circuits may be used. Present
day applications include:
a) Novelty uses
b) Judging panels
c) Educational purposes
d) Annunciator panels
e) Electronic metronomes
f) Game show lock-out device
g) Microwave ovens and other household appliances
h) Sporting events such as basketball games
i) Electrical alarms
j) Joy buzzer (mechanical buzzer used for pranks)
Department of ECE,MRITS 20
Determination of SPO2 and Heart Rate using Arduino
Blue tooth is a wireless technology standard used for exchanging data between fixed and
mobile devices over distances using UHF radio waves in the industrial, scientific and medical
radio bands, from 2.402GHz to 2.480GHz, and building personal area network (PAN) with high
levels of security. It is orginally conceived as a wireless alternative to RS-232 data cables.
It can connect to several devices by overcoming problems of synchronization and keeping
transmission power extremely low to save battery power. Bluetooth 1.0 maximum transfer speed
at 1 mbps and 2.0 manage up to 3mbps now we are using 5.2 version.
Protocols used in Bluetooth module are PPP(point to point protocol), UDP(User data
gram protocol), TCP (Transmission control protocol), WAP(wireless app protocol). It is operated
in the range of 32 feet i.e, 10 meters. Bluetooth can connect simultaneously up to 8 devices with
in its range. It uses a spread spectrum frequency hopping that makes it rare for more than one
device to be transmitting on the same time.
Since every Bluetooth uses a spread spectrum frequency hopping that makes it rare for
more than one device will use 79 individual, randomly chosen frequencies with a designate range,
changing from one to another on a regular basis. In the case of Bluetooth , the transmitters change
frequencies 1,600 times every second transmitting automatically, it’s unlikely that two
transmitter will be on the same frequency range of the same time. This same technique minimizes
the risk that portable phones will disturb bluetooth devices.
Department of ECE,MRITS 21
Determination of SPO2 and Heart Rate using Arduino
Specifications:
Applications:
Computer and peripheral devices:
Bluetooth peripheral devices are Bluetooth mouse, Bluetooth key board, Wireless
scanner, Bluetooth speakers, etc we can easily connect these Bluetooth peripheral devices to
your computer system using wireless connection.
GPS receiver:
Exterrnal Bluetooth GPS devices work by replacing your smartphones native GPS
location, and by then making the new location, and by then making the new location available
for apps that need it.
Industrial control:
Bluetooth low energy is increasingly used in metering, sensors, actuators, and other
small devices that need to be interconnected with Bluetooth low energy being rapidly integrated
into mobile ios and android devices, tailored apps can become powerful and cost-efficient tools
for industrial applications.
Department of ECE,MRITS 22
Determination of SPO2 and Heart Rate using Arduino
MCU projects:
To connected a device to other device wireless we Bluetooth technology for easy MCU
interfacing.
4.6 OLED Display
OLED (Organic Light Emitting Diodes) is a flat light emitting technology, made by placing a
series of organic thin films between two conductors. When electrical current is applied, a bright
light is emitted. OLEDs are emissive displays that do not require a backlight and so are thinner
and more efficient than LCD displays (which do require a white backlight).
OLED structure has many thin layers of organic material. These OLEDs compose of
aggregates of Amorphous and crystalline molecules arranged in irregular pattern. When current
passes through these thin layers, light gets emitted from their surface by a process of electro
phosphorescence. OLEDs work on the principle of electro-luminescence, and this can be
achieved by using multi-layered devices. In between these multi-layered devices, there are
several thin and functional layers that are sandwiched between the electrodes.
When Direct Current is applied, charge carriers from the anode and cathode are injected into
organic layers, due to electroluminescence visible light gets emitted.The architecture of OLED
display comprises several layers: two or three organic layers like conducting layer, emissive layer
and other layers such as substrate, anode and cathode layers that are explained below in detail.
The conductive layer and emissive layers are made of special organic molecules that are
helpful in conducting electricity. Anode and cathode are used for connecting OLEDs to the
source of electricity. When power is applied to an OLED, the emissive layer becomes negatively
charged and the conductive layer becomes positively charged. Due to electrostatic forces applied,
the electrons move from the positive conductive layer to a negative emissive layer. This may lead
to a change in electrical levels and creates radiation that varies in frequency range of visible light.
OLEDs also work as diodes if current flows through them in correct direction. The anode layer
connected above the emissive layer is at a higher potential compared to the cathode connected to
the conductive layer for the working of OLEDs
Department of ECE,MRITS 23
Determination of SPO2 and Heart Rate using Arduino
Substrate Layer: This layer is a thin sheet of glass with a transparent conductive layer, which
can also be made by a clear plastic layer or foil. This substrate supports the OLED structure.
Anode Layer: This layer is an active layer and removes electrons. When current flows through
this device, electrons are replaced by electron holes. Thin layers are deposited onto anode surface,
and therefore, it is also known as transparent layer. Indium tin oxide is the best example of this
layer that serves as the bottom of the electrode or anode.
Department of ECE,MRITS 24
Determination of SPO2 and Heart Rate using Arduino
Conductive Layer: Conductive layer is an important part in this structure that transports the
holes from the anode layer. This layer is made up of organic plastic, and the polymers
used include light-emitting polymers, polymer light-emitting diode, etc. The conductive polymer
used in OLED are polyaniline, polyethylenedioxythiophene. This layer is an electroluminescent
layer and uses the derivatives of p-phenylene vinylene and polystyrene.
Emissive layer: This layer transports electrons from anode layers, and it is made of organic
plastic molecules that are different from the conducting layers. There are multiple choices of
materials and processing variables such that a wide range of wavelengths can be emitted during
emission. In this layer, two polymers are used for emitting such as polyfluorene, poly para
molecules that conduct electricity.
Cathode Layer: Cathode layer is responsible for injection of electrons when current flows
through the device. Making of this layer is done by using calcium, barium, aluminum and
magnesium. It may be either transparent or opaque depending on the type of OLED.
Types of OLEDs:
Based on the structure of OLEDs, they are classified into different types:
1. Passive OLED: The organic layers that run perpendicularly between the strips of the anode
and the cathode are known as Passive OLEDs. These OLEDs describe about the external circuitry
and pixel information. These OLEDs are easy to make, and use more power and best options for
small screens.
2. Active matrix OLED: This OLED requires a thin-film transistor to place on the top of the
anode layer. These OLEDs require less power and are suitable for large screen displays. Anode is
used to control pixels. All the other layers such as cathode and organic molecules are similar to a
typical OLED.
3.Transparent OLED: This OLED consists of transparent substrate, anode and cathode. Lights
get emitted bi-directionally, and it can also be referred to as an active matrix OLED or a passive
OLED. These types of OLEDs are useful for heads-up display, transparent projector screens and
glasses.
Department of ECE,MRITS 25
Determination of SPO2 and Heart Rate using Arduino
4.Top emitting OLED: The substrate layer in this OLED may be reflective or non- reflective and
the cathode layer is transparent.
5. White OLED: These OLEDs emit only white light and are used in the making of larger
and efficient lighting systems. These OLEDs replace the fluorescent lights, and the energy cost is
reduced for lighting.
6. Foldable OLED: These OLEDs are made up of flexible metallic foil or plastic substrate. This
flexible OLED display technology has the characteristics like light weight, ultra-thin stature, and
thus reduces the breaking of electronic display boards.
7. Phosphorescent OLED: This OLED works on the principle of electroluminescence used to
convert 100 % of the electrical energy into light.
ADVANTAGES:
a. The OLEDs are flexible and hence it is very easy to manufacture OLED displays or other
OLED devices such as mobile phones, cameras, wearable devices etc.
b. They use wide energy gap semiconductors and exhibit singlet and triplet exciton radiation
phenomenon compare to LEDs and LCDs.
c. OLED consumes less power and are suitable for devices requiring less power
consumption such as android phones, portable gaming consoles, media players, digital
cameras etc.
DISADVANTAGES:
a. Their lifetime is shorter compare to other display types. White,Red and Green OLED
offer lifetime of about 5 to 25 years where as blue OLED offers about 1.6 years.
b. It is expensive compare to LCD.
c. It is susceptible to water and hence it can be easily damaged by water.
OLED screens are even worse compare to LCD when subjected to direct sunlight.
Department of ECE,MRITS 26
Determination of SPO2 and Heart Rate using Arduino
A power supply is an electronic device that supplies electric energy to an electrical load.
The primary function of a power supply is to convert one form of electrical energy to another. As
a result, power supplies are sometimes referred to as electric power converters. Some power
supplies are discrete, stand-alone devices, whereas others are built into larger devices along with
their loads. Examples of the latter include power supplies found in desktop computers and
consumer electronics devices.
Every power supply must obtain the energy it supplies to its load, as well as any energy it
consumes while performing that task, from an energy source. Depending on its design, a power
supply may obtain energy from various types of energy sources, including electrical energy
transmission systems, energy storage devices such as a batteries and fuel cells, electromechanical
systems such as generators and alternators, solar power converters, or another power supply.
All power supplies have a power input, which receives energy from the energy source,
and a power output that delivers energy to the load. In most power supplies the power input and
output consist of electrical connectors or hardwired circuit connections, though some power
supplies employ wireless energy transfer in lieu of galvanic connections for the power input or
output. Some power supplies have other types of inputs and outputs as well, for functions such as
external monitoring and control.
Specifications:
Department of ECE,MRITS 27
Determination of SPO2 and Heart Rate using Arduino
Features:
a) Simultaneous digital display of both voltage and current.
b) Ten-turn front panel voltage and current controls for high resolution setting of the
output voltage and current from zero to the rated output.
c) Automatic mode crossover into current or voltage mode.
d) Front panel push button control of output standby mode and preview of voltage, current, or
over voltage protection (OVP) set points. Front panel light emitting diode (LED) indicators for
voltage and current mode operation, OVP, remote programming mode, and shutdown. Front
panel control of OVP.
e) Multiple units can be connected in parallel or series to provide increased current or voltage.
f) Thermal shutdown, latching or auto reset.
g) Remote analog voltage and current limit programming with selectable programming ranges.
h) External monitor signals for output voltage and current.
i) Isolated analog remote programming control of the output voltage or current and
isolated readback of output voltage and current with the optional ISOL Interface.
j) Optional internal GPIB or RS-232 computer control for remote digital programming
and readback capability.
k) Rack mount brackets at the front panel are standard.
4.9 CONCLUSION:
In this chapter, the block diagram, sensors(like heart beat sensor) and Modules like bluetooth
module, microcontroller atmega328, Buzzer, OLED diplay, power supply has been discussed.
Department of ECE,MRITS 28
Determination of SPO2 and Heart Rate using Arduino
CHAPTER 5
Department of ECE,MRITS 29
Determination of SPO2 and Heart Rate using Arduino
5.3 IMPLEMENTATION
Implementing the hospital bed side patient information providence using bluetooth
module, to design this system which is used to monitor the patient condition using Bluetooth
module. By this project the patient in the ICU needs constant monitoring of their heart beat, if
any abnormality felt by the patient is indicated by an buzzer signal.
The project involves any abnormality felt by the patient is indicated through bluetooth
receiver by the help of heart beat sensor by detecting the pulse through plug, then it sends
through LCD display and then it parallel shows in serial monitor. The bluetooth transmitter is
having Vcc 5V and GND, the Tx is connected to arduino 10th pin and Rx is connected to
th
Arduino 9 pin. The bluetooth enable pin connected to the 9th pin of Arduino, Bluetooth reset
pin is connected to 10th pin of Arduino, VCC of heart beat sensor is connected to a intermediate
board and then to the Arduino, as same mentioned before the GND is connected to the arduino .
MAX30102 sensor is used to detect blood oxygen and heart rate. First, infrared radiation is
sent and reflected by hitting the finger, and then the amount of oxygen in the blood is determined
by measuring the wave amplitude. Heart rate is also obtained by analyzing the time series
The MAX30102 is an integrated module compatible with the Arduino and STM32. It
integrates a red LED with an infrared LED, a photoelectric detector, an optical device, and a low
noise electronic circuit for ambient light suppression. Heart rate and blood oxygen data are also
Department of ECE,MRITS 30
Determination of SPO2 and Heart Rate using Arduino
Heart beat sensor is used blood pressure and body temperatures are very important
parameters to known for human body. We go to doctors that use different kinds of apparatuses to
know the heart beat of a human. In this tutorial, we are going to make our own heart beat sensor
that will tell us the heart rate. We will make an Arduino based heart beat sensor that will tell us
the number of pulses in a minute when we will place a finger on it.
The module uses an infrared led (IR) and a photo transistor to detect the pulse of the
finger and whenever a pulse is detected red led flashes. There will be led on the light side of the
finger and a photo transistor on the other side of the finger. Photo transistor is used to obtain the
flux emitted. The resistance of the photo resistor will change when the pulse will change.
A typical OLED display consists of 16 pins that control various features of the screen.
The Arduino microcontroller can output voltages of either 5V or 3.3V, so the LCD can be
powered by wiring Vss and Vdd to the ground and 5V pins on the microcontroller.
The Hitachi HD44780 chipset or compatible OLED’s generally have a very standard pin
set . Those without backlights may have only 14 pins, omitting the final two pins powering the
light.
Solder the headers on to the OLED panel and insert the OLED panel into a solder less
bread board.Wire the bread board with 5V and GND from the Arduino
RS pin of the OLED module is connected to digital pin12 of the Arduino.R/W pin of the
OLED is grounded. Enable pin of the OLED module is connected to digital pin11 of the
Arduino. In this project , the OLED module and Arduino are interfaced in the 4-bit mode.
This method is very simple, requires less connections and that can almost utilize the full
potential of the OLED module. OLED through arduino is shown in fig 5.3
Department of ECE,MRITS 32
Determination of SPO2 and Heart Rate using Arduino
Step 2: You should have download two Zip files. Now add them to your Arduino by following
Sketch->Include Library -> Add Zip library as shown below. Then select the library we just
downloaded. You can select only one library at a time, hence you have to repeat this step again.
Step 4: Inside the example program on top of line 64 add the line “#define
SSD1306_LCDHEIGHT 64”
If a buzzer operates from a low enough voltage and draws low enough current, it can be
interfaced directly to an Arduino Uno pin as shown in Fig 5.6.
The buzzer used in this example can operate from a voltage between 3 to 28V and draws
only 4mA of current at 12V. When the current drawn by the buzzer was measured at 5V, it was
found that it only drew about 1.1mA which is well within the drive capability of an Arduino Uno
pin. Interfacing of buzzer with Arduino is shown in fig 5.4.
5.7 CONCLUSION
Department of ECE,MRITS 33
Determination of SPO2 and Heart Rate using Arduino
CHAPTER 6
RESULTS AND DISCUSSION
6.1 INTRODUCTION
In this chapter Results and Discussion On Determination of SPO2 and heart rate using
Bluetooth module are discussed.
6.2 RESULTS
Determination of Spo2 and heart rate using Bluetooth module, if the count of the heart
beat pulse is less than the normal pulse per minute then doctor gets alert through the buzzer and
message is sent to his/her owners through bluetooth module. This is the main hardware kit for
project. The output will be shown in OLED connected to the micro controller. The OLED
module is connected to the port P2 Arduino Uno board, as shown in fig 6.1
Fig 6.1 Hardware kit for smart heart rate monitoring system using SPO2 and bluetooth
module
Department of ECE,MRITS 34
Determination of SPO2 and Heart Rate using Arduino
In the fig 6.2, the heart beat sensor that is connected to analog input A0 to the
microcontroller which senses the pulse and displays the reading on OLED module as shown in
Fig 6.2.
The main aim of the project is to know whether Determination of SPO2 and heart rate
using arduino patient conditions is critical then heart beat sensor sense the pulse and Bluetooth
module gets activated and is displayed on OLED as shown in Fig 6.3 and buzzer is alarmed.
Department of ECE,MRITS 35
Determination of SPO2 and Heart Rate using Arduino
6.3 CONCLUSION
In this chapter, Results and Discussion on Determination of SPO2 and heart rate using
Arduino.
Department of ECE,MRITS 36
Determination of SPO2 and Heart Rate using Arduino
CHAPTER 7
7.1 CONCLUSION
From the above designed project we can conclude that we are able to transmit the data
which is sensed from remote patient to the doctors PC by using wireless transmission
technology, Bluetooth. Using Bluetooth at receiver the data is received and displayed on the PC.
With the fast development of the industrialization and urbanization process in the world
and hence with the increase of busyness of people it has become difficult To monitor the health
conditions of a patient continuously. Also with the increase in the number senior citizens and
chronic diseases, the number of elderly patients who need constant assistance has increased. One
key point of all critical care for elderly patient is the continuous monitoring of their vital signs.
To avoid unexpected health problems and obtain higher accuracy in diagnosis of the health
conditions of a patient, efficient and comprehensive data collecting, monitoring and control play
an important role to improve the health care system more reliable and effective.
Department of ECE,MRITS 37
Determination of SPO2 and Heart Rate using Arduino
networks on the verge of deployment, security issues pertaining to the sensor networks are in the
limelight. Due to the sensitiveness of medical data, austere privacy and security are inevitable for
all parts of healthcare systems. The IPv6 over Low power Wireless Personal Area Networks
(6LoWPAN) standard offers an alternative because it employs the IPv6 protocol and can operate
equally well over wireless and wired connections. The presence of a single actuator in sensor
networks eliminates the need for coordination and communication between actuators and a
sparsely connected network eliminates the need for location management. Our current work can
also extend further to monitor sports personalities and patients affected by other specific diseases
during their normal routine activities.
Department of ECE,MRITS 38
Determination of SPO2 and Heart Rate using Arduino
REFERENCES
1. J. Salyer, "Neonatal and Pediatric Pulse Oximetry", Respiratory Care, pp. 286-289, 2003.
2. C. Otto, A. Milenkovic, C. Sanders, E. Jovanov, "System architecture of a wireless body area
sensor network for ubiquitous health monitoring", Journal of Mobile Multimedia, vol. 1, pp.
307-326, 2006.
3.. Dusit Niyato, Ekram Hossain, Sergio Camorlinga, "Remote Patient Monitoring Service using
Heterogeneous Wireless Access Networks Architecture and Optimization", IEEE JOURNAL
ON SELECTED AREAS IN COMMUNICATIONS, vol. 27, no. 4, MAY 2009.
4. CC2430 Data Sheet (rev. 2.1) SWRS036F. A True System-on-Chip solution for 2.4 GHz
IEEE 802.15.4 Bluetooth(TM)Texas Instruments..
5. Xiang-dong JIANG, Yu-liang TANG, Ying LEL, Wireless Sensor Networks in Structural
Health Monitoring Based on Bluetooth Technology.
Department of ECE,MRITS 39
Determination of SPO2 and Heart Rate using Arduino
APPENDIX-A
SOURCE CODE
#include <Wire.h>
#include "MAX30105.h"
#include "spo2_algorithm.h"
MAX30105 particleSensor;
void setup()
{
Serial.begin(115200); // initialize serial communication at 115200 bits per second:
pinMode(pulseLED, OUTPUT);
pinMode(readLED, OUTPUT);
// Initialize sensor
if (!particleSensor.begin(Wire, I2C_SPEED_FAST)) //Use default I2C port, 400kHz speed
{
Serial.println(F("MAX30105 was not found. Please check wiring/power."));
while (1);
}
Department of ECE,MRITS 40
Determination of SPO2 and Heart Rate using Arduino
Serial.println(F("Attach sensor to finger with rubber band. Press any key to start conversion"));
while (Serial.available() == 0) ; //wait until user presses a key
Serial.read();
void loop()
{
bufferLength = 100; //buffer length of 100 stores 4 seconds of samples running at 25sps
//read the first 100 samples, and determine the signal range
for (byte i = 0 ; i < bufferLength ; i++)
{
while (particleSensor.available() == false) //do we have new data?
particleSensor.check(); //Check the sensor for new data
redBuffer[i] = particleSensor.getRed();
irBuffer[i] = particleSensor.getIR();
particleSensor.nextSample(); //We're finished with this sample so move to next sample
Serial.print(F("red="));
Serial.print(redBuffer[i], DEC);
Serial.print(F(", ir="));
Department of ECE,MRITS 41
Determination of SPO2 and Heart Rate using Arduino
Serial.println(irBuffer[i], DEC);
}
//calculate heart rate and SpO2 after first 100 samples (first 4 seconds of samples)
maxim_heart_rate_and_oxygen_saturation(irBuffer, bufferLength, redBuffer, &spo2,
&validSPO2, &heartRate, &validHeartRate);
//Continuously taking samples from MAX30102. Heart rate and SpO2 are calculated every 1
second
while (1)
{
//dumping the first 25 sets of samples in the memory and shift the last 75 sets of samples to the
top
for (byte i = 25; i < 100; i++)
{
redBuffer[i - 25] = redBuffer[i];
irBuffer[i - 25] = irBuffer[i];
}
redBuffer[i] = particleSensor.getRed();
irBuffer[i] = particleSensor.getIR();
particleSensor.nextSample(); //We're finished with this sample so move to next samplE
Department of ECE,MRITS 42
Determination of SPO2 and Heart Rate using Arduino
Serial.print(F(", HR="));
Serial.print(heartRate, DEC);
Serial.print(F(", HRvalid="));
Serial.print(validHeartRate, DEC);
Serial.print(F(", SPO2="));
Serial.print(spo2, DEC);
Serial.print(F(", SPO2Valid="));
Serial.println(validSPO2, DEC);
}
APPENDIX-B
ARDUINO SOFTWARE
OVERVIEW
Arduino
Arduino is a tool for making computers that can sense and control more of the physical
world than 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 communicated with software running on
computer (e.g. Flash, Processing, Max MSP.) The boards can be assembled by hand or
purchased preassembled; the open source IDE can be downloaded for free.
Feature
a) Schematic design of the open source development interface free download, and
also according to the needs of their own changes
b) Download the program is simple and convenient.
c) Simply with the sensor, a wide range of electronic components connection (such as:
LCD, buzzer, etc.), make all sorts of interesting things.
d) Using the high-speed micro-processing controller (ATMEGA328).
e) The development of language and development environment is very simple, easy to
understand, very suitable for beginners to learn.
Performance
a) Digital I/O 0~13.
b) Analog I/O 0~5.( R3 is 0~7 )
c) Support ISP Download Function
d) Input voltage: when connected to the USB without external power supply or
Special Port
a) 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). The supply voltage through this pin, or, if supplying voltage via the power
jack, access it through this pin.
b) AREF. Reference voltage for the analog inputs. Used with analogReference().
SAINSMART UNO R3
UNO R3
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. Performance Revision 3 is
the last SainSmart UNO development board version.
Parameter
a) 3.3V/5V Supply Voltage and IO Voltage can be switched at the same time.
b) More 3.3V modules supported, such as Xbee module, Bluetooth module, RF
module, GPRS module, GPS module, LCD5110 Backlight and so on, but the
original version can only support 5V IO.
Department of ECE,MRITS 45
Determination of SPO2 and Heart Rate using Arduino
Improvement of R3
a) Working voltage 3.3V/5V is optional.
b) Arduino can only work at 5V voltage. When it comes to 3.3V Level module, IO
can’t be connected to it. The Level should be changed, like the SD card, Bluetooth
module and so on.
c) Sainsmart UNO R3 can work at 3.3V voltage by switching on the button. At this
time, IO port is 3.3V and it can work with 3.3V Level module. (R3 can directly use
the electronic building blocks on I / O port and elicit G, V, S).
SAINSMART MEGA2560 R3
Description
This is the new MEGA2560 R3. In addition to all the features of the previous board, the
MEGA now uses an ATMega16U2 instead of the ATMega8U2 chip. This allows for faster
transfer rates and more memory. No drivers needed for Linux or Mac (inf file for Windows is
needed and included in the Arduino IDE), and the ability to have the Uno show up as a keyboard,
mouse, joystick, etc.
The MEGA2560 R3 also adds SDA and SCL pins next to the AREF. In addition, there are
two new pins placed near the RESET pin. One is the IOREF that allow the shields to adapt to the
voltage provided from the board. The other is a not connected and is reserved for future
purposes. The MEGA2560 R3 works with all existing shields but can adapt to new shields which
use these additional pins.
Features
a) Microcontroller ATmega2560
b) Operating Voltage 5V
c) Input Voltage (recommended) 7-12V
d) Input Voltage (limits) 6-20V
e) Digital I/O Pins 54 (of which 15 provide PWM output)
f) Analog Input Pins 16
g) DC Current per I/O Pin 40 mA
Department of ECE,MRITS 46
Determination of SPO2 and Heart Rate using Arduino
ARDUINO C GRAMMAR
Arduino grammar is built on the basis of C/C + +, in fact is also the basic C grammar,
Arduino grammar not only put some related parameters Settings are function change, we have no
need to understand his bottom, let us to know AVR micro control unit (MCU) friend can also
easy to fit in. So here I'll simple comment the Arduino grammar.
Control Structures
a) If
b) if...else
c) for
d) switch case
e) while
f) do... while
g) break
h) continue
i) return
j) goto
Further Syntax
a) ;
b) {}
c) //
d)/* */
Operators
a) ++
b) --
c) +=
d) -=
Department of ECE,MRITS 47
Determination of SPO2 and Heart Rate using Arduino
e) *=
f) /=
g) =
h) +
i) -
j) *
k) /
l) %
m) ==
n) !=
o) <
p) >
q) <=
r) >=
s) &&
t) ||
u) !
Data Type
a) boolean
b) char
c) byte
d) int
e) unsigned int
f) long
g) unsigned long
h) float
i) double
j) string
k) array
l) void
Department of ECE,MRITS 48
Determination of SPO2 and Heart Rate using Arduino
Constant
HIGH | LOW Said digital IO port level, HIGH Said high level(1), LOW Said low electric
flat(0).
INPUT | OUTPUT Said digital IO port direction, INPUT Said input (high impedance state)
Structure
Voidsetup ()
The setup() function is called when a sketch starts. Use it to initialize variables, pin
modes, start using libraries, etc. The setup function will only run once, after each power up or
reset of the Arduino board.
Voidloop()
After creating a setup() function, which initializes and sets the initial values, the loop()
function does precisely what its name suggests, and loops consecutively, allowing program to
change and respond. Use it to actively control the Arduino board.
Function
a) Digital I/O
pinMode(pin, mode)pin 0~13, mode is input or output.
digitalWrite(pin, value)pin 0~13, value is HIGH or LOW.
intdigitalRead(pin)pin 0~13, value is HIGH or LOW.
b) Analog I/O
IntanalogRead(pin)pin 0~5.
analogWrite(pin, value)pin 3, 5, 6, 9, 10, 11, value is 0 to 255.
Time
a) Delay(ms)Pauses the program for the amount of time (in miliseconds) specified
as parameter. (There are 1000 milliseconds in a second.)(unitms).
b) delayMicroseconds(us).
Department of ECE,MRITS 49
Determination of SPO2 and Heart Rate using Arduino
OLED Program
Here, we will learn use Arduino IDE serial interface tools to show the contents that
we want to display in the computer.
void setup()
{
Serial.begin(9600);// opens serial port, sets data rate to 9600 bps
Serial.println("Hello World!");
}
void loop()
{
}
Explain
Display connects to Arduino using only four wires – two for power and two for data, making
the wiring very simple. The data connection is I2C (I²C, IIC or Inter-Integrated Circuit). This
interface is sometimes called TWI (Two Wire Interface).
At the very lowest level, the Arduino Wire library is used to communicate with the display.
Libraries are available that make it easy to start using the display right away to display text and
graphics. These libraries are installed in this tutorial.
Department of ECE,MRITS 50
Determination of SPO2 and Heart Rate using Arduino
0.96 inch monochrome OLED display from Geekcreit is connected or interfaced to an Arduino.
Libraries are then installed and some example programs run which show how to use the display
in an Arduino sketch.
The display connects to Arduino using only four wires – two for power and two for data, making
the wiring very simple. The data connection is I2C (I²C, IIC or Inter-Integrated Circuit). This
interface is sometimes called TWI (Two Wire Interface).
Department of ECE,MRITS 51
Determination of SPO2 and Heart Rate using Arduino
The first and most important thing to note is that some of the displays may have the GND and
VCC power pins swapped around. Check your display to make sure that it is the same as the
image below. If the pins are swapped, make sure to change the connections to the Arduino –
OLED VCC connects to 5V on the Arduino, OLED GND to GND on the Arduino.
#include <Wire.h>
#include <Adafruit_SSD1306.h>
#include <Adafruit_GFX.h>
Adafruit_SSD1306 display(-1);
void setup() {
// initialize and clear display
display.begin(SSD1306_SWITCHCAPVCC, OLED_ADDR);
display.clearDisplay();
display.display();
Department of ECE,MRITS 52
Determination of SPO2 and Heart Rate using Arduino
Determination of SPO2 and Heart Rate using Arduino
display.setTextColor(WHITE);
display.setCursor(27,30);
display.print("Hello, world!");
void loop() {
// put your main code here, to run repeatedly:
Department of ECE,MRITS 53
Determination of SPO2 and Heart Rate using Arduino
Smart heart rate monitoring using bluetooth module
Department of ECE,MRITS 59