You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using a Raspberry Pi Pico running micropython.
I have the device attached on the hardware I2C pins and I pass through the instance just fine
Sensor setup works. However I can't seem to read any actual data from it
Using the example you have given I get strange errors, most are related to strings in the check function, for example:
Traceback (most recent call last):
File "<stdin>", line 42, in <module>
File "max30102.py", line 714, in safe_check
File "max30102.py", line 668, in check
TypeError: ord() expected a character, !string of length 536990608 found
Other times, I get a few readings then it just freezes.
I have tried with check() and safe_check()
Both give the same result
Hi Ibrahim,
you're the first one with such a problem on the Pi Pico.
Are you using a genuine Maxim sensor?
The values seem ok, but keep in mind that their magnitude depend on the sensor's configuration, that you have to tune based on your use case.
Also, did you load your project on the board, or executed main.py "on the fly"? Please follow the instructions given in the README.md, here if you haven't before.
I believe I am using a genuine sensor, is there anyway for me to tell?
I am using code from main.py, yes, Also yes I am using the same as the example in the readme
Ok, I suggest you to upload the files as described in the README, and then to press the reset button. Otherwise, we can't be sure that everything is running well. (Using pico-go you should use the 'Upload' feature.)
The sensor seems a clone to me. You can check it by following these hints.
I am having quite a bit of trouble doing so. Getting your example to work I mean
Even after using the correct, hardware, I2C pins and things, after uploading it simply doesn't run
I don't see any output either
Edit: Scratch that, I think I found the issue!
Edit2: Can I ask what version of python you're using? I'm using the latest micropython for the pi pico
Edit3: Well I'm baffled! It seems to work with your example, I have no idea why it wasn't working for me, I will require further help if you don't mind, I'll send you over my code tomorrow, Thanks!
I am using this driver since more than a year. I always used the latest micropython version, which now is 1.18.
Provided that you set the correct i2c pins, of you upload the main.py, boot.py and driver files into /lib folder, then the only thing you need is to reset the board with the onboard reset button. Then, it should work!
I just need to ask about one thing
Your driver is for the MAX30102 but in the library code all references are to the MAX30105, just a little confused on that bit
Also could you give a basic rundown on how it all works? I'm in the process of porting this to C, but I'm confused on why self._sample_avg etc exist
MAX30105 and MAX30102 are very similar; the 105 packs 3 LEDs (red, green, ir) while the 102 does not provide a green led.
This library is a port of MAX30105 library, and I had the chance to test it only on max30102 sensor. This is why you see references to max30105.
You're reinvent the wheel. If you reead the first lines of this repo's readme, you'll see that this is a port of a C driver. You should just use the sparkfun driver.
These drivers just interface with the sensor module through i2c. To understand how it works, you should take a look to Maxim MAX30102 datasheet.
Activity
n-elia commentedon Mar 25, 2022
Hi Ibrahim,
you're the first one with such a problem on the Pi Pico.
Are you using a genuine Maxim sensor?
The values seem ok, but keep in mind that their magnitude depend on the sensor's configuration, that you have to tune based on your use case.
Also, did you load your project on the board, or executed main.py "on the fly"? Please follow the instructions given in the README.md, here if you haven't before.
Ibrahim778 commentedon Mar 25, 2022
I believe I am using a genuine sensor, is there anyway for me to tell?
I am using code from main.py, yes, Also yes I am using the same as the example in the readme
n-elia commentedon Mar 25, 2022
Do you have a link to a shop webpage?
Did you load your project on the board, or executed main.py "on the fly"? Have you tried ti simply reset the board with reset button?
Ibrahim778 commentedon Mar 25, 2022
I run main.py 'on the fly', I use pico-go on vscode you see, it has a run button
I can link you the sensor:
https://hallroad.org/max30102-blood-oxygen-concentration-wrist-heart-rate-pulse-detection-heartbeat-sensor-module-stm32-sensor-in-pakistan.html
n-elia commentedon Mar 25, 2022
Ok, I suggest you to upload the files as described in the README, and then to press the reset button. Otherwise, we can't be sure that everything is running well. (Using pico-go you should use the 'Upload' feature.)
The sensor seems a clone to me. You can check it by following these hints.
Ibrahim778 commentedon Mar 25, 2022
I am having quite a bit of trouble doing so. Getting your example to work I mean
Even after using the correct, hardware, I2C pins and things, after uploading it simply doesn't run
I don't see any output either
Edit: Scratch that, I think I found the issue!
Edit2: Can I ask what version of python you're using? I'm using the latest micropython for the pi pico
Edit3: Well I'm baffled! It seems to work with your example, I have no idea why it wasn't working for me, I will require further help if you don't mind, I'll send you over my code tomorrow, Thanks!
n-elia commentedon Mar 26, 2022
Hi,
I am using this driver since more than a year. I always used the latest micropython version, which now is 1.18.
Provided that you set the correct i2c pins, of you upload the
main.py,boot.pyand driver files into/libfolder, then the only thing you need is to reset the board with the onboard reset button. Then, it should work!Feel free to ask anything,
Bye,
Nicola
Ibrahim778 commentedon Mar 27, 2022
I just need to ask about one thing
Your driver is for the MAX30102 but in the library code all references are to the MAX30105, just a little confused on that bit
Also could you give a basic rundown on how it all works? I'm in the process of porting this to C, but I'm confused on why self._sample_avg etc exist
n-elia commentedon Mar 27, 2022
Hi,
MAX30105 and MAX30102 are very similar; the 105 packs 3 LEDs (red, green, ir) while the 102 does not provide a green led.
This library is a port of MAX30105 library, and I had the chance to test it only on max30102 sensor. This is why you see references to max30105.
You're reinvent the wheel. If you reead the first lines of this repo's readme, you'll see that this is a port of a C driver. You should just use the sparkfun driver.
These drivers just interface with the sensor module through i2c. To understand how it works, you should take a look to Maxim MAX30102 datasheet.
I'll close this issue, have a nice day.
Nicola