IcosaLogic Op Amp Simulator

This opamp simulator lets you enter the amplitude and center offset voltages of both the input and output values. The simulator will then auto-configure the value of the feedback resistor and the reference voltage, and plot a graph of input and output sine waves. You can specify inverting or non-inverting opamp circuits, and also enter a test value to plot in the graph. If any output value exceeds the range Vneg..Vpos, it will be truncated.

Input Range

V
V

Output Range

V
V

Op Amp Config

V
V
V

Test Input

V

Computed Values

Ohm
Ohm
V
V
V
V
mA
mW
mW

Implementation Details

We start with the generalized resistor divider circuit.



Vt, Vm and Vb represent the voltages at the top, middle, and bottom of the resistor divider, respectively. R1 is the resistor on the top, and R2 is the resistor on the bottom.

Assuming Vt and Vb are fixed, and solving for Vm, we get:

Vm = Vb + (Vt - Vb) * (R2 / (R1 + R2))

Before going any further, let's define a couple values for the resistor term in this equation. First, invert the original term to get:

(R1 + R2) / R2

Then expand and simplify it:

R1 / R2 + R2 / R2
R1 / R2 + 1

Then our definitions for gain are:

Gi = R1 / R2
Gn = (R1 / R2) + 1
Gn = Gi + 1

Gi is the gain for an inverting op amp, and Gn is the gain for a non-inverting op amp.

Using our new definitions, we can rewrite the solution for Vm as:

Vm = Vb + (Vt - Vb) / Gn

This single equation solves the following circuits:

  • Resistor divider
  • Inverting opamp
  • Non-inverting opamp
  • This table shows the substitutions for Vt, Vm and Vb for each of these solutions.

    Resistor DividerInverting OpampNon-Inverting Opamp
    VtVinVoutVout
    VmVoutVrefVin
    VbVbVinVref

    Let's examine each of these circuits.

    Resistor Divider

    Starting with the generalized equation, use the substitutions from the table above for resistor dividers, and replace Gn with its definition.

    Vm = Vb + (Vt - Vb) / Gn
    Vt = Vin
    Vm = Vout
    Gn = (R1 / R2) + 1
    Vout = Vb + (Vin - Vb) / Gn
    Vout = Vb + (Vin - Vb) * R2 / (R1 + R2)

    In a resistor divider, Vb is usually zero. Removing those terms yields:

    Vout = Vin * R2 / (R1 + R2)

    Which is the classic resistor divider equation we all know and love.

    Inverting Opamp

    Again, starting with the generalized equation, do the substitutions for inverting opamps.

    Vm = Vb + (Vt - Vb) / Gn
    Vt = Vout
    Vm = Vref
    Vb = Vin
    Vref = Vin + (Vout - Vin) / Gn

    Solve for Vout.

    Vref = Vin + Vout / Gn - Vin / Gn
    Vref = Vout / Gn + Vin - Vin / Gn
    Gn * Vref = Vout + Gn * Vin - Vin
    Gn * Vref = Vout + Vin * (Gn - 1)
    Gn * Vref = Vout + Vin * Gi
    Gn * Vref - Vin * Gi = Vout
    Vout = Gn * Vref - Vin * Gi

    Vref in an inverting opamp circuit is normally 0, so removing that term results in the classic inverting opamp equation.

    Vout = - Vin * Gi

    Non-Inverting Opamp

    As before, start with the generalized equation and do the substitutions for non-inverting opamps.

    Vm = Vb + (Vt - Vb) / Gn
    Vt = Vout
    Vm = Vin
    Vb = Vref
    Vin = Vref + (Vout - Vref) / Gn

    Solve for Vout.

    Vin * Gn = Vref * Gn + Vout - Vref
    Vin * Gn = Vref * Gn - Vref + Vout
    Vin * Gn = Vref * (Gn - 1) + Vout
    Vin * Gn = Vref * Gi + Vout
    Vin * Gn - Vref * Gi = Vout
    Vout = Vin * Gn - Vref * Gi

    Again, Vref is normally 0, so removing that term results in the classic non-inverting opamp equation.

    Vout = Vin * Gn

    So there you have it. There really aren't separate equations for resistor dividers and opamps. There is only one equation, and it merits being memorized.

    Vm = Vb + (Vt - Vb) / Gn

    Also, the opamp really isn't some special kind of device, it is more of a Resistor Divider Driver (RDD) device that enables resistor dividers to be used in more scenarios. Instead of making the resistor divider that accompanies the opamp secondary to the opamp, one should really make the resistor divider primary, and the opamp secondary.

    Defining Rfeedback

    Given Vin_rhalf and Vout_rhalf, calculating the value of Rfeedback is easy.

    Gi = Vout_rhalf / Vin_rhalf
    Gn = Gi - 1
    Rfeedback = R1 * G

    Where G is Gi for inverting opamp circuits, and Gn for non-inverting opamp circuits.

    Defining Vref

    Once Rfeedback has been defined, one can assign the value of Vref. We assume that the value of R1 is fixed.

    For inverting opamp circuits, we have:

    Gn = Rfeedback / R1
    Gi = Gn - 1
    Vref = Vin_offset + (Vout_offset - Vin_offset) / (Gn + 1)

    For non-inverting opamp circuits, we have:

    Gi = Rfeedback / R1
    Gn = Gi + 1
    Vref = (Vin_offset * Gn - Vout_offset) / Gi