Using both max30102 and mlx90614, but

It is self resolved.
The solution is to change the I2C clock speed at mlx90614.
Both sensors now output the correct values as below.

IR=6772, BPM=0.80, Avg BPM=0 No finger?
Ambient = 28.19C Object = 25.81C
Ambient = 82.74F Object = 78.46F

I looked up various information on the Internet.
I found an article about lowering the I2C clock speed as a countermeasure to fix the value at mlx90614.
I tried a method of dynamically adjusting the frequency before and after the I2C communication part of the Adafruit library source code "Adafruit_MLX90614.cpp" and it worked.

Adafruit_MLX90614.cpp around line 130,

/*********************************************************************/

uint16_t Adafruit_MLX90614::read16(uint8_t a) {
uint8_t buffer[3];
buffer[0] = a;
Wire.setClock(50000);
// read two bytes of data + pec
bool status = i2c_dev->write_then_read(buffer, 1, buffer, 3);
if (!status)
return 0;
Wire.setClock(100000);
// return data, ignore pec
return uint16_t(buffer[0]) | (uint16_t(buffer[1]) << 8);
}

2 Likes