Close

Algorithm development in progress

A project log for uOxy - open source pulse oximeter

An open source oximeter device for measuring SpO2

ultimate-roboticsUltimate Robotics 06/18/2020 at 18:571 Comment

Algorithm development process has started :) Some part of the work is done, and we would like to share it (further progress is a bit delayed since we switched to other projects for now).

On the firmware side, everything is relatively simple - you need to turn on red, then infrared LEDs, then turn off both, and measure signal levels in these states. The only complication is that there is a switching noise, so measurements have to be done with half-millisecond delay after the switch, when the signal has already stabilized. Processing of the measured signal is more complicated. First of all, signals have a large constant component: the variation associated with the pulse is only about 1% of the signal value, and the noise is quite significant relative to this variation - but not too high, so simple smoothing solves this problem well. Then on these signals you need to find the local minimum and maximum points, which sounds simple, but there is a catch: the signal as a whole often goes up and down due to a number of factors, and a simple minimum / maximum in the interval will not produce anything useful. But an adaptive algorithm can track the average value and speed of change in each point, and produce quite a stable output. That is shown on the video - small triangles mark the points that the algorithm has identified as local extremums.

Then the real fun begins. This method allows to measure both absolute value and signal variation in each channel, so in theory the SpO2 level is easily obtained from the ratio of these values (it will need to be calibrated and all that, but still it should be simple). And this sounds really logical: the relative absorption in the red and infrared ranges changes with change in oxygen saturation, so the ratio of these values should clearly indicate it...

Well, it really should. The problem is, it doesn’t :) We don’t really have an oxygen deprivation chamber for testing, so for now we simply are holding our breath for lowering SpO2 at some point - but the ratio behaves in a very strange way. In some cases it reacts perfectly. In some - it doesn’t react at all, or only a bit and in a wrong direction :) Moreover, this does not change from case to case, but depending on the conditions - in some conditions it works every time, in others it does not work every time, and for now it is completely unclear why.

So, well, yes - work in progress

Discussions

the_3d6 wrote 04/18/2023 at 23:17 point

Not really an update (we postponed this project until better times) but an important comment: strange SpO2 behavior was caused by problem with my blood vessels )) So the hardware part and algorithm are likely ok, and SpO2 in my hands indeed behaves in a strange way in certain conditions - should have tested it on ears!

  Are you sure? yes | no