oxullo / Arduino-MAX30100

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

Arduino+MAX30100(RCWL-0530) Unable to begin MAX30100 #13

Closed William-An closed 7 years ago

William-An commented 7 years ago

Hi, thank you for developing such code for MAX30100!

But as my title says, after connecting the sensor to arduino uno, the serial console shows nothing. However, after I unplugged the sensor from my breadboard, the serial console starts to print "Heart rate:0.00bpm / SpO2:0%." After I inserted some "Serial.println();" in the MAX30100.cpp, I found out that the code stopped at this line: "Wire.write(data);" in "MAX30100::writeRegister" during the "MAX30100::begin" process.

I really cannot solve, could you help me through this?

AhmadZMQ commented 6 years ago

yup....Arduino UNO,Mega, as well as Nano....

On Fri, Mar 9, 2018 at 10:28 PM, Shooting77 notifications@github.com wrote:

@AhmadZMQ https://github.com/ahmadzmq is this (max30105) working with Arduino such as it described in this site https:// learn.sparkfun.com/tutorials/max30105-particle-and-pulse- ox-sensor-hookup-guide

β€” You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/oxullo/Arduino-MAX30100/issues/13#issuecomment-371873179, or mute the thread https://github.com/notifications/unsubscribe-auth/AVnDUYjlYGPFNNAwiR6evPP5oix0Ukdgks5tcrSpgaJpZM4LsNY3 .

Shooting77 commented 6 years ago

Thanks so much @AhmadZMQ

AhmadZMQ commented 6 years ago

It's my pleasure....have a fun with your electronicsπŸ‘.

On Sat, Mar 10, 2018 at 4:12 PM, Shooting77 notifications@github.com wrote:

Thanks so much @AhmadZMQ https://github.com/ahmadzmq

β€” You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/oxullo/Arduino-MAX30100/issues/13#issuecomment-372020434, or mute the thread https://github.com/notifications/unsubscribe-auth/AVnDUb4tAcR0c49hH_s5WOQbVCKFuVu5ks5tc64ggaJpZM4LsNY3 .

dianjach commented 6 years ago

I'm having problems. max30100 (rcwl0530) can not work. I'm using your library max30100. and run the max30100 tester and just show it

wp_20180325_22_10_31_pro wp_20180325_22_09_28_pro

pin max30100 vin = pin arduino v3,3 pin max30100 scl = pin arduino scl ( 4,7 R ) pin max30100 sda = pin arduino sda ( 4,7 R ) pin max30100 int = pin arduino d2 ( 4,7 R ) pin max30100 GND = pin arduino GND

this is like @mesutsaygioglu project. but I do not understand can some one help me??

AhmadZMQ commented 6 years ago

Hi, Is this working for him( @mesutsaygioglu https://github.com/mesutsaygioglu ).Also , you can try out by open the INT pin. As I already told you to just use max30105 ( https://learn.sparkfun.com/tutorials/max30105-particle-and-pulse-ox-sensor-hookup-guide) breakout board for convenience.I don't know whats wrong with max30100 breakout board,I didn't find any solution for him at yet.

On Mon, Mar 26, 2018 at 7:29 AM, dianjach notifications@github.com wrote:

I'm having problems. max30100 (rcwl0530) can not work. I'm using your library max30100. and run the max30100 tester and just show it

[image: wp_20180325_22_10_31_pro] https://user-images.githubusercontent.com/37766658/37883086-975488c6-30d2-11e8-9e1f-d412723a6200.jpg [image: wp_20180325_22_09_28_pro] https://user-images.githubusercontent.com/37766658/37883115-c19ee4c8-30d2-11e8-80b2-d8c90d8729ae.jpg

pin max30100 vin = pin arduino v3,3 pin max30100 scl = pin arduino scl ( 4,7 R ) pin max30100 sda = pin arduino sda ( 4,7 R ) pin max30100 int = pin arduino d2 ( 4,7 R ) pin max30100 GND = pin arduino GND

this is like @mesutsaygioglu https://github.com/mesutsaygioglu project. but I do not understand can some one help me??

β€” You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/oxullo/Arduino-MAX30100/issues/13#issuecomment-376025333, or mute the thread https://github.com/notifications/unsubscribe-auth/AVnDUdPKgw9nn_LsYfdQ79QyN4SHrn0dks5tiEtmgaJpZM4LsNY3 .

dianjach commented 6 years ago

i have problem sensor data. the sensor value jumps with a large range. how is the data sensor stable ?? anyone can help

AhmadZMQ commented 6 years ago

Firstly,just tell me which sensor are you using and let's explain little bit of you problem....

On Mon, Apr 9, 2018 at 12:08 PM, dianjach notifications@github.com wrote:

i have problem sensor data. the sensor value jumps with a large range. how is the data sensor stable ?? anyone can help

β€” You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/oxullo/Arduino-MAX30100/issues/13#issuecomment-379649506, or mute the thread https://github.com/notifications/unsubscribe-auth/AVnDUY7w5drBA213UC9v1xeo2Wb_oScrks5tmwHIgaJpZM4LsNY3 .

dianjach commented 6 years ago

saya menggunakan max30100 rcwl0530.

AhmadZMQ commented 6 years ago

Hi, Please purchase a new one MAX301005 from sparkfun. I suggest you a link to purchase the new one and get the fun--click o this link - https://learn.sparkfun.com/tutorials/max30105-particle- and-pulse-ox-sensor-hookup-guide

On Mon, Apr 9, 2018 at 8:35 PM, dianjach notifications@github.com wrote:

saya menggunakan max30100 rcwl0530.

β€” You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/oxullo/Arduino-MAX30100/issues/13#issuecomment-379784749, or mute the thread https://github.com/notifications/unsubscribe-auth/AVnDUYHMinEKxFW13RBOqYyEsuUyqbzHks5tm3jHgaJpZM4LsNY3 .

Shooting77 commented 6 years ago

Is any one has a library of MPU6050 gyroscope of for proteus 8??

AhmadZMQ commented 6 years ago

Hi, u can go for this link..https://github.com/jarzebski/Arduino-MPU6050

On Sat, Apr 14, 2018 at 8:47 PM, Shooting77 notifications@github.com wrote:

Is any one has a library of MPU6050 gyroscope of for proteus 8??

β€” You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/oxullo/Arduino-MAX30100/issues/13#issuecomment-381336177, or mute the thread https://github.com/notifications/unsubscribe-auth/AVnDUZa3u85WA_341RQ-ni6_Tvw-i8rTks5tohL7gaJpZM4LsNY3 .

Shooting77 commented 6 years ago

I want the library gyroscope of for proteus 8 NOT for Arduino , Thanks @AhmadZMQ

AhmadZMQ commented 6 years ago

HI, I apologise,what is proteus 8.I listen first time can u tell me plz....πŸ€”

On Mon, Apr 16, 2018 at 10:03 PM, Shooting77 notifications@github.com wrote:

I want the library gyroscope of for proteus 8 NOT for Arduino , Thanks @AhmadZMQ https://github.com/AhmadZMQ

β€” You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/oxullo/Arduino-MAX30100/issues/13#issuecomment-381666628, or mute the thread https://github.com/notifications/unsubscribe-auth/AVnDUXV6oXmpZCBr3l9GCYwZjUtDU49Lks5tpMfTgaJpZM4LsNY3 .

AhmadZMQ commented 6 years ago

Hi, I saw this,It's so cool s/w and provides a simulation.It's so interesting too. Can u let me know, what type of problem u encounter.As I understand that u can use Arduino IDE to code and make compatible with Proteus by adding Arduino library to the Proteus like this (click n c-- http://www.instructables.com/id/How-to-add-Arduino-Library-in-to-Proteus-7-8/)way . πŸ‘

On Tue, Apr 17, 2018 at 10:46 AM, Ahmad Ansari ahmadiotdev@gmail.com wrote:

HI, I apologise,what is proteus 8.I listen first time can u tell me plz....πŸ€”

On Mon, Apr 16, 2018 at 10:03 PM, Shooting77 notifications@github.com wrote:

I want the library gyroscope of for proteus 8 NOT for Arduino , Thanks @AhmadZMQ https://github.com/AhmadZMQ

β€” You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/oxullo/Arduino-MAX30100/issues/13#issuecomment-381666628, or mute the thread https://github.com/notifications/unsubscribe-auth/AVnDUXV6oXmpZCBr3l9GCYwZjUtDU49Lks5tpMfTgaJpZM4LsNY3 .

Saphal3 commented 6 years ago

Hi all, I was using MAX30102 and had the same issue. I solved the problem by using 1 pull-up resistor (4.7 kohm) for SDA pin and another one (4.7 kohm) for SCL pin. Vin was connected to 5V of Arduino and also both pull-up resistors were connected to 5V. I got these information from this link, http://mikrokontroler.pl/2017/09/14/przyklad-pulsoksymetr-max30100-plus-kamduino-uno/ Thanks,

CarlaZeine commented 5 years ago

@mesutsaygioglu @challee99 **use IIC to change RD/IRD current could you tell me how please ?

MaBoy29 commented 5 years ago

Hi! When using the Tester code I get this error : Initializing MAX30100..FAILED: wrong part ID 0x15 (expected: 0x11).

Can you help me find my problem pleaze ?

FelipeMdeO commented 5 years ago

Check if you are using max30100 or max30102.

Em qua, 19 de jun de 2019 12:19 PM, MaBoy29 notifications@github.com escreveu:

Hi! When using the Tester code I get this error : Initializing MAX30100..FAILED: wrong part ID 0x15 (expected: 0x11).

Can you help me find my problem pleaze ?

β€” You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/oxullo/Arduino-MAX30100/issues/13?email_source=notifications&email_token=ADNC5ZVRULULX2ITM7UYTWTP3JFBPA5CNFSM4C5Q2Y32YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODYCGZXY#issuecomment-503606495, or mute the thread https://github.com/notifications/unsubscribe-auth/ADNC5ZXOFZ2LJMPN3GAFOB3P3JFBPANCNFSM4C5Q2Y3Q .

MaBoy29 commented 5 years ago

@FelipeMdeO Which one should I use? (I have both)

FelipeMdeO commented 5 years ago

To this library, only max30100.

Em qua, 19 de jun de 2019 1:57 PM, MaBoy29 notifications@github.com escreveu:

@FelipeMdeO https://github.com/FelipeMdeO Which one should I use? (I have both)

β€” You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/oxullo/Arduino-MAX30100/issues/13?email_source=notifications&email_token=ADNC5ZX2JYUDAQF5L5Y7KNLP3JQO7A5CNFSM4C5Q2Y32YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODYCQAGA#issuecomment-503644184, or mute the thread https://github.com/notifications/unsubscribe-auth/ADNC5ZQQFUWURFMS7LTDIVDP3JQO7ANCNFSM4C5Q2Y3Q .

MaBoy29 commented 5 years ago

@FelipeMdeO I am using max30100 right now and I still have the same problem.

FelipeMdeO commented 5 years ago

Please, look again.

In datasheet of max30102 (https://datasheets.maximintegrated.com/en/ds/MAX30102.pdf )page 11 you have Part ID = 0x15 image But in max30100 (https://datasheets.maximintegrated.com/en/ds/MAX30100.pdf), Part ID is 0x11: image So, you have max30102 in your board. Please, if the problem continues, send photo of your wire.

CarlaZeine commented 5 years ago

Hi,

You should do some modifications on the Max30100 board to work with arduino. That is because of the voltage 1.8v or 3v.

Please check the image below.

You should cut the connection between one rail of the voltage regulator and the resistor, then you have to connect the resistors to Vin.

On Wed, Jun 19, 2019, 6:19 PM MaBoy29 notifications@github.com wrote:

Hi! When using the Tester code I get this error : Initializing MAX30100..FAILED: wrong part ID 0x15 (expected: 0x11).

Can you help me find my problem pleaze ?

β€” You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/oxullo/Arduino-MAX30100/issues/13?email_source=notifications&email_token=ALH6F3WFN5AJQRIPRXW3YYTP3JFBTA5CNFSM4C5Q2Y32YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODYCGZXY#issuecomment-503606495, or mute the thread https://github.com/notifications/unsubscribe-auth/ALH6F3SD6SYWOFDHKVM2RWLP3JFBTANCNFSM4C5Q2Y3Q .

FelipeMdeO commented 5 years ago

Please, look again.

In datasheet of max30102 ( https://datasheets.maximintegrated.com/en/ds/MAX30102.pdf )page 11 you have Part ID = 0x15 [image: image] https://user-images.githubusercontent.com/14298854/59810562-2c960380-92dc-11e9-8c34-c2181a3adff2.png But in max30100 (https://datasheets.maximintegrated.com/en/ds/MAX30100.pdf), Part ID is 0x11: [image: image] https://user-images.githubusercontent.com/14298854/59810582-551dfd80-92dc-11e9-932e-b828bb8c5257.png So, you have max30102 in your board. Please, if the problem continues, send photo of your wire.

Em qui, 20 de jun de 2019 12:25 PM, CarlaZeine notifications@github.com escreveu:

Hi,

You should do some modifications on the Max30100 board to work with arduino. That is because of the voltage 1.8v or 3v.

Please check the image below.

You should cut the connection between one rail of the voltage regulator and the resistor, then you have to connect the resistors to Vin.

On Wed, Jun 19, 2019, 6:19 PM MaBoy29 notifications@github.com wrote:

Hi! When using the Tester code I get this error : Initializing MAX30100..FAILED: wrong part ID 0x15 (expected: 0x11).

Can you help me find my problem pleaze ?

β€” You are receiving this because you commented. Reply to this email directly, view it on GitHub < https://github.com/oxullo/Arduino-MAX30100/issues/13?email_source=notifications&email_token=ALH6F3WFN5AJQRIPRXW3YYTP3JFBTA5CNFSM4C5Q2Y32YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODYCGZXY#issuecomment-503606495 , or mute the thread < https://github.com/notifications/unsubscribe-auth/ALH6F3SD6SYWOFDHKVM2RWLP3JFBTANCNFSM4C5Q2Y3Q

.

β€” You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/oxullo/Arduino-MAX30100/issues/13?email_source=notifications&email_token=ADNC5ZV27U6F5X3SH7S2PI3P3OONFA5CNFSM4C5Q2Y32YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODYFYAHY#issuecomment-504070175, or mute the thread https://github.com/notifications/unsubscribe-auth/ADNC5ZUIPDURNHR6YB6PTWTP3OONFANCNFSM4C5Q2Y3Q .

MaBoy29 commented 5 years ago

@FelipeMdeO I think you are right! It is marked as a Max30100 but it seems to respond as a Max30102...

Do you know another library for that one ?

FelipeMdeO commented 5 years ago

Its because max30100 and 30102 have same pin out and foot print, so you can change one per other in ae board. U can use it: https://learn.sparkfun.com/tutorials/max30105-particle-and-pulse-ox-sensor-hookup-guide/all

Em sex, 21 de jun de 2019 12:13 PM, MaBoy29 notifications@github.com escreveu:

@FelipeMdeO https://github.com/FelipeMdeO I think you are right! It is marked as a Max30100 but it seems to respond as a Max30102...

Do you know another library for that one ?

β€” You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/oxullo/Arduino-MAX30100/issues/13?email_source=notifications&email_token=ADNC5ZQDAOI4UHU43KTR65DP3TVZ3A5CNFSM4C5Q2Y32YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODYIXZAA#issuecomment-504462464, or mute the thread https://github.com/notifications/unsubscribe-auth/ADNC5ZW7SIAMIRVNC6XE2NDP3TVZ3ANCNFSM4C5Q2Y3Q .

sunitasonu commented 4 years ago

include

include "MAX30100_PulseOximeter.h"

define REPORTING_PERIOD_MS 1000

// PulseOximeter is the higher level interface to the sensor // it offers: // beat detection reporting // heart rate calculation // * SpO2 (oxidation level) calculation PulseOximeter pox;

uint32_t tsLastReport = 0;

// Callback (registered below) fired when a pulse is detected void onBeatDetected() { Serial.println("Beat!"); }

void setup() { Serial.begin(9600);

Serial.print("Initializing pulse oximeter..");

// Initialize the PulseOximeter instance
// Failures are generally due to an improper I2C wiring, missing power supply
// or wrong target chip
if (!pox.begin()) {
    Serial.println("FAILED");
    for(;;);
} else {
    Serial.println("SUCCESS");
}

// The default current for the IR LED is 50mA and it could be changed
//   by uncommenting the following line. Check MAX30100_Registers.h for all the
//   available options.
 pox.setIRLedCurrent(MAX30100_LED_CURR_7_6MA);

// Register a callback for the beat detection
pox.setOnBeatDetectedCallback(onBeatDetected);

}

void loop() { // Make sure to call update as fast as possible pox.update();

// Asynchronously dump heart rate and oxidation levels to the serial
// For both, a value of 0 means "invalid"
if (millis() - tsLastReport > REPORTING_PERIOD_MS) {
    Serial.print("Heart rate:");
    Serial.print(pox.getHeartRate());
    Serial.print("bpm / SpO2:");
    Serial.print(pox.getSpO2());
    Serial.println("%");

    tsLastReport = millis();
}

}

hello sir this is my program when i am running this program only using max30100 sensor then it is working but if i call any other funtion in void loop it is not working i am not getting how to solve this trying from 15 days not getting answer even i searched so many articles but dint get the answer plz if anyone knows plz reply as soon as early thank you

pahart2208 commented 4 years ago

Hi. Yes, I've struggled with this for a few days. Works fine as-is when writing to serial or LCD, but when I add anything, the output from MAX30100 stops. In my case I was trying to write to my cloud services dashboard using WiFi. I'm no s/w expert, but....Seems like the pox.update() has to run at a minimum 100Hz i.e. cycle time of <10ms. I put a couple of software timers in the code and when the code above runs, it takes between 1 and 2 ms, which is easily fast enough. However, the Wifi write was taking around 350ms and so pox.update() stopped working properly.
Now I understand the comment in the code: // Make sure to call update as fast as possible At least 100 times each second, or it won't work! So, your other function must be taking longer than 10ms which stops pox.update() working. Still trying to figure out a workaround.
Hope that helps - or at least gives some insight into the problem.

Kalsara01 commented 4 years ago

so I've been struggling with this for some time and finally able to get it working. I ordered got 2 "MAX30100" boards but 2 are not alike. 20200623_072248 turns out 1st one is MAX30100 and the 2nd one is MAX30102 so kept the max30102 aside and started working on max30100. I used an Arduino Mega. Vin to 3.3v, GND to GND, SCL to SCL, SDA to SDA and INT to digital pin 2. then I scanned for i2c devices File > examples > Wire > i2c _scanner No devices detected. then I broke the connection between SMD resistors and voltage regulator and solder a wire to those resistors ( check red circle in the picture) and connected that wire to 5V then again did an I2C device scan. -> device at address 57! then upload the max30100 debug file and it worked! then tried again the max30100 tester ---> "could not convert 'sensor.MAX30100::begin((pulseWidth)3, (ledCurrent)14, (sampleRate)1)' from 'void' to 'bool'" Sketch->include libraray -> MAX30100lib and finally got everything to work !!!

simtcrom commented 3 years ago

so I've been struggling with this for some time and finally able to get it working. I ordered got 2 "MAX30100" boards but 2 are not alike. 20200623_072248 turns out 1st one is MAX30100 and the 2nd one is MAX30102 so kept the max30102 aside and started working on max30100. I used an Arduino Mega. Vin to 3.3v, GND to GND, SCL to SCL, SDA to SDA and INT to digital pin 2. then I scanned for i2c devices File > examples > Wire > i2c _scanner No devices detected. then I broke the connection between SMD resistors and voltage regulator and solder a wire to those resistors ( check red circle in the picture) and connected that wire to 5V then again did an I2C device scan. -> device at address 57! then upload the max30100 debug file and it worked! then tried again the max30100 tester ---> "could not convert 'sensor.MAX30100::begin((pulseWidth)3, (ledCurrent)14, (sampleRate)1)' from 'void' to 'bool'" Sketch->include libraray -> MAX30100lib and finally got everything to work !!!

I have got MAX30102 green. I already removed all three resistors.

VIN to 3.3V GND to GND INT to D0 SCL to D1 SDA to D2 using 4.7K pullup resistors (connected to 3.3V) in SCL, SDA.

Ran Example -> i2cdetect -> i2cdetect and I can see its detected in 57

Ran Example MAX30100lib -> MAX30100_Debug getting error

--------------- CUT HERE FOR EXCEPTION DECODER ---------------

ets Jan 8 2013,rst cause:2, boot mode:(3,6)

load 0x4010f000, len 3584, room 16 tail 0 chksum 0xb0 csum 0xb0 v2843a5ac ~ld Failed to initialize the HRM sensor ERROR: Failed to initialize pulse oximeter

Can any one help me please?

simtcrom commented 3 years ago

Check if you are using max30100 or max30102.

I too get Initializing MAX30100..FAILED: wrong part ID 0x15 (expected: 0x11 I am using MAX30102 green. Can you provide a working program please?