An oximeter is a device that measures the amount of oxygen carried by a person's red blood cells. Oxygen provides energy for our bodies, supports the immune system, helps replace cells that break down, and more. Low blood oxygen levels can indicate certain health problems. These levels can also decrease as we age, so it can be helpful to monitor blood oxygen.
The conventional method for doing this is through an air blood gas (ABG) test, which is a blood test that measures oxygen, carbon dioxide, and acidity levels. Results from an ABG typically take a few hours.
Newer, more advanced techniques for testing the amount of oxygen saturation in the blood are currently in development. The most promising so far is through pulse oximetry, a non-invasive method by which a certain wavelength of light is emitted through the skin (usually this is a clip-on device that you put on your finger – just make sure you that is not in a tattoo, which would absorb some of the light).
A photodiode is used to measure the amount of light that is absorbed by the blood. This method can quickly detect even small changes in the efficiency with which oxygen is being transported throughout the body and has a small error rate of just two percent.
Small-scale oximeters are available that can be interfaced with low-cost controllers for do-it-yourself (DIY) projects. SparkFun Electronics offers an oximeter and heart rate monitor sensor, which comes mounted on a small board. Users just need to press a finger on the sensor module to take a reading.
Communication with an external controller is easily done with an I2C protocol, which is what we used in this project, together with the Arduino Nano. The I2C address for this sensor is set to 0x55 hex.
You'll notice that the Arduino Nano is tolerant of 3.3 volts and the oximeter above is the same, so this is ideal. There are two additional pins on the sensor: one is a reset and the other is a multi-function input/output (MFIO). The reset pin is active low and, as its name implies, resets the module.
The MFIO is an important pin because it puts the module into data acquisition mode. The module is composed of two ICs. One of them is the MAX3010, which is an oximeter and heart rate monitoring sensor. The second is a MAX32664, responsible for converting the data received from the other sensor.
The hub consists of a Cortex M4 microcontroller that receives data from the MAX3010 application conversion algorithm and sends this data to an external controller.
Circuit Diagram
The I2C interface pins are connected to the A4 and A5 pins of the Arduino Nano. Arduino digital pins 4 and 5 are used for reset and MFIO. The sensor board is powered by the Arduino's 3.3V power output pins.
The code
First, import the SparkFun sensor hub library. This will make this project much easier. You will also need to download the wire library to initialize the I2C interface.
Next, set the variables for the Arduino pins. The name and number of each pin must be passed to the hub library for proper initialization of the HUB IC (MAX32664). Then, a variable called body of type biological data has to be declared. This variable talks to the IC sensor (MAX3010).
In the configuration loop, start the Arduino serial monitor at 115,200 bps and activate the I2C pins. The hub should start and its status will be analyzed for possible errors (variable result ).
Initialize the sensor. The bioHub.configBPM function initializes the sensor module. A variable called MODE ONE is passed into the function, which is discussed below. After the sensor has properly initialized, the ideal is to allow it to rest for stabilization, which is why we inserted a delay of four seconds.
In the main loop, data is read through the sensor module. The sensor passes the data to the HUB, which prepares it (including heart rate, oxygen levels, etc.) for the external controller.
The external controller can place the read request on any instance.
There are two modes for this module in terms of HUB configuration. Each mode calculates a type of parameter(s).
Mode one
Mode two
The above parameters can be explored in more detail by visiting SparkFun's website .
Where to buy the parts?
- Arduino: mouse
- SparkFun oximeter: mouse