ECG with AD8232 problem with analog readings

Trying to build an ECG reader with ESP 32 DEVKITV1 and AD8232, I have been getting odd readings that don't resemble a ECG wave and I don't see how to fix it. I am using a classic code that is everywhere in the internet as follows:

void setup() {

// initialize the serial communication:

Serial.begin(9600);

pinMode(25, INPUT); // Setup for leads off detection LO +

pinMode(26, INPUT); // Setup for leads off detection LO -

pinMode(33, OUTPUT);

digitalWrite(33,HIGH);

}

void loop() {

if((digitalRead(25) == 1)||(digitalRead(26) == 1)){

Serial.println('!');

}

else{

// send the value of analog input 0:

Serial.println(analogRead(27));

}

//Wait for a bit to keep serial data from saturating

delay(1);

}

I properly get the message in the serial monitor for disconnecting the electrode, but besides that, I only get this weird shaped wave in the plotter. Yes, I have a matching baud rate. What could I do to troubleshoot it?

Start by posting an annotated schematic showing exactly how you have wired it showing all connections, power, ground and power sources. Along with that post links to the technical information on the hardware parts.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.