sparkfun/SparkFun_MAX3010x_Sensor_Library

Error in library regarding temperature readings

poolster opened this issue · 1 comments

There is a flaw in this library regarding the reading of temperature values from the MAX30105. After starting a measurement, the software keeps polling the register MAX30105_DIETEMPCONFIG until bit 0 has cleared, but for some reason that bit clears almost instantly, while the temperature AD-conversion takes about 29 ms according to the spec.
In order to get correct readings, you should instead poll the register MAX30105_INTSTAT2 to check the interrupt bit associated with the temperature measurement. Don't forget that somewhere in the software you have to enable this interrupt first in register MAX30105_INTENABLE2 !
If you use the library as provided, you seemingly get proper temperature readings, but they fluctuate quite a bit, and you can get an occasional weird value like -60 degrees.
If you do it the way I described above, the temperature readings are accurate and stable.

Thanks! Fixed in v1.1.1.