For the MAX30101 and MAX30102, the integrated proximity mode only works with the red LED (LED 1). When the SpO2 or HR function is initiated (by writing the MODE register), the RED LED is activated in proximity mode with a drive current set by the PILOT_PA register. When an object is detected by exceeding the RED ADC count threshold (set in the PROX_INT_THRESH register), the part transitions automatically to the normal SpO2/HR Mode. By reentering proximity mode periodically, the proximity detection can detect when the device is no longer connected to the used as the LEDs will be inactive. To reenter proximity mode, the MODE register must be rewritten (even if the value is the same). The proximity function can be disabled by resetting PROX_INT_EN to 0. In this case, the SpO2 or HR mode begins immediately.
Alterntatively, this procedure can also be implemented through software for any of the LEDs available in the sensor.
For an IR software proximity sensor use the below pseudo code:
- Initial Setting – SW proximity mode
0x0C 0x00 //RED LED: 0mA
0x0D 0x19 //IR LED: 5mA
0x0E 0x00 //GREEN LED: 0mA Only for MAX30101
0x0A 0x43 //SPO2 CONFIGURATION
//SPO2_ADC_RGE : 8uA (this is a good starting point, try other settings in order to fine tune your design),
//SPO2_SR : 50HZ, LED_PW : 400us
0x08 0x00 //FIFO CONFIG
0x11 0x12 //Multi-LED 1
0x12 0x00 //Multi-LED 2
0x04 0x00 //FIFO RESET
0x05 0x00 //FIFO RESET
0x06 0x00 //FIFO RESET
0x09 0x07 //Mode Configuration : Multi-LED Mode
0x02 0x40 //PPG RDY Interrupt Enable
current mode = proximity
- IRQ Handler
Read 6 bytes from FIFO(first 3bytes : IR, next 3bytes : RED)
If ( IR Count > 2000 and current mode == proximity ) {
0x0C 0x? //RED LED: desired LED current for RED
0x0D 0x? //IR LED: desired LED current for IR
0x0E 0x? //GREEN LED: desired LED current for GREEN Only for MAX30101
0x0A 0x4E //SPO2 CONFIGURATION SPO2_ADC_RGE : 8uA, SPO2_SR : 400HZ, LED_PW : 400us
0x08 0x40 //FIFO CONFIG : SMP_AVG : 4 Samples : 100 Hz ODR
current mode = HRM_SPO2
} else if ( IR Count < 5000 and current mode == HRM_SPO2 ) {
0x0C 0x00 //RED LED: 0mA
0x0D 0x19 //IR LED: 5mA
0x0E 0x00 //GREEN LED: 0mA Only for MAX30101
0x0A 0x43 //SPO2 CONFIGURATION SPO2_ADC_RGE : 8uA, SPO2_SR : 50HZ, LED_PW : 400us
0x08 0x00 //FIFO CONFIG
current mode = proximity
}