Cirkit Designer LogoCirkit DesignerYour all-in-one circuit design IDE Launch Cirkit Designer App

Arduino-Based Heart Rate Monitor with LED and Buzzer Alerts

View and Edit Project In Cirkit DesignerImage of Arduino-Based Heart Rate Monitor with LED and Buzzer Alerts

Circuit Documentation

Summary

This circuit is designed to monitor heart rate using an AD8232 Heart Rate Monitor and an Arduino UNO. The circuit includes visual and auditory indicators using LEDs and a buzzer. The Arduino UNO processes the heart rate signal and provides feedback through the LEDs and buzzer based on the status of the heart rate monitor.

Component List

  1. Arduino UNO

    • Description: A microcontroller board based on the ATmega328P.
    • Pins: UNUSED, IOREF, Reset, 3.3V, 5V, GND, Vin, A0, A1, A2, A3, A4, A5, SCL, SDA, AREF, D13, D12, D11, D10, D9, D8, D7, D6, D5, D4, D3, D2, D1, D0
  2. LED: Two Pin (red)

    • Description: A red LED with two pins: cathode and anode.
    • Pins: cathode, anode
  3. LED: Two Pin (green)

    • Description: A green LED with two pins: cathode and anode.
    • Pins: cathode, anode
  4. AD8232 HeartRate Monitor

    • Description: A heart rate monitor sensor.
    • Pins: GND, 3.3v, OUTPUT, LO-, LO+, SDN, RA, LA, RL
  5. Buzzer

    • Description: A simple buzzer with two pins: PIN and GND.
    • Pins: PIN, GND
  6. Resistor (150 Ohms)

    • Description: A resistor with a resistance of 150 Ohms.
    • Pins: pin1, pin2
  7. Resistor (150 Ohms)

    • Description: A resistor with a resistance of 150 Ohms.
    • Pins: pin1, pin2

Wiring Details

Arduino UNO

LED: Two Pin (red)

LED: Two Pin (green)

AD8232 HeartRate Monitor

Buzzer

Resistor (150 Ohms)

Resistor (150 Ohms)

Code Documentation

// Pin definitions
const int redLEDPin = 5;       // Red LED connected to D5
const int greenLEDPin = 8;     // Green LED connected to D8
const int buzzerPin = 9;       // Buzzer connected to D9
const int ad8232OutputPin = A0; // AD8232 OUTPUT connected to A0
const int loPlusPin = 10;      // AD8232 LO+ connected to D10
const int loMinusPin = 11;     // AD8232 LO- connected to D11

void setup() {
  // Initialize serial communication
  Serial.begin(9600);

  // Initialize pin modes
  pinMode(redLEDPin, OUTPUT);
  pinMode(greenLEDPin, OUTPUT);
  pinMode(buzzerPin, OUTPUT);
  pinMode(ad8232OutputPin, INPUT);
  pinMode(loPlusPin, INPUT);
  pinMode(loMinusPin, INPUT);

  // Turn off LEDs and buzzer initially
  digitalWrite(redLEDPin, LOW);
  digitalWrite(greenLEDPin, LOW);
  digitalWrite(buzzerPin, LOW);
}

void loop() {
  // Read the AD8232 output
  int heartRateSignal = analogRead(ad8232OutputPin);

  // Read the LO+ and LO- pins
  int loPlusStatus = digitalRead(loPlusPin);
  int loMinusStatus = digitalRead(loMinusPin);

  // Print heart rate signal to Serial Monitor
  Serial.print("Heart Rate Signal: ");
  Serial.println(heartRateSignal);

  // Check if leads are off
  if (loPlusStatus == 1 || loMinusStatus == 1) {
    Serial.println("Leads off detected!");
    digitalWrite(redLEDPin, HIGH);  // Turn on red LED
    digitalWrite(greenLEDPin, LOW); // Turn off green LED
    digitalWrite(buzzerPin, HIGH);  // Turn on buzzer
  } else {
    digitalWrite(redLEDPin, LOW);   // Turn off red LED
    digitalWrite(greenLEDPin, HIGH);// Turn on green LED
    digitalWrite(buzzerPin, LOW);   // Turn off buzzer
  }

  // Add a small delay to avoid flooding the Serial Monitor
  delay(100);
}

This code initializes the pins, reads the heart rate signal, and provides feedback through the LEDs and buzzer based on the status of the heart rate monitor. The red LED and buzzer are activated if the leads are off, while the green LED is activated if the leads are properly connected.