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?
-
1Comments are not for extended discussion; this conversation has been moved to chat. – Ghanima♦ 18 hours ago
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 encountered the following 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?
Answer
Part A – Remote I/O Error [Error #121]
(1)
/ to continue, …
Part B – Always Reading Zero Values of Red LED and IR LED
(1)
/ to continue, …
References
(1)
/ to continue, …
Appendices
Appendix A – MAX30100 Register Map Summary
/ to continue, …
Figures
Fig 1 – MAX3010x Register Map Summary
Categories: Uncategorized