Back to Sensors & Actuators Series

ECG/Heart Rate Monitor: AD8232

April 10, 2026 Wasil Zafar 9 min read

AD8232 deep dive — single-lead ECG acquisition, electrode placement, R-peak detection, Arduino code, and wearable health applications.

Contents

  1. Working Principle
  2. Electrical Characteristics
  3. Interfacing with MCU
  4. Calibration
  5. Code Example
  6. Real-World Applications
  7. Limitations

Working Principle

The AD8232 from Analog Devices is a single-lead heart rate monitor front-end that amplifies and filters the tiny electrical signals generated by the heart (<1 mV on the skin surface). It uses a three-electrode configuration (RA, LA, RL) with an instrumentation amplifier, a two-pole high-pass filter (0.5 Hz to reject DC offset and motion artifacts), and a two-pole low-pass filter (40 Hz to reject muscle noise). The output is a clean analog ECG waveform centred around Vref/2.

Note: The AD8232 is for educational, fitness, and research purposes only — not for clinical diagnosis. Medical-grade ECG requires certified multi-lead systems (12-lead) with patient isolation.

Electrical Characteristics

ParameterValue
Supply Voltage2.0–3.5 V
Gain~100 (instrumentation amp)
Bandwidth0.5–40 Hz (cardiac band)
CMRR80 dB (common mode rejection)
OutputAnalog voltage (~1.5 V centre, 0–3.3 V swing)
Leads-Off DetectionAC or DC selectable (LO+/LO- outputs)
Electrodes3-electrode (RA, LA, RL) snap connectors
Current Draw~170 µA

Interfacing with an MCU

Connect the AD8232 breakout: 3.3 V, GND, OUTPUT → ADC pin, LO+ → digital pin, LO- → digital pin. When either LO+ or LO- goes HIGH, a lead has disconnected — discard readings until both are LOW. Attach three Ag/AgCl electrodes: RA (right arm/chest), LA (left arm/chest), RL (right leg/lower abdomen as reference).

Safety: Never use the AD8232 while connected to mains-powered equipment (USB to laptop counts). Use battery-powered operation or galvanic isolation to prevent electrical shock risk through the electrodes.

Calibration

  • Electrode placement: Clean and dry skin; place RA and LA on opposite sides of the heart, RL on the lower torso (ground reference)
  • Gel electrodes: Use Ag/AgCl electrode pads with conductive gel for best signal quality; dry electrodes give noisy signals
  • Baseline settling: Wait 5–10 seconds after electrode placement for the high-pass filter to settle
  • BPM calculation: Detect R-peaks (highest spike in QRS complex) and calculate inter-beat interval (IBI) → BPM = 60000 / IBI

Code Example

/*
 * AD8232 ECG/Heart Rate Monitor — Arduino
 * Wiring: 3.3V, GND, OUTPUT → A0, LO+ → Pin 5, LO- → Pin 6
 * View in Arduino Serial Plotter for ECG waveform
 */
#define ECG_PIN A0
#define LO_POS  5   /* Leads-off detection + */
#define LO_NEG  6   /* Leads-off detection - */

void setup() {
    Serial.begin(9600);
    pinMode(LO_POS, INPUT);
    pinMode(LO_NEG, INPUT);
}

void loop() {
    if (digitalRead(LO_POS) == HIGH ||
        digitalRead(LO_NEG) == HIGH) {
        Serial.println("!");  /* Leads off — no valid signal */
    } else {
        int ecg = analogRead(ECG_PIN);
        Serial.println(ecg);  /* Plot in Serial Plotter */
    }
    delay(2);  /* ~500 Hz sample rate */
}

Real-World Applications

Fitness Wearables, Biofeedback & Education

The AD8232 is used in DIY heart rate monitors, biofeedback devices (HRV analysis for stress management), exercise physiology experiments, biomedical engineering coursework, and wearable health prototypes. Combined with Bluetooth (ESP32), it enables real-time wireless ECG streaming to mobile apps.

ECGWearableBiofeedbackEducation

Limitations

  • Not medical-grade: Single-lead ECG cannot replace clinical 12-lead systems for diagnosis.
  • Motion artifacts: Movement causes baseline wander and noise; requires stationary recording for clean signals.
  • Electrode quality: Signal quality depends heavily on electrode adhesion and skin preparation.
  • No isolation: Requires battery operation or USB isolator for safety.