You are on page 1of 63

VIETNAM NATIONAL UNIVERSITY - HCMC

International University
Biomedical Engineering Department

Design of a SpO2 Pulse Oximeter Prototype


by
Le Nguyen Trong Nghia

A thesis submitted to the Biomedical Engineering Department in partial fulfillment


of the requirements for the Degree of Engineer

Ho Chi Minh city, Vietnam


02/2012

DESIGN OF A SpO2 PULSE OXIMETER PROTOTYPE

APPROVED BY:
__________________________
Prof. Vo Van Toi, Ph.D., Chair
__________________________
PhD. Truong Quang Dang Khoa
__________________________
PhD. Nguyen Thanh Hai
__________________________
PhD. Vo Thi Kieu Loan
__________________________
PhD. Nguyen Duc Thang

THESIS COMMITTEE

ACKNOWLEGMENTS

Firstly, I would like to send my deep gratitude to Prof. Vo Van Toi who
has given me his constant encouragement and support to help me to
finish my project successfully.
Secondly, I also want to give my gratefulness to PhD. Nguyen Thanh
Hai, Msc. Nguyen Thanh Tam and Msc. Ngo Thanh Hoan for their
precious advice, technical help, and support from the beginning of my
study. They have made these months a great learning experience.
And finally, I am really thankful to my friends because of their
enthusiasm and helpful support during the completion of this thesis.

TABLE OF CONTENTS
LIST OF FIGURES .................................................................................................................... 6
ABSTRACT................................................................................................................................ 7
KEY WORDS............................................................................................................................. 8
CHAPTER
INTRODUCTION.................................................................................................................... 9
1.

Background ............................................................................................................... 9

2.

Introduction..............................................................................................................10

3.

Motivation .................................................................................................................11

LITERATURE REVIEW .........................................................................................................13


1.

A brief history ...........................................................................................................13

2.

Principle of pulse oximetry......................................................................................16

3.

Significance...............................................................................................................19

4.

Limitation and Advancement..................................................................................21

METHODOLOGY ..................................................................................................................23
1.

Fundamental principle ............................................................................................23

2.

Hardware description ..............................................................................................28

3.

Measurement strategy.............................................................................................37

RESULTS..............................................................................................................................44
1.

Achievement .............................................................................................................44

2.

Implementation ........................................................................................................47

3.

Discussion ................................................................................................................49

CONCLUSION ......................................................................................................................51
REFERENCES .........................................................................................................................52
APENDICES .............................................................................................................................53

LIST OF FIGURES
Figure

Page

1. Red (R) and infrared (IR) scaled alternating current (AC) signals at arterial
oxygen saturation (SaO2) of 0%, 85% and 100%. The numeric value of the redto-infrared (R/IR) ratio can be easily converted to SaO2 ........................................ 9
2. The absorption spectra of both HbO2 and Hb. Hb has a higher absorption than
HbO2 at 660nm (RED). In the infrared region, HbO2 has a higher absorption. .. 16
3. Basic Oximeter Sensor Components..................................................................... 17
4. Blue Trace IR Light / Red Trace RED Light ................................................... 18
5. AC and DC component of a SpO2 signal .............................................................. 18
6. Calibration curve for pulse oximeter..................................................................... 19
7. Above shows the results of the differentiator (black) and the peak follower
envelope (blue) on the IR waveform (Red)........................................................... 40
8. The finished prototype .......................................................................................... 49
9. The prompt at the beginning of the test ................................................................ 50
10. The result of my SpO2 test .................................................................................... 51

ABSTRACT

Pulse oximetry is a non-invasive method which allows health care


providers to monitor the oxygenation of patients blood. Oxygen
saturation is the percentage of haemoglobin molecules bound with
oxygen molecules. The basic principle of a pulse oxymeter is based on
the measurement of the red and infrared light absorption. Infrared is
absorbed more by oxygenated hemoglobin and red transmitted, by
opposition to the deoxygenated cells. With the low cost and availability of
Microchips, there is a question why these instruments are so expensive
and why they are not available at our local drugstores like glucose
meters. Based upon the above principle, a simple prototype of pulse
oximeter can be made using a Microchip dsPIC30F digital signal
processor and a small available LCD. Therefore, we can think about a
simple, reliable and affordable product that can go into mass-production.
In conclusion, with cheap, simple and available components, we have the
possibility to successfully build a prototype of pulse oximeter that can be
utilized in medical centers, clinics, and nursing homes and do not have
to buy the available commercialized products.

KEY WORDS

Pulse oximetry, pulse oximeter, oxygen saturation, hemoglobin (or


hemoglobin), absorption, transmit, LTF (Light to Frequency)

CHAPTER I
INTRODUCTION

1. Background
The Pulse Oximeter is an instrument that is widely used in todays
medical fields. There are many different models available by different
companies. Some units such as those utilized in hospitals are integrated
into larger systems used to monitor other vital signs. Other smaller more
portable units can be found in doctors offices, clinics, and nursing
homes and are also used by home health-care professionals. In the
Oct/Nov 2000 issue of RT The Journal for Respiratory Care
Practitioners, an article titled Recent Developments in Pulse Oximetry
is quoted as Pulse Oximetry is often considered the fifth vital sign, after
heart rate, blood pressure, temperature and respiratory rate.

Pulse

Oximetry has served as an important tool for the clinician by providing


continuous monitoring of the critically ill patients arterial oxygen
saturation (SaO2), by calculating an estimate of the SaO2 (known as the
SpO2) via an algorithm and displaying a readout of this estimation.

2. Introduction
A pulse oximeter is a medical device that indirectly monitors the
oxygen saturation of a patient's blood and changes in blood volume in
the skin, producing a photoplethysmograph. It is often attached to a
medical monitor so staff can see a patient's oxygenation at all times.
Most monitors also display the heart rate. Portable, battery-operated
pulse oximeters are also available for home blood-oxygen monitoring. The
original oximeter was made by Millikan in the 1940s. The precursor to
today's modern pulse oximeter was developed in 1972, by Aoyagi at
Nihon Kohden using the ratio of red to infrared light absorption of
pulsating components at the measuring site. It was commercialized by
Biox in 1981. The device did not see wide adoption in the United States
until the late 1980s. Basically, the principle of the pulse oximetry is
based upon the measurement of the red and infrared light absorption. A
sensor is placed on a thin part of the patient's body, usually a fingertip
or earlobe, or in the case of an infant, across a foot. Light at red (660nm)
and infrared (910nm) wavelengths is passed sequentially through the
patient to a photodetector. The changing absorbance at each of the two
wavelengths is measured, allowing determination of the absorbance due
to the pulsing arterial blood alone, excluding venous blood, skin, bone,

10

muscle, fat, and fingernail polish. Based upon the ratio of changing
absorbance of the red and infrared light caused by the difference in color
between oxygen-bound (bright red) and oxygen-unbound (dark red or
blue, in severe cases) blood hemoglobin, a measure of oxygenation (the
percentage of hemoglobin molecules bound with oxygen molecules) can
be made. Using the above methodology, we would be able to build a
prototype of pulse oximeter with only some low-cost and available
components in the market.

3. Motivation
Over the past few years, I have had experience with the nursing
home setting since I had to be there for 3 months. It is very common for
bed-ridden patients to contract pneumonia during the flu season. A
pulse oximeter is normally used to determine if the patient is having
difficult time breathing. A particular nursing home I was at had one such
instrument. During the winter, I had contracted pneumonia. I asked the
nurse if I could be examined. They had to wait for the oximeter because it
was being used in another part of the building. Because of the
instruments high cost, the nursing home couldnt afford a second or
perhaps a third. My question was - does anybody make one? During my

11

search, I have read an interesting article of an individual who was on the


same question. With the low cost and availability of microchips, I cant
understand why these instruments are so expensive and why they are
not available at our local drugstores like glucose meters.

12

CHAPTER II
LITERATURE REVIEW

1. A brief history
In 1935, Matthews developed the first 2-wavelength ear oxygen
saturation meter with red and green filters, later switched to red and
infrared filters. This was the first device to measure oxyhemoglobin
saturation.
In 1949 Wood added a pressure capsule to squeeze blood out of an
ear to obtain zero setting in an effort to obtain absolute oxygen
saturation value when blood was readmitted. The concept is similar to
today's conventional pulse oximetry but was hard to implement because
of unstable photocells and light sources. This method is not used
clinically. In 1964 Shaw assembled the first absolute reading ear
oximeter by using eight wavelengths of light. Commercialized by Hewlett
Packard, its use was limited to pulmonary functions and sleep
laboratories due to cost and size.

13

Pulse oximetry was developed in 1974, by Takuo Aoyagi and Michio


Kishi, bioengineers, at Nihon Kohden using the ratio of red to infrared
light absorption of pulsating components at the measuring site. Susumu
Nakajima, a surgeon, and his associates first tested the device in
patients, reporting it in 1975. It was commercialized by Biox in 1981 and
Nellcor in 1983. Biox was founded in 1979, and introduced the first
pulse oximeter to commercial distribution in 1981. Biox initially focused
on respiratory care, but when the company discovered that their pulse
oximeters were being used in operating rooms to monitor oxygen levels,
Biox expanded its marketing resources to focus on operating rooms in
late 1982. A competitor, Nellcor (now part of Covidien, Ltd.), began to
compete with Biox for the US operating room market in 1983. Prior to its
introduction, a patient's oxygenation could only be determined by arterial
blood gas, a single-point measurement that takes a few minutes of
processing by a laboratory. In the United State alone, approximately 2
billion dollars was spent annually on this measurement. With the
introduction of pulse oximetry, a non-invasive, continuous measure of
patient's oxygenation was possible, revolutionizing the practice of
anesthesia and greatly improving patient safety. Prior to its introduction,
studies in anesthesia journals estimated US patient mortality as a

14

consequence of undetected hypoxemia at 2,000 to 10,000 deaths per


year, with no known estimate of patient morbidity.
By 1987, the standard of care for the administration of a general
anesthetic in the US included pulse oximetry. From the operating room,
the use of pulse oximetry rapidly spread throughout the hospital, first to
the recovery room, and then into the various intensive care units. Pulse
oximetry was of particular value in the neonatal unit where the patients
do not thrive with inadequate oxygenation, but also can be blinded with
too much oxygen. Furthermore, obtaining an arterial blood gas from a
neonatal patient is extremely difficult.
In 1995, Masimo introduced Signal Extraction Technology (SET)
that could measure accurately during patient motion and low perfusion.
Some have termed newer generation pulse oximetry technologies as High
Resolution Pulse Oximetry (HRPO). One area of particular interest is the
use of pulse oximetry in conducting portable and in-home sleep apnea
screening and testing.
In 2009, the world's first Bluetooth-enabled fingertip pulse oximeter
was introduced by Nonin Medical, enabling clinicians to remotely
monitor patients pulses and oxygen saturation levels. It also allows

15

patients to monitor their own health through online patient health


records and home telemedicine systems.

2. Principle of pulse oximetry


The principle of pulse oximetry is based on the red and infrared
light

absorption

characteristics

of

oxygenated

and

deoxygenated

hemoglobin. Oxygenated hemoglobin absorbs more infrared light and


allows more red light to pass through. Deoxygenated (or reduced)
hemoglobin absorbs more red light and allows more infrared light to pass
through. Red light is in the 600-750 nm wavelength light band. Infrared
light is in the 850-1000 nm wavelength light band.
Pulse oximetry uses a light emitter with red and infrared LEDs that
shines through a reasonably translucent site with good blood flow.
Typical adult/pediatric sites are the finger, toe, pinna (top) or lobe of the
ear. Infant sites are the foot or palm of the hand and the big toe or
thumb. Opposite the emitter is a photodetector that receives the light
that passes through the measuring site.
There are two methods of sending light through the measuring site:
transmission and reflectance. In the transmission method, as shown in
the figure on the previous page, the emitter and photodetector are

16

opposite of each other with the measuring site in-between. The light can
then pass through the site. In the reflectance method, the emitter and
photodetector are next to each other on top the measuring site. The light
bounces from the emitter to the detector across the site. The
transmission method is the most common type used and for this
discussion the transmission method will be implied.
After the transmitted red (R) and infrared (IR) signals pass through
the measuring site and are received at the photo-detector, the R/IR ratio
is calculated. The R/IR is compared to a "look-up" table (made up of
empirical formula) that convert the ratio to a SpO2 value. Most
manufacturers have their own look-up tables based on calibration curves
derived from healthy subjects at various SpO2 levels. Typically an R/IR
ratio of 0.5 equates to approximately 100% SpO2, a ratio of 1.0 to
approximately 82% SpO2, while a ratio of 2.0 equates to 0% SpO2.

Fig. 1: Red (R) and infrared (IR) scaled alternating current (AC) signals at arterial oxygen
saturation (SaO2) of 0%, 85% and 100%. The numeric value of the red-to-infrared (R/IR)
ratio can be easily converted to SaO2.

17

The major change that occurred from the 8-wavelength Hewlett


Packard oximeters of the '70s to the oximeters of today was the inclusion
of arterial pulsation to differentiate the light absorption in the measuring
site due to skin, tissue and venous blood from that of arterial blood.
At the measuring site there are constant light absorbers that are
always present. They are skin, tissue, venous blood, and the arterial
blood. However, with each heart beat the heart contracts and there is a
surge of arterial blood, which momentarily increases arterial blood
volume across the measuring site. This results in more light absorption
during the surge. If light signals received at the photodetector are looked
at as a waveform, there should be peaks with each heartbeat and
troughs between heartbeats. If the light absorption at the trough (which
should include all the constant absorbers) is subtracted from the light
absorption at the peak then, in theory, the resultants are the absorption
characteristics due to added volume of blood only; which is arterial.
Since peaks occur with each heartbeat or pulse, the term "pulse
oximetry" was coined. This solved many problems inherent to oximetry
measurements in the past and is the method used today in conventional
pulse oximetry.

18

Still, conventional pulse oximetry accuracy suffered greatly during


motion and low perfusion and made it difficult to depend on when
making medical decisions. Arterial blood gas tests have been and
continue to be commonly used to supplement or validate pulse oximeter
readings. The advent of "Next Generation" pulse oximetry technology has
demonstrated significant improvement in the ability to read through
motion and low perfusion; thus making pulse oximetry more dependable
to base medical decisions on.

3. Significance
A pulse oximeter is useful in any setting where a patient's
oxygenation is unstable, including intensive care, operating, recovery,
emergency and hospital ward settings, pilots in unpressurized aircraft,
for assessment of any patient's oxygenation, and determining the
effectiveness of or need for supplemental oxygen. Assessing a patient's
need for oxygen is the most essential element to life; no human life
thrives in the absence of oxygen (cellular or gross). Although a pulse
oximeter is used to monitor oxygenation, it cannot determine the
metabolism of oxygen, or the amount of oxygen being used by a patient.
For this purpose, it is necessary to also measure carbon dioxide levels. It

19

is possible that it can also be used to detect abnormalities in ventilation.


However, the use of a pulse oximeter to detect hypoventilation is
impaired with the use of supplemental oxygen, as it is only when patients
breathe room air that abnormalities in respiratory function can be
detected reliably with its use. Therefore, the routine administration of
supplemental oxygen may be unwarranted if the patient is able to
maintain adequate oxygenation in room air, since it can result in
hypoventilation going undetected.
Because of their simplicity and speed, pulse oximeters are of
critical importance in emergency medicine and are also very useful for
patients with respiratory or cardiac problems, especially COPD, or for
diagnosis of some sleep disorders such as apnea and hypopnea. Portable
battery-operated pulse oximeters are useful for pilots operating in a nonpressurized aircraft above 10,000 feet (12,500 feet in the US) where
supplemental oxygen is required. Prior to the oximeter's invention, many
complicated blood tests needed to be performed. Portable pulse oximeters
are also useful for mountain climbers and athletes whose oxygen levels
may decrease at high altitudes or with exercise. Some portable pulse
oximeters employ software that charts a patient's blood oxygen and
pulse, serving as a reminder to check blood oxygen levels.

20

4. Limitation and Advancement


Pulse oximetry measures solely of oxygenation, not ventilation, and
it is not a substitute for blood gases checked in a laboratory because it
gives no indication of base deficit, carbon dioxide levels, blood pH, or
bicarbonate HCO3 concentration. The metabolism of oxygen can be
readily measured by monitoring expired CO2. Saturation figures also give
no information about blood oxygen content. Most of the oxygen in the
blood is carried by hemoglobin. In severe anemia, the blood will carry
less total oxygen, despite the hemoglobin being 100% saturated.
Falsely low readings may be caused by hypo-perfusion of the
extremity being used for monitoring (often due to the part being cold or
from vasoconstriction secondary to the use of vasopressive agents);
incorrect sensor application; highly calloused skin; and movement (such
as shivering), especially during hypo-perfusion. To ensure accuracy, the
sensor should return a steady pulse and/or pulse waveform. Falsely high
or falsely low readings will occur when hemoglobin is bound to
something other than oxygen. In cases of carbon monoxide poisoning,
the falsely high reading may delay the recognition of hypoxemia (low
blood oxygen level). Methemoglobinemia characteristically causes pulse
oximetry readings in the mid of 1980s. Cyanide poisoning can also give a

21

high reading because it reduces oxygen extraction from arterial blood


(the reading is not false, as arterial blood oxygen is indeed high in early
cyanide poisoning).
Pulse oximetry only reads the percentage of bound hemoglobin.
Hemoglobin can be bound to other gases such as carbon monoxide and
still read high even though the patient is hypoxemic. The only
noninvasive method that allows the continuous measurement of the
dyshemoglobins is a pulse CO-oximeter. Pulse CO-oximetry was invented
in 2005 by Masimo and currently allows clinicians to measure total
hemoglobin levels in addition to carboxyhemoglobin, methemoglobin and
PVI, which initial clinical studies have shown may provide clinicians with
a new method for noninvasive and automatic assessment of patient fluid
volume status. Appropriate fluid levels are vital to reducing postoperative
risks and improving patient outcomes as fluid volumes that are too low
(under hydration) or too high (over hydration) have been shown to
decrease

wound

healing,

increase

complications.

22

risk

of

infection

and

cardiac

CHAPTER III
METHODOLOGY

1. Fundamental principle
The fundamental basis for Oximetry is that blood has different
optical properties at different levels of oxygen saturation. This means
that if multiple sources of light at different wavelengths are used to
examine the blood, they can be compared algorithmically by a computer
to determine the level of oxygen saturation in the blood. The beauty of
the concept is that the examination can be made invasively by passing
light through an extremity such as a finger, ear lobe, etc. The light is
collected by a light sensitive solid-state device such as a photo-detector,
phototransistor or more recently a LTF (Light to Frequency) converter.
Oximeter probes are designed to have multiple light sources (LEDs) that
are switched on/off during the measurement phase of the instrument.
The oxygen carrying component of blood is called hemoglobin. It is
also the colored substance in your blood. The amount of visible light
absorbed changes with each level of oxygenation. On a molecular scale,
there are two forms of the hemoglobin molecule. One is called oxidized

23

hemoglobin (HbO2) and the other is called reduced hemoglobin (Hb). Both
of these molecular forms have different optical characteristics. The
absorption of both forms of hemoglobin can be seen below.

Fig. 2: The graph shows the absorption spectra of both HbO2 and Hb. Hb has a higher absorption than HbO2 at
660nm (RED). In the infrared region, HbO2 has a higher absorption. The point where the absorption of the HbO2
and the Hb are equal is called the isobestic point.

24

IR

LTF
`

Fig. 3: Basic Oximeter Sensor Components

The above figure illustrates two LED sources: RED and INFRARED
that transmit light through a finger. The light is received by the LTF
(Light to Frequency sensor). The output of this sensor has a frequency
that is proportional to the intensity of the light for each source. The
sources are time multiplexed. Each source is switched on for a brief
instant and the frequency is measured. Light is absorbed from each
source by the tissue as well as the blood. The absorption is different in
the tissue for each source. As blood flows through the finger a pulsatile
component is present. The pulsatile component represents the arterial
flow of the blood which contains 97% of the oxygen in the body. The
constant or DC component that is picked up by the LTF represents the
tissue, venous and capillary absorption. The below figure shows the
pulsatile and DC components for each signal. The RED trace represents
the RED source and the BLUE trace represents the IR trace. The Black
line represents the DC value for each of the sources.

25

Fig. 4: Blue Trace IR Light / Red Trace RED Light

Fig. 5: AC and DC component of a SpO2 signal

26

The system measures both the AC and DC levels obtained from both
sources and computes the SpO2 based on the following equation:

R
log rms
R DC
R
IR

log rms
IR DC
SpO

10 . 0002 R 3 52 . 887 R 2 26 . 817 R 98 . 293

Fig. 6: Calibration curve for pulse oximeter

27

The Heart Rate is determined by measuring the elapsed time between


peaks of the IR signal. The heart rate is then calculated using the
equation:

BPM

60
PeriodinSe conds

2. Hardware description
The heart of the pulse oximeter is a Microchip dsPIC30F3013
Digital Signal Controller.

DIGITAL SIGNAL CONTROLLER (dsPIC30F3013)


The Microchip dsPIC30F3013 digital signal controller was a nice choice
for this project because of its excellent computational abilities, available
hardware, its low cost and its ease of field programmability.

SYSTEM CLOCK
The 16-bit 28-pin development board comes with an internal 8MHz
crystal. This worked out perfect for the application. The on-chip PLL was
used to boost the operating frequency 16x. With the instruction clock set

28

at input clock frequency, the operating frequency of the clock for the
system is: Fcy = 32MHz.

TIMER T1
T1 is a 16-bit timer that acts as a time-base generator with interrupt to
implement a simple state machine used to control the sequencing of
events. Timer T1 also sets the sample rate for all signal processing. T1 is
a type-A timer which uses the 29.4192 MHz internal clock as its input. A
prescaler is used to divide the frequency by 256 to drop the TMR1
module input to 115200 Hz. The Period Register PR1 is set to 576 so the
timer provides an interrupt period of 5ms.

TIMER T2
T2 is also a 16-bit timer that is setup to be free-running with a
29.4192MHz input to the TMR2 module. Timer T2 is a type-B timer but
does not utilize an interrupt in its operation. It is used to measure the
period of the output from the LTF device. The LTF output period is
inversely proportional to the intensity of the light striking its surface.

29

INPUT CAPTURE 1
It is connected to the output of the LTF sensor. It is setup to trigger on
each rising edge of its input. When the IC1 event occurs, an interrupt is
produce and the value of timer T2 is copied. An interrupt handler saves
this value. On the second input capture event, the period of the LTF can
be determined by taking the difference between this value and the saved
value. The period is used to compute a frequency which is proportional to
the intensity of the light measured.

SPI MODULE
The SPI module is enabled for use in communicating with the Microchip
MCP4822 serial digital to Analog converter IC. The SPI is setup in master
mode to have a 16 bit serial output at a clock rate of 8MHz. Since the
SPIDAC device has 12 bit resolution, the other 4 bits are used for
control. The SPI module sends LED intensity commands from the digital
controller to the DAC IC.

UART MODULE
A serial output from the system sends data at a rate of 115,200 bits per
second to the development computer with an 8 bit data size, 1 stop bit,

30

no-parity and no flow control. Since the data comes out of the system in
serial form, a special scope program was written and used to analyze
system operation during development. Using the SW1 input on the
development board, one of three diagnostic screens can be selected.

DIGITAL I/O
Ten pins were used as digital output and a single pin for a digital input.
They are identified below:

DIGITAL OUTPUTS
RB0 VIRon

Signal to the H-Bridge to control the IR light source. A


high state turns IR LED on, a low state turns IR LED off.

RB1 VRon

Signal to the H-Bridge to control the RED light source.


A high state turns the RED LED on while a low state
turns the RED LED off.

RB3 R/*W

Controls Read/Write input on the LCD display. A high


state sets display into READ mode while a low state
sets display to WRITE.

RB4 D4

LCD Data input line Bit 4

RB5 D5

LCD Data input line Bit 5

31

RB6 D6

LCD Data input line Bit 6

RB7 D7

LCD Data input line Bit 7

RB9 PULSE

Diagnostic Bit used during development

RF4

Enable Line input for the LCD display.

RF5

RS

Register Select line for the LCD display. High state


selects the internal data register while a low state
selects the command register.

DIGITAL INPUT
RD8 SW1

Input connected to a momentary switch with pull-up


resistor on the development board. This switch is used
to toggle one of three data outputs from the serial port.
This was used during development and may be used for
diagnostics.

32

LED DRIVER CIRCUIT

H-BRIDGE
In reference to the schematic located in Appendix 6, the LED module is
driven by an H-Bridge.

This circuit uses a 9V decoupled supply to

deliver pulsed power to the LED's at variable drive currents.

BUFFER AMPLIFIERS
A Microchip MCP6002 dual op-amp package is used to drive the
bottom half of the H-Bridge circuit and isolate it from the SPIDAC. These
amplifiers along with the current feedback resistors R1 and R2 are used
to set the current in each branch of the H-Bridge circuit thus setting the
LED intensities. Element U4B controls the IR LED and U4A controls the
RED element.

SPI-DAC
A Microchip MCP4822, Digital to Analog Converter with SPI
interface and internal reference connects the dsPIC30F controller to the
buffer amplifiers.
This device takes a 12 bit command over the SPI link. The SPI is
setup for a 16 bit word transfer using an 8MHz clock. The bottom 12 bits

33

of the word are data and the upper nibble are control bits. One of these
control bits is used to select one of the two DAC circuits in the device.
DAC output A (pin 8) controls the intensity of the IR Led while DAC
output B controls (pin 6), the RED emitter.

DIGITAL CONTROL BITS


Two bits from the dsPIC30F device are used to switch the LED's
on and off. The upper half of the H-Bridge is controlled by output pins
RBO and RB1. These pins control transistor drivers Q2 and Q1 which
drive the PNP transistors in U2. Pin RB0 will turn on the IR Led while pin
RB1 will turn on the RED Led. The software will switch only one light
source on at a time. Below are the code segments for SPI initialization
and DAC Output.

LIQUID CRYSTAL DISPLAY


The system uses a 2 line by 16 character display to provide the
SPO2 data as well as the heartbeat information to the user. A HD44780U
Liquid Crystal Display was chosen to do the job because it is
inexpensive, robust and easy to work with. To reduce the number of I/O
pins required by the microcontroller, a 4 bit data bus was chosen. There

34

are three additional control lines that the micro has to supply to
communicate with the display. The 8 bit data is multiplexed into the
display from the micro using the upper nibble of the lower byte of PORT
B. One nibble is loaded at a time on the upper four pins of the display
bus (the display bus is an 8 bit bus but has both modes of operation).
See the attached code segment on the next page for details on how the
display is initialized and how data is written to the display.

R/*W INPUT
This is an input to the display that allows the software to select either a
read or a write operation. This application uses only writes to the display
and does not necessitate the use of the read function.

RS INPUT
This input to the display allows writing to either the DATA register or the
CONTROL register. When the input is low, Instructions can be written to
the control register. When the input is high, ASCII data can be written to
the display.

35

ENABLE
By applying a pulse on this input of about 50us, the data and control
bytes can be written to either the data or control registers respectively.

COMMUNICATION PORT
The communications port uses only a single direction of the UART
MODULE. It was used to collect data during the development of the
software and can also be used to monitor the heartbeat waveform from
both the IR and RED sensors if one wishes. Input RD9 which is
connected to SW1 on the demo board is used to toggle between three
different data output modes. More will be explained on this later.

The UART pin of the controller is connected to a MAX232 (EIA232 Driver/Receiver) manufactured by Texas Instrument. The IC
converts the output voltage level of the controller UART to those
necessary to connect to an RS-232 device. The output goes to the 9-pin
DB9 connector which may be wired to the RS-232 port of a computer.

The software sets up the UART MODULE to have the following parameters:
Baud Rate:

115200

Data Size:

8 bits

36

Parity:

None

Stop Bits:

One

Flow Control:

None

3. Measurement strategy
As discussed in the HARDWARE section of this paper, Timer T1
sets up a 5ms interrupt. The interrupt handler sets up a state machine
with two states and an initialization state that takes place in the main
program. The state machine has the following flow diagram:

STATE = -1
Initialization state
Executed in main program

Turn OFF both LEDs


Set DAC values
Initialize Timer T1

Interrupt T1 occurs

STATE = 0
The system waits for the next T1
interrupt 5ms later. During this
time, the IC1 interrupt gets center
stage. MEASURE is the state
counter for the IC1 interrupt.

Set PULSE = 0 (Diagnostic)


Set MEASURE = 0
Initialize Timer T2
Initialized IC1
STATE = 1

Interrupt T1 occurs

STATE = 1
After 5ms, the second T1 event
Occurs. The measurements have
Been taken and it is time to process
The data. This occurs during this
STATE

37

Set PULSE = 0 (Diagnostic)


Perform LP filtering
Perform HP filtering
Perform DC tracking
Set PULSE = 1 (Diagnostic)
Calculate AC signal Values
STATE = 0

In the main program, at a presetable number of samples, the


program runs the auto_adj() procedure which tunes the IR LED to match
the intensity of the RED LED. After this routine is executed, the STATE
counter is set to 1, and the beats goes on.

During STATE = 0, the T1 interrupt handler sets up the entry


point for the IC1 interrupt. The state counter MEASURE = 0. The RED
DAC is loaded and the RED LED is turned on. The IC1 interrupt will
occur on the rising edge of each and every LTF output pulse until the IC1
interrupt is disabled. The interrupt occurs twice for each emitter
measuring the PERIOD from the TLF device and calculating the
subsequent INTENSITY.

IC1 Interrupt Handler

MEASURE=0

Read IC1 buffer and save T0 = IC1BUF


MEASURE = 1

IC1 Interrupt Handler

MEASURE=1

Read IC1 buffer


Calculate RED period (the difference)
Compute Intensity for RED
Turn OFF RED Led
Turn ON IR Led
MEASAURE = 2

38

IC1 Interrupt Handler

MEASURE=2

Read IC1 buffer and save T0 = IC1BUF


MEASURE = 3

MEASURE=3

Read IC1 buffer


Calculate
IRInterrupt
period ((the
difference)
IC1
Handler
Compute Intensity for IR
Turn OFF IR Led
MEASURE = 0
Disable IC1
Disable T2

The STATE=1 of the T1 interrupt handler process the Low Pass


Filter, High Pass Filter and DC Tracking filter algorithms for both the
RED and IR sources[12].

LOW PASS FILTER


The 4th order LP algorithm in Z-domain is:
Fc = Low Pass Cutoff Frequency
Ts = Sample Rate

Wc 2Fc
C

1
WcTs
tan

256 26
500

34118
10000

D0 C 4 MC 3 NC 2 MC 1
D1 4C 4 2 MC 3 2 MC 4
D2 6C 4 2 NC 2 6
D3 4C 4 2 MC 3 2 MC 4
D 4 C 4 MC 3 NC 2 MC 1
39

N0 1
N1 4
N2 6
N3 4
N4 1
N 0 N 1 Z 1 N 2 Z 2 N 3 Z 3 N 4 Z 4 Y ( z )
H L ( z)

X ( z)
D0 D1 Z 1 D2 Z 2 D3 Z 3 D4 Z 4
The coefficients of the above function are determined in the main
program while the algorithm is executed after each set of Red and IR
samples are acquired in the interrupt handler for the T1 timer. This
occurs every 10ms [12].

DIFFERENTIATOR (HIGH PASS FILTER)


The differentiator is used by the peak follower algorithm to detect an edge
for timing of the heart wave [12].

Fh = High Pass Cutoff Frequency


Ts = Sample Rate

Wc 2Fh

K1

1
1 C

WcTs
C tan

2
K2

1 C
1 C

40

H H ( z)

Y ( z ) K 1 1 Z 1

X ( z ) 1 K 2 Z 1

DC TRACKING FILTER
Averages the Low Pass output and removes the AC signal. The output of
this algorithm is the DC level for each color LED [12].

1
256

H T ( z)

Y ( z)
K

1
X ( z ) 1 Z (1 K )

PEAK FOLLOWER
The peak follower algorithm uses the differentiated Low-pass filter
output sequence from the IR sensor as its input. The idea is to allow the
Peak variable to follow these differentiated peaks and decay at a very
slow rate. It works much like a filter capacitor in a power supply. It
attempts to follow the peaks and decays very slowly producing an
envelope that can be used to time the heart-wave that is produced by the
IR signal. This IR signal was chosen because its amplitude is greater

41

than that of the RED source and it doesnt vary as much as the RED
signal does [12].

HEARTBEAT/SpO2 CALCULATION
The peak follower is used to time the period of the heart wave and
also set up a period for the RMS calculation of the AC portion of the signal.
In the T1 handler, the AC signal is calculated by taking the difference
between the Filtered Sensor output and the DC level (from the DC tracking
algorithm)[12]. For example, the AC signal from the RED sensor is:

Rdiff = Rfilt R_DC;


The RMS value is calculated for each sample of the Rdiff and
accumulated using the statement:
Rsum = RDiff*RDiff + Rsum;
After the period is detected, the RMS value is calculated and Rsum set
back to 0:
Rms = sqrt(Rsum/period);
Rsum = 0;
Once the RMS value is calculated, the SPO2 is calculated by finding the
ratio R;
R = Rrms/RDC / Irrms/IRDC
Then,

SpO s 10 .002 R 3 52 .887 R 2 26 / 817 R 98 .293

42

SIMPLE MOVING AVERAGE FILTER


A simple moving average filter is used to smooth the heart-rate and the
SpO2 calculations over 10 samples. It follows the general form:
Yk Y K 1

X K X K 1
N

Where,

N = 10

Fig. 7: Above shows the results of the differentiator (black) and the peak follower envelope (blue) on the IR waveform (Red)

43

CHAPTER IV
RESULTS

1. Achievement
Base on the above methodology, a prototype of pulse oximeter was
successfully built. The prototype was designed with fully functional
characteristics of a pulse oximeter and worked well. The hardware is
contained of a printed circuit board (PCB), a 16x2 LCD, a simple
amplifier circuit and a Nellcor ds-100A SpO2 sensor. In order to
implement

this

circuit,

an

algorithm

microcontroller was also designed.

Schematic Diagram

44

for

the

dsPic30F3013

Fig. 8: The schematic diagram

R1
10K

VCC

P2

U1A
5
9
4
8
3
7
2
6
1

TL082

P1

TO BOARD-M

3
2

R3
100K

C1
100nF

5
9
4
8
3
7
2
6
1

TO SENSOR-FM
R2
100K

Fig. 9: The schematic and layout of amplifier circuit

45

PCB Layout

Fig. 10: The top layer of PCB

Fig. 11: The bottom layer of PCB

46

Fig. 12: The finished prototype

2. Implementation
When the system is powered up, there will be a brief prompt on
the display as that shown below in figure 10.

Fig.13: The prompt at the beginning of the test

47

After the unit has gone through its initial power up, it will display
the prompt "WAITING. . .". Place one of our index fingers into the sensor.
Figure 11 shows the sensor that has already been fitted to my friends
finger. Once the controller detects the placement of the finger, it will
begin taking measurements. After about 10 seconds, we will have a
stable reading of both our heart-rate (BPM) and our blood oxygen
saturation (SPO2). Below is a photograph of the system measuring my
heart-rate at 80 beats-per-minute and my SpO2 at 99%. The heart-rate
was up slightly because of the success of the project.

Fig. 14: The result of my SpO2 test

48

3. Discussion
After several months of working with my teacher and my friends, I
have consequently finished my project to complete my graduate thesis. A
prototype of pulse oximeter was successfully built with its merits and I
am really happy to see it function well. However, nothing is perfect and
my product is the same, and there are still shortcomings in my design.
The displayed values of heart-rate and SpO2 are not as exact as the
commercialized products. There are some gradients in the result but the
differences are still small and it will not strongly effect the diagnosis of
the doctor. My prototype would be better if I made the sensor myself. At
the beginning of the project, I have intended to build the sensor with a
LED module and a LTF photo-detector. However, I have failed to finish
my intended plan because of limited time for the thesis and my
difficulties in ordering the needed components from the USA. I have
really been disappointed about this incompletion.

In the future, there are several things needed to finish my project.


The most important thing is that we need to design a hand-made sensor
that can be compatible with the PCB I have designed so that we do not
have to buy the Nellcor sensor and reduce the cost for the product.

49

Furthermore, if we can build an interface between the oximeter and the


computer, it is easier for the doctor to manage the status of patients.
Bluetooth and wireless communication are the most popular solutions
that we can consider.

50

CHAPTER VI
CONCLUSION

In conclusion, the pulse oximeter is a medical device that is used


to measure oxygen saturation (Sp02) and heart-rate non-invasively. The
basic principle of a pulse oxymeter is based on the measurement of red
and infrared light absorption. Infrared is absorbed more by oxygenated
hemoglobin and red transmitted, by opposition to the deoxygenated cells.
With

the

availability

of

Microchip

dsPic30F

microcontroller

and

supporting components, we would be able to successfully build a


prototype of pulse oximeter that functions well. Therefore, we can think
about a simple, reliable and affordable product that can go into massproduction and is going to be utilized in medical centers, clinics and
nursing homes while we do not have to buy the available commercialized
products.

51

REFERENCES

1. Jubran A: Pulse oximetry. In: Tobin MJ (ed). Principles and Practice of Intensive
Care Monitoring. New York: McGraw Hill, Inc.; 1998. pp. 261287.
2. Hill Aileen , RRT : Recent Developments in Pulse Oximetry, RT The Journal
for Respiratory Care Practitioners, Oct/Nov 2000, p1
3. Tremper KK, Barker SJ: Pulse oximetry. Anesthesiology 1989, 70:98108,
25:155175.
4. Wukitisch MW, Peterson MT, Tobler DR, Pologe JA: Pulse oximetry: analysis of
theory, technology, and practice. J Clin Monit 1988, 4:290301.
5. Townsend, Neil: Medical Electronics, Michaelmas Term, 2001
6. Emergency Care Research Institute: Pulse oximeters. Health Devices 1989,
18:185230.
7. Alexander CM, Teller LE, Gross JB: Principles of pulse oximetry: theoretical and
practical considerations. Anesth Analg 1989, 68:368376.
8. Jeff B, Light-to-Frequency Conversion. Circuit Cellar 2004, pp.1-31.
9. Kamat Vijaylakshmi : Pulse Oximetry, Indian Journal of Anesthesia, Aug 2002,
p.261
10. Oximeter.org, Principles of Pulse Oximetry Technology, 2002,
www.oximeter.org/pulseox/principles.htm.
11. TAOS, Inc., Pulse Oximetry, www.taosinc.com/downloads/pdf/pulse.pdf.
12. Microchip.com, PO Box - Utilizing a Microchip dsPic30F2012 digital signal
controller, 2007,
http://www.microchip.com/wwwcategory/TaxonomySearch.aspx?show=Applicati
on%20Notes&ShowField=no

52

APENDICES

APPENDIX 1
TRANSMITTANCE

Materials can absorb electromagnetic radiation such as light. The definition


of transmittance through a material with concentration C is:

Io

I
Io

Concentration

where:

I = Output Intensity
Io = Input Intensity

ABSORBANCE

The absorbance by the material is defined as the log of the inverse of


transmittance:

1
A log
T
log(1) log(T )
log(T ) APPENDIX

I 2
A log
Io
53

BEER-LAMBERT LAW

A
Io

IiIiz
Iz Iz

I
Iz-dI

dZ, dI
B

The Beer-Lambert model can be derived for a material of absorbing


species. First consider the absorption dI, of an infinitesimal cross-sectional
slab of material of thickness dZ. The total length of the path of the material
is B with a total cross-section of A. The intensity is Io at Z=0 and I at the full
length of the material. The intensity at Z is Iz. The intensity after the
absorption dI is (Iz dI). Consider a molecular cross section of (cm2). If
there is a concentration of N (mol/cm2) absorbers in this molecular cross
section. Then the total absorbed light on this infinite cross-sectional slab
would be:
* N * A * dZ

(cm2) * (# mol/cm3) * (cm2) * (cm) = #mol*cm2

The fraction of photons absorbed across this surface area A is:

54

* N * A * dZ / A = * N * dZ

(#mol)

The fraction of the photons absorbed across dz becomes,


- * N * dZ = dI/Iz

Integrating both sides,


I

1
0 I dI N 0 dZ
ln( I ) ln( Io) NB

I
ln NB
Io
Remember that absorbance is equal to the left side of the equation, and then
the equation becomes:

A = NB
Since N (molecules/cm3) *(1 mol/6.023x1023 molecules) * 1000 cm3/liter = c
(mol/liter)
and 2.303 * log(x) = ln(x)
I
20
* (6.023x10 / 2.303) * c * b
Io

then, log

or,

A bc

55

where, = * (6.023 x 1020/2.303) = * (2.61 * 1020)


So,

I
A log
bc
Io

56

Beer-Lambert Law

APPENDIX 3
OXYGEN SATURATION
Hemoglobin is the primary component that carries oxygen from the
lungs to the rest of the body via passages called arteries, veins and
capillaries. It is a protein that is bound to the red blood cells. Oxygen is
chemically combined with the hemoglobin inside of the red blood cells and
makes up nearly all the oxygen present in the blood.

The absorption of visible light at different frequencies by


hemoglobin varies with oxygenation as can be seen in Figure 1. Two forms
of the hemoglobin molecule are oxidized (HbO2) and reduced hemoglobin
(Hb).

The oxygen saturation is defined, as SaO2 (SpO2) and s a function of


the concentration of the two forms of hemoglobin in the blood:

SaO 2

Ko
Ko Kr

Where,
Ko = Concentration of HbO2
Kr = Concentration of Hb

57

Arterial SpO2 is a parameter measured with Oximetry and is


normally expressed as a percentage. Under normal conditions, arterial blood
is 97% saturated while venous blood is 75% saturated.

The wavelength range 600nm 1000nm is the range for which there
occurs the least amount of attenuation of light by body tissue because tissue
and pigmentation absorb blue, green and yellow light and water absorbs the
longer infrared wavelength.

The Oxygen Saturation (SPO2) of the arterial blood may be


determined by measuring the transmitted light through the fingertip or
earlobe at two different wavelengths and then compared ratiometrically. The
two wavelengths that best suit this type of measurement are RED (660nm)
and INFRARED (940nm).

According to the Beer-Lambert law there is a linear relationship


between the absorbance and concentration of each component of the blood at
that particular frequency of light. Also, the intensity of the light will
decrease logarithmically with the path length.

58

Suppose we had a source of length Z with incident light intensity Io


and transmitted intensity of I. If there were two species of absorbers called
HbO2 (RED) and Hb (Blue) with the concentrations Ko and Kr respectively.
These are analogous to oxygenated hemoglobin and reduced hemoglobin.
Now supposed we examine the specimen using two light sources 1 and 2.
Using Beer-Lambert law, at each wavelength, we get:

At (1)

I 1 I 0110 ( O 1 K O r 1 K r ) Z

At (2 )

I 2 I 02 10 ( O 2 K O r 2 K r ) Z

Where:
K0 = concentration of hemoglobin
K1 = concentration of reduced hemoglobin
o1 = absorption coefficient of HbO2 at 1
r1 = absorption coefficient of Hb at 1
o2 = absorption coefficient of HbO2 at 2
r2 = absorption coefficient of Hb at 2
Writing both equations in log form:

I
log 1
I 01
I
log 2
I 02

( O 1 K O r 1 K r ) Z

( O 2 K O r 2 K r ) Z

We can express both functions as the ratio (R).

59


log

log

I1
I 01
I2
I 02

O1 K O r1 K r
O2K O r2K r

O1 K O r1 K r
O2K O r2K r

Then solving for Kr,

Kr KO

R O 2 O1
r1 R r 2

Substituting this into the equation for SaO2 yields:

SaO

where:

R ( r 2

R r 2 r1
O 2 ) ( r 1 O 1 )

I
log 1
I 01
R
I
log 2
I 02

60

Below is a graph of the above equation showing the theoretical


values. The second trace shows an actual calibration using arterial blood
samples. This is the curve for the HP M1190A probe. The difference has
been found to be caused mainly by scattering effects and non-ideal light
sources.

Using Matlab, analyzing the graphical data above, data from the real
calibration curve shown above was extracted into vector form. The data was
input into Microsoft excel and fit to a 3rd order equation. It is this equation
which expresses SpO2 = f (R) that was used in this project. The graph of this
data and the fit equation are shown below.

61

62

APPENDIX 4
BLOCK DIAGRAM

63

You might also like