I am using a MAX30102 sensor with Sparkfun library for heart rate monitoring. It does work for a finger, but when the sensor is mounted on chest I am not getting a reading.
Why is that?
The article that Transistor pointed to goes into some detail on how pulse-oximeters work.
I won't try to reproduce all of it, but I'll summarize:
A pulse-oximeter counts the pulse by detecting changes in the light passed through the blood due to the increased volume of blood during each heart beat.
The article uses a pulse-oximeter with the emitter on one side of the finger and the detector on the other side - it works "through" the whole finger tip.
The MAX30102 is a reflective type - the emitter and detector are both on the same side. That looks a little different, the principle is the same.
Now, as to why the MAX30102 works on your finger but not your chest:
Your finger tip has fairly decent blood flow. There are arteries in the finger tip that transport a lot of blood. The pulse-oximeter detects the blood flow in the arteries.
Your chest doesn't have much in the way of arteries. The skin has a lot of capillaries, but no larger arteries. There are arteries in the muscles beneath the skin, but they are too deep for the pulse-oximeter to "see."
The LEDs have a limited light output (brightness.) That limits how far the pulse-oximeter can "see" into or through your body.
The brightness is limited for a couple of reasons:
There's not enough blood flow through the skin of your chest for the MAX30102 to detect a pulse in it.
While the article linked above gets the technical details correct (it correctly describes how a pulse-oximeter works,) it consistently gets the location of the arteries in the finger tip wrong.
It shows the arteries on the top of the finger (same side as the finger nail) when in fact the arteries run along the "pad" side opposite the finger nail.
This drawing shows what I mean:
(Image taken from this paper on reattaching fingers. Arteries in red, veins in blue. Fingernail is drawn on the dorsal side.)
I figure a couple of doctors who reconnected arteries and veins on 24 fingers should have a good grasp of where the arteries and veins actually run.
Brief: It is not obvious that there is a good reason to expect a reflective pulse oximeter sensor to work on a chest.
The page you cited mentions use of a finger with the sensor 10 times, but a chest not a whit.
I have seen a large number of pulse oximeters. (I own one and have been on the receiving emd of their use too many times).
While there may be pulse-oximeters that work by chest contact, ALL of the ones I have seen work my detecting the properties of blood in fingers.
Fingers have vessels with blood flow in them relatively near the surface, making them common targets for transmissive or reflective pulse oximeter sensors.Chests contain a heart (usually) and blood vessels usually but given the nature of typical pulse oximeter sensors it seems likely that chests are far less suited to detecting changes due to blood flow.