Hi!
I am trying to use the MAX30102 Sensor to gather pulse and blood oxygen saturation readings with an Arduino Uno. I am running my program on a Windows 11.
I first tried running an Example 1 code from the SparkFun MAX3010x Pulse and Proximity Sensor Library.
/*
MAX30105 Breakout: Output all the raw Red/IR/Green readings
By: Nathan Seidle @ SparkFun Electronics
Date: October 2nd, 2016
https://github.com/sparkfun/MAX30105_Breakout
Outputs all Red/IR/Green values.
Hardware Connections (Breakoutboard to Arduino):
-5V = 5V (3.3V is allowed)
-GND = GND
-SDA = A4 (or SDA)
-SCL = A5 (or SCL)
-INT = Not connected
The MAX30105 Breakout can handle 5V or 3.3V I2C logic. We recommend powering the board with 5V
but it will also run at 3.3V.
This code is released under the [MIT License](http://opensource.org/licenses/MIT).
*/
#include <Wire.h>
#include "MAX30105.h"
MAX30105 particleSensor;
#define debug Serial //Uncomment this line if you're using an Uno or ESP
//#define debug SerialUSB //Uncomment this line if you're using a SAMD21
void setup()
{
debug.begin(9600);
debug.println("MAX30105 Basic Readings Example");
// Initialize sensor
if (particleSensor.begin() == false)
{
debug.println("MAX30105 was not found. Please check wiring/power. ");
while (1);
}
particleSensor.setup(); //Configure sensor. Use 6.4mA for LED drive
}
void loop()
{
debug.print(" R[");
debug.print(particleSensor.getRed());
debug.print("] IR[");
debug.print(particleSensor.getIR());
debug.print("] G[");
debug.print(particleSensor.getGreen());
debug.print("]");
debug.println();
}
Here is a schematic of my connections:
Sensor --> Arduino
VIN --> 5V
GND --> GND
SDA (Green) --> A4
SCL (Yellow) --> A5
Whenever I try to run the code, the red light for the sensor does not turn on and I receive these messages in the serial monitor.
"Initializing..."
"Basic Readings Example"
"MAX30102 not found. Please check wiring/power."
I recognize that the code gets stuck within the first few lines of the void setup, but I don't understand why.
I am confused at from where the backwards "??" are coming from, since there are nowhere in the code:
I also sometimes get errors in my code, but often times when I upload the sketch the errors disappear, without having made any changes:
exit status 1
'class MAX30105' had no member named 'setup'; did you mean 'setBit'?
I have tried replacing the above 'setup' with 'setBit', but then I get a reverse error stating:
'class MAX30105' had no member named 'setBit'; did you mean 'setup'?
I was tried soldering some of the pins, to see if that would help the connection issue. I also swapped my Arduino Uno to see if it was a problem with the board. Additionally, in speculation that I may have ruined the sensor in my poor attempts to solder it, I replaced the soldered sensor with a new unsoldered one. I also replaced my USB cable, however, all these attempts were to no avail and there is still no sign of activity from the sensor. A few weeks ago, I did wiggle around the Power and SCL jumper wires connected to the sensor and saw the LED flicker briefly, but haven't seen it since. I used my multimeter to check the voltage of the jumper wires on the Arduino, the pins on the sensor, and the jumper wires connecting to the sensor but all read the same at all three locations.
VIN - 5.0 V
SDA - 4.8 V
SCL - 4.8 V
I have tried three different variations of code that I found online, which also didn't work. (I am not posting them here for the sake of simplicity). I read online of someone facing a similar issue, but once they substituted their board with a Nano, then suddenly the LED turned on. I tested this with a Nano Every (mistakenly ordered an Every instead of a regular Nano, so take these results with a grain of salt I recognize this result may not be reliable since the boards aren't exactly the same) and still I came across the same errors, and some more (which I am again not including since I am new to the Nano Every and would rather prefer to stick with the Arduino Uno.)
Here are some more pictures if this may help:
Please excuse my poor job of soldering - prime example of a skill that is easier said than done ....
I have read about how there are issues with the MAX30100 due to the placement and connections of the pull up resistors within the board, that requires one to rewire the circuit for it to work. I ruled this out as a source of error, since I am using the newer MAX30102 version, but I am including this information here for the sake of thoroughness.
Does anyone have suggestions on what I could be doing wrong and what changes I should try out?
All help would be greatly appreciated. Thank you in advance!