I am trying to Connect MLX90614 and MAX30100, Getting error

#include<Wire.h>
#include<Adafruit_MLX90614.h>
#include "MAX30100_PulseOximeter.h"

#define REPORTING_PERIOD_MS 1000

Adafruit_MLX90614 mlx = Adafruit_MLX90614();
PulseOximeter pox;

uint8_t max30100_address = 0x57;
uint8_t irmlx90614_address = 0x5A;

float temperature;
uint8_t heart_rate;
uint8_t oxygen_level;
int i = 0;

void onBeatDetected()
{
  Serial.println("Beat!");
}

void setup() {
  Serial.begin(115200);
  Serial.println("Initalize Oximeter Sensor");
  if (!pox.begin()) {
    Serial.println("Failed");
  }
  else {
    Serial.println("Success");
  }
  pox.setIRLedCurrent(MAX30100_LED_CURR_7_6MA);
  pox.setOnBeatDetectedCallback(onBeatDetected);

  
  Serial.println("Initalize Contactless - Temperature Sensor");
  Wire.setClock(100000);
  if (!mlx.begin()) {
    Serial.println("Failed");
  }
  else {
    Serial.println("Success");
  }
}

void loop() {
  delay(2000);
  temperature = mlx.readObjectTempC();
  if (temperature >= 31.0) {
    Serial.print(temperature);
    Serial.println(" C");
    readOxiValues();
  }
  else
  {
    Serial.print(temperature);
    Serial.print(" C");
    readOxiValues();
  }
}

void readOxiValues()
{
  delay(5000);
  Serial.println("Reading Oximeter Values");
    pox.update();
    heart_rate = pox.getHeartRate();
    oxygen_level = pox.getSpO2();
    Serial.print("Heart Rate ");
    Serial.print(pox.getHeartRate());
    Serial.print(" bpm / SPO2 ");
    Serial.print(pox.getSpO2());
    Serial.print(" %");
}

I am getting the output for mlx90614 but I am not getting any reading for max30100. Kindly tell me how to change frequency of max30100 to get the output. At first I was not able to get the output for mlx90614 but when I changed the frequency it worked. What should I do for MAX30100.

Look at the examples that came with this library and just get the MAX30100 working first.

1 Like

The problem got resolved, I had to change the frequency speed in the library and worked fine.

I am am quite new with this and I am facing the same problem. Can you please tell me what exactly did you do to resolve the problem. I am using the same code you have shared above.

what value did you used for the frequency?

Hola , tengo un problema , quiero enviar los datos del programa del max30100 por ubidots , pero de alguna manera se cuelga cuando hago el envio de datos , pudiesen ayudarme porfavor

Hello, were you able to solve this problem, I have a similar problem that I want to send the data from the max30100, but whenever I connect it to a WIFI network it hangs and only sends 0

i also faced the same problem only when connecting to wifi network

Definitely not the same problem. Description is much to short to give even the slightest hint.

I am not sure with MLX90614, but I faced same problem when connected with ds18b20. To solve, I called the pox.update() at certain interval. its working. you may try that for other sensors also hopefully.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.