**Overview**

This is the fourth post in the series of fundamental concepts of electric circuits and signals with the Tek 1202B-EDU oscilloscope. In my previous three posts, I covered circuit analysis, capacitors, and inductors. In this post, I will present an intuitive and analytical view of operational amplifiers. I will start by showing how to use operational amplifiers in inverting and non-inverting configurations, as unity buffers, and summing amplifiers. Then I will show how to build an instrumentation amplifier, an integrator, a differentiator, and a comparator using operational amplifiers. Following these I will analyze the gain and phase variation with frequency. I will be using the new Tek 1202B-EDU Oscilloscope from Tektronix to illustrate these concepts.

**What is an Operational Amplifier**

An operational amplifier is a high gain amplifier with two inputs and one output. One of the two inputs is called “inverting” and it is marked with a “-“ sign and the other is called “non-inverting” and it is marked with a “+” sign. A voltage increase on “+“ input will make the output increase and a voltage increase on the “-“ input will make the output decrease. So the output will be a function of the difference between the voltage on “+” input and the voltage on “-“ input.

Operational amplifiers have very high gain, very high input impedance, and very low output impedance. In a simplified view, operational amplifiers have infinite input impedance, infinite gain, and zero output impedance. So based on this approximation, there will be no electric current flowing into the “+” and “-“ inputs, which simplifies significantly the analysis of circuits containing operational amplifiers. Zero output impedance is easy to grasp, since it means that the operational amplifier acts as a voltage source controlled by the voltage difference at the inputs. But what does infinite gain mean? Infinite gain means that any small voltage difference at the “+” and “-“ inputs will result in an infinite positive or negative voltage at the output. In reality the output voltage will not go to infinite since it will rail at the voltage supply values. This infinite gain does not seem to be useful itself, but it actually becomes very useful when using the operational amplifier with negative feedback. The main advantage of the negative feedback is that it makes the voltage gain dependent only on the circuit components in the feedback network. Let’s take a look at some operational amplifiers with negative feedback configuration.

**Inverting Amplifier**

The figure below shows an operational amplifier in inverting configuration.

In a simplified analysis let’s assume that operational amplifier is ideal (infinite input impedance, infinite gain, zero output impedance). So there is no current flowing into the “-“ input, thus the current flowing through R1 has to be equal to the current flowing through R2. Since the operational amplifier gain is infinite any small difference in the “+” and “-“ voltages will push Vout to plus infinite or minus infinite. Let’s look in more details at this statement.

Notice that “+“ input is connected to ground, which is at zero volts level. If we assume the voltage at “-“ terminal is lower than zero it results that the difference of voltage between “+” and “-“ inputs is positive so Vout will increase towards infinity. But as it starts increasing the current through R2 and R1 increases and the voltage on “-“ input increases. When this voltage reaches zero volts the voltage difference at the input is zero and Vout stops increasing.

If we now assume that the voltage at “-“ terminal is higher than zero, it means that the voltage difference between “+” and “-“ inputs is negative so Vout will decrease towards minus infinity. Notice however that as Vout starts decreasing the current through R2 and R1 decreases too and thus the voltage on the “-“ terminal decreases. When this voltage reaches zero volts the voltage difference at the input is zero and Vout stops decreasing.

So intuitively the operational amplifier will “continuously adjust” Vout so that the voltage at “-“ terminal is equal to the voltage at “+” terminal.

At equilibrium Vout has the value (-R2/R1)*Vin, as shown in the figure above. Notice that Vout is dependent only on Vin, R1, and R2. The minus sign in the formula represents the inversion; if Vin increases Vout will decrease and if Vin decreases Vout will increase.

Let’s look now at experimental measurements of an inverting amplifier. The following figure shows an experiment that uses an operational amplifier in inverting configuration.

The operational amplifier is mounted on the solderless breadboard together with the feedback resistors and power supply decoupling capacitors. A sinusoidal input signal of 600mV amplitude and 2.5kHz frequency is applied to the input. The Tektronix TBS-1202B-EDU oscilloscope probes the input and output signals of the amplifier. Channel 1 (yellow trace) probes the input and channel 2 (blue trace) probes the output. The built-in measurement function of the oscilloscope is set to measure the amplitude of the signals, the frequency, and the phase difference between the output sinusoid and the input sinusoid. From the reading at the bottom of the screen we can calculate the voltage gain as 4.8V/600mV=8. Notice that the output is in opposite phase compared to the input, which we expect since this is an inverting amplifier. We can say that the output phase is 180 degrees shifted.

**Noninverting Amplifier**

Let’s see now how non-inverting amplifiers work. The following figure shows an operational amplifier configured as non-inverting amplifier.

The analysis follows the same steps as for inverting configuration, so intuitively the operational amplifier will continuously adjust Vout to keep the voltage at “-“ terminal equal to Vin. The equilibrium is reached when Vout = (1+(R2/R1))*Vin, as shown in the figure. Notice there is no “-“ sign like for inverting amplifier, which is expected for non-inverting functionality: if Vin increases then Vout will increase and if Vin decreases then Vout will decrease.

The figure below shows a measurement example of a non-inverting amplifier.

Same as in previous example I used the Tektronix TBS 1202B-EDU oscilloscope to probe the input and output signals and to measure the amplitude, frequency, and phase difference. Channel 1 (yellow trace) probes the input and channel 2 (blue trace) probes the output. Based on the displayed measurements at the bottom of the screen I can calculate the voltage gain as 5.28V/0.58V=9.1. Notice that the output sinusoid is now in phase with the input sinusoid.

**Unity Gain Buffer**

A noninverting amplifier with voltage gain equal to 1 is refereed to as unity gain buffer. The figure below shows an operational amplifier configured as unity gain buffer.

This circuit can be viewed as a derivation from noninverting configuration with R2=0 and R1=infinite. The output waveform follows the input as shown in the experiment below.

The input and output waveforms are measured with the TBS 1202B-EDU oscilloscope. Channel 1 (yellow trace) probes the input and channel 2 (blue trace) probes the output. We can notice that both input and output sinusoidal signals have the same amplitude and phase. So if they are the same why do we need buffers? The answer is that we use buffers to capture a signal from a high impedance source like a sensor for example and send it to other circuits from a low impedance voltage source. This translation from high impedance to low impedance is needed in many analog circuits.

**Summing Amplifiers**

Operational amplifiers can be configured to output the algebraic sum of multiple input signals. The following figure shows an example of a three-input summing amplifier.

The analysis follows the same steps as for inverting configuration, and the result is shown in the formula above. So the output voltage is the sum of the three input voltages each multiplied with a gain factor set by the values of resistors.

**Instrumentation Amplifier**

Many times when we use analog sensors we need to amplify the difference between two analog outputs (or one analog output and a reference voltage). In these cases it is convenient to use an instrumentation amplifier. The following figure shows the diagram of an instrumentation amplifier.

There are three operational amplifiers in this instrumentation amplifier. First two provide high input impedance and moderate voltage gain and the third one provides additional gain and low output impedance. The transfer function is shown in the figure above. Notice that the output voltage is a function of the difference between the input voltages.

**Integrator**

Operational amplifiers can be configured as integrators by using a capacitor in the feedback loop as I am showing in the figure below.

The output, Vout(t), is the integral of the input, Vin(t), multiplied by a factor dependent on the values of R and C in the feedback loop. To better understand the functionality of this integrator I have built an experiment, shown in the figure below.

The integrator circuit in the previous diagram is implemented on the solderless breadboard and a square wave signal is applied at the input. Both inputs and outputs are measured with the Tektronix 1202B-EDU oscilloscope. Channel 1 (yellow trace) probes the input and channel 2 (blue trace) probes the output. Notice that the output signal represents the “inverted” integral function of the square wave input signal, which is a triangular waveform.

**Differentiator**

Similarly, we can configure an operational amplifier to function as a differentiator, as I am showing in the figure below.

Notice that this circuit is similar to the integrator with the difference that I swapped the locations of the capacitor and resistor in the feedback network. To “visualize” how this differentiator works, I have built the experiment, shown in the figure below.

Channel 1 (yellow trace) probes the input, which is a square wave signal, and channel 2 (blue trace) probes the output. Notice that on the falling edge of the input the output “spikes up” (and then it oscillates/rings due to the loop inductance of power distribution and feedback path – this is an unwanted effect). On the rising edge of the input, the output “spikes down” (and then again it oscillates). This is an inverting differentiator, as also described by the mathematical formula in the schematic diagram above.

**Operational Amplifier Used As Comparator**

When configured in open-loop mode, an operational amplifier functions as a comparator. The figure below shows an operational amplifier used as comparator.

When the voltage on the “+“ input is higher than the voltage on the “-“ input the output will increase all the way to the positive voltage supply level. When the voltage on the “+“ input is lower than the voltage on the “-“ input the output will decrease all the way to the negative voltage supply level. To illustrate this functionality I have built the experiment shown in the figure below.

Channel 1 (yellow trace) probes the input, which is a triangular signal, and channel 2 (blue trace) probes the output. As the triangular signal goes above the Vref reference level, the output raises quickly to the positive supply level and remains there as long as the input is higher than the reference. Then, when the input triangular signal decreases below the reference voltage, the output drops down to the negative supply level.

**Slew Rate**

The slew rate characteristic of an amplifier quantifies how fast the output responds to changes in the input. Slew rate is expressed in Volts per Seconds (V/s). Here is an example of slew rate measurement for a non-inverting amplifier:

On the solderless breadboard I have built a non-inverting amplifier and I have applied a square wave signal at the input. I then configured the Tektronix TBS 1202B-EDU oscilloscope to measure the input and output waveforms of this amplifier. Channel 1 (yellow trace) probes the input, which is a square wave signal, and channel 2 (blue trace) probes the output. To see the ramp at the output I had to “magnify” the time around the rising edge transition by adjusting the time base of the oscilloscope.

To measure the slew rate I used the built-in measurement functions of TBS 1202B-EDU oscilloscope, so I setup the peak-peak and rise time measurements for channel 2 waveform. These values are displayed at the bottom of the screen: Peak-Peak = 23.2V and rise time = 44.2us. Since rise time represents the time on the ramp between 10% to 90% of the Peak-Peak, I can compute the slew rate as 0.8*23.3V/44.2*10^-6s = 421719V/s or 0.42V/us. Slew rate limits the desired functionality of amplifiers in high-speed signal processing applications.

**Output Phase Shift, Bandwidth, and Stability**

At low frequencies the input and output signals are in phase (0 degrees phase difference for non-inverting amplifiers and 180 degrees phase difference for inverting amplifiers). The figure below shows the input and output of a non-inverting amplifier at low frequency (100Hz in this example).

So the output is in phase with the input and the voltage gain is 1000. Let’s see what happens when we increase the frequency of the input sinusoidal signal to 1kHz, as I am showing in the picture below:

The voltage gain did not change significantly but notice the output phase lagging a bit compared to the input phase. So as we increase the frequency the amplifier starts shifting the phase of the output signal. The picture below shows the phase shift at 10kHz:

The phase shift continued to increase as I increased frequency. Also notice that the voltage gain has decreased to 72. I continued to increase the frequency to 874kHz, as shown in the picture below.

The phase shift approaches 180 degrees while the voltage gain decreased to about one.

So the frequency increase shifts the phase of the output and lowers the voltage gain. Why shall we care about these effects? Why shall we care that the output gets shifted in phase? Well, let’s remember the inverting amplifier analysis at the beginning of this blog post. The feedback network provided actually a “negative” feedback effect, which controlled the voltage at the output. To do so, the feedback path brought back to the input a “scaled” version of the output, which was then compared with the input signal. If the “scaled” version of the output were higher than the input the operational amplifier would lower Vout and if the “scaled” version were lower than the input the operational amplifier would increase Vout. Too much phase shift alters this process and may actually make the “negative” feedback act as “positive” feedback that would make the operational amplifier act in “opposite” direction creating self-sustained oscillations. Oscillations in amplifiers are unwanted effects that can make an entire system not functional. This is only an intuitive view of amplifier stability; which is an extensive topic that involves complicated but very interesting mathematical analysis methods.

To conclude, in this blog post I have covered fundamental concepts and applications of operational amplifiers. In the following blog post, I will talk about analog versus digital signals.

Best Wishes,

Cosmin