Coder Social home page Coder Social logo

max30100's People

Contributors

xcoder123 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

max30100's Issues

Possible to measure respiratory rate with Max30100?

Hey!

I just read your article Implementing pulse oximeter using MAX30100 and was wondering if you think you could use the Max30100 to measure a person's respiratory rate? Do you think inhalations and exhalations will register as variations in SpO2? Is that perhaps something you noticed when experimenting with the chip?

License

I'd like to publish my code for a Pebble smartstrap using the MAX30102 and I'm currently using a slightly modified version of your library. Would it be possible to license this library under some open source license?

Thanks
Jakob

GY-MAX30102

Hi,
can you help me with GY-MAX30102 sensor it is same board of MAX30100 but with MAX30102 sensor,
i try to use your library on Nodemcu 12E, where i connect SDA and SCL to default pins,
but i could not get any data or red led not running.
Best Regards,
Sayed

Error

I am running below,

#include "MAX30100.h"
#include <Wire.h>

MAX30100* pulseOxymeter;

void setup() {
Wire.begin();
Serial.begin(115200);
Serial.println("Pulse oxymeter test!");

//pulseOxymeter = new MAX30100( DEFAULT_OPERATING_MODE, DEFAULT_SAMPLING_RATE, DEFAULT_LED_PULSE_WIDTH, DEFAULT_IR_LED_CURRENT, true, true );
pulseOxymeter = new MAX30100();
pinMode(2, OUTPUT);

}

void loop() {
//You have to call update with frequency at least 37Hz. But the closer you call it to 100Hz the better, the filter will work.
pulseoxymeter_t result = pulseOxymeter->update();

if( result.pulseDetected == true )
{
Serial.println("BEAT");

Serial.print( "BPM: " );
Serial.print( result.heartBPM );
Serial.print( " | " );

Serial.print( "SaO2: " );
Serial.print( result.SaO2 );
Serial.println( "%" );

}
}

getting error

C:\Users\sim_t\AppData\Local\Temp\arduino_modified_sketch_125959\Example8_SPO2.ino: In function 'void loop()':
Example8_SPO2:19:3: error: 'pulseoxymeter_t' was not declared in this scope
pulseoxymeter_t result = pulseOxymeter->update();
^
Example8_SPO2:19:19: error: expected ';' before 'result'
pulseoxymeter_t result = pulseOxymeter->update();
^
Example8_SPO2:22:7: error: 'result' was not declared in this scope
if( result.pulseDetected == true )
^
Multiple libraries were found for "MAX30100.h"
Used: C:\Users\sim_t\Documents\Arduino\libraries\MAX30100
Not used: C:\Users\sim_t\Documents\Arduino\libraries\MAX30100-master
Not used: C:\Users\sim_t\Documents\Arduino\libraries\MAX30100lib
Not used: C:\Users\sim_t\Documents\Arduino\libraries\MAX30100_milan
exit status 1
'pulseoxymeter_t' was not declared in this scope

any one can help to fix?

GY-MAX30100 issue

I connected the purple oximeter to the Arduino Uno with the following connections:

VIN - 5V
GND - GND
SCL - SCL
SDA - SDA
INT - D2

But it shows me this:

13:16:02.851 -> Pulse oxymeter test!
13:16:02.851 -> BEAT
13:16:02.851 -> BPM: 8616.35 | SaO2: 92.01%
13:16:03.055 -> BEAT
13:16:03.055 -> BPM: 4313.73 | SaO2: 92.66%
13:16:03.089 -> BEAT
13:16:03.089 -> BPM: 1209.15 | SaO2: 92.74%

I used the example sketch from github.
How can I fix this?

Problem with sum getting undefined value for the DiffMean filter

First congrats for the tutorial and the explanations, I think your explanation and implementation is the best relating Oximeter functionality.
I still don't understand fully all the filters and signal processing that you used but with time maybe I will get it.

I forked your code in order to use it with my 30102 board and an ESP32 based board, I kind of massacred your driver part to make it work with my 30102 board.
As a suggestion it would have been much nicer if you could have split the driver and the DSP functionality, so that different drivers could be used to get the values from the sensor and then the DSP could process this independently.
With you permission and copyright I will try to make this so I can use some driver that is better written with your processing part.

I had a big problem when debugging, as the sum inside the meanDiff filter and the following butterworth filter was showing inf values when debugging, and I couldn't understand why, as the raw values from the sensor were OK.

After a lot of head banging, I found the cause to be that before the array is filled for the first time, you subtract from the sum the first 15 values, but only the first value is initialized, so for the other values is subtracting some random memory value which is huge and messes up the whole calculation.
I think I fixed this by simply not subtracting until the buffer is filled for the first time:

So this is not an issue as I already fixed it:

`float MAX30100::meanDiff(float M, meanDiffFilter_t* filterValues)
{
float avg = 0;

Serial.print("sum_before = ");
Serial.print(filterValues->sum);
if (filterValues->count == MEAN_FILTER_SIZE) {
filterValues->sum -= filterValues->values[filterValues->index];
}
Serial.print(" sum- = ");
Serial.print(filterValues->sum);
filterValues->values[filterValues->index] = (int32_t)M;
Serial.print(" value = ");
Serial.print(filterValues->values[filterValues->index]);
filterValues->sum += filterValues->values[filterValues->index];
Serial.print(" sum+ = ");
Serial.println(filterValues->sum);

filterValues->index++;
filterValues->index = filterValues->index % MEAN_FILTER_SIZE;

if(filterValues->count < MEAN_FILTER_SIZE)
filterValues->count++;

avg = (float)filterValues->sum / filterValues->count;

#ifdef FLEXIPLOT_DRIVER
Serial.print("{P3|meanDiffValue|0,0,255|");
Serial.print(filterValues->values[filterValues->index]);
Serial.print("|meanDiffIndex|255,0,0|");
Serial.print(filterValues->index);
Serial.print("|meanDiffCount|255,0,0|");
Serial.print(filterValues->count);
Serial.print("|meanDiffSum|255,0,0|");
Serial.print(filterValues->sum);
Serial.print("|meanDiffAverage|255,0,0|");
Serial.print(avg);
Serial.print("|meanDiffReturn|255,0,0|");
Serial.print(avg-M);
Serial.println("}");
#endif

return avg - M;
}`

Doubt About SPO2 calculation method

I have one doubt...
To calculate SPO2 you are using the equations:

Screenshot 2019-06-10 22 25 01

But looking for TI docs (who you use as reference), we have:

Screenshot 2019-06-10 22 27 15

Pay attention that the variable is R'.

Looking for TI .c code example (slaa468.zip):
[(http://www.ti.com/lit/zip/slaa458)]
Screenshot 2019-06-10 22 28 55

I don't know, but I think that you mixed Rs. Because TI implementation no uses linear equation.

The equation used by you:
Screenshot 2019-06-10 22 32 08

And R is:
Screenshot 2019-06-10 22 34 01

Can you confirm, please, the font of the information:
Screenshot 2019-06-10 22 39 55

VisualMicro could not compile

Strange, your code works with ArduinoIDE, but could not be linked with VisualMicro, giving the following errors:
`core.a(main.cpp.o)*: (.literal._Z8loopTaskPv+0x4): undefined reference to setup()

Error linking for board M5Stack-Core-ESP32
Debug build failed for project 'MAX30100'
core.a(main.cpp.o)*: (.literal._Z8loopTaskPv+0x8): undefined reference to loop()

core.a(main.cpp.o): In function loopTask(void)
main.cpp:20: undefined reference to setup()
main.cpp:23: undefined reference to loop()

collect2.exe*: error: ld returned 1 exit status`

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.