Uncategorized

max30100 notes

Asked 
Active today
Viewed 136 times
1

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.

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():
    try:
        mx30 = max30100.MAX30100()
        mx30.set_mode(max30100.MODE_SPO2)
        # mx30.reset()
        # time.sleep(1)
        # mx30.startup()
        # time.sleep(1)

        i = 0
        while i < 30:
            mx30.set_mode(max30100.MODE_HR)
            mx30.read_sensor()
            # # 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()
            mx30.reinit()
            mx30.set_mode(max30100.MODE_SPO2)
            # time.sleep(1)
            mx30.read_sensor()
            # 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))
            mx30.reset()
            time.sleep(1)

            i = i + 1
        mx30.reset()
        # mx30.shutdown()

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

if __name__ == "__main__":
  main()

https://github.com/whilemind/MAX30100u

connection PINS GPIO and sensor max30100

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

Can anyone help me to fix this issue?

0

Question

The OP has setup and successfully detected an I2C MAX30100 Pulse Oximeter and Heart-Rate Sensor module. But when trying to read the sensor, he encounters two problems:

(1) Gets the "Exception remote I/O error [error 121]",

(2) Gets only zero values for the red LED and IR Led outputs.

How to fix it?


max30100 module


Answer

Part A – Setting up and preliminary testing

(1) Suggest to check I2C wiring and use “i2cdetect” and “i2cget” to find max30100 chip at I2C Bus #1, I2C device address 0x57, and Part ID 0x11 or 0x15 at max30100 register address 0xFF, as show below. (Note: MAX30100 Part ID is 0x11, MAX30102 is 0x15)

max30100 read


(2) The OP’s Test Results

op test results


(3) Using max30100’s library methods to read PartID register OK.

read part id reg

/ to continue, …


Part B – Pulse Oximeter and Heart Rate Measurements

(1) Hardware Setup

hardware setup


(2) The simplest read sensor program

read sensor v09

(3) Minimal program to read registers and sensor

Sample Output

partID = 0x15

revID = 0x3

temperature = 14.9375

ir = 3 red = 1

ir = 3 red = 1

ir = 3 red = 1

ir = 3 red = 1

# max30100test12.py tlfong01 2020may08hkt1941
# Rpi4B buster (2020feb13), linux 4.19.97
# python 3.7.3 (2019dec20) thonny v3.2.7 (2020jan22)

import max30100lib07 as max30100

# *** Test Function ***

sensor1 = max30100.MAX30100()

def setupSensor(sensor):
    sensor.reinit()
    sensor.set_mode(max30100.MODE_SPO2)
    return

def resetSensor(sensor):
    sensor.reset()
    return

def readRegisters(sensor):    
    # *** Read PartId ***
    partId =  sensor.get_part_id()
    print('partID      =', hex(partId))

     # *** Read Rev Id ***
    revId =  sensor.get_rev_id()
    print('revID       =', hex(revId))   

    # *** Read Temperature ***
    temperature =  sensor.get_temperature()
    print('temperature =', temperature)    

    return

def readSensor(sensor):
    totalCount = 4
    for count in range(totalCount):
        sensor.read_sensor()
        print('ir          =', sensor.ir, '          red           =', sensor.red)
    return

# *** Main ***

setupSensor(sensor1)
readRegisters(sensor1)
readSensor(sensor1)
resetSensor(sensor1)

# *** End of program ***

# *** Sample output  tlfong01  2020may08hkt2135 ***
'''
>>> %Run max30100test12.py
partID      = 0x15
revID       = 0x3
temperature = 14.9375
ir          = 3           red           = 1
ir          = 3           red           = 1
ir          = 3           red           = 1
ir          = 3           red           = 1
>>> 
'''

* End of Sample output *

/ to continue, …


References

(1) MAX30100 Pulse Oximeter and Heart-Rate Sensor IC for Wearable Health Datasheet – Maxim

(2) MAX30102 High-Sensitivity Pulse Oximeter and Heart-Rate Sensor for Wearable Health – Maxim

(3) whilemind/MAX30100u max30100 Library

(4) whilemind/MAX30100u max30100 Class (max30100.py)

(5) whilemind/MAX30100u max30100 Test (test_max30100.py)

(6) mfitzp/max30100 max30100 Library

(7) kontakt/max30100 Library

(8) Amazon MAX30100 Pulse Oximeter Heart Rate Sensor Module – Lysignal

(9) AliEXpress GY-MAX30100 Pulse Oximeter Heart Rate Sensor Module – US$7

(10) TaoBao Risym GY-MAX30100 MAX30102 Pulse Oximeter Heart Rate Sensor Module – ¥35

(11) Amazon MAX30102 Pulse Oximeter Heart Rate Sensor Module

(12) Pulse Oximeter Instructable – MolecularD 2019sep

(13) max30100/102 pulse sensor discussion – ParticleCommunity

(11) TaoBao GY-MAX30100 MAX30102 Pulse Oximeter and Heart-Rate Sensor – ¥35

(12) Pulse Oximeter Instructable – MolecularD 2019sep

(13) Amazon max30102 Pulse Oximeter and Heart-Rate Sensor

(14) Particle.Community max30100 Forum Discussion

(15) Implementing pulse oximeter using MAX30100 Blog – Raivis Strogonovs 2017

(16) Max30100 Heart Rate Monitor Youtube Video – Maxim

(17) AD8232 ECG / Haeart Rate Sensor Rpi.StackExchange Forum Discusson

(18) Oxygen Saturation – Wikipedia

(19) Pull-up Resistors Tutorial – Electronics.Tutorials

(20) Application note AN10441 Level shifting techniques in I2C-bus design R0.1 2007jun18 – NXP

(21) I2C Bus Pullup Resistor Calculation, Application Report SLVA689, TI 2015feb

(22) Setting up multiple I2C buses using dtoverlay [Rpi4B] – rpi.stackexchange forum post 2019sep30

(23) What is Rpi4B I2C Maximum Speed?

(24) A Guide to Voltage Translation With TXS-Type Translators – TI

(25) MAX30100/02 Oximeter – How to fix wrong board – Valeriy Yatsenkov 2018aug22

(26) SC6206B LDO 65K5 (1V5 to 5V0, 250 mA) Datasheet – LCSC

(27) Max30100 pulse Oximeter Arduino Code, circuit, and Programming – Engr Fahad, Electronic Clinic 2020feb23

(28) How pulse oximeters work explained simply – Howeauipmentworks

(29) MAX30100 Pulse Oxmeter and Heart Rate Sensor (Arduino 5V input, use external 4k7 pullup to 5V, instead of 1V8)

(30) MAX30105 Particle and Pulse Oxmeter (Vin 5V, green LED won’t work if Vin is 3V3)

(31) Bash V5.0 User Manual – 2019may

/ to continue, …


Appendices

*Appendix A – MAX30100 *

/ to continue, …


Figures

Fig 1 – MAX3010x System Diagram

max30100 system


Fig 2 – MAX3010x Function Diagram

max30100 function diagram


Fig 3 – MAX3010x Register Map Summary

max3010x reg map summary


Fig 4 – GY-MAX30102 Module Schematic

max30100 schematic


Fig 5 – GY-MAX00 ProductSheet

max30100 product sheet


Fig 6 – GY-MAX30100 PCB Components Layout Diagram

max30100 pcb


Fig 7 – Rpi4B to MAX30100 Module Wiring Diagram

rpi max wiring


Fig 8 – MAX30102 PCB and Components Layout

max30102


Program Listings

(1) read_max30100.py tlfong01 2020may05hkt1936

# read_max30100.py tlfong01 2020may05hkt1936
# Rpi4B buster (release 2020feb13, linux 4.19.97), thonny v3.2.7 (release 2020jan22)
# Reference: https://github.com/whilemind/MAX30100u/blob/master/test_max30100.py

import max30100

# import max30100lib07 as max30100

# *** Test Functions ***

def readMax30100PartIdRegister():

    sensor = max30100.MAX30100()
    sensor.reinit()
    sensor.set_mode(max30100.MODE_SPO2)

    partIdRegisterContents =  sensor.get_part_id()

    # partIdRegisterContents = 'fakeFakeFake'

    print('max30100 Part ID register contents =', partIdRegisterContents)

    sensor.reset()

    return

# *** Main ***

readMax30100PartIdRegister()

# End of program

(2) Setting up multiple I2C buses

# fi2c62.py  tlfong01 2019aug28hkt1433

from time          import sleep
import             smbus
import             fprint53    as fprint
import             ftime53     as ftime

# I2c Bus Setup Notes
# pi@raspberrypi:~ $ date Wed 28 Aug 2019 03:26:24 PM HKT
# pi@raspberrypi:~ $ uname -a
# Linux raspberrypi 4.19.58-v7l+ #1245 SMP Fri Jul 12 17:31:45 BST 2019 armv7l GNU/Linux
# pi@raspberrypi:~ $ sudo nano /boot/config.txt
# dtoverlay=i2c1,pins_2_3  (board pins 3, 5)
# dtoverlay=i2c3,pins_4_5  (board pins 7, 29)
# dtoverlay=i2c4,pins_6_7  (board pins 31, 26)
# dtoverlay=i2c5,pins_12_13 (board pins 32, 33)
# dtoverlay=i2c6,pins_22_23 (board pins 15, 16)
# pi@raspberrypi:~ $ ls /dev/i2c*
# /dev/i2c-1  /dev/i2c-3  /dev/i2c-4  /dev/i2c-5  /dev/i2c-6

# ********************************************************************************
# ********************************************************************************

# *** I2c Bus Config ***

i2cBus1 = smbus.SMBus(1) 
i2cBus3 = smbus.SMBus(3)
i2cBus4 = smbus.SMBus(4)
i2cBus5 = smbus.SMBus(5)

i2cBusDict = {'I2cBus1': i2cBus1,
              'I2cBus3': i2cBus3,
              'I2cBus4': i2cBus4,
              'I2cBus5': i2cBus5,
             }

# *** Pca9685 I2c Slave Device Congif ***

pca9685DevAddrDict = {
                'Dev0': 0x40,
                'Dev1': 0x41,
                'Dev2': 0x42,
                'Dev3': 0x43,
                'Dev4': 0x44,
                'Dev5': 0x45,
                'Dev6': 0x46,
                'Dev7': 0x47,
              }

pca9685RegAddrDict = { 'Mode1': 0x00,
                       'Mode2': 0x01,
                     }

pca9685DataByteDict = {
                       'Mode1Reset': 0x11,

    }

# ********************************************************************************
# ********************************************************************************

# *** Read Write Print Device/Register Functions ***

def writeDevTwoBytes(i2cBus, devAddr, writeByte1, writeByte2):
    i2cBus.write_byte_data(devAddr, writeByte1, writeByte2)
    return

def writeRegOneByte(i2cBus, devAddrDict, devName, regAddrDict, regName, writeByte):
    devAddr = devAddrDict[devName]
    regAddr = regAddrDict[regName]
    writeDevTwoBytes(i2cBus, devAddr, regAddr, writeByte)
    return

def readDevOneByte(i2cBus, devAddr, readByteAddr):
    readByte = i2cBus.read_byte_data(devAddr, readByteAddr)
    return readByte

def readRegOneByte(i2cBus, devAddrDict, devName, regAddrDict, regName):
    devAddr = devAddrDict[devName]
    regAddr = regAddrDict[regName]
    readByte = i2cBus.read_byte_data(devAddr, regAddr)
    return readByte

def printRegOneByte(i2cBus, devAddrDict, devName, regAddrDict, regName):
    readByte = readRegOneByte(i2cBusName, devAddrDict, devName, regAddrDict, regName)
    print(printTitle, hex(readByte))
    return

# *** Main Test Function ***

def testWriteReadPca9685Bus1Dev0RegMode1():     
    fprint.printBeginExecFunction()

    i2cBusName = 'I2cBus1'
    devName    = 'Dev0'
    regName    = 'Mode1'

    #i2cBus      = fi2c.i2cBusDict[i2cBusName]
    i2cBus      = i2cBusDict[i2cBusName]
    devAddrDict = pca9685DevAddrDict
    regAddrDict = pca9685RegAddrDict  

    writeByte = 0x77

    writeRegOneByte(i2cBus, devAddrDict, devName, regAddrDict, regName, writeByte)
    readByte = readRegOneByte(i2cBus, devAddrDict, devName, regAddrDict, regName) 

    if readByte == writeByte:
        resultsString = 'Good'
    else:
        resultsString = 'Bad'

    devAddr = devAddrDict[devName]

    fprint.printTitleOneByteNum('PCA9685 I2C Address',             fprint.indentFormat640, devAddr)
    fprint.printTitleOneByteNum('PCA9685 MODE1 Register Written',  fprint.indentFormat640, writeByte) 
    fprint.printTitleOneByteNum('PCA9685 MODE1 Register Read',     fprint.indentFormat640, readByte)    
    fprint.printTitleString('Write/Read Results',                  fprint.indentFormat640, resultsString)

    fprint.printEndExecFunction()
    return

def testPingPca9685Bus1Dev0RegMode1():     
    fprint.printBeginExecFunction()

    i2cBusName = 'I2cBus1'
    devName    = 'Dev0'
    regName    = 'Mode1'

    #i2cBus      = fi2c.i2cBusDict[i2cBusName]
    i2cBus      = i2cBusDict[i2cBusName]
    devAddrDict = pca9685DevAddrDict
    regAddrDict = pca9685RegAddrDict

    devAddr = devAddrDict[devName]

    readByte = readRegOneByte(i2cBus, devAddrDict, devName, regAddrDict, regName)    

    compareByte = pca9685DataByteDict['Mode1Reset'] 

    if readByte == compareByte:
        resultsString = 'Good'
    else:
        resultsString = 'Bad'

    fprint.printTitleString('PCA9685 I2C Address',             fprint.indentFormat640, hex(devAddr))
    fprint.printTitleString('PCA9685 MODE1 Register Written',  fprint.indentFormat640, hex(compareByte)) 
    fprint.printTitleString('PCA9685 MODE1 Register Read',     fprint.indentFormat640, hex(readByte))    
    fprint.printTitleString('Ping Results',                    fprint.indentFormat640, resultsString)

    fprint.printEndExecFunction()
    return

# ********************************************************************************
# ********************************************************************************

# *** Main Tests ***

def mainTests():
    #ftime.testPrintDateTime()
    testPingPca9685Bus1Dev0RegMode1()
    testWriteReadPca9685Bus1Dev0RegMode1()
    return

# ********************************************************************************
# ********************************************************************************

# *** Init/Main Functions ***

# *** Init Function ***

def init():
    pass
    return

#*** Main Function ***

def main():
    init()
    mainTests()    
    return

# ********************************************************************************
# ********************************************************************************

# *** Main ***

if __name__ == '__main__':
    main()

# *** End of Program ***

# ********************************************************************************
# ********************************************************************************
Q: When I run source code the sensor Max30100, I get an error remote i/o error

saeed sadatiI 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. Error: max30100 got exception [errno 1…

(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.
One more trick to reduce overloading I2C bus: REMOVE ALL PULLUPs on the modules (Rpi I2C pins also have 1k8 strong pullup).
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/…,
(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:)
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.
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/….
Invariably poor wiring. You need to add a clear photo or photos showing the I2C connections if you want practical help.
@tlfong01 Hi ,thanks for your response , I changed the wire. No change.
Hi @saeed sadati, yest one more troubleshooting suggestion: Use another I2C device to check that I2C hardware/software are basically OK.
@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).
10:12 AM
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, thanks a lot
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.
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, …
(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, …
(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.
BTW, the python library actually includes an Arduino C++ Library (Ref #6 above) . If by any chance you have have an Arduino in hand, you can test it (just to make sure your sensor is working OK) using Arduno. But don’t let your bad Anono friends know about it, or they will LOL:)
I will test with Ardino. output now :i.stack.imgur.com/miYRF.png
10:12 AM
Ha, I am glad to see that you are using Thonny to test the “test_max30100.py” program. I used to think that Rpi IDLE IDE is good to play with python. Now I think Thonny is even better. Anyway, I shall wait to hear the good news from your stupid Arduino. In the mean time I will check out the test_max30100.py and perhaps suggest a troubleshooting plan later. Ah, locking up lunch time now! Good luck and cheers.
So eating my lunch, at the same time googling around. I found this interesting: (7) “Pulse Oximeter MAX30100/MAX30102 – how to fix wrong board – Valeriy Yatsenkov 2018apr22”: reedpaper.wordpress.com/2018/08/22/…. The funny guy Yatsenkov tells us two things: (8) max30100 is old model and discontinued, and now replaced by max30102. (9) The bad guys up North of my city had made a huge mistake (no, not the virus thing :)) and are trying to cover it up by redesigning something. Anyway, let me finish my noodle and come back later.
So if you read Yatsenkov’s post and finally make your max30100 sensor module working for Arduino, you might come back to Rpi and try your luck again. Just now I skimmed the max30100 library’s class and test program and found them quite straightforward as usual the basic step: (1) create a max30100 sensor object, (2) reset sensor object,
(3) read sensor object. I know your sensor returns zero. I found that the class has other methods like “read temperature”. So perhaps you might like to see if you can read temperature, and if OK, then move on to read sensor. You might also like to use the class’s read registers to see if you can properly read the register. As I said the library is quite short, only about 250 python statements. The test program is even shorter, so you can mess around with the max30100 class’s methods. Let me me know if you got stuck. Good luck and cheers.
I am writing a penzu reading log: penzu.com/p/86a772c1. You might like to refer to the included list of reference and listings of programs for future discussions.
Now I am reading the datasheet to see what is inside the MAX30102 chip, and try to read the registers: penzu.com/p/abd5ffe9. I am thinking of first reading the Part ID Register at address 0xFF. I usually read this register as a first step in testing and troubleshooting. Ah, almost supper time. See you late this evening, or tomorrow.Cheers.
7 hours later…
5:13 PM
hi, Thank you very much for following up. I would like to inform you of the results.
2:30 AM
@saeedsadati Ah, Program Listing #2 on setting up multiple I2C buses is for testing 4 sensors at the same time. You see that I am setting up five I2C buses, #1, 3, 4, 5, 6, using DT drivers. My plan is to test 4 sensors at the same time.
The import modules “fprint53.py”, “ftime53.py” are debug printing and debug timing python functions. I am refactoring these functions as time goes by, and now they are version 200+. Perhaps I should show you the complete listing when they become more stable.
What users need to copy and paste are the driver setting, and how to initialize the buses. Again I would show you the details when the time comes. By the way, the four MAX30100 toys I ordered would hopefully arrive today, so see you later 🙂
HI, Thank you very much for your follow-up.
I am now tracking my toys. They are crossing the ShenZhen HongKong border right now, hopefully arriving today or tomorrow. GY-MAX30100 MAX30102 心跳心率 脉搏 血氧浓度检测传感器模块 天猫10年老店 Risym 价格¥34.95 x 4
Bid date 2020-05-04 14:23:13 Paid date 2020-05-04 14:29:12
顺丰速运有限公司 SF10221310*****
2020-05-05 20:47:13 等待揽收中
2020-05-05 23:09:00 顺丰速运 已收取快件
2020-05-05 23:14:00 快件在【深圳福田友谊路营业部】已装车,准备发往 【深圳五和中转场】
2020-05-06 00:04:00 快件到达 【深圳五和中转场】
2020-05-06 01:20:00 快件在【深圳五和中转场】已装车,准备发往 【香港新界青衣中转场】
3:03 AM
And Google translates to: GY-MAX30100 MAX30102 Heartbeat Heart Rate Pulse Blood Oxygen Concentration Detection Sensor Module Tmall 10 Year Old Risym Price ¥ 34.95
Bid date 2020-05-04 14:23:13 Paid date 2020-05-04 14:29:12
SF Express Co., Ltd. SF10221310 *****
2020-05-05 20:47:13 waiting for collection
2020-05-05 23:09:00 SF Express
2020-05-05 23:14:00 The express shipment has been loaded at the [Shenzhen Futian Youyi Road Sales Department] and is ready to be sent to [Shenzhen Wuhe Transit]
2020-05-06 00:04:00 Express delivery 【Shenzhen Wuhe Transit】

(see full text)

3:18 AM
I hope the GY-MAX30100 MAX30102 is good.
11 hours later…
2:03 PM
Yes, I hope so. They just arrived. I am checking out the layout of the components. One thing I don’t understand is the following: What is the correct input to the module? 3V3 or 5V0? Since there is two regulators (1) 5V down to 3V0, (2) 3V3 to 1V8. So I think I should input 5V. But I see the Arduino guys use 3V3 input to the module. That seems not making sense. I need to google again. QUESTION: Have you seen any Arduino guys inputting 5V to the module?
user image
Bed time. I call it a day. See you tomorrow.
5 hours later…

« first day (1 day earlier)      last day (2 days later) »

12:50 AM
@saeedsadati Oh my goodness, so you are still alive, I mean your toy is still alive and kicking. That is good news, because then we can do sort of global/remote pair programming/development at two different space and time points of the Galaxy. By the way, I notice that your toy’s PartID is 0x11, mine 0x15. You might like to tell me how come the discrepancy.
1:05 AM
I have merged your two photos into one. Perhaps you might like to edit your question to include your two-in-one masterpiece.
user image
3 hours later…
3:46 AM
good morning, Thanks a lot. That means you say the sensor is healthy And it doesn’t need to be changed, and programming is problem?
1 hour later…
5:03 AM
@saeedsadati Yes, if you can (1) i2cdetect 0x53, (2) i2cget 0x11, then your max30100 is 90% chances good. In other words, we can now use the python library to read the sensor and see why you got zeros. Anyway, next step is to use the library to again read the PartID register to get 0x11 (me 0x15), and if OK, then try to read sensor output, or temperature output.
2 hours later…
6:35 AM
@saeedsadati Just now I ran my readPartId program and it took me only 2 minutes to debug and got what I want – 0x15. The program listing and sample output is shown below. You might also like to try your luck and see if you can get 0x11! : )
user image
@saeedsadati Just now I ran my readPartId program and it took me only 2 minutes to debug and got what I want – 0x15. The program listing and sample output is shown below. You might also like to try your luck and see if you can get 0x11! : ) Note: I renamed the original library program from max30100lib.py to max30100lib07.py, so that I can try changes of on the renamed library without messing up the original version, which is now used as backup.
7:00 AM
@saeedsadati The time has come to do pulse oximetering!
user image
7:25 AM
@saeedsadati No luck in first run of the oximeter program, with an error message something like “exception name ‘time’ not defined.” Ah, afternoon tea time, so will take a long break, cheers.
1 hour later…
8:54 AM
@saeedsadati So I started debugging. My usual trick is the “Occam’s Razor “: Make things as simple as possible, but not simpler. So I snipped the original read sensor program as much as possible and tried my luck again. This time I had some non zero readings, as show below:
user image
You might also like to try my readSensor(*) v09 and see if you can also get non zero results.
5 hours later…
1:51 PM
@saeedsadati Now I have written a demo program to do the following: (1) Read PartID and temperature registers, (2) Read sensor. Please read my answer Part B Section 3 for more details.
My answer is coming to an end. Very briefly, I have completed the following: (1) troubleshooting tricks for I2C I/O Error #121, (2) reading sensor with non-zero values. Of course we are just scratching the surface of oximeter and heart rate sensor. If you don’t have other problems for me, I am taking a long break, before coming back. Feel free to make comments and suggestions at the end of my answer. Hopefully me and other visitors would join in an learn together. Good luck and cheers.
Old answer cannot edit, so repeat here: My answer is coming to an end. Very briefly, I have completed the following: (1) show troubleshooting tricks for I2C I/O Error #121, (2) reading sensor with non-zero values. Of course we are just scratching the surface of oximeter and heart rate sensor.
And if you don’t have other problems for me now, I am taking a long break, before coming back. Please Feel free to make comments and suggestions at the end of my answer. Hopefully me and other visitors would join in an learn together. Good luck and cheers.
.END

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: