This is not exactly ECG. This is only experiment how precise have to be the circuit. I decided to not use the classical 2 stage 3 opamp instrumentation amplifier. I don't intend to picture my hairy chest but I will share my heart beat. This is personal :))
The circuit is instrumentation amplifier with 2 operational amplifiers. The overal gain is1+R2/R1+2R2/Rg. One disadvantage of the circuit is the dependency of the CMRR from the gain. We need high gain so this is not an issue. Second, the amplifiers have different bandwidth because of different closed loops. We have relatively slow signals and there is no need to compensate the AC CMRR.
CMRR mean Common Mode Rejection Ratio and there is a lot of easy OPA theory on the net.
In practical circuit I use 2 more stages. Additional CMRR amplifier, which do balance between differential electrodes on hands or chest. This is done by third electrode on the left leg or chest. The other stage is integrator, which prevent output DC floating. The board is 'kitchen made'. The resistors can be 1% or more precise. I did not saw huge difference in the signal. The left and right cables should be shielded. I used sticky electrodes for veloergometry.
The result is almost good. The signal have 50Hz noise which can be easy filtered. I am not sure whether or not this waveforms are actual from medical point of view. My signal is inverted so I have to swap the electrodes. I see clear spike (something called QRS complex) and subsequent pulse (something called T-wave) but I dont see the beginning of the cycle (something called P-wave). In the body there are isoelectric lines and commercial ECG use far more electrodes around them.
Whatever, I have signal. Hear my heart in Deep Purple beat :D