Pulsesensor how to detect when its really getting a pulse

simple, pulsesensor.com pulse sensor.
purple is connected to A3 and i read values.
but i don’t trust the values, because just analogRead(A3) sends values of around 2043.
how can i figure out if a real pulse is being read and not just raw random data?

Try to plot the read data and see if you get the expected output when putting it on your skin.

Just like shown in this guide
https://pulsesensor.com/pages/code-and-guide

Hi,
Yea that’s one of the links I was using as a guide, along with one of my udemy courses with the particle.
I tried two different pulsesensors to compare, and I’ll be testing with a thing dev board when I get home from work to compare against the photon.
Thanks

1 Like

@dcarl661, which library are you using for the sensor?

No library, i’m straight reading the analogRead(PIN) and testing the value to see what the raw data is.
What I’m concerned with is why are values such as a variable range 2000-2056 coming in when my finger is not on the pulsesensor. I tested this on two different pulse sensors.
I expected 0-1024.

@dcarl661, assuming you are using a Particle device, the ADC is a 12-bit device. As such, the range of values is expected to be between 0 and 4095 over its 3.3v range. From @ScruffR’s link, it appears like the sensor output has a DC offset which may explain the 2000-2056 values you are seeing. You can recreate the sample code in the link’s image to the USB Serial port. If you have the Arduino IDE installed, you can use its Serial Plotter feature making sure to chose the serial port of the Photon. That will produce the nice plot you see in the picture.

Be aware that the “threshold” has a value of 0-4095 instead of 0-1023.

2 Likes

Thanks, I do have the arduino ide so i’ll try that.
I will try the particle.io web ide add library and use the pulsesensor_spark.
Btw the lib choices in the web ide confuse me because of the name “pulsesensor_spark” but i’m using a photon, it’s always a guess as to whether the lib will work.

@dcarl661, I ported that library a long time ago when I wrote the SparkIntervalTimer library. It is not possible to change library names without breaking somebodie’s code who is using that library. However, both libraries are fully Photon compatible.

1 Like

So true! as i’m typing i have a library name issue with the Naval Research Labs just got off the phone. I always “assume” spark and functions named with spark will work with the photon.
Thanks for your help and quick response!

Thats the link to the source:
https://docs.particle.io/reference/device-os/firmware/argon/#analogread-adc-

By the way: which udemy course teaches Photon? A free course,@dcarl661?

@Postler, that link is for the Argon which is very different hardware than the Photon. The correct link is:

https://docs.particle.io/reference/device-os/firmware/photon/#analogread-adc-

1 Like

Does anyone have any tips on how to get the Pulsesensor working using a photon? I have the Pulse Sensor Amped 1.4 with the libraries PulseSensor_Spark and SPARKINTERVALTIMER, however when I flash the code I get an error reference to ‘Signal’ is ambiguous. How would I fix this and how would I view the heartrate?