To achieve a specific op amp circuit gain, you must set the ratio of two feedback resistors in your chosen topology. For the most common configuration—the non-inverting amplifier—the closed-loop voltage gain ($A_v$) is calculated as $A_v = 1 + (R_f / R_g)$. By selecting precision resistors and a rail-to-rail operational amplifier, you can predictably scale millivolt sensor signals up to levels your microcontroller’s ADC can actually read.
The Non-Inverting Topology: Nodes, Math, and Real Values
The non-inverting amplifier is the workhorse of signal conditioning because it preserves the phase of the input signal and offers exceptionally high input impedance. Let’s break down the physical nodes on a standard DIP-8 package, using the “A” channel of a TLC2272CP (a true rail-to-rail output, single-supply op-amp).
- $V_{in}$ (Input): Connects to the non-inverting input (Pin 3).
- $V_{out}$ (Output): Taken from the output pin (Pin 1).
- $V_{-}$ (Inverting Node): The summing junction at the inverting input (Pin 2).
- $R_f$ (Feedback Resistor): Connects between $V_{out}$ (Pin 1) and $V_{-}$ (Pin 2).
- $R_g$ (Ground Resistor): Connects between $V_{-}$ (Pin 2) and analog ground.
Design Walkthrough: Target Gain of 5.0
Suppose you need to amplify a 0–1V DC sensor signal to a 0–5V range for an ESP32 ADC, using a single 5.0V supply. You need an op amp circuit gain of exactly 5.0.
First, we pick the resistors. Avoid standard 5% carbon film resistors; their tolerance will wreck your gain accuracy. Instead, use 1% metal film resistors from the E96 series. If we set $R_g = 10.0\text{k}\Omega$, we need $R_f$ to be $40.0\text{k}\Omega$ to get a gain of 5. However, $40.0\text{k}\Omega$ is not a standard E96 value. The closest standard 1% value is $40.2\text{k}\Omega$.
Let’s verify the math:
$A_v = 1 + (40.2\text{k} / 10.0\text{k}) = 1 + 4.02 = \mathbf{5.02}$
A gain of 5.02 means a 1.000V input yields 5.02V at the output. Because the TLC2272 is powered by a 5.0V single supply, the output will physically clip at roughly 4.98V (the positive rail limit). For a 0.99V max sensor input, this circuit will perfectly scale the signal without clipping.
Why Non-Inverting Over Inverting? (And When It Breaks)
Why choose this topology over the inverting amplifier? The decision usually comes down to input impedance and phase requirements. Here is the direct comparison:
| Criterion | Non-Inverting Topology | Inverting Topology |
|---|---|---|
| Input Impedance | Extremely high (Op-amp common-mode impedance, often $>10^{12}\Omega$) | Equal to $R_{in}$ (often $1\text{k}\Omega$ to $100\text{k}\Omega$) |
| Phase Shift | $0^\circ$ (Output is in phase with input) | $180^\circ$ (Output is inverted) |
| Minimum Gain | $1$ (Unity gain buffer) | $0$ (Can attenuate signals) |
| Virtual Ground | No (Common-mode voltage moves with $V_{in}$) | Yes (Inverting node stays at 0V) |
The non-inverting topology wins when you are buffering high-impedance sources like piezo sensors or voltage dividers, because it won’t load the source down. However, because the input pins see the actual input voltage, you must ensure your op-amp’s input common-mode voltage range includes your signal levels.
Failure Modes: What Breaks at the Extremes?
Textbooks rarely explain what happens when a solder joint fails. Here is how the non-inverting topology behaves when components open or short:
- $R_f$ Opens: The feedback path is broken. The inverting input ($V_{-}$) is pulled to 0V via $R_g$. Since $V_{in}$ is applied to $V_{+}$, the op-amp sees a massive differential voltage ($V_{+} > V_{-}$) and acts as a comparator, saturating the output at the positive supply rail.
- $R_g$ Opens: The inverting input is now tied exclusively to the output via $R_f$. Because no current flows into the op-amp’s input pin, $V_{-}$ perfectly tracks $V_{out}$. The circuit degenerates into a unity-gain buffer. Gain drops to exactly 1.
- $R_f$ Shorts: $V_{out}$ is hardwired to $V_{-}$. Similar to an open $R_g$, gain becomes exactly 1.
- $R_g$ Shorts: $V_{-}$ is hardwired to ground (0V). Any positive voltage at $V_{in}$ forces $V_{+} > V_{-}$, causing the output to saturate at the positive rail.
Behavior Matrix: What Changes When You Tweak a Component
When debugging or iterating on a PCB design, changing one parameter triggers a cascade of secondary effects. Use this matrix to predict circuit behavior.
| Component Changed | Modification | Effect on Gain | Secondary Effect (Bandwidth / Noise) |
|---|---|---|---|
| $R_f$ | Increase value | Gain increases | Bandwidth decreases (due to constant Gain-Bandwidth Product). Johnson-Nyquist thermal noise increases. |
| $R_g$ | Decrease value | Gain increases | Increases current draw from the op-amp output stage; may cause clipping if $R_g$ is too low (e.g., $< 100\Omega$). |
| Op-Amp IC | Swap to higher GBW part | No change to DC gain | Extends the usable frequency range before gain rolls off; may introduce high-frequency oscillation if PCB layout is poor. |
| Power Supply | Increase $V_{CC}$ | No change to gain ratio | Increases maximum output voltage swing before clipping; increases quiescent power dissipation. |
Never use resistor values in the megaohm range (e.g., $R_f = 10\text{M}\Omega$, $R_g = 1\text{M}\Omega$) just to save microamps of current. A $10\text{M}\Omega$ resistor generates roughly $12.8\text{ \mu V}$ of thermal noise per root-Hz at room temperature. In a high-gain audio or sensor circuit, this noise will completely bury your signal. Keep feedback resistors between $1\text{k}\Omega$ and $100\text{k}\Omega$ for the best balance of power and noise.
Step-by-Step Breadboard Verification
Do not trust your math until you have verified it on the bench. Here is how to build and test the Gain=5 TLC2272 circuit.
- Seat the IC and Route Power: Place the TLC2272CP across the breadboard center trench. Connect Pin 8 to your 5.0V bench supply and Pin 4 to Ground. Crucial Step: Place a 100nF (0.1μF) X7R ceramic decoupling capacitor directly across Pins 4 and 8, as close to the plastic body as possible. Without this, the op-amp will likely oscillate at high frequencies.
- Wire the Feedback Network: Insert the $10.0\text{k}\Omega$ resistor from Pin 2 (Inverting) to the ground rail. Insert the $40.2\text{k}\Omega$ resistor from Pin 2 to Pin 1 (Output).
- Connect the Input: Run a jumper from your signal source (or a potentiometer wiper for manual testing) to Pin 3 (Non-inverting).
- Verify DC Bias: Power on the supply. Set your digital multimeter (DMM) to DC Volts. Measure Pin 3. If using a potentiometer, adjust it to exactly 0.500V.
- Measure the Output: Move the DMM probe to Pin 1. You should read 2.51V ($0.500\text{V} \times 5.02$). If you read 4.9V or 0.1V, your feedback loop is wired incorrectly or the op-amp is saturated.
- AC Sweep (Optional): Feed a 1kHz, 200mV peak-to-peak sine wave into Pin 3. Probe Pin 1 with an oscilloscope. You should see a 1.0V peak-to-peak sine wave, perfectly in phase with the input.
Frequently Asked Questions
How do I calculate op amp circuit gain for AC signals?
The DC resistor ratio ($1 + R_f/R_g$) still dictates the baseline gain for AC signals, but you must account for coupling capacitors. If you place a capacitor in series with $R_g$ to block DC offset, the gain becomes frequency-dependent. At DC, the capacitor acts as an open circuit, making $R_g$ effectively infinite, which drops the DC gain to exactly 1 (unity). As the AC frequency increases, the capacitor’s impedance drops, and the circuit’s AC gain approaches your designed $1 + (R_f/R_g)$ ratio. The cutoff frequency is determined by $f_c = 1 / (2\pi \times R_g \times C)$.
Why is my op amp circuit gain lower than expected at high frequencies?
You are hitting the op-amp’s Gain-Bandwidth Product (GBW) limit. An op-amp’s open-loop gain drops by 20dB per decade as frequency increases. The GBW is the frequency at which the open-loop gain drops to 1. For the TLC2272, the GBW is roughly 2.25 MHz. If your closed-loop circuit is designed for a gain of 5 (which is roughly 14 dB), your maximum usable bandwidth is $2.25\text{ MHz} / 5 = 450\text{ kHz}$. If you try to pass a 1 MHz signal through this Gain=5 circuit, the op-amp simply does not have the internal speed to maintain the feedback loop, and the gain will roll off severely. To fix this, you must select an op-amp with a higher GBW, such as the OPA350 (38 MHz GBW).
Can I configure an op amp circuit gain of less than 1?
Not with a standard non-inverting topology. The mathematical minimum for the non-inverting configuration is $1 + 0$, which equals 1 (a unity-gain buffer). You cannot attenuate a signal using a non-inverting amplifier. If you need a gain of 0.5 (attenuation by half), you have two choices: use an inverting amplifier topology (where Gain = $-R_f / R_{in}$, allowing fractional gains like $-0.5$), or simply place a passive resistor voltage divider at the input of a unity-gain non-inverting buffer. The latter is usually preferred in modern designs because it preserves the high input impedance while scaling the voltage down before the active stage.






