I am trying for the beginning to run a simple Arduino code in order to test the functionality of the ECG sensor. What I am getting on the output are some random values around 600 or around 200. I connected everything the same as in any tutorial about AD8232: GND -> GND, 3.3V -> 3.3V, L0+ -> digital pin 10, L0- -> digital pin 11, output -> analog pin A0. I placed the sensor pads on my body like in pictures (forming a triangle), but regardless of putting the electrodes or not, I always get the same floating signal. Here is Arduino code:
int ecg;
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
pinMode(10,INPUT);
pinMode(11,INPUT);
}
void loop() {
if((digitalRead(10) == 1)||(digitalRead(11) == 1)){
Serial.println('!');
}
else{
// send the value of analog input 0:
Serial.println(analogRead(A0));
}
//Wait for a bit to keep serial data from saturating
delay(1);
}
When I run this code I get only "!" on the output, no matter where I put the electrodes on my body. When I comment "if" and "else" parts of the code and print directly only reading from the pin A0, I get those random floating values, like on the image.
I also tried another custom built ECG sensor, but the results are the same. I haven't found the solution anywhere. It is not about the noise, because when I touch the metal box of my PC, I only reduce the values but there is still nothing on the output.
I only reduce the values but there is still nothing on the output.
Have you tried measuring using a laptop that isn't connected to AC? Not to mention, have you added large electrolytic capacitors to the 3.3V bus and made sure it can supply enough current for the sensor?