In this instructable I hope to cover the fundamentals of DC circuits involving operational amplifiers, otherwise known as op-amps. The material I will present has been adapted from my Electronics lab materials at Pomona College. For a textbook explanation of these concepts, I highly recommend either Scherz and Monk's Practical Electronics for Inventors, or Curtis Meyer's Basic Electronics: An Introduction to Electronics for Science Students.
Step 1: The Basics of Op-Amps
The good news about op-amps is that there are a few relatively simple first principles from which the behavior of any circuit can be readily deduced. To explain them, it helps first to get familiarized with the op-amp itself. The image above is a schematic of an LF411 op-amp in the 8-pin DIP package (don't worry about the jargon here). The first thing you'll notice is the hefty number of inputs and outputs, eight to be exact. For the purposes of this instructable, we can safely ignore the two labeled balance, as well as the one labeled NC, which should hopefully make things a little less daunting.
The most important part of building any op-amp circuit is.......powering your op-amp! This is because the op-amp is an active circuit element, which basically means that it generates energy in your circuit. This is as opposed to it being a passive circuit element, such as a resistor, which strictly draws energy circuit. As such your op-amp always needs to be connected to a power source. We generally connect the two leads labeled V+ and V- to +15V and -15V respectively. These inputs are not always drawn in circuit diagrams, so it is important to remember that it is implied that your op-amp is powered via these two inputs in any circuit diagram.
The next thing about your op-amp that should jump out at you is that it has two inputs, but only one output. The output is, well, the output. The output signal is, in general, some modified version of the input signal, the details of which will be covered soon. The upper of the two inputs, denoted by the minus sign in the triangle, is known as the inverting input, while the lower input, denoted by the plus sign, is known as the non-inverting input. Op-amps, for the most part, only get interesting when the output is directly linked to one of these two inputs, producing what is known as feedback. Negative feedback, which we will soon see is the "good" kind, refers to when the output is directly linked to the inverting input. Positive feedback, on the other hand, refers to when the output is directly linked to the non-inverting input. Now that we have these terms hammered down, we can progress to the so called "golden rules" of op-amps, and then to circuit analysis.
Step 2: The Golden Rules
Know the golden rules of op-amps, and circuit analysis becomes easy. The very first rule actually explains in math exactly what an op-amp does (something I have yet to do in English). As you may have guessed, and operational amplifier amplifies! But what does it amplify, and by how much? This brings us to the first golden rule
- V_out=A(V+ - V-)
All this rule states is that the output voltage is equal to the voltage at the terminal V+ minus the voltage at the terminal V-, multiplied by an amplification constant A. This constant is generally on the order of one million or more! But how? We surely aren't getting a million or more volts out of our op-amp are we? Of course not! This is because our op-amp can only operate between +15V and -15V as per the limitations of our power source. What this implies is that given two input signals, the op-amp will rail to either +15V or -15V depending on the voltages of its inputs. As it is impossible in practice to get two different signals of identical voltage into the two inputs of our op-amp, our op-amp will always operate according to rule number one and give either +15V or -15V out, depending on the specific voltages at its inputs. One very cool application of this rule can be seen by setting V+ to ground and then sending an input signal in the form of a sine wave or a triangle wave to V-. The result will always be a perfect square wave, as the op-amp can only give us either +15V or -15V when there is no feedback.
On to rule number two, then.
2. No current flows into or out of the two inputs of the op-amp.
This rule is crucial for circuit analysis, and is as simple as it sounds. Note that this rule really hits home the importance of the op-amp reliance on external power, as it's inputs are not allowed to draw current (and hence power) from the circuit.
Without any further adieu, the final rule for op-amp circuits.
3. An ideal op-amp has infinite input impedance and zero output impedance. For a real op-amp these numbers are more like 10^6-10^12 ohms for the input impedance, and 10-1000 ohms for the output impedance.
All this really means is that out op-amp behaves both like an ideal load and like an ideal power source. This rule has some practical implications, which we will explore via an example soon.
There is a fourth and final rule that applies only to situations of negative feedback. When an op-amp senses a voltage difference between its inputs, it responds by feeding back as much voltage and current through its feedback network as is necessary to keep this voltage difference equal to zero. That is
4. (V+ - V-)=0 for negative feedback.
That's it. Know these golden rules and you can solve for the behavior of any op-amp circuit. So let's look at some examples!
Step 3: The Comparator
The circuit above is called a comparator, and essentially serves to demonstrate the action of golden rule number one. It is the first op-amp circuit we built in our lab. In this case we have no feedback, and the potentiometer lies between +15V and -15V. Note that the op-amps power source is shown in the circuit, thought it will not be in others. In this case we can wipe the potentiometer so that that V+ sees anywhere between +15V and -15V. According to the rule, V_out=A(V+ - V-)=A(V+ - 0V)=A(V+), and our output will read +15V if we wipe the potentiometer such that it inputs a positive voltage to the non-inverting input. On the other hand, if we wipe the potentiometer such that it inputs a negative voltage into our non-inverting input, we will see -15V out. This circuit is aptly called a comparator because it allows us to compare any signal at our non-inverting input to the signal at the inverting input. Based on whether we see a positive or a negative rail, we can use this circuit to easily determine the sign of an unknown voltage. As an extension, we can easily imagine setting V- to some nonzero reference point, and inputting some signal, possibly an alternating one, to V+ for more interesting "comparisons".
Step 4: The Non-inverting Amplifier (Part I)
If you're looking to learn about op-amps, I'm going to assume that you're already familiar with the process of creating a voltage divider using a combinations of two properly chosen resistors. This is a great way to get take a signal we don't want and turn it into one that we do, but the method has some problems. The largest among these is that you might need to choose high resistor values to limit current to your load, which could result in a troublesomely high thevenin resistance for your new circuit. In comes the op-amp to fix this!
We see that:
2. Because we have negative feedback, (V+ - V-)=0.
As V+=5V in this case, we know V- =5V. We also know that Vout=V-, as the two are simply connected via a wire. Thus, we conclude:
But what's the point if Vout=Vin?! The point is rule number 3! The op-amp has very low output impedance, which means we just took our "bad" voltage source, and brought it much closer to the ideal limit by using an op-amp! Don't underestimate the usefulness of such a circuit. Voltage and current are a lot of fun to play with, but without appropriate impedances we can get ourselves into a lot of trouble with sag, among other things.
Step 5: The Non-inverting Amplifier (Part II)
Next, let's consider a slightly more complicated circuit as shown above, and solve for Vout using the golden rules. First, Let's agree to some notation changes. I'll call the signal at the non-inverting input Vset, the resistor in the feedback leg R2, and the remaining resistor R1. Thus far we have used rules 1,3, and 4; this circuit will finally introduce us to rule number 2.
Because we are dealing with negative feedback here, we know
1. (V+ - V-)=0
Now for rule 2. We know that no current can flow into or out of either of our inputs. Surely current must flow in this circuit, though, as Vout and ground are connected by two resistors in series. What rule 2 implies is that when current flows, it will flow between Vout and ground, avoiding the op-amp all together. Furthermore, the same current will flow through both resistor in order to conserve charge. With that said, let's just suppose the flow of current is counterclockwise. This is an assumption we can always make, correcting our solution if the sign of our answer makes no sense.
Using Ohm's law to find the current through R1 and equating that to the current through R2 we find
3. (0-Vset)/R1=(Vset - Vout)/R2
Solving for Vout gives
Now we see the real meaning behind the name. V_out is not inverted, and is equal to V_set multiplied by one plus the ratio of the resistors. Indeed V_set is amplified!
Step 6: The Transimpedance Amplifier
This circuit hinges around the photodiode. If you don't know what a photodiode is, don't worry. It's just an LED operating in reverse. While we bias an LED with a voltage in order to produce a light, a photodiode responds to light to produce a voltage, and, consequentially, a current that we call a photocurrent. In this circuit, the photocurrent flows counterclockwise. The reason this circuit is called a transimpedance amplifier, as we will see, is because our output voltage will be a function of the photocurrent rather than some input voltage. Applying the first golden rule, we know
I skipped a step here, but convince yourself this is correct by referencing the previous examples.
Now the second rule, which tells us that no current is flowing into or out of our inputs, implies that the the current through the diode must be equal to the current coming through the 100k resistor. Thus
If we generalize this a bit, calling the 100k resistor R, we conclude
Step 7: Thanks!
Hopefully I've been able to give you a good intuition for how basic op-amp circuits works, and how we can apply the "golden rules" to find the output voltage at any arbitrary point. Thank you for checking out my instructable and for any negative feedback you can give me (pun intended)! A special thanks goes out to Professor Dwight Whitaker for his patience in the lab and his attentiveness to his students in Electronics this semester!