Closed Tommaarleveld closed 5 years ago
@Tommaarleveld I just published a new release of the PulseSensor Playground library. Please download it here https://github.com/WorldFamousElectronics/PulseSensorPlayground/releases or use the Arduino Library Manager to update. This should fix your problem. LMK
@biomurph Thanks for the quick reply! I updated the library and it seems my first error has been fixed. But when I try to upload the example Getting_BPM_To_Monitor and test the sensor I get the following message in the serial monitor: "interrupts not supported".
In this thread I found a similar problem. So I tried out the code snippet which you suggested.
We don't yet support use of interrupts on the Mega. You will need to run the BPM_Alternative code example. If all you want is BPM on the serial port, then you will need to add a variable at the top of the sketch
int myBPM;
Then modify part of the code in the loop to be something like this
if (pulseSensor.sawStartOfBeat()) { myBPM = pulsesensor.getBeatsPerMinute(); Serial.print("BPM: "); Serial.println(myBPM); }
Now the serial monitor starts to output unreadable characters:
Sidenote: While uploading or verifying the code, it does output a few warnings but compiles anyways.
Hope you can help me with this!
So apparently this was due to the wrong baud setting. I changed it to 115200 baud and now it sort of works. Although I'm getting an insane amount of readings with occasionally the one that I'm asking for:
@Tommaarleveld ahh, baud rate mismatch... a rookie mistake ;)
Yes, it does look like you are getting the right data. The way the sketch is set up is to send the data as
BPM,IBI,Signal
once every 20mS
If you want to ignore the data stream, comment out the line that says pulseSensor.outputSample()
Then, in the conditional if(pulseSensor.sawStartOfBeat())
just put in your serial statement to print the BPM.
The serial reply that says Interrupts not supported
is there to tell you to use the BPM_Alternative code.
We're working on good examples that use the built in library tools to monitor jitter when you aren't using interrupts. Stand by for that.
@biomurph Thanks for the help, it works pretty well now. I'll definitely stand by for the new updates!
I attached the sensor to the velcro strip. But when I strap it all around my finger, most of the time it starts out with a lot of high readings. When I hold my finger absolutely still it starts to settle down and gives the correct reading. Have you got any pointers on how to get more accurate readings?
There is kind of a 'goldilocks' pressure that you want on the sensor. Pulse Sensor, like any PPG based heart monitor, measures the change in tissue density. When a pulse wave courses through your body at every heartbeat, your capillary tissues get less dense for just a moment. That's what is making the reflected light change in intensity.
The thing that will also make your tissue density change is movement. We are all basically bags of blood and bone, sloshing around will make the signal change.
Also, I never asked you. Did you get a legit Pulse Sensor? Does it have black, red, and purple wires about 24" long? There are lots of cheap knockoffs out there.
Alright seems clear!
I'm pretty sure I do have a legit Pulse Sensor. It does have the black, red and purple wires. Although the wires are more like 15" long. It came with the velcro and steel clip. Here's a picture:
Yup, looks good! Thanks for supporting the original makers of Pulse Sensor! Have fun with your project!
It seems the code can't be compiled for the Arduino Uno WiFi Rev2. Is there a simple fix for this issue? Or do I need to use a regular Arduino Uno?
This is the error I got: