Arduino Micro and AD8232 Heart Rate Monitor with Lead-Off Detection
View and Edit Project In Cirkit Designer
Circuit Documentation
Summary
This circuit is designed to monitor heart rate using an AD8232 Heart Rate Monitor module connected to an Arduino Micro (Rev3). The Arduino reads the heart rate signal from the AD8232 module and prints the analog value to the Serial Monitor. Additionally, it checks for lead-off detection.
Component List
Arduino Micro (Rev3)
- Description: A microcontroller board based on the ATmega32U4.
- Pins: MISO, 5V, SCK, MOSI, RESET, GND, RXLED/SS, D1/TX, D0/RX, D2/SDA, D3/SCL, D4 PWM/A6, D5 PWM, D6 PWM/A7, D7, D8 PWM/A8, D9 PWM/A9, D10 PWM/A10, D11 PWM, D12 PWM/A11, VIN, A5, A4, A3, A2, A1, A0, AREF, 3V3, D13 PWM
AD8232 Heart Rate Monitor
- Description: A single-lead heart rate monitor front end.
- Pins: GND, 3.3v, OUTPUT, LO-, LO+, SDN, RA, LA, RL
Wiring Details
Arduino Micro (Rev3)
- GND connected to GND of AD8232 Heart Rate Monitor
- D10 PWM/A10 connected to LO+ of AD8232 Heart Rate Monitor
- D11 PWM connected to LO- of AD8232 Heart Rate Monitor
- A0 connected to OUTPUT of AD8232 Heart Rate Monitor
- 3V3 connected to 3.3v of AD8232 Heart Rate Monitor
AD8232 Heart Rate Monitor
- GND connected to GND of Arduino Micro (Rev3)
- LO+ connected to D10 PWM/A10 of Arduino Micro (Rev3)
- LO- connected to D11 PWM of Arduino Micro (Rev3)
- OUTPUT connected to A0 of Arduino Micro (Rev3)
- 3.3v connected to 3V3 of Arduino Micro (Rev3)
Code Documentation
/*
* Arduino ECG Heart Rate Monitor using AD8232
* This code reads the heart rate signal from the AD8232 module and prints
* the analog value to the Serial Monitor.
*/
// Pin definitions
const int ecgPin = A0; // ECG output connected to A0
const int loPlusPin = 10; // LO+ connected to D10
const int loMinusPin = 11; // LO- connected to D11
void setup() {
// Initialize serial communication
Serial.begin(9600);
// Set LO+ and LO- pins as inputs
pinMode(loPlusPin, INPUT);
pinMode(loMinusPin, INPUT);
}
void loop() {
// Read the analog value from the ECG pin
int ecgValue = analogRead(ecgPin);
// Print the ECG value to the Serial Monitor
Serial.println(ecgValue);
// Check for lead-off detection
if (digitalRead(loPlusPin) == 1 || digitalRead(loMinusPin) == 1) {
Serial.println("Lead off detected!");
}
// Small delay for stability
delay(10);
}
- File Name: sketch.ino
- Description: This Arduino sketch reads the heart rate signal from the AD8232 module and prints the analog value to the Serial Monitor. It also checks for lead-off detection and prints a message if a lead is off.