Chips
Op-amp & comparator
An amplifier chip with two inputs and one output. It amplifies the tiny difference between its inputs enormously. With feedback resistors it becomes a precise amplifier; with no feedback it becomes a comparator that answers "which input is higher?".
Think of it as: A very strong servant that copies whatever you point at, as hard as needed, until its two inputs match.
Pins
- + (non-inverting input)
- : When this rises, the output rises.
- − (inverting input)
- : When this rises, the output falls. Feedback from the output usually comes back here.
- OUT
- : Swings between the supply rails (nearly all the way on "rail-to-rail" parts).
- V+ / V−
- : Power pins, often left off schematics but always connected.
Op-amps come as chips with one, two or four amplifiers inside. The LM358 (two op-amps in 8 pins) is a classic. The dot or notch marks pin 1; pins count anticlockwise from there.
What to look for inside
- For 8 seconds the op-amp is wired as a buffer (output fed back to the − input), then for 8 seconds as a comparator with no feedback.
- Inside, the first stage measures the difference between the inputs (ε) and the next stage multiplies it about 100 000 times.
- With feedback, the output moves until the − input matches the + input, so ε stays near zero and the output copies the input.
- Without feedback, even 1 mV of difference drives the output hard to one rail or the other: a clean yes/no answer.
The numbers that matter
| Spec | Typical |
|---|---|
Supply range Check it works at your supply. Not every op-amp runs from 3.3 V. | 1.8 V to 36 V |
Rail-to-rail in/out Older parts cannot get within about 1.5 V of the rails. | yes / no |
Gain-bandwidth (GBW) Gain × frequency is limited: 1 MHz GBW at gain 10 only reaches 100 kHz. | 1 MHz to 100 MHz |
Input offset V_os A small built-in error that gets amplified along with the signal. | 10 µV to 5 mV |
Where you’ll use it
- Buffering a weak signal, such as a high-resistance voltage divider, so the next stage does not load it.
- Amplifying sensor signals before the ADC.
- Comparators: battery-low alarms, thermostats, turning an analogue signal into a digital one.
- Active filters.
Common mistakes
- Expecting the output to reach 0 V or the full supply on a non-rail-to-rail part.
- Leaving the inputs of an unused op-amp floating. Tie them to a fixed voltage so it does not oscillate.
- Using an op-amp as a comparator for fast signals. Real comparator chips switch much faster.
Lessons that use it
Go deeper
Open loop: the huge gain A_OL (≈ 10⁵) is why it acts as a comparator.
Non-inverting amplifier: feedback resistors set the gain precisely.
Inverting amplifier: the output is flipped upside down.