Skip to content

Having issues with a raspberry pi pico #10

Closed

Description

@Ibrahim778

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

Also the readings I get are like this:

22665 , 30041
22663 , 30040
22661 , 30038
22660 , 30039
22660 , 30041
22661 , 30044
22663 , 30052
22668 , 30063
22672 , 30073
22673 , 30075
22669 , 30070
22667 , 30068
22665 , 30068
22666 , 30071
22667 , 30074

Are they normal for this sensor?

Activity

  1. n-elia commented on Mar 25, 2022

    @n-elia
    Owner

    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.

  2. Ibrahim778 commented on Mar 25, 2022

    @Ibrahim778
    Author

    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

  3. n-elia commented on Mar 25, 2022

    @n-elia
    Owner

    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?

  4. Ibrahim778 commented on Mar 25, 2022

    @Ibrahim778
    Author

    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

  5. n-elia commented on Mar 25, 2022

    @n-elia
    Owner

    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.

  6. Ibrahim778 commented on Mar 25, 2022

    @Ibrahim778
    Author

    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!

  7. n-elia commented on Mar 26, 2022

    @n-elia
    Owner

    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.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!

    Feel free to ask anything,
    Bye,
    Nicola

  8. Ibrahim778 commented on Mar 27, 2022

    @Ibrahim778
    Author

    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

  9. n-elia commented on Mar 27, 2022

    @n-elia
    Owner

    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

  10. Repository owner locked and limited conversation to collaborators on Mar 27, 2022
  11. converted this issue into a discussion #11 on Mar 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions