Currently I am trying to build a portable ECG device where by the ECG signal will then be sent to Arduino UNO where the data will be transmitted via Bluetooth and the waveform will be displayed on Android Phone. I've already built a circuit and have a good waveform. I also managed to successfully transmit the data via Bluetooth and gotten a signal displayed on the phone.

Here is the problem. I just found out (unfortunately) that Arduino UNO only reads from 0 - 5V. However, my signal range from -220mV to + 550mV. That being said, the signal that is being shown on the phone are clipped or only halved are shown and the negative waveform disappears. How do I shift the whole signal so that its value starts from above 0V ? I have tried non-inverting summing amplifier and it does not work, or maybe it was wrong placement to built. I have attached a schematics of my ECG circuit for references. I am supplying my circuit with 1x 9V battery where the power is split into +4.5V/-4.5V. I also have successfully built an analogue 50Hz notch filter. If anyone knows how to solve this, please share. Also, if I were to add summing amplifier, where should I add it ?

Take note, I have 2 signals that I am sending to the UNO. A0 Pin is receiving the filtered signal, and A1 Pin is receiving the unfiltered signal. Both signals need to be level shifted.

I am from a Mechanical background, so don't be too hard on me.

enter image description here

Newly Updated Schematic.

  • 1
    \$\begingroup\$ TL071 is not recommended on supplies lower than +/-5 volts and I would use a proper op-amp mid-rail generator. I know that's not what your asking but I don't feel like advising when there's basic problems that need fixing first. \$\endgroup\$
    – Andy aka
    Jan 10 '17 at 18:31
  • \$\begingroup\$ So far, I have tried OP177 GPZ and it was way to noisy for this application. I chose TL071 as it was one of the lowest noise op-amp. Also, I am from a Mechanical Background. So don't to be too hard on me. So what would be your recommendation ? \$\endgroup\$
    – Ziamk
    Jan 10 '17 at 18:49
  • \$\begingroup\$ The input noise current on the OP177 is the killer for your design - look for a FET input op-amp capable of working from supplies of less than +/- 3V to at least +/- 5V \$\endgroup\$
    – Andy aka
    Jan 10 '17 at 18:56
  • \$\begingroup\$ There is plenty of gain in the AD520 and the datasheet links newer models cheaper, lower noise etc. but your R gain is low and could be increased and noise can be reduced considerably with 3 pads see Figure 39. A Medical ECG Monitor C ( such that a line notch filter may not be needed) \$\endgroup\$ Jan 10 '17 at 18:59
  • \$\begingroup\$ I agree with the above @TonyStewart.EEsince'75 - your gain is only about 8 at the moment and given the bandwidth of your signal the gain could probably be 80 or 800! \$\endgroup\$
    – Andy aka
    Jan 10 '17 at 19:00

The simplest way is to generate an artificial 2.5 volts pseudoground, then connect what are currently the ground points for R5 and R2/R3 to that. This way, the AC coupling that you are already doing will be to a nominal zero level of 2.5 volts rather than 0. If you do this, though, you will definitely need to replace the TL071, since you will be really violating common-mode input limits. Without knowing your packaging limitations, I'd suggest that you simply add another battery, and operate from +/- 9 volts.

Also, I suggest you look closely at pages 4 and 8 of the AD620 data sheet. You will notice that with increasing gain the (effective) input noise actually drops, so using as much gain as possible in the first stage is (as always) a good idea. I'm not sure what "noise saturation" means, but I'd recommend putting a pair of matched 1000 pF caps from the 620 inputs to ground to act as a low-pas filter for noise. As a matter of course, you should ALWAYS add input capacitors to any high-impedance amplifier which is connected to the nasty outside world. While this will, of course, decrease bandwidth, unless you absolutely, unequivocally must have that bandwidth you're best off without it. James Roberge, once a big name at MIT, had a saying: "People who ask for more bandwidth than they need deserve what they get."

Another reason to increase the gain of the AD620 is to decrease the effect of the second stage input offset errors. Assuming you run R1 at 50% (500k) your DC gain will be as much as 10 mV, depending on which TL071 model you use. 500 x 10 mV is 5 volts, and this is clearly more than you can afford. More gain in the first stage means less offset in the second, and the AC coupling will get rid of any DC offset from the first stage.

  • \$\begingroup\$ If you take a look at the schematics, R5 and C4 is part of the 1st order High pass filter (RC) 0.03Hz. If I were to connect it to the artificial 2.5V pseudo ground, wont it affect the high pass filter ? Also, what kind of caps are you referring to ? Ceramic caps or Electrolytic caps ? Sorry about the basic question, I am from a Mechanical Background. So I may not understood some of what you just wrote here. \$\endgroup\$
    – Ziamk
    Jan 10 '17 at 23:31
  • \$\begingroup\$ @Ziamk - You never did define what "noise saturation" is, so I assume you're worried about input EMI on the AD620. R5/C4 don't address this issue, but caps on the inputs to the AD620 do. And for something like 1000 to 10,000 pf (and yes, ceramic) these will form a low-pass filter for common-mode input noise. 10,000 pF and 100 ohms will give a high-frequency cutoff of 159 kHz, which is far above any frequency you're interested in. \$\endgroup\$ Jan 11 '17 at 0:18
  • \$\begingroup\$ I managed to offset the signal by adding non-inverting summing amplifier. I did not connect the 2.5V to R5 and R2/R3. However, the signal I see on the oscilloscope (DC Coupling) is still halved or clipped. I was told by a colleague of mind that DC saturation is still present. Preventing me from having the signal that is seen during AC coupling. How do I remove it ? Also, you mentioned that it is recommended to put a pair of 1000pF caps on the input (pin 3 and 2) of AD620. However when I did my calculation, I arrived at 1.59Mhz. Is this correct ? \$\endgroup\$
    – Ziamk
    Jan 11 '17 at 15:03
  • \$\begingroup\$ Also, you asked about noise saturation. Here is a link that describes about the gain of Instrumental Amp should be kept low to prevent DC saturation. link \$\endgroup\$
    – Ziamk
    Jan 11 '17 at 15:05
  • \$\begingroup\$ @Ziamk - OK, but DC is not (usually) considered noise, and you stated "noise saturation". And whether or not that's necessary depends on your setup. Do you expect to see 1 volt of offset? 0.1 volt? .01 volt? it's impossible to discuss the tradeoffs without specifications. Also, input caps - 1000 pf/100 ohms will indeed give you 1.6 MHz, so on second thought you'd do well to use 0.1 uF. \$\endgroup\$ Jan 11 '17 at 16:55

Assume that offset voltages of IC2 are zero, so that its average output voltage is zero volts - your ECG signals vary above and below this point. This is a dangerous assumption, since its gain seems rather high, amplifying any offset voltage. WhatRoughBeast's info on the input Instrumentation amplifier makes good sense, and allows that second amplifier to have reduced gain.

Your UNO chip has a 5v supply, which usually also provides the full-scale reference voltage for its internal analog-to-digital converter. This voltage would be a good source to supply the required DC offset of 2.5v.
The filtered output from your ECG circuit comes from a twin-T notch filter whose DC resistance to ground (or to near-ground) is 200 kohms. A 200k resistor from this output to UNO's +5v rail should provide the required 2.5v offset. This method also allows you to detect a faulty connection to your ECG circuit: if your UNO yields a full-scale voltage, the connection is broken.
Should you prefer to use the unfiltered ECG output, a different offset method is required. Many sources of micropower 2.5v references are available for ZD1 (note that some higher power references require significantly more current, forcing R2 to be a smaller value). A micropower 2.5v reference eases the DC power requirements in the front-end preamp.


simulate this circuit – Schematic created using CircuitLab

  • \$\begingroup\$ I am sending 2 sets of signals to the UNO. One of it is filtered and the other one is not filtered. How should a different offset be for the unfiltered output ? \$\endgroup\$
    – Ziamk
    Jan 10 '17 at 23:22
  • \$\begingroup\$ @Ziamk Have modified the schematic for a possible way to input unfiltered signal. At first, had considered a parallel RC substituting for ZD1, but the time constant required is rather long for your application. \$\endgroup\$
    – glen_geek
    Jan 11 '17 at 3:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.