17
\$\begingroup\$

I have a front end module that generates an (ECG) signal that varies from +/-2.5 V. I want to shift this signal to 0 - 5V. What is the best way to do this? Would a summing amplifier like the below circuit good enough? With R1 = R2 and V1 = 2.5V, V2 = my signal, V3 = V4 = GND

Summing Amp

\$\endgroup\$
17
\$\begingroup\$

First thing to try is a simple resistor adder, without opamp. But it's clear that this won't work here: a resistor adder always attenuates the signal, and we need a \$\times\$1 amplification.

enter image description here

This is a non-inverting summing amplifier. You would think that we simply have to add 2.5 V, but do you have that? I'm assuming you have 5 V, so let's use that and see where it gets us. If we have -2.5 V on the Vin input the non-inverting input should be zero if you want 0 V out, regardless of the values of R3 and R4. So R1 and R2 form a voltage divider, and R2 should be twice R1 to get the 0 V.

Next we have to find the amplification, which is determined by R3 and R4:

\$ A_V = \dfrac{R3 + R4}{R3} \$

If we have 2.5 V on the Vin input and with R2 = 2 \$\times\$R1 we get 3.33 V on the non-inverting input of the opamp. To make that 5 V out we have to amplify by 1.5, so R3 must be twice R4.

We could use the following values:

R1 = 10 kΩ
R2 = 20 kΩ
R3 = 20 kΩ
R4 = 10 kΩ

You'll need an RRIO (Rail-to-Rail I/O) opamp if you want to power if from a single 5 V supply.

\$\endgroup\$
  • \$\begingroup\$ Thank you for your circuit, but I find that I need to give 2.5 V at R2 instead of 5V for the shifting to work. Not sure why that is the case.. But the circuit works \$\endgroup\$ – govind m Aug 7 '12 at 10:47
  • \$\begingroup\$ @govindm - Nope, the calculation says 5 V :-). Are you sure you didn't use the same values for R1 and R2? \$\endgroup\$ – stevenvh Aug 7 '12 at 10:55
  • \$\begingroup\$ Oops sorry Steven, stupid mistake on my part. I'd interchanged r1 and r2. I am happy to confirm once again (in the history of human civilization), that calculations DONT lie. \$\endgroup\$ – govind m Aug 8 '12 at 3:45
14
\$\begingroup\$

Here is one way to do it:

Level Shift

The resistive divider supplies 1.25V to the non-inverting input. This can be replaced by a dedicated voltage reference if desired. You will need a rail to rail output opamp.

Here is a simulation:

Level Shift Sim

Note the input impedance is defined by R3, so you may need to increase this (and R2 by the same) or buffer if the source is high impedance. Also note that the output is inverting.

Here's a non-inverting method for reference also:

Level Shift Non Inverting

And the simulation (the "to_adc" is the output voltage):

Level Shift Non-Inverting

The above non-inverting circuit is a bit like your summing amplifier.
The summing amp you show has a problem though, the inverting gain resistors shown will not correct for the divider. It needs (R1 + R2) for the feedback resistor.
So gain equals ((R1 + R2) / R2) + 1.

Here is an example of how it should look (the a and b suffixes are just to keep SPICE happy):

Level shift summing

In the simulation you can see the opamp +IN swings from 0V to 1.25V, so it needs a gain of 4 to output 0V to 5V. Since R1c and R1d are in parallel, we get 50k. So (150k / 50k) + 1 = 4.

Level shift summing sim

\$\endgroup\$
  • \$\begingroup\$ I'm curious, how did you size C2? \$\endgroup\$ – jippie Aug 3 '12 at 6:27
  • \$\begingroup\$ I didn't actually size it for this particular question, it's a remnant from a previous schematic I adjusted for this answer (I left it in as it's always a good idea to have a small cap across Rf to prevent oscillation, but didn't want to go into more detail in that area) However, as shown the bandwidth would be 1 / (2pi * C2 * (R1+R2)) -> 1 / (6.28 * 100e-12 * 150e3) = ~10.6kHz. For an ECG, the bandwidth could be reduced plenty more. \$\endgroup\$ – Oli Glaser Aug 3 '12 at 6:35
  • \$\begingroup\$ Thanks for your detailed answer. I just tried your non-inverting circuit, but I seem to have run into some problem. Even though the input signal swings from -2.5 to 2.5 V, the output of the amplifier swings between 1V and 3.3V only, I don't know what is going on.. I am using LM358AN \$\endgroup\$ – govind m Aug 3 '12 at 7:17
  • \$\begingroup\$ The LM358 is not a rail to rail opamp, specifically the output won't swing all the way to +5V though it should reach ground. The input is not rail to rail either. Also, if your source impedance is high (e.g. > 5k) you will need to buffer the signal before sending to the level shifter. \$\endgroup\$ – Oli Glaser Aug 3 '12 at 7:35
  • \$\begingroup\$ I also tried OPA333 - which according to the datasheet is "rail to rail output within 3mV", with the same result. Maybe it's an issue with the input impedence then? I shall try adding a voltage follower.. \$\endgroup\$ – govind m Aug 3 '12 at 7:45

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.