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.
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 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.