Electronics From Zero Search/

Explainer · Intermediate · about 30 minutes

Op-amps: amplifiers and comparators

An operational amplifier (op-amp) is a chip that compares two voltages and drives its output hard in the direction of the difference. On its own it is a comparator; add two resistors of feedback and it becomes a precise amplifier. It is how small sensor signals get big enough to use.

What it does

An op-amp has two inputs, + (non-inverting) and − (inverting), one output, and two power pins. It multiplies the difference between its inputs by a huge number, typically 100 000 or more:

Vout = gain × (V+ − V−)

With a gain that big, a difference of a few millivolts is enough to push the output as far as it can go. It cannot go beyond its power supply: an LM358 on 9 V can reach about 0 V at the bottom but only about 7.5 V at the top.

The two golden rules

When the output is connected back to the − input (negative feedback), and the output is not stuck at a limit:

  1. The output does whatever it takes to make V− equal V+.
  2. No current flows into either input.

Those two rules are enough to work out every circuit below. Without feedback (a comparator), rule 1 does not apply: the output just slams to one side.

Try the four classic circuits

Op-amp circuit
Vout (model)—
Ideal formula—

—

Output against input

Model: LM358-style op-amp: gain 100 000, output from about 0.02 V above the negative rail to 1.5 V below the positive rail, a 100 kΩ load on the output. Not modelled: input voltage limits, speed (slew rate and bandwidth), offset voltage and noise. Real op-amps differ; rail-to-rail types get much closer to both supply rails. Check the datasheet.

Where you meet them

  • Sensor amplifiers: a thermocouple gives microvolts per degree; a non-inverting amplifier makes that big enough for an ADC.
  • Buffers: a follower copies a voltage without loading it, so a high-resistance divider can drive a meter or ADC input.
  • Comparators: “is it dark yet?”, battery-low alarms, thermostats.
  • Audio: microphone preamplifiers, mixers, tone controls and filters.

Build them

The breadboard trainer has an LM358 non-inverting amplifier and a comparator dark detector to build leg by leg, plus a challenge: an amplifier with a gain of exactly 3. The circuit sandbox has the op-amp as a part too.

A comparator built from an op-amp can “chatter” (switch on and off rapidly) when the input sits right at the reference. Real designs add a little positive feedback (hysteresis) to stop it.

Check your understanding