You are on page 1of 1

Start

Initiate all volatile integer variables: BPM=0, signal =0;


SignalTime=0;IBI=600,P=512,T=512,thresh=525,t=355,amp=
100, z=0, rate=[10] ; sampleCounter=0;last beatTimer=0; N=0

Read pulse sensor data. Signal = analogRead(pulsePin);

sampleCounter += 2; int N = sampleCounter - lastBeatTime;

NO
if(Signal < thresh YES if (N >
YES
&& N > (IBI/5)*3) 250)
T = Signal or
P= Signal NO NO
if ( (Signal > thresh)
Pulse=false;amp=P-T; && (Pulse == false)
thresh = amp/2 + T;
YES
for(int i=0; i<=8; i++) {rate[i] = rate[i+1]; runningTotal += rate[i];
} rate[9] = IBI; runningTotal += rate[9]; runningTotal /= 10;
BPM = 60000/runningTotal;

Read BPM and IBI NO


if(Signal<t
&& Signal>z)
Print BPM in LCD
YES
NO if(SignalTime>
Serial.print("it’s okay");
(t-z) mS)

Print no. of missing pulse in LCD YES

Upload the system information on the cloud


through ESP 8266 Wi-Fi module End

You might also like