Arduino+MAX30100(RCWL-0530) Unable to begin MAX30100
Closed this issue Β· 81 comments
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?
P.S. I cannot detect my MAX30100 through i2CScanner either... After I burnt the i2CScanner into my arduino, the serial console showed nothing, and the code seemed to stop. But after I unplugged the MAX(again), the console started to work
After checking my MAX30100 datasheet and its SDA & SCL pins' voltage, I realized that it must work under 3.3v of I2C instead of the 5v on arduino. I think that is the final reason behind this.
I used the rcwl-0530 module, to get it to work I had to cut the 1.8V to the pullup resistors and connect to 3.3V pull up.
Then I had to play with the LED current - Using 4.4 or 7.6 ma Worked well for me.
Thanks for this code, it works great.
@William-An did you check this brief schematics? https://github.com/oxullo/Arduino-MAX30100/blob/master/extras/arduino-wiring.pdf
@mollyandchloe thanks for your contribution. Does it really work for you with such low bias current?
@oxullo
Connections :
Vin => arduino 3. 3v
Scl => ardunio Scl
Sda=>ardunio sda
Int=> ardunio pin 2
Gnd=> arduino gnd
After connecting the int to the 3.3v (without a pull resistor) now the red led is working. But I still cannot get any result.it doesn't detect the beat. It stops on "pox.begin() ;" it looks like max30100 is not responding :/. I have to RCWL. I tried both of them. Nothing changed . I don't know where my mistake is. I followed the instructions. And I couldn't get a result. I need help
@mollyandchloe how did you change the led current?
use IIC to change RD/IRD current
@challee99 thank you :) I changed it and it is working now :)
Please teach me.
Is it necessary to connect RD and IRD pins?
Where to connect Arduino pins Number separately?
OKοΌ I can show you how to connect it . Just.. wait a moment...Get something to handle with..
I get a meetting...
when IR_LED+/R_LED+ is connected with 3.3V
The IRD/RD should be low or connect to GND. So the RedLED/IRLED can be lighten.
Thank,you very much.
After connecting to GND,LED has changed shine stronger.
I resolved this problem that wasn't operated in arduino UNO. Arduino UNO doesn't have TWI register.
So. Connect 10k ohm register on sdk, scl pin. Then operate Try
Thank,you. I tried 1.0KΞ©γThat going but cannot pick up beat constantly.
I'will try value up the register.
@JAICHANGPARK the Uno equips an ATMega328p which sports a hardware I2C/TWI interface.. And watch out for the pullup, 10k might be too high: with 4,7k I can already see the effects of an RC.
@dokechin check #14 for the beat issue you're experiencing
hey can anyone show me the code plz, im thinking maybe mine misses something
@oxullo
@ghostmanzero
@challee99
hi everyone..i have connected max30100 rcw0530 to arduino i loaded the code but in serial monitor its just showing initializing max30100..nothing shows after it can anybody tell me how to fix it.. my pin connections are
Vin => arduino 5v
Scl => arduino analog a5
Sda=>arduino analog a4
Int=> ardunio digital pin 2
Gnd=> arduino gnd
@sezarosama000 try the new example MAX30100_Tester on v1.1.0
@sunny950 make sure you have proper pullups. Read the README.md and check the proposed schematics in the extras folder
@oxullo thank u.i m trying without pullup resistors.should i use two pullup resistor for sda and scl pins seperatly..can u tell me where to connect these pullup ressistor i m new to this project
@sunny950
RCW0530 I2C module voltage is 1.8V, so level converter is needed between Arduino and RCW0530. You should buy a voltage level converter board and try again.
Please see the topic below, bidirectional level converter is needed.
https://forum.arduino.cc/index.php?topic=447071.0
thank u i have tried mega 2560 and its working but its not calcuating sp02 while beat is detected and temperature also showing.what i have to do to calculate spo2.its either have value 0 or 100% which is incorrect i have connected my wires as follow
sda to arduino sda
scl to arduino scl
ird and red common ground with arduino grnd
gnd to arduino ground
@sunny950 were u able to solve the problem.
and need some help when i am connecting ird and rd to common ground the red led does'nt blink,
but if i keep ird open the red is blinking.
and on running test module the red=0 and ir=0.
and do i have to connect interrupt to any digital pin and if it has to be pulled up or down.
i am using mega2560 so i dont need a pull up register for sda scl, but do i still need it for interrupt ? @oxullo
can anyone help me please?
I am trying to get the spo2 using max30100 and arduino nano. I have wired all the pins as an instructions. And the red LED started lighting. But we I am trying to run the code (tester or any of the codes) , i face with this error: Initializing max30100, Failed : I2C error
to be noted that I wired scl, sdk , int via 4.7k pull up resisitors to vcc (5 volt).
@challee99 I did it as you said but the problem is both RED and IRLED doesn't light up.when I connect the one with GND (RED led alone) they got light up but doesn't respond something. What we have to do for.kindly help plz.
The same issue the red and it LEDs are not turning on
I'm using mega with the same 4.7 k pull up rezistor
can you give me the wiring for max30100 to arduino mega 2560?
From 5 volt I pulled up the i2c lines with 4.7k rezistors
so the wiring is this VIN->5V, SCL(PULLUP4.7K)->SDL,SDA(PULLUP4.7K)->SDA,IRD&RD->GND,GND->GND. i am right sir ?
can you give me the circuit of it guys . it shows FAILED
@sunny950 when you using your max30100 to arduino your wiring is this VIN->5V, SCL(PULLUP4.7K)->SDL,SDA(PULLUP4.7K)->SDA,IRD&RD->GND,GND->GND.
I too had a problem where it was only printing 0 in all columns.
The fix for it is to just uncomment this line
pox.setIRLedCurrent(MAX30100_LED_CURR_17_4MA);
from the oxullo program Minimal Sketch.
I came to know about this from
http://edycube.blog.fc2.com/blog-entry-982.html
We dont have to connect INT IRD RD pins available in the RCWL Pulse Sensor Module.
For Vcc - 3.3v I used.
@challee99 What's IIC ? and how I will use it??
@Shooting77 Its Communication bus. You should google it .
@AhmadZMQ thank you, but I connected SDA & SCL of MAX30100 to the SDA(A4) & SCL(A5) of the Arduino UNO but i still get the (Initializing pulse oximeter..) only without beats.
@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 ???
Thanks so much @AhmadZMQ
I'm having problems. max30100 (rcwl0530) can not work. I'm using your library max30100. and run the max30100 tester and just show it
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??
i have problem sensor data. the sensor value jumps with a large range. how is the data sensor stable ?? anyone can help
saya menggunakan max30100 rcwl0530.
Is any one has a library of MPU6050 gyroscope of for proteus 8??
I want the library gyroscope of for proteus 8 NOT for Arduino , Thanks @AhmadZMQ
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,
@mesutsaygioglu @challee99
**use IIC to change RD/IRD current
could you tell me how please ?
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 Which one should I use? (I have both)
@FelipeMdeO I am using max30100 right now and I still have the same problem.
Please, look again.
In datasheet of max30102 (https://datasheets.maximintegrated.com/en/ds/MAX30102.pdf )page 11 you have Part ID = 0x15
But in max30100 (https://datasheets.maximintegrated.com/en/ds/MAX30100.pdf), Part ID is 0x11:
So, you have max30102 in your board.
Please, if the problem continues, send photo of your wire.
@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 ?
#include <Wire.h>
#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
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.
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.
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 !!!
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.
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?
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?