Op-Amps

Operational amplifiers are high-gain analog building blocks: they amplify the voltage difference between two inputs. de:volt ships three DIP-8 parts: the LM358 (dual, single-supply general-purpose), the MCP6002 (dual, low-voltage), and the LM386 (audio power amplifier).

What an op-amp does

An op-amp drives its output so that, in a closed feedback loop, the two inputs are held at (almost) the same voltage. The gain is enormous on its own (open-loop ~100 dB on the LM358), so you almost always wrap it in feedback to set a useful, predictable gain: a non-inverting amplifier, an inverting amplifier, a voltage follower, or a comparator.

The two inputs follow a fixed convention:

  • IN+ (non-inverting): the output moves with this input.
  • IN− (inverting): the output moves against this input. Feedback is normally taken back to this pin.

Supply rails and headroom

Every op-amp here is single-supply: wire VCC to your positive rail and GND to 0 V. The simulated output is constrained between those rails. How close it gets to each rail (the headroom) is where these parts differ:

PartOutput swing to V+Output swing to GND
LM358only to ~VCC − 1.5 Vto within ~20 mV of GND
MCP6002within ~20 mV of V+within ~20 mV of GND
LM386about 0.5 V below VSabout 0.5 V above GND; output biases to VS/2

This is the practical reason to reach for the MCP6002 in a 3.3 V circuit: the LM358 loses about 1.5 V at the top, while the MCP6002 output can approach both rails. The real MCP6002 also has rail-to-rail inputs, but the simulator does not enforce a detailed input common-mode range for either part. The supply-range trade-off remains important: the LM358 runs up to 32 V, while the MCP6002 is limited to 6 V.

Simulator behaviour

These are dynamic, supply-aware macro-models. Each gain stage includes finite low-frequency gain, one dominant pole derived from gain-bandwidth, slew-rate limiting, rail headroom, output resistance, and separate source/sink current limits. Quiescent current and output-load current return to the supply rails, so loading can sag a finite source. Hard overdrive reaches a declared headroom or current limit rather than producing unlimited output.

The model is intentionally compact. It omits input bias and offset, a detailed input common-mode limit, broadband noise, higher-order poles and phase margin, capacitive-load instability, detailed crossover/clipping distortion, and overload-recovery timing. It is useful for first-order transient and loading behaviour, not vendor-macro-model sign-off.

For exact catalog identities, solved package dissipation drives a persistent one-pole junction-temperature estimate and an ambient-adjusted power allowance. The time constant is a teaching assumption. Temperature does not feed back into electrical parameters, and these op-amp profiles do not claim thermal shutdown.

LM358: dual general-purpose

Two independent op-amps in one DIP-8, sharing one supply. Single-supply 3–32 V (or ±1.5 to ±16 V dual). Output is not rail-to-rail. Good for comparators, active filters, and amplifiers where the top ~1.5 V of headroom doesn’t matter.

PinLabelFunction
1OUT1Op-amp 1 output
2IN1−Op-amp 1 inverting input
3IN1+Op-amp 1 non-inverting input
4GNDGround
5IN2+Op-amp 2 non-inverting input
6IN2−Op-amp 2 inverting input
7OUT2Op-amp 2 output
8VCCPositive supply (3–32 V)

Model defaults are 100 dB open-loop gain, 1 MHz gain-bandwidth, 0.3 V/µs slew rate, 40 mA source limit, 20 mA sink limit, and 50 Ω output resistance. The package draws about 0.7 mA quiescent current. Add 100 nF decoupling at VCC in hardware and in a simulation where rail transients matter.

MCP6002: dual rail-to-rail

Same DIP-8 pinout as the LM358, but tuned for 1.8–6 V single-supply operation. The output model swings to within about 20 mV of each rail. Defaults are 100 dB open-loop gain, 1 MHz gain-bandwidth, 0.6 V/µs slew rate, ±23 mA current limits, and 50 Ω output resistance. The package draws about 200 µA quiescent current. Input rail-to-rail limits are not explicitly enforced by the simulator.

PinLabelFunction
1OUT1Op-amp 1 output
2IN1−Op-amp 1 inverting input
3IN1+Op-amp 1 non-inverting input
4GNDGround
5IN2+Op-amp 2 non-inverting input
6IN2−Op-amp 2 inverting input
7OUT2Op-amp 2 output
8VCCPositive supply (1.8–6 V)

Add 100 nF decoupling at VCC.

LM386: audio power amplifier

A fixed-gain power amp for small speakers, self-biased to VS/2 so an AC-coupled input rides the mid-supply bias. The transient macro-model uses the Inspector’s gain value, a 6 MHz gain-bandwidth product, 0.3 V/µs slew, ±250 mA current limits, 2 Ω output resistance, and about 4 mA quiescent current.

On hardware, pins 1 and 8 set gain through an external network:

GAIN pins (1, 8) on hardwareGain
Open×20
About 1.2 kΩ in series with a capacitor between pins 1 and 8about ×50
10 µF between pins 1 and 8×200
PinLabelFunction
1GAINGain-set (with pin 8)
2−INInverting input
3+INNon-inverting input
4GNDGround
5VOUTOutput to speaker
6VSPositive supply (4–12 V)
7BYPASSBias bypass cap
8GAINGain-set (with pin 1)

Decouple VS (pin 6) with 10 µF + 100 nF. In the simulator, choose gain (20 / 50 / 200) in the Inspector. The electrical impedance and frequency shaping of the gain-pin and bypass-capacitor networks are not modelled. The amplifier does produce an AC transient waveform, but it omits speaker impedance versus frequency, detailed coupling/bypass networks, additional poles, distortion spectra, acoustics, and thermal shutdown.

Orientation

All three are DIP-8 through-hole parts. Pin 1 is at the notch/dot end: place the package with the notch facing left, pin 1 at the bottom-left, and count counter-clockwise. Straddle the breadboard centre gap. A DIP socket is recommended.

Example circuit

A non-inverting amplifier with gain ≈ 1 + R_f/R_g, built on one half of an LM358:

        VCC (5 V) ── pin 8

Vin ──────────────── IN1+ (pin 3)

         ┌─────────── IN1− (pin 2) ───── R_g ───── GND

         └──── R_f ── OUT1 (pin 1) ──── Vout

                     GND (pin 4) ── GND

With R_f = 10 kΩ and R_g = 10 kΩ the gain is ×2. Add a 100 nF cap from pin 8 to GND for decoupling.

Select the part to see its exact model identity plus Included / Not included. A missing or mismatched catalog ID uses labelled fallback behaviour rather than silently borrowing another package’s thermal defaults.