Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Heart beat sensor, problem with the threshold value !

Status
Not open for further replies.

imane tech

New Member
Hello community!

I'm new on this forum. I'm working on my heartbeat sensor (pulse sensor) that uses PPG technology, i've got some troubles to calibrate the sensor. Actually, i don't know how to choose a "threshold value" in order to have the shape of that ppg signal when i put my finger on it. Do you have any idea, please ? If you want me to give more details, feel free to ask me, and thank you!!
 
I believe you will need an adaptive setup, where you use the peak maximum and minimum levels, and set the threshold proportionally between those.

Ideally monitor the levels on an oscilloscope to see what percentage between the peaks will give the ideal signal - or adjust through the range and use the midpoint between the extremes it becomes unreliable.
 
Thanks so much for your reply!
Unfortunately, I don't have an oscilloscope available right now, but I'm using the serial monitor of Arduino instead, but still the same problem. To be more practical, I'm gonna share the result that I got, and the signal that I wish to have! The program that is available on Arduino's library suggests a threshold value that we can adjust, tried many values randomly f many times but in vain. Thank you so much!! I need help, please!
 

Attachments

  • ppg signal arduino threshold value problem.png
    ppg signal arduino threshold value problem.png
    27.3 KB · Views: 312
  • Clean and good ppg signal.PNG
    Clean and good ppg signal.PNG
    90.7 KB · Views: 290
These might help -







This is soundcard solution, scope + spectrum analyzer + sig gen, make sure you protect inputs -


Google "protect soundcard inputs"


Regards, Dana.
 
To be more practical, I'm gonna share the result that I got, and the signal that I wish to have!
It looks like you need a lot more gain before the ADC to get a decently accurate waveform representation.
You may be able to get something from the existing signal using a low pass filter, eg. like storing the last 32 samples in a circular buffer and adding them all together after each new sample, to get a slower-moving signal with a lot more levels.
 
Hello community!

I'm new on this forum. I'm working on my heartbeat sensor (pulse sensor) that uses PPG technology, i've got some troubles to calibrate the sensor. Actually, i don't know how to choose a "threshold value" in order to have the shape of that ppg signal when i put my finger on it. Do you have any idea, please ? If you want me to give more details, feel free to ask me, and thank you!!
What sensor are you using?, and how is it connected?, post a schematic.
 
It looks like you need a lot more gain before the ADC to get a decently accurate waveform representation.
You may be able to get something from the existing signal using a low pass filter, eg. like storing the last 32 samples in a circular buffer and adding them all together after each new sample, to get a slower-moving signal with a lot more levels.
I believe that the signal that I will have on the serial plotter will not be clean, and this is normal because of motion artifacts, but this is the next step of my project which is filtering the signal. Firstly, I think I need to calibrate the sensor, then after having a noisy PPG signal, I'll try-finally to filter it. What do you think?
 
Single chip approach with SOC and onboard digital filter -


Note this ap note seems to have been obsoleted, maybe contact author to see
if there is an update. Could be medical application some vendors gun shy on
involvement.

In general, PSOC has the following on it (single chip) -


View attachment 136672

Regards, Dana
Hello Dana!
Thanks for your help! I get from that document that maybe it is not necessary to have the shape of the signal that I am aiming for, because It is the main purpose of filtering, What do you think? But still, the threshold value needs to be adjusted!

PS: For filtering, I am planning to use LMS Algorithm.
 
What sensor are you using?, and how is it connected?, post a schematic.
Hello! This is the guide that I am following.

 
According to the original article, the amplitude out of the sensor is near 200 ADC counts, which gives a decent signal range to work with; yours is more like 5 counts.

That implies something wrong with the hardware setup, a faulty sensor, or the ADC input pin is not configured correctly??
 
I'm gonna share the Arduino code and the schematic. My circuit contains the following components: 10 LEDs, 10 resistors (1 k ohm), Arduino UNO, and my pulse sensor. The circuit is quite simple.
Thank you so much for your precious help!

According to the original article, the amplitude out of the sensor is near 200 ADC counts, which gives a decent signal range to work with; yours is more like 5 counts.

That implies something wrong with the hardware setup, a faulty sensor, or the ADC input pin is not configured correctly??
 

Attachments

  • scematic.PNG
    scematic.PNG
    58.4 KB · Views: 297
  • Arduino code pulse sensor.txt
    4.3 KB · Views: 295
  • schemaSimple.pdf
    144.7 KB · Views: 363
Your first output pin is D2 so this :

//LEDS SETUP in Output
for (int thisPin = 0; thisPin < pinCount; thisPin++) {
pinMode(ledPins[thisPin], OUTPUT);
}

should be :

//LEDS SETUP in Output
for (int thisPin = 2; thisPin < pinCount+2; thisPin++) {
pinMode(ledPins[thisPin], OUTPUT);
}

And you have other loops where you are setting / clearing pins starting with D0 ....instead of D2 ....


Regards, Dana.
 
Last edited:
Regards, Dana.
Your first output pin is D2 so this :



should be :

//LEDS SETUP in Output
for (int thisPin = 2; thisPin < pinCount+2; thisPin++) {
pinMode(ledPins[thisPin], OUTPUT);
}

And you have other loops where you are setting / clearing pins starting with D0 ....instead of D2 ....


Regards, Dana.
so I'll start with D0, just a quick question please, I think that led 13 on Arduino's board will lighten if I have something wrong with my circuit, and the LEDs will lighten simultaneously with my heartbeat? What do you think?
 
Stay with D2, so you dont give up your serial connection to IDE.

Your update loop is fast enough should look simultaneously.....

LED on D13 is not an overall circuit fail indicator......not sure why you think this.


Regards, Dana.
 
Last edited:
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top