Op-Amps and Analog Signals
Amplify and condition real signals: what an operational amplifier does, the golden rules, inverting and non-inverting amplifiers, gain from two resistors, supply rails and clipping, comparators, the voltage follower, gain-bandwidth limits, and single-supply design.
1. What an op-amp is
An operational amplifier (op-amp) is a chip with two inputs and one output. It amplifies the difference between its inputs by a huge gain (100,000 or more):
Vout = A × (V+ − V−) A is very large
Left on its own it just slams to a supply rail. The trick is negative feedback: connect some of the output back to the inverting (−) input, and the gain becomes precise and set by resistors, not by the chip.
| Pin | Name | Role |
|---|---|---|
| + | Non-inverting input | Output moves with this input |
| − | Inverting input | Output moves against this input |
| Out | Output | The amplified result |
| V+ and V− (or GND) | Supply | Power rails; the output cannot go beyond them |
2. The two golden rules (with negative feedback)
For an ideal op-amp working with negative feedback:
- The output does whatever it takes to make V+ equal V−.
- The inputs draw no current.
Everything below follows from these two rules and Ohm’s law. Real parts have small errors (offset voltage, bias current), but the rules are an excellent design model.
3. Inverting amplifier
Vin ---[Rin]---+---(−) op-amp (+) to GND ---> Vout
| |
+-----------[Rf]----------------+
The + input is at ground, so the − input is held at 0 V (a virtual ground). The input current is Vin / Rin and all of it flows through Rf:
Gain = − Rf / Rin
With Rf = 100 kΩ and Rin = 10 kΩ the gain is −10: a 0.2 V input gives −2 V, so it needs a negative supply (or an offset). The input resistance seen by the source is Rin.
4. Non-inverting amplifier
The input goes to the + input; a divider (Rf from output to −, Rg from − to ground) feeds a fraction of the output back:
Gain = 1 + Rf / Rg
With Rf = 90 kΩ and Rg = 10 kΩ the gain is 10 and the output is in phase with the input. The input resistance is very high. The smallest possible gain is 1 (Rf = 0, Rg open), called a voltage follower or buffer: Vout = Vin, but it can drive a load the source could not. Use it after a high-resistance divider or a sensor.
5. Limits: rails, speed and real parts
- Supply rails and clipping. The output cannot exceed the rails, and many parts stay 1 to 2 V inside them. A gain of 10 on 0.7 V would ideally give 7 V, but on a 5 V supply it clips near 5 V. Rail-to-rail parts (such as the MCP6002) get within millivolts.
- Single supply. Run from 0 V and 5 V (or 3.3 V) and bias the signal at half the supply (for example with a divider and capacitor), or the negative half of a signal will be cut off.
- Gain-bandwidth product (GBW). The usable bandwidth shrinks as gain rises: bandwidth ≈ GBW / gain. A 1 MHz GBW part with a gain of 10 only works up to about 100 kHz.
- Slew rate limits how fast the output can change, which distorts large fast signals.
- Input and output current. Op-amps drive only a few milliamps; use a transistor or a power amp for more.
- Decouple the supply with a 100 nF capacitor at the pins.
6. The comparator
Without feedback, an op-amp compares its inputs: Vout goes to the positive rail if V+ is greater than V−, and to the negative rail (or ground) if it is less. That makes it a comparator, which turns an analog signal into a yes/no decision: “is the light level above a threshold?”, “is the battery below 3 V?”. For real comparators prefer a dedicated part (LM393) or add hysteresis (a little positive feedback) so noise near the threshold does not cause chatter.
7. On your bench
- Build a non-inverting amplifier with Rf = 9.1 kΩ and Rg = 1 kΩ (gain about 10) on a 5 V single supply. Feed it 0.2 V from a divider and measure the output (about 2 V). Increase the input until the output clips and note where.
- Wire a voltage follower after a 100 kΩ/100 kΩ divider, and watch the output stay at half the supply when you connect a 1 kΩ load, where a plain divider would collapse.
- Make a comparator from an LM393 or an op-amp: a light-dependent resistor in a divider against a reference, and an LED on the output.
- Measure the gain at 1 kHz and at 100 kHz and see it fall. Compare with GBW / gain.
8. Hands-on lab: op-amp calculations
9. Common mistakes
| Mistake | Better |
|---|---|
| Expecting an output beyond the supply | Check the rails and the part’s output range |
| Using an inverting stage on a single supply without a bias | Bias at half supply or use a non-inverting stage |
| High gain at high frequency | Check GBW: bandwidth is GBW divided by gain |
| Missing decoupling capacitor | 100 nF at the supply pins |
| A bare comparator on a noisy signal | Add hysteresis or use a comparator chip |
| Loading the output with a heavy load | Buffer with a transistor or a power stage |
10. Key takeaways
- An op-amp with negative feedback sets its gain with resistors; inputs draw no current and V+ ≈ V−.
- Inverting: −Rf/Rin; non-inverting: 1 + Rf/Rg; a follower has gain 1 and buffers a signal.
- Output is limited by the supply rails (clipping) and speed by GBW (bandwidth ≈ GBW / gain).
- Without feedback it is a comparator; add hysteresis against noise.
- On single supplies bias the signal at mid-supply and use rail-to-rail parts when needed.
A sensor outputs 0 to 100 mV and you need 0 to 3.3 V for an ADC on a 3.3 V supply. What gain and which op-amp type?
The gain is 3.3 / 0.1 = 33. A non-inverting amplifier with Rf = 32 × Rg gives 33 (for example Rg = 1 kΩ and Rf = 32 kΩ, using 33 kΩ gives 34). You need a rail-to-rail output op-amp, so the full-scale output reaches near 3.3 V, and a low-offset part because 1 mV of offset becomes 33 mV at the output.
Can You Explain It?
Close the lesson and answer these without looking back. The goal isn't the wording — it's whether you've formed a usable mental model.
- State the two golden rules of an ideal op-amp with negative feedback.
- Derive the gains of the inverting and non-inverting amplifiers.
- Explain clipping and gain-bandwidth limits with an example.
🧪 Want to practise this on your own computer? See how to set up your lab →