Personal Page of DM3MAT

pulseOxi - A simple and cheap homebrew USB Pulse Oximeter

An pulse oximeter is a relatively simple device. It uses the property of hemoglobin to change its absorption spectrum around 660nm (red) and to some lesser degree around 940nm (infrared) when saturated with oxygen. This change in the absorption spectrum can therefore be measured indirectly by measuring the amount (intensity, brightness) of red and infrared light being transmitted through or back-scattered from e.g. a finger.

The absolute amount of light that gets detected, however, depends on many factors, including the sensitivity of the detector (photo diode), the light source (LEDs), how the detector and sources are fixated on the skin and, of course, on physiognomic properties of the finger. These dependencies turn the measurement with a single light source virtually impossible. Many of these influences, however, affect light of all wavelengths. Hence it is possible to reduce these influences on the measurement by measuring the brightness of light of more than one wavelength. The oxidation of hemoglobin changes its absorption at different wavelengths differently, hence using two light sources with different wavelengths allows to cancel out the influences which are wavelength insensitive. This "trick" then allows to measure the oxidation of the hemoglobin by measuring the change in the difference of the intensities at these two wavelengths.

The hardware

For the circuit, two LEDs are used as light sources. One red led (around 645nm) and one infra red (IR, 900nm) led. The intensity of the transmitted light is then measured using a photo diode. The current through this diode is then converted to a voltage using a operational amplifier (opamp). The voltage signal is then sampled using one of the analog/digital converters (ADCs) of the ATtiny45. By switching the LEDs on and off (also controlled by the ATtiny), the intensity difference can be computed, representing the relative oxidation level of the hemoglobin. For more details on how to construct a pulse-oximeter, consider the AN4327 application node by NXP.

Schematics of the USB pulse-oximeter.
The circuit of the USB pulse-oximeter just consists of a transimpedance amplifier and the ATtiny MCU.

This circuit is very reduced. It was designed as a USB dongle without using any SMD parts. Hence many parts usually enhancing the circuit stability and reliability have been omitted and should be added when a larger form factor is chosen. For example, I omitted:

Given the simplicity of the circuit, the results are surprisingly good.

Circuit of the back-to-back LEDs.

Please note that the LEDs are driven directly by the digital outputs of the ATtiny. They are able to deliver (only) about 20-30mA. Hence choose the LEDs and their series resistors accordingly. The circuit above does not include the series resistors. They are connected directly to the LEDs at the clip. The single LEDs are driven by ATtiny in a H-bridge way. That is, one of the LED pins acts as a source and one as a sink. This allows to drive the LEDs with two wires only but does not allow for driving them both simultaneously. Hence the LEDs must be connected to the ATtiny like shown in the circuit above.

The client software

The client software provides a convenient Qt5 GUI application using QCustomPlot for potting and libusb to interface the pulse oximeter hardware.

Screen-shot of the client application in action.
The client application in action, showing the relative saturation level and pulse rate in the top plot, as well as the actual measured pulse signal in the bottom plot.

The upper half shows the (approx.) SpO2 level (relative oxygen saturation, blue line) together with an estimate of the pulse rate in BPM (red line). The smaller bottom plot shows the pulse signal obtained for the IR channel (blue line) and red channel (red line) from which the pulse rate gets estimated. With the current implementation, the baseline and AC signal (deviance from the baseline) as well as the amplitude of the AC signal are obtained using sinc-convolution filters. This implies a short delay (about 5s) between the actual measurement and the display.

Features

Download/Sources

The sources and schematics can be found on my GitHub page.

License

Pulse - A simple pulse oximeter. (c) 2015 Hannes Matuschek, dm3mat [at] darc [dot] de

The hardware is licensed under Creative Commons BY-SA 4.0 and the software under GPL 2.0+ (see below).

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

Best & 73,
Hannes, DM3MAT