How to combine MAX30100 sensor with DS18B20 temperature sensor

hello,

I am trying to use MAX30100 sensor with DS18B20 temperature sensor with LCD screen using arduino mega, when I tried each sensor separately it works, but when I combine two sensors, the temperature sensor work but MAX30100 does not work.

This is my code:

/********************************************************************/
// First we include the libraries
#include <OneWire.h>
#include <DallasTemperature.h>

#include <LiquidCrystal_I2C.h>
#include <Wire.h>
#include "MAX30100_PulseOximeter.h"
/********************************************************************/
// Data wire for TMP is plugged into pin 2 on the Arduino
#define ONE_WIRE_BUS 2 
//Buzzer is pluged into pin 11 & GND(Negative)
#define buzzer 11
// Temp at which it beeps at
#define alarmTemp 30
#define maxHR 150
#define maxSpO2 80


LiquidCrystal_I2C lcd(0x27,20,4); 
#define REPORTING_PERIOD_MS     1000
/********************************************************************/
// Setup a oneWire instance to communicate with any OneWire devices  
// (not just Maxim/Dallas temperature ICs) 
OneWire oneWire(ONE_WIRE_BUS); 
/********************************************************************/
// Pass our oneWire reference to Dallas Temperature. 
DallasTemperature sensors(&oneWire);


PulseOximeter pox;
uint32_t tsLastReport = 0;

void onBeatDetected()
{
   Serial.println("Beat!");
}
/********************************************************************/ 
void setup() 
{ 
// start serial port 
Serial.begin(9600); 
Serial.begin(115200);
Serial.println("Dallas Temperature IC Control Library Demo"); 
// Start up the library 
sensors.begin(); 

/**********************************************************/
 
   Serial.print("Initializing pulse oximeter..");
   
   lcd.backlight();

   lcd.begin(16,2);
   lcd.print("Initializing...");
   delay(3000);
   lcd.clear();

   // 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");
   }
    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();
   if (millis() - tsLastReport > REPORTING_PERIOD_MS) {
       Serial.print("Heart rate:");
       Serial.print(pox.getHeartRate());
       Serial.print("bpm / SpO2:");
       Serial.print(pox.getSpO2());
       Serial.println("%");

       lcd.clear();
       lcd.setCursor(0,0);
       lcd.print("BPM : ");
       lcd.print(pox.getHeartRate());
       
       lcd.setCursor(0,1);
       lcd.print("SpO2: ");
       lcd.print(pox.getSpO2());
       lcd.print("%");

       tsLastReport = millis();
   }
 /*********************************************/
// call sensors.requestTemperatures() to issue a global temperature 
// request to all devices on the bus 
/********************************************************************/
Serial.print(" Requesting temperatures..."); 
sensors.requestTemperatures(); // Send the command to get temperature readings 
Serial.println("DONE"); 
/********************************************************************/
Serial.print("Temperature is: "); 
Serial.print(sensors.getTempCByIndex(0)); // Why "byIndex"?  
  // You can have more than one DS18B20 on the same bus.  
  // 0 refers to the first IC on the wire 

  /***************************************************/
 
   
  if (sensors.getTempCByIndex(0) > alarmTemp || pox.getHeartRate() > maxHR || pox.getSpO2() > maxSpO2 ) { //If the temp reaches above alarm temp:
    tone(buzzer, 1000, 250); 
    delay(250);
    tone(buzzer, 1000, 250); 
    delay(250);
    tone(buzzer, 1000, 250); 
    tone(buzzer, 1000, 250); 
    delay(250);
    tone(buzzer, 1000, 250); 
    delay(250);
    tone(buzzer, 1000, 250);
  }
  delay(250); 
}


Provide a GitHub link to where we can find 'MAX30100_PulseOximeter.h'

gfvalvo:
Provide a GitHub link to where we can find 'MAX30100_PulseOximeter.h'

Is there some minimum rate you are supposed to all pox.update()? You have a 250 millisecond delay() at the bottom of loop(). Try getting rid of the delay.