Cirkit Designer Logo
Cirkit Designer
Your all-in-one circuit design IDE
Home / 
Project Documentation

Arduino Heart Rate Monitor with AD8232 and LED/Buzzer Alerts

Image of Arduino Heart Rate Monitor with AD8232 and LED/Buzzer Alerts

Circuit Documentation

Summary

This circuit is designed to monitor heart rate using the AD8232 Heart Rate Monitor and an Arduino UNO. It includes visual and auditory indicators using LEDs and a buzzer. The circuit reads the heart rate signal and detects if the leads are off, providing feedback through LEDs and a buzzer.

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.
    • Pins: cathode, anode
  3. LED: Two Pin (green)

    • Description: A green LED with two pins.
    • 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.
    • 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

  • 5V connected to 3.3v of AD8232 HeartRate Monitor
  • GND connected to:
    • pin1 of Resistor
    • D8 of Arduino UNO
    • GND of AD8232 HeartRate Monitor
    • cathode of green LED
    • cathode of red LED
    • GND of Buzzer
  • A0 connected to OUTPUT of AD8232 HeartRate Monitor
  • D11 connected to LO- of AD8232 HeartRate Monitor
  • D10 connected to LO+ of AD8232 HeartRate Monitor
  • D9 connected to PIN of Buzzer
  • D5 connected to pin1 of Resistor

LED: Two Pin (red)

  • cathode connected to GND of Arduino UNO
  • anode connected to pin2 of Resistor

LED: Two Pin (green)

  • cathode connected to GND of Arduino UNO
  • anode connected to pin2 of Resistor

AD8232 HeartRate Monitor

  • 3.3v connected to 5V of Arduino UNO
  • GND connected to GND of Arduino UNO
  • OUTPUT connected to A0 of Arduino UNO
  • LO- connected to D11 of Arduino UNO
  • LO+ connected to D10 of Arduino UNO

Buzzer

  • PIN connected to D9 of Arduino UNO
  • GND connected to GND of Arduino UNO

Resistor (150 Ohms)

  • pin1 connected to GND of Arduino UNO
  • pin2 connected to anode of green LED

Resistor (150 Ohms)

  • pin1 connected to D5 of Arduino UNO
  • pin2 connected to anode of red LED

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 checks the status of the leads. If the leads are off, it turns on the red LED and the buzzer. If the leads are on, it turns on the green LED and turns off the red LED and the buzzer. The heart rate signal is printed to the Serial Monitor.