-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Signals oscillate in diferent Thresholds #1
Comments
@VladiLuzJr Also, can you verify your hardware? Send a picture of your setup? |
Greetings @biomurph! Thanks for communicating with us and being available, we acknowledge your dedication... In the following link you can take a look in the video we have recorded, in order for you to understand the hardware configuration(I am sorry for the cable management....) This is how we test the software, for PTT acquisition: Here follows the Arduino an protoboard pinout: Pulse Sensor 1(Analog pin0) Pulse Sensor 2(Analog pin1) If there is any doubt, please fell free to ask me... |
@VladiLuzJr thank you for sending the pictures. They make everything very clear. Regarding the PTT measurement, I would like to know if you have any study or white paper that you are following to put the two sensors so close together? They seem to be too close in proximity to get a valid or useful PTT. At the distance you have, it may require a rather high sample rate to gather anything useful. I usually see PTT placement in earlobe and fingertip, or other far away sites. This makes the difference easier to measure, as well as being able to tell when there are changes due to vasoconstriction. Much easier when further away. |
@biomurph , thanks for your attention! Sorry I have bought those knockoffs... guess the COVID-19 crisis have effected the Brazilian currency, in a way two Pulse Sensor would cost R$500.00 with shipping in SparkFun. Do you think I could by me some of these real IR LEDs and re-attach them as in thins link: or should I manage to achieve some real ones for myself??? In regard to the Pulse Transit Distance, I will link in some paper in witch the distance of (Wrist - finger or even closer) were used. We proposed ourselves(by using different microcontroller, such as a STM32 which has higher clock settings), if it was possible to built-in the "local-PWV" measurement in an oximeter device. Happy to share our research with you... 28mm apart IR Rx for local PWV: Wrist_finger PPG: Wrist-finger for SPWV: |
I can't say what changes need to be made, as I have no idea what the parts they used to make their knockoff. Sorry. As for the LED, we use a green LED because the sensor we use is most sensitive at that wavelength. IR would not be effective if it were our hardware. Thanks for the links to the papers! They look very interesting indeed. |
I meant those brighter green LEDs as referred in the blog post, lol. Although I understand it wouldn't be possible to know the components used... I have an Oscilloscope in hands, maybe I'll try to hard dig what is creating this difference in threshold. In the mean time I am looking forward to buy myself some real pulse sensors.... Thanks for being supportive! |
Please do let me know what you discover. In our design, the raw PPG from the sensor can be found on the left side of the capacitor just above the green wire in your hardware photo. |
Signals oscillate in diferent Thresholds
Recently I have been engaged in my Conclusion Project of an technician course in electronics...
When trying to use two pulse sensors at once, in order to find PTT. I have received high variance values, while using Processing...
The sensor in Analog pin0 is located in the beginning of my hand thumb and the sensor in Analog pin1 is located at the tip of the same thumb. Is it possible that the two IR LEDs nearby can add noise to the signal, therefore creating this difference in Threshold?
Using windows 10 , Arduino UNO and PulseSensor Playground 1.5.1. I emphasize that the pulse graphics are tiny, even if I try "goldilocks pressure" : (
Is it possible that once both sensors are being powerd by de Arduino built-in 5v supply, they are acting like a current divider?
I have reason to believe that this errors may happen due to Arduino Interupts malfunction... Do I need to install some especific version of the Arduino IDE to use this define?
Once both signals oscillate in different levels, I think the PTT software cannot use the same Threshold for the pulse sensors...
In the pictures , the correspondig Processing GUI and Serial Plotter prints:
SerialPlotter_with_Interupts=False:
SerialPlotter_with_Interupts=True:
ProcessingGUI_with_Interupts=False:
ProcessingGUI_with_Interupts=True:
The .ino code is written as follows:
/*
Arduino Sketch to detect pulses from two PulseSensors
and measures the time between! This can be used to derive
Pulse Transit Time (PTT)
Here is a link to the PTT tutorial
https://pulsesensor.com/pages/pulse-transit-time
Copyright World Famous Electronics LLC - see LICENSE
Contributors:
Joel Murphy, https://pulsesensor.com
Yury Gitman, https://pulsesensor.com
Bradford Needham, @bneedhamia, https://bluepapertech.com
Licensed under the MIT License, a copy of which
should have been included with this software.
This software is not intended for medical use.
*/
/*
Every Sketch that uses the PulseSensor Playground must
define USE_ARDUINO_INTERRUPTS before including PulseSensorPlayground.h.
Here, #define USE_ARDUINO_INTERRUPTS false tells the library to
not use interrupts to read data from the PulseSensor.
If you want to use interrupts, simply change the line below
to read:
#define USE_ARDUINO_INTERRUPTS true
Set US_PS_INTERRUPTS to false if either
by PulseSensor Playground, or
NOTE: if US_PS_INTERRUPTS is false, your Sketch must
call pulse.sawNewSample() at least once every 2 milliseconds
to accurately read the PulseSensor signal.
*/
#define USE_ARDUINO_INTERRUPTS true
#include <PulseSensorPlayground.h>
/*
The format of our output.
Set this to PROCESSING_VISUALIZER if you're going to run
the multi-sensor Processing Visualizer Sketch.
See https://github.com/WorldFamousElectronics/PulseSensorAmped_2_Sensors
Set this to SERIAL_PLOTTER if you're going to run
the Arduino IDE's Serial Plotter.
*/
const int OUTPUT_TYPE = PROCESSING_VISUALIZER;
/*
Number of PulseSensor devices we're reading from.
*/
const int PULSE_SENSOR_COUNT = 2;
/*
PULSE_POWERx = the output pin that the red (power) pin of
the first PulseSensor will be connected to. PulseSensor only
draws about 4mA, so almost any micro can power it from a GPIO.
If you don't want to use pins to power the PulseSensors, you can remove
the code dealing with PULSE_POWER0 and PULSE_POWER1.
PULSE_INPUTx = Analog Input. Connected to the pulse sensor
purple (signal) wire.
PULSE_BLINKx = digital Output. Connected to an LED (must have at least
470 ohm resistor) that will flash on each detected pulse.
PULSE_FADEx = digital Output. PWM pin onnected to an LED (must have
at least 470 ohm resistor) that will smoothly fade with each pulse.
*/
const int PULSE_INPUT0 = A0;
const int PULSE_BLINK0 = 13; // Pin 13 is the on-board LED
const int PULSE_FADE0 = 5;
const int PULSE_INPUT1 = A1;
const int PULSE_BLINK1 = 12;
const int PULSE_FADE1 = 11;
const int THRESHOLD = 550; // Adjust this number to avoid noise when idle
/*
All the PulseSensor Playground functions.
We tell it how many PulseSensors we're using.
*/
PulseSensorPlayground pulseSensor(PULSE_SENSOR_COUNT);
/*
Variables used to determine PTT.
NOTE: This code assumes the Pulse Sensor on analog pin 0 is closer to he heart.
*/
unsigned long lastBeatSampleNumber[PULSE_SENSOR_COUNT];
int PTT;
void setup() {
/*
Use 250000 baud because that's what the Processing Sketch expects to read,
and because that speed provides about 25 bytes per millisecond,
or 50 characters per PulseSensor sample period of 2 milliseconds.
*/
Serial.begin(250000);
/*
Configure the PulseSensor manager,
telling it which PulseSensor (0 or 1)
we're configuring.
*/
pulseSensor.analogInput(PULSE_INPUT0, 0);
pulseSensor.blinkOnPulse(PULSE_BLINK0, 0);
pulseSensor.fadeOnPulse(PULSE_FADE0, 0);
pulseSensor.analogInput(PULSE_INPUT1, 1);
pulseSensor.blinkOnPulse(PULSE_BLINK1, 1);
pulseSensor.fadeOnPulse(PULSE_FADE1, 1);
pulseSensor.setSerial(Serial);
pulseSensor.setOutputType(OUTPUT_TYPE);
pulseSensor.setThreshold(THRESHOLD);
// Now that everything is ready, start reading the PulseSensor signal.
if (!pulseSensor.begin()) {
/*
PulseSensor initialization failed,
likely because our Arduino platform interrupts
aren't supported yet.
}
}
void loop() {
/*
Wait a bit.
We don't output every sample, because our baud rate
won't support that much I/O.
*/
delay(20);
// write the latest sample to Serial.
pulseSensor.outputSample();
/*
If a beat has happened on a given PulseSensor
since we last checked, write the per-beat information
about that PulseSensor to Serial.
*/
for (int i = 0; i < PULSE_SENSOR_COUNT; ++i) {
if (pulseSensor.sawStartOfBeat(i)) {
pulseSensor.outputBeat(i);
}
}
I would really appreciate any collaboration and will be forever in debt! I apologize the bad English, my native country is Brazil. If there is any doubt, I am happy to help!
Thank you in advance,
Looking forward for answers...
The text was updated successfully, but these errors were encountered: