MAX30100 notes

Active 2 days ago
Viewed 33 times

I want to connect the sensor max30100 to the Raspberry Pi board.I think everything is accurate.When I run the code, the red light flashes.I activated I2C.max30100 device address 0x57 is detected. When I put my hand on the sensor, I get the following error.


max30100 got exception [errno 121] remote i/o error

I use the source code below.

import os
import sys
import time
import max30100

def main():
        mx30 = max30100.MAX30100()
        # mx30.reset()
        # time.sleep(1)
        # mx30.startup()
        # time.sleep(1)

        i = 0
        while i < 30:
            # # The latest values are now available via .ir and .red
            # print("HeartRate sensor .ir: {} and .red: {}".format(mx30.ir, mx30.red))

            # time.sleep(2)
            mx30 = max30100.MAX30100()
            # time.sleep(1)
            # The latest values are now available via .ir and .red
            print("HRate sensor .ir: {} and SpO2 .red: {}".format(mx30.ir, mx30.red))

            # temp = mx30.get_temperature()
            # print("Temperature {}\n".format(temp))

            i = i + 1
        # mx30.shutdown()

    except Exception as e:
        print("Max30100 got exception {}".format(e))

if __name__ == "__main__":


connection PINS GPIO and sensor max30100

(3.3V -VIN)
(I2C SDA1 - SDA)
(I2C SCL1 - SCL)
(PIN7 - INT )

Can anyone help me to fix this issue?

 New contributor
  • (1) [errno 121] remote i/o error usually means the following: (a) data transmission error, because wires too long, speed too high, impedance overloaded (too many i2c devices on the same bus exceeding 400pF limit) (2) workarounds include (i) remove other devices to other I2C buses (for R4, you have many buses to use), (ii) lower speed to 50k or even 10k, to see if problem disappeared. (3) i2cdetect -y 1 only pings (read something, no guarantee can read-after-write), refactoring wiring, say star to daisy chain topology, to reduce capacitance, (4) Avoid interrupt in prelimin test. Cheers. – tlfong01 2 days ago
  • One more trick to reduce overloading I2C bus: REMOVE ALL PULLUPs on the modules (Rpi I2C pins also have 1k8 strong pullup). – tlfong01 2 days ago
  • PS – I am using the following references: (1) “MAX30100 Pulse Oximeter and Heart-Rate Sensor IC for Wearable Health datasheet- Maxim”: datasheets.maximintegrated.com/en/ds/MAX30100.pdf, (2) “AliExpress MAX30102 heart rate sensor / blood oxygen sensor MAX30100 heart rate sensor pulse oximeter – US$1.65”: fr.aliexpress.com/item/…, – tlfong01 2 days ago
  • (3) “AliExpress OxyMeter Catalog”: aliexpress.com/popular/pulse-oximeter-sensor.html. (4) I am assuming you are using the Ref 2 cheap toy which is coronaVirus friendly. Please let me know otherwise:) – tlfong01 2 days ago
  • If your are using whilemind/MAX30100u’s test_max30100.py, you can add debug print statement. Or you can try to read-after-write the ConfigReg at address 0x06. You can also try your luck on other python max30100 python/C libraries: (1) “mfitzp/max30100 – A Python lib for MAX30100 HR/Oximetry sensor”: github.com/mfitzp/max30100, (2) “kontakt/MAX30100 – Lib Maxim MAX30100 pulse oximetry chip”: github.com/kontakt/MAX30100, (3) “whilemind/MAX30100u – max30100 heart rate and oxygen sensor driver in python”: github.com/whilemind/MAX30100u. Good luck cheers. – tlfong01 2 days ago
  • And there is the noise problem, that might also cause data transmission IO error, thought not the frequent. On troubleshooting trick is to use battery power. For noise sensitive sensors, I usually use 18650 Lipo Power Bank and step down to 5V or 3V, to make sure no line 50/60Hz interfering the heart pulse signal. You might like to read the answer about ECG heart pulse meter to see how I use Lipo power bank to reduce noise: raspberrypi.stackexchange.com/questions/98416/…. – tlfong01 2 days ago
  • 1
    Invariably poor wiring. You need to add a clear photo or photos showing the I2C connections if you want practical help. – joan 2 days ago
  • 1
    @tlfong01 Hi ,thanks for your response , I changed the wire. No change. – saeed sadati 2 days ago
  • Hi @saeed sadati, yest one more troubleshooting suggestion: Use another I2C device to check that I2C hardware/software are basically OK. – tlfong01 2 days ago
  • 1
    @tlfong01 Hi ,I hope that the good state.Error remote i/o error was resolved. I think it was a connection.When I run the code, the sensor starts flashing, but even though I put my finger on the sensor, it still shows zero(0). – saeed sadati 1 hour ago
  • Hi @saeed sadati, How nice to hear that you solved the I2C I/O Error #121 problem. Perhaps I can follow the tutorial you are following and see if I can suggest anything, and then come back to you. – tlfong01 57 mins ago
  • 1
    @tlfong01, thanks a lot – saeed sadati 53 mins ago
  • Question: Are you using the following or similar cheap toy: (1) “GY-MAX30100 Heart Rate Oxygen Concentration Sensor – FYD Open Source Hardware, US$7”:: fr.aliexpress.com/item/32749194911.html. – tlfong01 45 mins ago
  • 1
  • I skimmed the python driver/library you are using and found it good. Now let me see. If (1) “i2cdetect – y 1” can detect the device, and (2) no more #122 IO errors, then means general setup is OK. Now (3) You read zero output. Now please confirm if you are using the program “test_max30100.py” and show us the output message and see if we can help. I found the python class and test in python are well documented. Perhaps you can insert debug print statements to narrow down the trouble making area. / to continue, … – tlfong01 1 min ago   Edit
  • (1) “Amazon MAX30100 Pulse Oximeter Heart Rate Sensor Module – Lysignal”: amazon.com/dp/B073W999X2 (2) “MAX30100 Pulse Oximeter and Heart-Rate Sensor IC for Wearable Health Datasheet – Maxim”: datasheets.maximintegrated.com/en/ds/MAX30100.pdf (3) “whilemind/MAX30100u max30100 heart rate and oxygen sensor driver in python – whilemind/MAX30100u”: github.com/whilemind/MAX30100u (4) “whilemind/MAX30100u max30100.py (Class)”: github.com/whilemind/MAX30100u/blob/master/max30100.py, / to continue, … – tlfong01 38 secs ago   Edit
  • (5) “whilemind/MAX30100u MAX30100u/test_max30100.py (Test)”: github.com/whilemind/MAX30100u/blob/master/test_max30100.py (6) “whilemind/MAX30100u C Source for Arduino”: github.com/whilemind/MAX30100u/tree/master/csource. Good luck and cheers. – tlfong01 just now   Edit

(1) “Amazon MAX30100 Pulse Oximeter Heart Rate Sensor Module – Lysignal”:

(2) “MAX30100 Pulse Oximeter and Heart-Rate Sensor IC for Wearable Health Datasheet – Maxim”:

Click to access MAX30100.pdf

(3) “whilemind/MAX30100u max30100 heart rate and oxygen sensor driver in python – whilemind/MAX30100u”:

(4) “whilemind/MAX30100u max30100.py (Class)”:

(5) “whilemind/MAX30100u MAX30100u/test_max30100.py (Test)”:

(6) “whilemind/MAX30100u C Source for Arduino”:

Risym GY-MAX30100 MAX30102 Heart Rate Oxygen Concentration Sensor – ¥35

GY-MAX30100 Heart Rate Oxygen Concentration Sensor -FYD Open Source Hardware US$7

The heart rate click carries the integrated pulse oximetry and the Maxim MAX30100 heart rate sensor. It is an optical sensor which derives its readings.

From the emission of two wavelengths of light from two LEDs – one red and one infrared -, then from the measurement of the absorbance of the pulsating blood through a Photodetector . This LED color combination is optimized for reading data through the fingertip. The signal is processed by a low noise analog signal processing unit and communicated to the target MCU via the mikroBUS ™ I2C interface. The developers of End-user applications should note that the readings can be negatively impacted by excess movement and temperature changes. Also, too much The pressure can limit capillary blood flow and therefore decrease the reliability of the data. A programmable INT pin is also available. Uses

3.3 V power supply. Size: 14mm * 14mm

Main features:

Optical sensor: IR and red LED combined with photodetector

Measures the absorbance of pulsed blood

I2C interface and INT
3.3 V pin.

Main advantages:
Movement artifact resillence
Ambient light cancellation

Examples ready for jobs save development time
Supported in all MikroElektronika compilers

Development of algorithms for pulse oximetry and heart rate readings through the tip of a finger.



Categories: Uncategorized

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: