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);
}
https://europe1.discourse-cdn.com/ardui … 0cfc06.png
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?