MAX30100 Class
- ID: max30100
- Name: Pulse Oximeter and Heart-rate Sensor
- Category: medical
- Manufacturer: maxim
- Link: https://www.maximintegrated.com/en/products/analog/sensors-and-sensor-interface/MAX30100.html
- Connection: i2c gpio
The MAX30100 is an integrated pulse oximetry and heartrate monitor sensor solution. It combines two LEDs, a photodetector, optimized optics, and low-noise analog signal processing to detect pulse oximetry and heart-rate signals.
I2C sensor which can be used to read: Heart-rate Peripheral capillary oxygen saturation temperature
Item Index
Methods
Properties
Methods
MAX30100
-
i2c_bus
Oximeter and heart-rate sensor constructor
Initialize Oximeter and heart-rate sensor. Note, the I2C address is 0x57.
Parameters:
-
i2c_bus
NumberTarget I2C bus
Returns:
sensor context pointer
sample
()
Max30100_value
Sample a single set of infrared/red values
Note, all setup (sample rate, LED current, and pulse width must be done prior to calling this sample method.
Returns:
One IR/R sample
sample_continuous
-
gpio_pin
-
buffered
-
cb
Continuously sample Infrared/Red values.
This method requires a GPIO pin which is used to signal sample/samples ready. The INT * pin is open-drain and requires a pullup resistor. The interrupt pin is not designed to sink large currents, so the pull-up resistor value should be large, such as 4.7k ohm. The RCWL-0530 PCB which this library was designed with had the I2C lines and INT pin pulled up to 1.8v.
Note, all setup (sample rate, mode, LED current, and pulse width must be done prior to calling this sample method.
Parameters:
-
gpio_pin
NumberGPIO pin for interrupt (input from sensor INT pin)
-
buffered
BooleanEnable buffered sampling. In buffered sampling mode, the device reads 16 samples at a time. This can help with I2C read timing. buffered == true, enable buffered sampling buffered == false, single-sample mode
-
cb
CallbackPointer to instance of Callback class. If parameter is left NULL, a default instance of the Callback class will be used which prints out the IR/R values.
sample_stop
()
Stop continuous sampling. Disable interrupts.
read
-
reg
Read Oximeter and heart-rate sensor registers
Parameters:
-
reg
MAX30100_REGTarget register to read
Returns:
Data returned from sensor
write
-
reg
-
wr_data
Write Oximeter and heart-rate sensor registers
Parameters:
-
reg
MAX30100_REGTarget register to write
-
wr_data
NumberTarget data to write
version
()
Number
Get sensor version Sensor version is a 2 byte value: upper byte = PART ID lower byte = REVISION ID
example: version() return 0x1105 0x11 = PART ID 0x05 = REVISION
Returns:
Sensor version
temperature
()
Number
Get temperature reading from device
Returns:
rd_data Temperature in degrees Celsius
mode
-
mode
Set the sampling mode (none vs red only vs SpO2)
Parameters:
-
mode
MAX30100_MODETarget sampling mode
mode
()
MAX30100_MODE
Get the sampling mode
Returns:
Current sampling mode
high_res_enable
-
enable
Enable or disable high-resolution mode
Parameters:
-
enable
BooleanHigh-resolution enable true == SpO2 ADC resolution of 16 bit with 1.6ms LED pw
high_res_enable
()
Boolean
Get the high-resolution enable bit
Returns:
Current high-resolution bit value
sample_rate
-
sample_rate
Set the sample rate
Parameters:
-
sample_rate
MAX30100_SRTarget sample rate
sample_rate
()
MAX30100_SR
Get the sample rate
Returns:
Current sample rate
pulse_width
-
pulse_width
Set the LED pulse width
Parameters:
-
pulse_width
MAX30100_LED_PWTarget LED pulse width
pulse_width
()
MAX30100_LED_PW
Get the LED pulse width
Returns:
Current LED pulse width
current
-
ir
-
r
Set the current for the infrared and red LEDs
Parameters:
-
ir
MAX30100_LED_CURRENTLED current enum
-
r
MAX30100_LED_CURRENTLED current enum
current_ir
()
MAX30100_LED_CURRENT
Get the infrared LED current
Returns:
current_r
()
MAX30100_LED_CURRENT
Get the red LED current
Returns:
reset
()
Reset sensor
When the RESET bit is set to one, all configuration, threshold, and data registers are reset to their power-on-state. The only exception is writing both RESET and TEMP_EN bits to one at the same time since temperature data registers 0x16 and 0x17 are not cleared. The RESET bit is cleared automatically back to zero after the reset sequence is completed.
sleep
-
sleep
Put device into power-save mode. While in power-save mode, all registers retain their values, and write/read operations function as normal. All interrupts are cleared to zero in this mode.
Parameters:
-
sleep
BooleanEnter/exit power-save mode