The Direct Answer: Calculating the Gain of a Non-Inverting Op Amp

The voltage gain ($A_v$) of a non-inverting operational amplifier is calculated using the formula:

$A_v = 1 + \frac{R_f}{R_i}$

Where $R_f$ is the feedback resistor (connected from the output to the inverting input) and $R_i$ is the input resistor (connected from the inverting input to ground). The minimum possible gain in this configuration is 1 (unity gain), achieved when $R_f = 0\Omega$ or $R_i = \infty$ (open circuit).

Unlike the inverting configuration, the input signal is applied directly to the non-inverting pin (+), resulting in an output that is in-phase with the input. The op-amp's internal high open-loop gain forces the inverting pin (-) to match the voltage at the non-inverting pin (+), creating a 'virtual short' between the two inputs.

Standard 8-Pin DIP Pinout Reference

When wiring a dual op-amp IC (like the LM358 or TL072) in an 8-pin DIP package, the pins are mapped as follows:

  • Pin 1: Output A
  • Pin 2: Inverting Input A (-)
  • Pin 3: Non-Inverting Input A (+)
  • Pin 4: V- (Negative Supply / GND for single-supply)
  • Pin 5: Non-Inverting Input B (+)
  • Pin 6: Inverting Input B (-)
  • Pin 7: Output B
  • Pin 8: V+ (Positive Supply)

Operation Regions and Power Supply Limits

An op-amp does not output infinite voltage. The actual output is constrained by the power supply rails and the internal transistor architecture. Before setting your gain, you must understand which operation region your circuit will fall into.

Operation Region Output Voltage Behavior Typical Output Current Practical Implication
Linear (Active) $V_{out} = A_v \times V_{in}$ < 20mA (Load dependent) The desired operating state. Virtual short holds true.
Positive Saturation $V_{CC} - 1.5V$ (Standard) or $V_{CC} - 50mV$ (RRIO) Limited by load Output clips. Increase supply voltage or lower gain.
Negative Saturation $V_{EE} + 0.2V$ (LM358) or $V_{EE} + 50mV$ (RRIO) Limited by load Output clips near ground. Use a dual supply or RRIO IC.
Short Circuit Pinned to 0V (or load potential) Internal limit (~30-40mA) IC dissipates heat. Prolonged shorts may destroy the die.
Bench Note on Rail-to-Rail (RRIO): Standard op-amps like the LM358 can pull the output down to the negative rail (ground), but they cannot swing all the way to the positive rail. If you power an LM358 with 5.0V, your maximum linear output is roughly 3.5V. If you need a 0-5V output swing, you must either power the LM358 with at least 7V, or switch to a true Rail-to-Rail I/O (RRIO) op-amp like the MCP6002.

Designing the Feedback Network: Resistor Selection Decision Tree

The gain formula gives you a ratio, not absolute values. A gain of 10 can be achieved with $R_f = 9\Omega$ and $R_i = 1\Omega$, or $R_f = 9M\Omega$ and $R_i = 1M\Omega$. Choosing the wrong absolute values leads to excessive power draw, thermal noise, or bias current errors. Use this decision path to select your resistor scale.

Application Condition Recommended $R_f$ Scale Why This Matters
High source impedance sensor (>100k$\Omega$) 1k$\Omega$ - 10k$\Omega$ Keeps feedback current high enough to swamp the op-amp's input bias current, preventing massive DC offset errors.
Battery/IoT low-power node 100k$\Omega$ - 1M$\Omega$ Minimizes quiescent current draw through the feedback divider, extending battery life.
High-fidelity audio / Low noise 10k$\Omega$ - 47k$\Omega$ (Metal Film) Balances Johnson-Nyquist thermal noise (which increases with resistance) against bias current offsets.
Driving heavy capacitive loads (>100pF) < 10k$\Omega$ Lower output impedance prevents the feedback pole from inducing high-frequency oscillation.

The Workbench Default Pick

For 90% of general-purpose DC sensor amplification and bench prototyping running on 5V to 15V supplies, lock your feedback resistor ($R_f$) at 10.0 k$\Omega$ (1% tolerance). This provides a safe 1mA feedback current at 10V, keeps thermal noise low, and makes the math for $R_i$ trivial. Calculate $R_i$ based on this fixed $R_f$ value.

Complete Application Circuit: 10x DC Sensor Amplifier

Let's build a circuit to amplify a 0-500mV shunt or load cell signal to a 0-5V range for an ESP32 or Arduino ADC. We need a gain of exactly 10.

  1. Calculate the Ratio: $10 = 1 + (R_f / R_i) \rightarrow R_f / R_i = 9$.
  2. Select $R_i$: Using our workbench default, set $R_i = 10.0\text{ k}\Omega$.
  3. Select $R_f$: We need $90.0\text{ k}\Omega$. Since 90k is not a standard 1% E96 value, we select the closest standard value: $R_f = 90.9\text{ k}\Omega$ (1% metal film). This yields an actual gain of 10.09.
  4. Verify Output Swing: $500\text{mV} \times 10.09 = 5.045\text{V}$. Warning: This will clip on a standard 5.0V supply. You must power this op-amp with a 9V or 12V supply and place a 5.1V Zener diode (or a resistor voltage divider) at the output to protect the 3.3V/5V microcontroller ADC.
  5. Decoupling: Place a 100nF (0.1$\mu$F) X7R ceramic capacitor directly across Pin 8 (V+) and Pin 4 (V-), as close to the IC body as physically possible. This prevents high-frequency RF rectification and oscillation.
Input Bias Compensation: If your signal source has a high DC resistance, add a compensation resistor ($R_{comp}$) in series with the non-inverting pin. Set $R_{comp} = R_f || R_i$ (the parallel equivalent). For our 10x circuit, $R_{comp} = (90.9k \times 10k) / (90.9k + 10k) \approx 9.01\text{ k}\Omega$. Use a standard 9.09k$\Omega$ resistor to cancel out voltage drops caused by input bias currents.

Safe Default Part Numbers for Your Workbench

Do not blindly grab any op-amp from your bin. Match the IC architecture to your supply voltage and signal type. Here are the definitive safe defaults for modern builds, backed by Texas Instruments datasheets and industry standards.

Part Number Best Application Supply Voltage Range Slew Rate GBWP Key Characteristic
LM358 DC sensors, single-supply 12V 3V to 32V (Single) 0.6 V/$\mu$s 1 MHz Output swings to true ground (V-). Cheap, rugged.
TL072 Audio pre-amps, dual supply $\pm$5V to $\pm$15V (Dual) 13 V/$\mu$s 3 MHz JFET inputs. Extremely low voltage noise for audio.
MCP6002 3.3V ESP32/Arduino ADC buffering 1.8V to 5.5V (Single) 0.6 V/$\mu$s 1 MHz True RRIO. Swings millivolts from both rails on 3.3V.
OPA2134 Precision instrumentation $\pm$2.5V to $\pm$18V 20 V/$\mu$s 8 MHz FET inputs, low THD. Premium audio and measurement.

Troubleshooting: Testing the IC and Verifying Gain

When your circuit output is pegged to a rail, reads 0V, or exhibits high-frequency noise, the op-amp or the feedback network has failed. According to Analog Devices tutorial MT-047, improper layout and missing decoupling are the primary culprits for apparent 'gain errors' that are actually high-frequency oscillations rectifying into DC offsets.

Multimeter Diagnostic Sequence

Follow this exact sequence with a digital multimeter (DMM) to isolate the fault:

  1. Verify Power Rails: Set DMM to DC Voltage. Measure Pin 8 to Pin 4. You must read your exact supply voltage (e.g., 9.00V). If it reads <1V, your IC is shorted or your breadboard power rail is broken.
  2. Check the Virtual Short: Set DMM to DC mV. Probe Pin 3 (Non-inverting) and Pin 2 (Inverting). In the linear region, the difference must read < 5mV. If you read a difference of 100mV or more, the op-amp is saturated (clipped) or the feedback loop is broken.
  3. Test Feedback Continuity: Power down the circuit. Set DMM to Resistance ($\Omega$). Measure across $R_f$ (Pin 1 to Pin 2). You should read exactly 90.9k$\Omega$ ($\pm$1%). An 'OL' (open) reading means a broken jumper wire or a blown resistor, which forces the op-amp into open-loop comparator mode (pegging the output to V+).
  4. Check Internal ESD Diodes: Power down. Set DMM to Diode Test mode. Place the red probe on Pin 4 (V-) and the black probe on Pin 3 (In+). You should read a forward voltage drop of 0.6V to 0.8V. Reverse the probes; it should read 'OL'. If it reads 0.0V or shorted in both directions, the internal silicon junction is blown from an overvoltage event. Desolder and replace the IC.

By anchoring your design to the $1 + (R_f/R_i)$ formula, selecting resistor scales that match your source impedance, and verifying the virtual short with a multimeter, you eliminate the guesswork from analog amplification. Default to the 10k$\Omega$ feedback baseline and the LM358/MCP6002 IC families, and your sensor interfaces will work reliably on the first breadboard build.