# op-amp circuit to transform input signal

In this typical op amp circuit, how would I go about calculating the value of each component if I want to simply transform the input voltage range into another voltage range, e.g. when input voltage vary between -5mV and 20mV, I want the output to vary from 0V to 5V, at a given frequency.

Edit: Hmmm ... may be the circuit above is not suitable to do the transformation. If that is the case, what would be a good one for that?

• what frequency is your signal? – miceuz Jun 22 '12 at 7:42
• I just realized you have been here a while, asked a bunch of questions, but never accepted a single answer. If I had noticed that earlier I may not have bothered trying to answer this question. – Olin Lathrop Jun 22 '12 at 13:00
• @Olin Lathrop, thanks a lot for answering my question and every other question you answer. I do enjoy and do learn a lot from reading your answers. I didn't think it makes a lot of difference if I accepted an answer or not, since every answer adds a bit more to the useful info. However, if that is considered good etiquette, I would be happy to do it. – lyassa Jun 23 '12 at 2:03
• @lyassa - Like upvoting, accepting an answer is a token of appreciation, and no matter what others may say, we all enjoy our answers being appreciated. Accepting an answer also signals that your problem is solved, and for some this will be a reason to move on to other questions that still need a solution. (Personally, I often answer questions which already have an accepted answer, and from the upvotes I can tell that these answers are often useful too.) Keep asking questions, but don't forget that tap on the shoulder. HANWE. – stevenvh Jun 23 '12 at 7:34

The way it's now it's not suitable for that transformation, but that can easily be fixed. The capacitors will block any DC content of the signal, so the 2.5 V offset of your output signal will be lost, and 0 V to 5 V out will become -2.5 V to +2.5 V out. Solution: get rid of the capacitors, also C1, we won't need them.

Your input range is 25 mV, and the output range 5 V, that means we have to amplify by a factor 200. Let's do that by choosing R1 = 100 Ω and R4 = 20 kΩ, that's a 200:1 ratio. Now all we have to do is find values for R2 and R3, which will determine the offset.

Let's call the voltage on the inverting input of the opamp V1. Then, according to Kirchhoff's Current Law, and because the input is high impedance:

$\dfrac{V1 - 20 mV}{100 \Omega} = \dfrac{0 V - V1}{20 k\Omega}$

from which we find that V1 is 19.9 mV. So for a +5 V supply we can choose R2 = 100.1 kΩ and R3 = 400 Ω.

The circuit you show is AC coupled. That means that the input DC level is irrelevant and a fixed output DC level will be provided, which in this case is 0 V due to R5.

There is nothing necessarily wrong with a AC coupled amplifier. It depends on what you want to accomplish. For example, if you want to manipulate audio, then AC couping is fine, even a good idea.

So, your question comes down to two issues, gain and frequency response. You mentioned nothing about gain as a function of frequency, so let's start out assuming the AC coupling is at sufficient frequency points so as not to effect the frequencies of interest.

In this circuit, the gain magnitude is R4 divided by the impedance of the signal arriving at the opamp negative input. Again we assume that C1 is large enough to not be relevant compared to R1 at frequencies we care about, so the voltage gain is -R4/R1. This circuit inverts, hence the negative gain.

Note that this nails down only one degree of freedom in choosing the values of two resistors. There are many ways to think of the other degree of freedom, but the input impedance of the amplifier is probably the most relevant. The input impedance is basically R1 (again making the approximation that C1 has little impedance relative to R1).

Let's say you wanted this amplifier to have 600 Ω input impedance and a gain magnitude of 10. From our two constraints, R1 = 600Ω and R4/R1 = 10. This set of simultaneous equations is so simple that they can be solved by inspection. R1 = 600 Ω and R4 = 6 kΩ.

R2 and R3 form a voltage divider. The output of this divider is the virtual 0 level that the signal will float at around the opamp. You can think of this is the quiescient bias level. Since you generally want equal swing high and low from the center level, the output of the R3,R3 divider should be at about the middle of the output swing of the opamp. If this is a rail to rail output opamp, then the output of the R3,R3 divider should be near 1/2 the supply voltage. The second degree of freedom can again be thought of as coming from the desired output impedance of the divider. There is wide latitude here since the opamp input impedance should be quite high. Lower impedance won't help much but will cause higher wasted current thru R2 and R3. Go too high, and the node can pick up noise. I'd aim for 10 kΩ to 100 kΩ given no other information. The output impedance of the R2,R3 divider is R2 and R3 in parallel.

The only things left are parameters you didn't ask about, which are the rolloff frequencies of the two high pass filters and the output impedance. Let's say this is for audio. The full audio range is generally considered to be 20 Hz to 20 kHz. To avoid too much effect at 20 Hz, let's set the two high pass filter rolloff frequencies to 10 Hz each. The crossover frequency between a resistor and capacitor is:

F = 1/(2 π R C)

When R is in Ohms, C in Farads, then F will be in Hertz. Obviously you can rearrange this equation to solve for any of F, R, or C given the other two.

We previously said that R1 is 600 Ω in our example and we want 10 Hz rollof. That makes C1 27 µF. That's a bit high, but doable. If too high, you can make the input impedance higher, which allows for higher R1, which allows for lower C1.

The same relationship holds true for C2 and R5. C2 of 27 µF and R5 of 600 Ω give a 10 Hz rolloff and 600 Ω output impedance at the highest. Note that at high frequencies C2 has lower impedance, which more directly couples the opamp output to the output at D. In the limit, the circuit has whatever output impedance the opamp can support.

• @m.Alin: I wrote "R2,R3 divider" deliberately as apposed to "R2/R3 divider". The reason is that the latter implies a mathematical operation which is incorrect in this context. I used a comma to avoid any confusion with mathematical division. – Olin Lathrop Jun 22 '12 at 12:51
• Sorry for that. You were too subtle for me :-) – m.Alin Jun 22 '12 at 12:53
• @m.Alin - I had seen the suggested edit, but didn't want to approve it. If R2 = R3 then R2/R3 = 1 instead of the divider value of 1/2. – stevenvh Jun 22 '12 at 17:16
• @stevenvh Yep, it makes sense. I just didn't see R2/R3 as a division operation. – m.Alin Jun 22 '12 at 19:59