I'm using the AD8232 ECG sensor with Adafruit ESP32 Feather V2. I'm following this Sparkfun guide https://learn.sparkfun.com/tutorials/ad8232-heart-rate-monitor-hookup-guide/all to use the sensor correctly but the serial monitor returns gibberish data, 4095 and !. I've tried different electrode placements but still no result. The ESP32 board I'm using does not have GPIO pins 11 and 10 so I'm using pins 33 and 27 for leads off detection. This is my code:

void setup() {
  // initialize the serial communication:
  pinMode(33, INPUT); // Setup for leads off detection LO +
  pinMode(27, INPUT); // Setup for leads off detection LO -


void loop() {
  if((digitalRead(33) == 1)||(digitalRead(27) == 1)){
    // send the value of analog input 0:
  //Wait for a bit to keep serial data from saturating

enter image description here

  • I request you to check the AD8232 Sensor. The sparkfun tutorial uses an Arduino Pro mini. If you have that same board or any other Arduino, please follow the tutorial meticulously without any change in the given code or wiring. This is to make sure that the sensor itself is not problematic. Once you figure out this problem, you can make an adapter for AD8232 sensor like this: pcbway.com/project/shareproject/…
    – tepalia
    Commented May 27 at 18:05


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.