The display program is demonstrated in this video below from the same blog post
I am just using this simple code to print the output of the AD627 amplifier to the serial port after a low pass filter with C = 0.1uF and R=1Mohm which sets the cutoff frequency at 1.6Hz
void setup(){
Serial.begin(38400);
}
void loop(){
int val = analogRead(0);
Serial.println(val, DEC);
delay(25);
}
All I get from the Python display program is a periodic signal and no resemblance to an EKG signal. Heres a screenshot.
Can anyone provide some insight as to why this is the case? I tried amplifying the output from the AD627 through an OP amp and it still did not produce an EKG signal
I am an ECG Tech, and when I see that on the screen, that means you are getting electrical noise. During The ECG process, the right leg wire is a ground. I see noise when this wire is not connected. Also, when instruments in the room are not properly grounded, the noise will be picked up by the machine.
Thanks for the input guys. I will be fixing my low pass filter and grounding electrode.
Is the 25 millisecond pause between each loop iteration the optimum time? When I went lower than 20 my serial port seemed the freeze up and I'd have to restart my computer.
Is the 25 millisecond pause between each loop iteration the optimum time?
It's been a long time since I digitized EKGs but IIRC the sampling rate was 250Hz which is every 4ms. If you use println to send the data, it will produce up to 5 characters per sample which is 12500 bits/sec.
When I went lower than 20 my serial port seemed the freeze up and I'd have to restart my computer.
Do you mean the Arduino froze or the PC? The PC shouldn't have any trouble keeping up with 38400.
With a delay of 4ms the Arduino's TX light would stop blinking for long periods of time and my computer's cursor would freeze up until I shutdown the display program. This was all at 38400 baud. Is this normal?
I can only use the Serial monitor on windows but with a delay of 4ms and transmitting at 38400 baud, it shows the output as one continuous stream with no pauses. The Tx light is on solidly.
Hmm I guess its the display program? I think I need to find an oscilloscope to make sure the AD627 is even putting out a signal before I can move on. Does anyone know of a successfully built Arduino based EKG that displays the waveform as well? I found this but it only detects heart rate