Defective Pulse Sensor?

I have a new MetaWear R with pulse sensor, which lit once briefly and now doesn't at all. When I run Laura's iOS HeartRate app, it connects but the BPM reading doesn't change from 60. I've cleared, restarted, and reset the device, including factory reset. Seems like the pulse sensor or pins 8-11 are defective, but perhaps its a configuration problem? What can I do?

Comments

  • pdupuy,

    You need to set one of the GPIO pins low in order to enable to hear rate sensor (by default it is off).
  • Thanks for the quick reply Laura. Will you please provide more specific details on how to set one of the GPIO pins to low? Will you please provide a code snippet? Can I do this "manually" in the MetaWear app's GPIO section?
  • edited November 2015
    You can read up on the GPIO class on the iOS docs: https://mbientlab.com/iosdocs/#gpio.  The documentation has code snippets for the various GPIO features.
  • edited December 2015
    Thanks Eric. I saw the docs but there's nothing explicitly about setting a GPIO pin low. If that's a requirement, why doesn't the example application do it?

    In the API documentation, GPIO:Set/Clear Pin, there is "[pin0 setToDigitalValue:YES];"  Is "low" equivalent to "NO"?

    I tried this at the end of the refreshPressed method, after "Set up timer for GPIO pin reading", which seems a likely place for this kind of initialization:

    MBLGPIOPin *pin0 = self.device.gpio.pins[0];
    [pin0 setToDigitalValue:NO];

    There was no change in the system (Pulse Sensor light still off).

    I see a property that looks related, enablePinActiveLow, documented here: http://cocoadocs.org/docsets/Metawear-iOSAPI/1.8.2/Classes/MBLGPIOPin.html

    It is false and an attempt to set it true ([pin0 enablePinActiveLow:YES];) results in the error "No visible @interface for 'MBLGPIOPin' declares the selector 'enablePinActiveLow:'"

    I'm guessing it is fairly trivial to "set one of the GPIO pins low" -- Laura will you or one of your MbientLab colleagues please just give me a code snippet to do this? I can't use the product I bought until this problem is solved.

    Thanks,
  • edited December 2015
    pdupuy,

    Please check these projects for code snippets:

    Please note you will need to set GPIO1 low to "turn on" the pulse sensor (and the data comes in GPIO0), that is the only difference between your setup and the one in the projects website.

    Good luck!
  • edited December 2015
    Thank you for the response Laura. I've been working with the HeartRate code at https://github.com/mbientlab/HeartRate . The prior Heart Rate Data post includes the comment "There are many improvements to make from here such as tying the ground pin to a GPIO pin and setting it low (0V) a few milliseconds before the Analog read on the data pin of the Pulse Sensor." It does not say how to go about doing that.

    Nowhere can I find an example of *how to set a GPIO pin to low*. Will you please tell me, explicitly, with a code snippet, *how to set a GPIO pin to low*? I'd also like to know how to set a GPIO pin low "manually" using the MetaWear app, if that's possible, so I can turn the Pulse Sensor on and off at will.

    Thanks in advance for your help,
  • edited December 2015
    You actually had the correct code snippet from before:
    MBLGPIOPin *pin0 = self.device.gpio.pins[0];
    [pin0 setToDigitalValue:NO];

    This will set pin 0 to "Low".  In the digital world "NO", "0", "Clear", "false", and "Low" all mean the same thing, a pin at zero volts.

    I updated the HeartRate App at https://github.com/mbientlab-projects/HeartRate, with code to enable the sensor so please take a look to get a feel for how to use the SDK.  I added 2 constants for setting the pulse sensor data and enable pins, incase those change later on.


    For "manual" use in the MetaWear app, you simply need to scroll down to the GPIO section, choose the pin number from the segmented control and press "Set Pin" or "Clear Pin".

  • You need to set one of the GPIO pins low in order to enable to hear rate sensor.
    Please
    note you will need to set GPIO1 low to "turn on" the pulse sensor (and
    the data comes in GPIO0), that is the only difference between your setup
    and the one in the projects website.
This discussion has been closed.