Op-Amp Gain
Works out the closed-loop gain of the two basic op-amp amplifiers, inverting and non-inverting, and the output voltage for a given input. It can also run the other way: give a target gain and the input resistor, and it finds the feedback resistor and the nearest standard value. Use it when scaling a sensor signal, setting up a preamp or checking a schematic.
Equations
Inverting: Av = −Rf/Rin
Non-inverting: Av = 1 + Rf/Rin
Vout = Av·Vin
Rf is the feedback resistor, from the output to the inverting (−) input. Rin is the input resistor: in the inverting amplifier it runs from the signal to the − input, and in the non-inverting one from the − input to ground. Av is the voltage gain and Vin the input voltage. The minus sign means the inverting amplifier flips the signal. Solving for Rf gives Rf = |Av|·Rin for the inverting amplifier and Rf = (Av − 1)·Rin for the non-inverting one, which can’t go below a gain of 1. These hold for an ideal op-amp with very high open-loop gain [1]. The nearest standard Rf comes from the chosen IEC 60063 series [2].
Limits and common mistakes
- The output can’t swing past the supply rails. If Vout comes out larger than the supply allows, the real amplifier clips.
- Gain falls with frequency. An op-amp with a gain-bandwidth product of 1 MHz set to a gain of 100 has only about 10 kHz of bandwidth.
- The gain shown when solving for Rf is the target. Fitting the nearest standard Rf changes it slightly; enter the standard value in the first mode to see the real gain.
- The inverting amplifier’s input resistance is only Rin, which loads a weak source. Keep resistors roughly between 1 kΩ and 1 MΩ.
Worked example
A sensor gives up to 75 mV and must be scaled to about 2.5 V for an ADC, a gain of 33 without inversion. Rin is 4.7 kΩ. What feedback resistor is needed?
- Choose Configuration Non-inverting and Solve for Feedback Resistor (Rf) (given target Gain & Rin).
- Enter Input resistor (Rin) 4.7 kΩ, Target Gain Magnitude |Av| 33 and Input voltage (Vin) 0.075 V.
- Choose Also show the nearest standard Rf from (IEC 60063) E24 (±5 %) and press Solve. The Solution shows:
Required Rf: 150,400 Ω
Nearest E24 value (±5 %): 150 kΩ (0.27 % below)
Gain (Av): 33
Output voltage (Vout): 2.475 V - To see the gain with the standard part, choose Solve for Gain & Output Voltage (given Rf & Rin), enter Feedback resistor (Rf) 150 kΩ and press Solve:
Gain (Av): 32.9149
Output voltage (Vout): 2.46862 V
Check by hand: (33 − 1) × 4.7 kΩ = 150.4 kΩ. With 150 kΩ, 1 + 150/4.7 = 32.91, and 32.91 × 75 mV = 2.469 V. That 0.26 % loss of gain is far smaller than the ±5 % tolerance of the resistors themselves.