Saturday, 28 April 2018

Heart rate monitor using Arduino and lab view

using the same circuit in the previous post, the arduino source code is only changed, and for viewing output




Arduino Code for Heart rate measurement

int val, beat;
int count = 0;
unsigned int previoustime;
unsigned int currentime;
float del;

void setup()
{
  Serial.begin(9600);
  //lcd.begin(8, 2);
  pinMode(A0, INPUT);
  pinMode(13, OUTPUT);
  //Beat status LED
}

void loop()
{
  val = analogRead(A0);
  if (val > 200)
  {
    count++;
    currentime = millis();
    del = currentime - previoustime;
    previoustime = currentime;
    float Q = 1000 / del;
     float fb = 60 * Q;
   Serial.println(fb);
    digitalWrite(13, HIGH);
    delay(400);
  }
  else
  {
    digitalWrite(13, LOW);
  }
}


Block diagram:






Front panel



No comments:

Post a Comment

Own IOT website and Hardware Using Node MCU (cyber thinks)

NODE MCU code -- website link  Cyberthinks google drive link  cyberthinks website files #include <ESP8266WiFi.h> #include <ArduinoJ...