I am designing a smart glove, in which I have a MAX30102 sensor (heart rate, SpO2, temperature sensor) connected to an Arduino. The MAX30102 is placed on the tip of the index finger; please see the attached photo for demonstration.
For reading the MAX30102 data, I used the following algorithm from GitHub: https://github.com/aromring/MAX30102_by_RF . For further explanation of the algorithm see the following link: https://www.instructables.com/Pulse-Oximeter-With-Much-Improved-Precision/.
However, this algorithm sometimes does not give accurate readings on different skin colors and does not consider the effects of motion artifacts.
Therefore, I want you to write an Arduino code that includes an algorithm to accurately detect heart rate, SpO2, and temperature using the MAX30102 sensor and to cancel motion artifacts. Also, the readings should be accurate when moving, and you should consider the placement of the MAX30102 sensor as demonstrated by the photo.