Arduino temperature ds18b20 + lcd i2c + pulse sensor + led help

I made an Arduino temperature project ds18b20 + lcd i2c + pulse sensor + led, everything went smoothly except the pulse sensor. My pulse sensor is why the bpm can be above 200 bpm after installing ds18b20. Can you detect the error of my code?

#define USE_ARDUINO_INTERRUPTS true
#define ONE_WIRE_BUS 2
#include <DallasTemperature.h>
#include <PulseSensorPlayground.h> 
#include <LiquidCrystal_I2C.h>
#include <OneWire.h>
#include <Wire.h> 
LiquidCrystal_I2C lcd(0x27,16,2);

const int PulseWire = 0;
const int LED12 = 12;
int PulseSensorPurplePin = 0;
int Signal;
int Threshold = 550;

OneWire oneWire(ONE_WIRE_BUS);
DallasTemperature sensors(&oneWire);
PulseSensorPlayground pulseSensor;

void setup() {
  lcd.begin();
  sensors.begin();
  pulseSensor.analogInput(PulseWire);
  pulseSensor.blinkOnPulse(LED12);
  pulseSensor.setThreshold(Threshold);
  Serial.begin(9600);

  if (pulseSensor.begin()) {
    lcd.setCursor(0,0);
    lcd.print("GONIT SENSOR");
    
    lcd.setCursor(0,1);
    lcd.print("VERSION 1.0");
    delay(3000);
    lcd.clear();
    
    lcd.setCursor(0,0);
    lcd.print("Suhu: 0");
    lcd.print("C");

    lcd.setCursor(0,1);
    lcd.print("BPM: 0");
  }
}

void loop() {
  int myBPM = pulseSensor.getBeatsPerMinute();
  Signal = analogRead(PulseSensorPurplePin);
  sensors.requestTemperatures();

  lcd.setCursor(0,0);
  lcd.print("Suhu: ");
  lcd.print(sensors.getTempCByIndex(0));
  lcd.print("C");
  delay(500);
  
  if (pulseSensor.sawStartOfBeat()) {
  
  lcd.setCursor(0,1);
  lcd.print("BPM: ");
  lcd.setCursor(5,1);
  lcd.print(myBPM);
  Serial.println(myBPM);
  }

  if(myBPM > 0){
    digitalWrite(LED12,HIGH);
  } else {
    digitalWrite(LED12,LOW);
  } 
 delay(20);
}

The OneWire library disables interrupts while communicating with the sensors to ensure a correct timing. As you defined to use interrupts for the pulse sensor this might influence the measurement. Have you tried to set USE_ARDUINO_INTERRUPTS to false?

The 1820 takes an appreciable while to respond to a read . You need to ask it for a reading ( “ start conversion”) but not wait for the response and then go back later , look to see if a new reading in ready and then read it if it’s available
Sorry can’t be more definitive atm , but hopefully you get the idea and can research further.

https://forum.arduino.cc/index.php?topic=384784.0