The AD8232 from Analog Devices is a dedicated single-lead heart rate monitor analog front end that is ideal for monitoring electrical activity of the heart. This small and power-efficient integrated circuit (IC) is optimized for wearable health monitoring devices and fitness trackers. It is capable of extracting, amplifying, and filtering small biopotential signals in the presence of noisy conditions, such as those created by motion or remote electrode placement.
Pin Number | Name | Description |
---|---|---|
1 | IN+ | Positive input for the differential amplifier |
2 | IN- | Negative input for the differential amplifier |
3 | SDN | Shutdown pin; active low |
4 | GND | Ground reference for the circuit |
5 | OUTPUT | Output signal of the heart rate monitor |
6 | LO+ | Lead-off detection positive input |
7 | LO- | Lead-off detection negative input |
8 | VCC | Supply voltage for the IC |
// Include the Arduino Wire library for I2C
#include <Wire.h>
// AD8232 output pin
const int OUTPUT_PIN = A0;
// AD8232 LO+ pin
const int LO_PLUS_PIN = 10;
// AD8232 LO- pin
const int LO_MINUS_PIN = 11;
void setup() {
// Initialize serial communication at 9600 bits per second
Serial.begin(9600);
// Configure the LO+ and LO- pins as inputs
pinMode(LO_PLUS_PIN, INPUT);
pinMode(LO_MINUS_PIN, INPUT);
}
void loop() {
// Check if both LO pins are not detecting lead off
if(digitalRead(LO_PLUS_PIN) == HIGH && digitalRead(LO_MINUS_PIN) == HIGH) {
// Read the heart rate signal
int heartRateSignal = analogRead(OUTPUT_PIN);
// Send the value to the serial monitor
Serial.println(heartRateSignal);
} else {
// Send a '0' to the serial monitor if lead off is detected
Serial.println(0);
}
// Wait for a bit to avoid spamming the serial monitor
delay(200);
}
Note: This example assumes that the AD8232 is properly connected to the Arduino UNO. The OUTPUT_PIN
should be connected to the AD8232's output, and the LO_PLUS_PIN
and LO_MINUS_PIN
should be connected to the AD8232's LO+ and LO- pins, respectively. The serial monitor will display the heart rate signal or '0' if a lead-off condition is detected.