WorldFamousElectronics / PulseSensor_Heart-Rate-Variabilty

Processing Sketches for exploring Heart Rate Variability (HRV)
34 stars 15 forks source link

Ino script to get the IBI during 1 - 5 min and calculate LnRMSSD? #10

Open miguelgisbert opened 1 day ago

miguelgisbert commented 1 day ago

Hi, do you have any .ino code to execute at Arduinio UNO R4 WiFi to get the inter beat intevals during a period of time (1 min. - 5 min.). I would like to calculate the LnRMSSD with that values.

Thanks!

biomurph commented 23 hours ago

@miguelgisbert We don't have anything that specific. Our examples are designed to get you started and ensure that you are getting a good signal. Anything that you want that is that specific you will need to build your own code for. What you are asking is not much of a heavy lift. It is easy to time things with Arduino, and RMS calculations are quick and simple. Please take some time to build something yourself, and when you have issues, you can always come back here and share your code and ask for help.

miguelgisbert commented 23 hours ago

Thank you very much for the answer. I was trying to write my own code but I'm getting wrong IBI data. However, I think that's something already developed by you guys! I was trying to use the PulseSensorAmped_HRV_PoincarePlot_1_1_0 package to see the HRV plots already defined, but I couldn't find the way to execute that on the Arduino board. I also noticed there's a getInterBeatIntervalMs() function on the PulseSensorPlayground.h library, so I believe everything I need to get started is already developed but I can't find the way to execute it on my Arduino board and get the IBI times to check if they are correct.

Any idea please?

Thanks a lot!

biomurph commented 22 hours ago

@miguelgisbert

The HRV examples that we offer use two different code bases. The one in this repo is to be run in the Processing IDE. You can download Processing from www.processing.org

When you run this in Processing, you will need to program your Arduino board with the PulseSensor_BPM.ino example sketch. When you open that sketch, you need to change one variable. The variable is defined as

const int OUTPUT_TYPE

The example defaults to SERIAL_PLOTTER and that formats the data for the Arduino Serial Plotter. change that to PROCESSING_VISUALIZER, and it will format the data for our Processing sketch examples (there are a few!). There is a note in the comments PulseSensor_BPM.ino just above the OUTPUT_TYPE declairation.

I am seeing that this bit of info about the variable is kind of buried. I'll work on getting it more visible.

You might also want to try the basic visualizer Processing sketch first. https://pulsesensor.com/pages/processing-visualization

LMK if you run into any issues.

miguelgisbert commented 21 hours ago

Thanks a lot Joel! I managed to get up to the plot screen on Processing but only with the red line representing the analogic signal,

image

not the dots representing the HRV Poincare Plot as mentioned on the documentation

image

Any idea why the blue points aren't being shown and about how could I get those numbers that the blue points represent to send them to other app or do some calculations with them?

Many thank!!

Miguel Gisbert

biomurph commented 21 hours ago

@miguelgisbert I can see in the screen shot that you sent that your pulse waveform is very small. It may be too small to be read by our beat finder algorithm.

Please sent a pic of your hardware setup, including your sensor. Where are you placing the sensor on your body to get a reading?

miguelgisbert commented 21 hours ago

I'm using a custom clip for my finger. The signal on the Arduino IDE example was ok:

image

image

image

biomurph commented 20 hours ago

@miguelgisbert

Thanks for the photos. I think we have solved your code problem, but you have a hardware problem.

You are not using our hardware, you are using a knockoff clone. Since I have no idea what is on that PCB, I have no way to help troubleshoot the issue.

Please support the original makers of PulseSensor and purchase legit hardware from reliable suppliers. Our Original PulseSensor is available at PulseSensor.com Adafruit.com Sparkfun.com Mouser.com Digikey.com Amazon.com (Our listing is "Original and Best")

You can tell when you see the cable color (RED, BLACK, PURPLE) and our cable is 24" long.

miguelgisbert commented 20 hours ago

Thanks, can you send me a link of the original one in Amazon Spain? I had to choose one that could be delivered in Spain, because on those all websites you mentioned the deliver cost was about 60 $!

biomurph commented 17 hours ago

Hi,

I don't have a link for amazon spain. We are not selling in amazon eu yet.

SparkFun bundles our PulseSensor to send to distributors around the world. Check this site https://www.sparkfun.com/distributors There are multiple places in Spain where SparkFun might be sending our PulseSensor where you can pick up or order?

Let me know if you find one!

miguelgisbert commented 5 hours ago

Thanks Joel for the distributors info. I found the sensor only at https://ultra-lab.net/. It's 45 € with the delivery, I think it's too much for my Masters Final Project (in addition to the already spent cost of the Arduino), but I'll ask to the University in case they have any other solution or proposal.

Thanks a lot!