oxullo / Arduino-MAX30100

Arduino library for MAX30100, integrated oximeter and heart rate sensor
GNU General Public License v3.0
192 stars 134 forks source link

Big problem - cannot use this library in any serious project (big pulse delta or showing zero or showing pulse without finger) #70

Open DarkDaemon1 opened 4 years ago

DarkDaemon1 commented 4 years ago

Troubleshooting checklist

Description of the issue

When I add delay more than 30ms in loop with pox.update(), I get wrong pulse data with big delta or zero data. When I add delay more than 80ms in dump function with 1s perion, I get phantom pulse data without finger. So, it is not possible to use this library in any serious project with other functions, which take a lot of processor time. Anyone know the solution?

Heart rate:53.04bpm / SpO2:93% Beat! Heart rate:56.98bpm / SpO2:93% Beat! Beat! Heart rate:83.81bpm / SpO2:93% Beat! Heart rate:95.21bpm / SpO2:93% Beat! Beat! Heart rate:67.57bpm / SpO2:93% Beat! Heart rate:65.02bpm / SpO2:93% Heart rate:65.02bpm / SpO2:93% Beat! Heart rate:57.93bpm / SpO2:93% Beat! Heart rate:38.50bpm / SpO2:93% Beat! Beat! Heart rate:104.25bpm / SpO2:93% Beat! Heart rate:73.49bpm / SpO2:95% Beat! Heart rate:64.13bpm / SpO2:95%

Output from MAX30100_Tester example

Initializing MAX30100..Success Enabling HR/SPO2 mode..done. Configuring LEDs biases to 50mA..done. Lowering the current to 7.6mA..done. Shutting down..done. Resuming normal operation..done. Sampling die temperature..done, temp=40.25C All test pass. Press any key to go into sampling loop mode

Details of my setup

DarkDaemon1 commented 4 years ago

I found solution, that increase time for other functions twice. I slow down sample rate to 50Hz.

I've added in MAX30100_PulseOximeter.h void setSamplingRate(SamplingRate sr);

in MAX30100_PulseOximeter.cpp

void PulseOximeter::setSamplingRate(SamplingRate sr)
{
    hrm.setSamplingRate(sr);
}

And then use pox.setSamplingRate(MAX30100_SAMPRATE_50HZ);

It is not perfect solution, but it fits to my project

iamDshetty commented 4 years ago

I have also seen this issue, its due to light from tubelight or CFL or LED light falling into Senosr.