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.
Arduino UNO
LED: Two Pin (red)
LED: Two Pin (green)
AD8232 HeartRate Monitor
Buzzer
Resistor (150 Ohms)
Resistor (150 Ohms)
// 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.