pcbway




Heart Beat Monitor using Arduino, Heart Beat Monitor using Arduino in proteus, heart beat monitor, heart beat counter, hb monitor,hb counterHello friends, I hope you all are doing great and having fun in your lives. In today’s tutorial, we are gonna design a Heart Beat Monitor using Arduino in Proteus ISIS. You should download this Heart Beat Sensor Library V2.0 for Proteus because we are gonna use that to detect heart beat in Proteus.

I have also used a 20×4 LCD which will display our heart beat value. You should download this New LCD Library for Proteus. I have counted the heart beat for ten seconds and then I have multiplied it with 6 to get the heart beat per minute which is abbreviated as bpm (beats per minute). So, let’s get started with Heart Beat Monitor using Arduino in Proteus ISIS.

Heart Beat Monitor using Arduino in Proteus

  • First of all, click the below button to download this complete Proteus simulation & Arduino code for Heart Beat Monitor:

Download Proteus Simulation & Arduino Code

  • Now let’s have a look at How we have designed this simulation and How it works.
  • So, design a simple circuit in Proteus as shown in below figure:

Heart Beat Monitor using Arduino, Heart Beat Monitor using Arduino in proteus, heart beat monitor, heart beat counter, hb monitor,hb counter

  • As you can see in the above figure, we have our Arduino UNO board along with LCD and Heart Beat Sensor.
  • There’s also a Button attached to Pin # 2, so when we press this button our Arduino will start counting the Heart Beat and will update it on the LCD.
  • Here’s the code which I have used for this Heart Beat Monitor using Arduino:
#include <LiquidCrystal.h>
#include <TimerOne.h>
LiquidCrystal lcd(13, 12, 11, 10, 9, 8);

int HBSensor = 4;
int HBCount = 0;
int HBCheck = 0;
int TimeinSec = 0;
int HBperMin = 0;
int HBStart = 2;
int HBStartCheck = 0;

void setup() {
  // put your setup code here, to run once:
  lcd.begin(20, 4);
  pinMode(HBSensor, INPUT);
  pinMode(HBStart, INPUT_PULLUP);
  Timer1.initialize(800000); 
  Timer1.attachInterrupt( timerIsr );
  lcd.clear();
  lcd.setCursor(0,0);
  lcd.print("Current HB  : ");
  lcd.setCursor(0,1);
  lcd.print("Time in Sec : ");
  lcd.setCursor(0,2);
  lcd.print("HB per Min  : 0.0");
}

void loop() {
  if(digitalRead(HBStart) == LOW){lcd.setCursor(0,3);lcd.print("HB Counting ..");HBStartCheck = 1;}
  if(HBStartCheck == 1)
  {
      if((digitalRead(HBSensor) == HIGH) && (HBCheck == 0))
      {
        HBCount = HBCount + 1;
        HBCheck = 1;
        lcd.setCursor(14,0);
        lcd.print(HBCount);
        lcd.print(" ");
      }
      if((digitalRead(HBSensor) == LOW) && (HBCheck == 1))
      {
        HBCheck = 0;   
      }
      if(TimeinSec == 10)
      {
          HBperMin = HBCount * 6;
          HBStartCheck = 0;
          lcd.setCursor(14,2);
          lcd.print(HBperMin);
          lcd.print(" ");
          lcd.setCursor(0,3);
          lcd.print("Press Button again.");
          HBCount = 0;
          TimeinSec = 0;      
      }
  }
}

void timerIsr()
{
  if(HBStartCheck == 1)
  {
      TimeinSec = TimeinSec + 1;
      lcd.setCursor(14,1);
      lcd.print(TimeinSec);
      lcd.print(" ");
  }
}
  • In this code, I have used a TimerOne Library which creates an interrupt after every 1sec.
  • On each interrupt, it executes timerIsr() function, in which I have placed a check that whenever this interrupt will call we will increment TimeinSec variable.
  • So, when TimeinSec will become equal to 10 then I am simply multiplying it with 6 and updating it on the LCD.
  • So, use the above code and get your Hex File from Arduino Software and update it in your Proteus Simulation.
  • Now run your Proteus Simulation and you will get something as shown in below figure:

Heart Beat Monitor using Arduino, Heart Beat Monitor using Arduino in proteus, heart beat monitor, heart beat counter, hb monitor,hb counter

  • Now click this HB button and it will start counting the HB as well as will count the Time in seconds.
  • After ten seconds it will multiply the current HB with six and will give the Heart Beat Per Minute.
  • Here’s a final image of the result:

Heart Beat Monitor using Arduino, Heart Beat Monitor using Arduino in proteus, heart beat monitor, heart beat counter, hb monitor,hb counter

  • You can change the value of Heart Beat from the variable resistor connected with Heart Beat Sensor.
  • Let’s change the value of variable resistance connected to Heart Beat sensor, and have a look at the results.
  • You have to press the button again in order to get the value.
  • Here’s the screenshot of the results obtained:

Heart Beat Monitor using Arduino, Heart Beat Monitor using Arduino in proteus, heart beat monitor, heart beat counter, hb monitor,hb counter

  • So, now the heart is beating a little faster and we have got 108 bpm.
  • If you run this simulation then you will notice that the second is quite slow which I think is because of Proteus.
  • I have tested this code on hardware and it worked perfectly fine, although you need to change heart beat sensor’s values in coding.
  • Here’s the video in which I have explained the working of this Heart Beat Monitor Simulation in detail.

So, that was all about Heart Beat Monitor using Arduino in Proteus ISIS. I hope you have enjoyed it and will get something out of it. Have a good day. 🙂

1 Comment

Leave a Reply