IR Pulse Sensor Help
hello,
i bought ir pulse sensor ebay few £ , can't seem give reading representative of heartbeat.
(here link: http://www.ebay.co.uk/itm/281259154674?sspagename=strk:mewnx:it&_trksid=p3984.m1439.l2648)
this might because placing finger in wrong place? or problem code/ circuit.
here image showing circuit using, image of "keyes heartbeat sensor":
the code using is:
thanks!
i bought ir pulse sensor ebay few £ , can't seem give reading representative of heartbeat.
(here link: http://www.ebay.co.uk/itm/281259154674?sspagename=strk:mewnx:it&_trksid=p3984.m1439.l2648)
this might because placing finger in wrong place? or problem code/ circuit.
here image showing circuit using, image of "keyes heartbeat sensor":
the code using is:
code: [select]
int ledpin=13;
int sensorpin=0;
double alpha=0.75;
int period=20;
double change=0.0;
void setup()
{
pinmode(ledpin,output);
}
void loop()
{
static double oldvalue=0;
static double oldchange=0;
int rawvalue=analogread(sensorpin);
double value=alpha*oldvalue+(1-alpha)*rawvalue;
change=value-oldvalue;
digitalwrite(ledpin,(change<0.0&&oldchange>0.0));
oldvalue=value;
oldchange=change;
delay(period);
serial.println(change);
}
thanks!
code not in code tags , there no link used hardware. please read sticky post @ top of forum.
Arduino Forum > Using Arduino > Sensors > IR Pulse Sensor Help
arduino
Comments
Post a Comment