GCY / Pulse-Oximeter-with-MAX3010X

This project is MAX3010x library for STM32F4
MIT License
27 stars 10 forks source link
biomedical biomedical-engineering biomedical-signal-processing max30100 max30102 oximeter pulse-oximeter stm32f4 stm32f407g-discovery wxwidgets wxwidgets-applications

Pulse-Oximeter-with-MAX3010X

This project is MAX3010x library for STM32F4, currently supported MAX30100、MAX30102.
The Pulse Oximeter Monitor is a simple PC-Host tool for PPG signal used in pulse oximetry for the computation of oxygen saturation(SpO2).

MAX30102

USE

1. Pulse Oximeter Monitor Compile:

2. Build stm32f4 project :

First, select MAX3010x type.

 #define _MAX30102_
//#define _MAX30100_

Demo:


Audi R8


Near-Infrared Rpectroscopy (NIRS) measure oxygenation in a whole blood

The aim of pulse oximetry is to measure the percentage of oxygenated hemoglobin (HbO2) to the total hemoglobin (Hb) (oxygenated plus deoxygenated) in the arterial blood – this is referred to as SpO2. Oxygenated hemoglobin in the blood is distinctively red, whereas deoxygenated hemoglobin in the blood has a characteristic dark blue coloration. measures light absorbance at one wavelength (or more wavelengths) where there is a large difference between Hb and HbO2 and at another wavelength (or more wavelengths) to quantify oxygen saturation

Absorption spectroscopy – oxygen saturation Biomedical Photonics Handbook, Figure 29.2

For SpO2 measure the ratios between our two readings(IR and RED), on base level their DC levels should be nearly identical.

MAX30100 adjustment strategy (step 0 to 15 = 0mA to 51mA):

MAX30102 adjustment strategy (step 0 to 255 = 0mA to 51mA): decay_coeff = adjustment decay rate. decay_counter = count(ordinal) of adjustment. decay_factor = exp(decay_coeff * decay_counter);

If decay_coeff or RED_LED_CURRENT_ADJUSTMENT_NS too small, it will result in a lot of oscillation.

Adjustment Strategy

Finally, the normalized R/IR “ratio of ratios” can then be related empirically to SpO2.

The ratio R between these two wavelengths is defined with the following equations:
R = (red_ac/red_dc) / (ir_ac/ir_dc)

Or it can also be Beer-Lambert Law:
R = log(red_ac) / log(ir_ac)

Linear Regression model of SpO2 = a + b * R-ratio

Note:you’ll need to calibrate the model of computing SpO2.

Reference:

MIT License

Copyright (c) 2018 GCY

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.