Arduino Pulse Oximeter: by Nate and Ben
Arduino Pulse Oximeter: by Nate and Ben
Re c o mme n d e d To o ls a n d Equipme n t Dremel Tool with Routing and Cutting bits (You can get by
with a utility knife, but not as quickly)
Heat Gun
Pliers, Wire cutters, Wire Strippers, etc.
Soldering Iron with a Fine Tip
https://vimeo.com/413374861
In order to understand how to build a pulse oximeter, Io = Incident light (before added sample)
it is rst necessary to understand the theory behind I = Incident light (after added sample)
its operation. The principle mathematical equation = Molar absorption coe cient (function of
used is known as Beer-Lambert's Law. wavelength and substance)
b = Path length of light
Beer-Lambert's law is a well-used equation that c = Concentration of substance in sample
describes the relationship between the concentration
of a substance in a solution and the transmittance (or When measuring concentrations using Beer's Law, it's
absorbance) of light passed through said solution. In convenient to select a wavelength of light in which
a practical sense, the law says that increasingly the sample absorbs most. For oxygenated
greater amounts of light are blocked by increasingly hemoglobin, the best wavelength is about 660nm
greater particles in a solution. The law and its (red). For deoxygenated hemoglobin, the best
components are described below. wavelength is about 940nm (Infrared). Using LEDs of
both wavelength, the relative concentration of each
Absorbance = log10(Io/I) = bc can be calculated to nd a %O2 for the blood being
measured.
Where:
Our device uses a dual LED (two LEDs on the same chip) for the 660nm and 940nm wavelengths. These are
alternated on/o , and the Arduino records the result from the detector on the opposite side of the nger from the
LEDs. The detector signal for both LEDs pulses in time with the heartbeat of the patient. The signal can thus be
divided into two portions: a DC portion (representing the absorbance at the speci ed wavelength of everything but
the blood), and an AC portion (representing the absorbance at the speci ed wavelength of the blood). As speci ed
in the Beer-Lambert section, Absorbance is related to both of these values (log10[Io/I]).
Substituting in the Beer Lambert Equations, solved for concentration, the result is a very complex fraction of
fractions. This can be simpli ed in a few ways.
Arduino Pulse Oximeter: Page 3
1. The path length (b) for both LEDs is the same, causing it to drop out of the equation
2. An intermediate ratio (R) is used. R = (AC640nm/DC640nm)/(AC940nm/DC940nm)
3. Molar Absorption coe cients are constants. When divided, they can be replaced with a generic t
factor constant. This causes a slight loss in accuracy, but seems to be pretty standard for these
devices.
The Arduino Nano required for this project is known as a microprocessor, a class of devices that continuously runs a
set of preprogrammed instructions. Microprocessors can read inputs to the device, do any required math, and write
a signal to its output pins. This is incredibly useful for any small-scale project that requires math and/or logic.
GitHub is a website that hosts repositories, or spaces for collections of sketches for a project. Ours is currently
Arduino Pulse Oximeter: Page 4
stored in https://github.com/ThatGuy10000/arduino-pulse-oximeter. This allows us to do several things.
1. You can download the code for yourself and run it on your personal Arduino
2. We can update the code at any point without changing the link here. If we nd bugs or decide to do
math di erently, we will push out an update that will be accessible here immediately
3. You can edit the code yourself. This will not cause an immediate update, but you can create a "pull
request" that asks if I want to include your changes in the master code. I can accept or veto these
changes.
For any questions on GitHub or how it works, see this tutorial published by GitHub itself.
As a device, this is about as safe as it can get. There is very little current, and nothing is operating over 5V. In fact,
the circuit should be more scared than you are.
In the construction process though, there are some key things to keep in mind.
Knife safety should be a given, but some of the parts have a very organic shape which can make it
tempting to hold them in a spot where your ngers really shouldn't be. Just be ca re f ul .
If you own a soldering iron, heat gun, or a dremel tool, I assume you should know how to use them
properly. Regardless, take the necessary precautions. Do no t work through frustrations. Take a
break, clear your head, and get back to it when you are more stable. (Safety information for the
soldering iron, heat gun, and dremel tools can be found in the links)
As you test any circuits or move things around on a breadboard, it's best to turn everything o . There
really isn't a need to test anything with live power, so do no t risk causing shorts and potentially
damaging the Arduino or other components.
Be careful when using the electronic components in and around water. Wet skin has a signi cantly
lower resistance than dry skin, which can cause currents that exceed safe levels. Further, electric
shorts in board components can cause signi cant damage to components. Do no t operate
electrical equipment near liquids.
WARNING : Please do not try to use this as a true medical device. This device is a proof of concept, but it is NO T a
perfectly accurate instrument that should be used in the care of potentially sick individuals. There are plenty of
cheap alternatives you can buy that provide a much higher level of accuracy.
As the project developed, there were a number of lessons learned. Here are a few bits of advice:
We'll start by making the two circuit boards that go into the design. I used a two-sided copper clad board and
Dremel tool to make these by hand, which was not perfect, but it worked. If you have the resources I highly
recommend drawing a schematic and having this milled with a machine, but it is do-able without.
Here is the circuit I put on the rst board, minus the capacitor. It's best to keep a low pro le, since this is going to go
Arduino Pulse Oximeter: Page 6
around your nger inside of the oximeter. The photodetector, in this case, is a photodiode which means that it is
electrically similar to a diode, but will generate current for us based on the light level.
I decided to start by printing and cutting out a scale This is available at the vendor's sight for the
model of the recommended footprint. Because I'm photodetector.
just eyeballing my cutting, this gave a good reference
before I took the photodetector out of its package.
This part is a bit tricky. I've marked the orientation of the board is liquid, it should connect with the chip
the photodetector here in white. I put a tiny bit of pretty quickly if you have enough solder on. You
solder on the bottom of each pin on the chip, put should also solder the 100k resistor a 3-pin header
some solder on the circuit board, and then held the to the same side of the board.
chip in place as I heated the solder on the board. You
don't want to heat it up too much, but if the solder on
Here is the schematic for the second board. This one is a bit more di cult, but luckily we are warmed up from doing
the last one.
Because two opposite corners of the LED chip both into the hole and soldered on both sides. I cut o as
need to be connected, we need to use the backside of much excess wire as I could and did a continuity check
the board to connect them. When we electrically to see that there was near-zero resistance between
connect one side of the board to the other, that's these two areas. Unlike the last board, this vias will
called a "via." To make the vias on the board, I drilled a not need to be outlined on the backside because we
hole in the two areas I've marked above. From here, I want them to be connected.
put the leads of the resistor on the previous board
To solder the LED chip, follow the same procedure as marked what numbers attach at which points. Once
the photodiode, adding solder onto each pin and to you've soldered it on, you should again use the diode
the surface as well. The orientation of the part is test setting on the multimeter to see that both sides
tough to get right, and I recommend following the are attached properly. This will show you which LED is
datasheet to get your bearings. On the underside of the red one too, since it will light up a little when the
the chip, "pin one" has a slightly di erent pad, and the multimeter is connected.
rest of the numbers continue around the chip. I've
Next, solder on the resistors and the 3-pin header. If you happened to have the LED chip ipped 180° in the
previous step, you are actually still ne to continue. When you put on the resistors, make sure the 150 resistor
goes on the red side, and the other side has the 180
On the backside, cut around the resistors like before to avoid them shorting with the via. Cut out the board, and do
one last sweep over with the continuity tester on the multimeter, just to double check that nothing became
shorted accidentally.
After all of the ne soldering work I did, I wanted to oximeter. I tested out a few things I had lying around,
make sure nothing would knock the components o and this industrial strength adhesive worked well. I
while the oximeter was being used, so I decided to started by covering the backside and letting it sit for a
"pot" the boards. By adding a layer of something non- few hours.
conductive, all the components will stay in place
better and will provide a atter surface for the
I only had stranded wire on hand, so I decided to use each wire to a pin on the header, and if you have it I
some male 3-pin header to create some cables. If you would coat each strand with some heat-shrink. M a ke
have it on hand, it's much simpler to just use solid s ure y o u ha v e t he w ire s in t he s a m e o rde r
gauge wire for this without soldering. It does help to w he n y o u co nne ct t he he a de r o n t he o t he r
twist the wires together though, since that prevents s ide .
snagging and just generally looks neater. Just solder
Because of the way I connected these boards to cables, I wanted to make sure I never connected them wrong, so I
color coded the connection with paint markers. You can see here which pin is which connection and how my color
coding works.
The enclosure for the oximeter I made with L200 foam and a piece of PVC pipe, but you can certainly use whatever
foams and/or plastics you have lying around. The PVC works great because it is already nearly in the shape we want.
Using a heat gun on PVC for shaping is simple, but can take some practice. All you need to do is apply heat to the
PVC until it starts to bend freely. While it's hot, you can bend it into just about any shape you want. Start out with a
Arduino Pulse Oximeter: Page 14
section of PVC pipe just wider than the boards. Cut one of the sides, and then just put some heat on it. You'll want
some gloves or some wood blocks to be able to maneuver the PVC while it's hot.
As you bend the loop in, cut o some any excess PVC. somewhere to grab in order to open the oximeter to
Before you have it completely bent in, use a knife or put it on your nger. Don't worry about the tightness
dremel tool to carve out a notch on one side and the for now, since you'll want to see how it feels once the
edges of the opposing side. This forked shape allows foam and boards are in.
you to close the loop further. It also gives you
Next, cut a piece of foam to the width of your PVC, and to a length that will fully wrap around the inside loop.
To keep the board from digging into your nger, it's under the foam. At this point, you can put the boards
important to recess them into the foam. Trace the and foam into the PVC and test out the t in the
shape of the boards into the foam and use a pair of actual PVC and then on your nger. If you do this start
scissors to excavate the material. Instead of clearing to lose circulation, you will want to use the heat gun
the entire area around the headers, add some slits on again to open up the enclosure a little bit more.
the side connectors can pop out but still be slightly
We're going to start putting it all together now! To start, just throw some epoxy/adhesive into the holes you just
made in the foam and put the boards into their little homes. I used the same adhesive I used to pot the boards
earlier, which seemed to work just ne. Make sure you let this sit for a few hours before moving on.
Next, I lined the inside of the PVC with the same glue and carefully put the foam inside. Wipe the excess and put
something inside for the foam to chomp on. My utility knife worked well, and it really helps to push the foam
against the PVC to get a strong seal.
At this point the actual sensor is completed, but of course we want to use it for something. There isn't much to
connect to the Arduino, but it's incredibly important not to wire anything backwards or you will very likely damage
things on the circuit boards. M a ke s ure po w e r is t urne d o w he n y o u a re co nne ct ing t he circuit s (It
really is the safest way to avoid problems).
The capacitor from the signal to ground does wonders on the noise. I didn't have a wide selection, so
I used the "dad's junk bin special," but if you have variety then go for something around 47nF or less.
Otherwise you might not be able to have a fast switching speed between the red and IR LEDs.
The resistor going into the photodetector cable is a safety thing. It isn't necessary, but I was scared
that while handling the breadboard circuit I might accidentally short something and botch the
whole project. It won't cover every accident, but it just helps to have a little more piece of mind.
As stated in the preparation step, the code for this device can be found in our GitHub repository. Simply: