The most often requested video! In this tutorial Dave explains what Operational Amplifiers (OpAmps) are and how they work. The concepts of negative feedback, open loop gain, virtual grounds and opamp action. The comparator, the buffer, the inverting and non-inverting amplifiers, the differential amplifier, and the integrator circuit configurations are also explained.
Then a practical breadboard circuit to demonstrate a virtual ground and the effect of voltage rail limitations.
All EEVblog Opamp related videos are here:
https://www.youtube.com/playlist?list=PLvOlSehNtuHu2FviAaZaiyXwN41G4b1Lf
Forum: http://www.eevblog.com/forum/blog/eevblog-600-opamps-explained/'>http://www.eevblog.com/forum/blog/eevblog-600-opamps-explained/
If you find my content useful you may consider supporting my work on Patreon or via Crypto:
BTC: 33BsprBQNBtHuVzVwDmqWkpDjYnCouwASM
ETH: 0x68114e40ff4dcdd384750500501e20acf3875f8c
BCH: 35n9KBPw9T7M3NGzpS3t4nUYEf9HbRmkm4
USDC: 0x68114e40ff4dcdd384750500501e20acf3875f8c
LTC: MJfK57ujxy55su4XicVGQc9wcEJf6mAoXF
Buy the T-Shirt here! https://teespring.com/NegativeFeedbackBlack
EEVblog Main Web Site:
http://www.eevblog.com
EEVblog Amazon Store:
http://astore.amazon.com/eevblogstore-20
Donations:
http://www.eevblog.com/donations/
Projects:
http://www.eevblog.com/projects/
Electronics Info Wiki:
http://www.eevblog.com/wiki/
Then a practical breadboard circuit to demonstrate a virtual ground and the effect of voltage rail limitations.
All EEVblog Opamp related videos are here:
https://www.youtube.com/playlist?list=PLvOlSehNtuHu2FviAaZaiyXwN41G4b1Lf
Forum: http://www.eevblog.com/forum/blog/eevblog-600-opamps-explained/'>http://www.eevblog.com/forum/blog/eevblog-600-opamps-explained/
If you find my content useful you may consider supporting my work on Patreon or via Crypto:
BTC: 33BsprBQNBtHuVzVwDmqWkpDjYnCouwASM
ETH: 0x68114e40ff4dcdd384750500501e20acf3875f8c
BCH: 35n9KBPw9T7M3NGzpS3t4nUYEf9HbRmkm4
USDC: 0x68114e40ff4dcdd384750500501e20acf3875f8c
LTC: MJfK57ujxy55su4XicVGQc9wcEJf6mAoXF
Buy the T-Shirt here! https://teespring.com/NegativeFeedbackBlack
EEVblog Main Web Site:
http://www.eevblog.com
EEVblog Amazon Store:
http://astore.amazon.com/eevblogstore-20
Donations:
http://www.eevblog.com/donations/
Projects:
http://www.eevblog.com/projects/
Electronics Info Wiki:
http://www.eevblog.com/wiki/
Hi Welcome to Fundamentals Friday Today, we're going to take a look at the Operational Amplifier or better known as the Opamp really important building block. Absolutely essential that you understand how they work. Now, there are two ways to learn about Opamps. One is this way.
the hard way. We don't want to do it that way. That sucks. So let's get rid of this.
and let's do it the easy way. So what is an Opamp or an Operational amplifier? Well, the name Operational Amplifier comes from the fact that when they were first developed, they were developed to do mathematical operations. hence the name Operational Amplifier. And back then we didn't have digital computers.
They did. They used these for analog computers. So, analog mathematical operations, addition, subtraction, integration, differentiation, stuff like that. even that real hard calculus stuff Opamps could actually do these operations in.
Hardware Now of this digital software rubbish. So that's where they came from. So although we don't have analog computers today, we still use them for those mathematical operations. You can, uh, turn an opamp into an integrator.
For example, you can turn it into a summer which is just an adder and things like that. So they're really useful circuit building blocks. But the main thing we're going to look at is the operational amplifier as an actual amplifier. cuz that's what they most commonly use for and probably what you mostly use them for as well.
So an Op Amp is essentially just an amplifier. Yes, it can be used for those mathematical operations, but essentially, what it comes down to is this is a differential amplifier And what that means is that it's got two inputs over here, which we'll talk about and an output. and it's got some gain in there. Because Amp amplifiers have a gain, and what it does is it takes the difference between these two input signals, amplifies it by its internal gain or what's called open loop gain, and gives you an output voltage.
But Opamps really can't be used as differential amplifiers on their own, even though that's what they are. Rather confusing, but an important aspect you should understand. So why can't this be used as just a differential amplifier Input signal Here, output signal with some gain in there? Well, the answer is, they're not designed to be used as differential amplifiers. As strange as that may seem, because they are essentially differential amplifiers.
That was. that was that hard circuit you saw over here before was actually the internal circuitry of an Opamp, showing it as a differential amplifier. But hey, let's forget about differential amplifiers. I Shouldn't even mention it.
But it is important to understand the operation of how an opamp actually works. Now, the reason they don't work is differential amplifiers. Because the Opamp, the gain of the natural gain. The internal natural gain of the Op Amp is enormous.
And that's the first thing you need to know about Opamps is it's not quite infinite, but you can think of it as infinitely large. It's like millions of times. And well. the data sheet won't even tell you. So if we just tried to use an opamp like this with no external circuitry and just fed, you know, like one molt on the input. Here, the gain is so large that the output voltage is going to be so huge that it's just not a practical device at all. So that's why you never see an Op amp with without any external circuitry or what's called negative feedback. So that brings us to our first practical application for the opamp, which is a comparator.
But before we look at that, we will look at the symbol here. Now, an opamp is typically drawn as a triangle like this. It's got two inputs over here and one input here. Sometimes it might be flipped depending on, uh, the ease of drawing your circuit and the way the signal flows, but it's exactly the same thing Now, these two inputs here one is the positive input is called the non-inverting input easy to remember because it's positive.
The inverting input is likewise easy to remember because it's negative negative inverts something. So that's the terminology you should be using when referring to Opam. It's very important to get the terminology right. Otherwise, you sound like a bit of a dill.
Now there's an output pin here. easy. And there's two power supply pins a positive and a negative one, which we'll talk about as well. So I mentioned that the gain of an opamp naturally inside is designed to be enormous, almost infinite.
So what happens if you just feed voltage on the input here? Well, let's assume that we have one volt on our non-inverting input here, and we have 1.01 volts or slightly above 10 m volts or even 1 molt above this one here. Well, the amplifier will actually amplify the difference or attempt to amplify the difference between these two inputs. So the output put here will be this huge gain. Like a million times that one molt.
So it'll try and output hundreds and hundreds or thousands of volts. And Well it can't do it because well, your circuit's only you know, 5, 10, 15 volts, something like that. So your output is going to saturate. So if you've got 1 volt here, and let's say 1.1 volts here, then your output is going to go boom right up to V+ It's just going to saturate right up at the positive voltage.
So we've got ourselves a comparator. And likewise, if you swe switch those voltages around so that the non-inverting input is bigger than the inverting input, even by a tiny amount. Bingo your output is then going to go from positive and it's going to slam right down to the negative rail down here so you can see that it's just used used as a comparator. It's a going to be a very crude comparator and you can use an opamp as a comparator in a pinch.
but they aren't quite as good as a proper comparator that you can actually buy. They're designed to be comparators, but hey, you can actually use Op opamps as comparators. But that's what happens if you connect an opamp with no feedback at all. And what that's called is the open loop configuration. Because there is no Loop. There's no loop, the loop is open, and we'll close the loop in a minute. But with an open loop configuration like that, an Opam is just a comparator. So now that we got that little nonse out of the way the the Oddball configuration of the comparator for the Opam.
let's have a look at what where opamps come really useful and that's as proper amplifiers. Now to do that as I said, we need to go from the open loop configuration with no feedback to add in what's called negative feedback and hence the T-shirt negative feedback. And once you do that, opamps become incredibly useful and Powerful devices. Now there are two rules with Opamps.
That's all you have to remember. It's fantastic. This is how easy Op amps are if you know these two rules. If you remember these two rules, you can analyze practically any opamp circuit.
You can't get into the real, nitty-gritty details of the performance of it perhaps, but you can look at a schematic and you can understand how it works. And the two rules are very simple. Rule number one: No current flows in or out of these inputs. So there's nothing flowing in or out of these two input pins.
ever. That's it. Nothing. Nothing flows in or out regardless of how you connect this circuit up.
Whether it was the open loop comparator configuration we saw before, or whether or not it's uh, a Clos Loop configuration and inverting or non-inverting amplifi is, we're going to look at nothing flows in or out. Rule Number Two: Now, this rule only applies when you have a closed loop like this. It doesn't apply at all to the open loop one we just saw with the comparator. That's why I did the comparator first, even though it might have been a little bit confusing to start that way.
Most people start opam explanations with these two rules, but I wanted to show you that comparative first because to highlight that, rule number two does not apply or only applies to closed loop configurations with negative feedback. Now, rule number two is, the Opamp does whatever it can internally, right internal circuitry which we won't going into, but it does whatever it can to keep these two input voltages the same. Now, the Opamp can't actually change its input voltage. It has these are inputs.
It has no way to actually drive a voltage out and keep them the same. but it can do it with feedback. And that's why this rule only applies to Clos Loop configurations. So the Op Amp only has control over its output.
but if you have feedback, it will change this output voltage to make sure this input equals this input here. And that's a very powerful rule of opamps. And if you see a Clos Loop configuration like this, you can be pretty sure that rule is going to apply. So using these two rules, let's look at the simplest conf opamp configuration possible and it's not this. It actually has no external components. So what it has is the output tied back to the inverting input like this. and you feed your signal or your voltage into the non-inverting positive input like that. and this is called an opamp buffer.
So using our two rules, very easy to analyze this opamp buffer circuit. let's say we let's just do DC because opamps. The other thing is, opamps are DC coupled amplifiers. They can, uh, amplify DC as well as AC signals.
Very important property. So but let's do the DC case. We're feeding one volt into our non-inverting input here. what do we get on the output of our Opamp? Well, look, Rule number two always applies when you're uh, when you've got feedback in a circuit.
In in an Opamp circuit, the Opamp tries to keep these two input voltages identical. So because of the rule, this inverting input here is going to be equal to this pin up here. the the Op An will ensure that by driving this output to get this input to match this one. So we' got one volt here.
Then we've got one volt here. and because it's just connected by a bit of wire, we're going to get 1 Vol out here. That's why it's called a buffer. It's not an amplifier.
It because there is no gain. 1 volt in 1 volt out. Minus one volt in minus one volt out. Whatever the voltage is within, uh, within the limits of the power supply voltages here.
what use is that? Well rule number one: No current flows in or out of the inputs, so nothing, no current flows in. So if you've got a load over here I don't know it could be some sort of sensor or whatever. It could be a uh, low pass filter for example, like you're feeding a pulse withth modulated signal from your microcontroller or something like that and then you want to buffer that voltage off there because no current flows into the input. This opamp does not disturb your sensor or your circuit that you're actually trying to do.
It's a what's called a very high impedance input, essentially open circuit, so it doesn't disturb anything you hook up to it. But the Op Amp has a what's called a low impedance output. so we can drive. You know, a reasonable amount of current.
You know, milliamps? Tens of milliamps. that sort of thing. Some can go as high as a couple hundred milliamps for your power Op amps, but it can drive a reasonable amount of current, so that's why it's buffering the signal. A high impedance signal and giving you a low impedance output just allows you to drive things with a sensitive input like that.
Pretty easy. Very useful configuration. The Opamp buffer. Now the next configuration we're going to take a look at is What's called the non-inverting amplifier. and this is where we tame our opamp Beast that huge, unwieldy gain that changes everywhere with temperature. and it's horrible. Anyway, it's got this massive, unusable gain in there as a differential amplifier, but as a single-ended amplifier, that's what single-ended means. Your feed input here, and it's always referenced to ground.
We can use this as a single-ended amplifier, and we can tame that gain by adding negative feedback on it. And I won't explain negative and positive feedback in the mechanisms and how it works because. Well, that's for a more advanced topic. But anyway, we feed in a feedback resistor here.
just like we did before. it was shorted out. but we put a resistor in there and we put a resistor back down to ground. So what it's doing now is this input.
The inverting input is taking a small portion R This feedback resistor we'll call RF is always bigger than R1 here. So fence. So we just got a voltage divider here that feeds back a smaller part of the input. and that's essentially what negative feedback is you taking a part of the output and you're feeding it back to the input.
And there's a very simple formula you need to remember for this non-inverting amplifier configuration and I won't try and derive it, but the gain of this amplifier or what's called AV that's the actual terminology used. AV is just gain you can use. Gain gain equals RF the feedback resistor divided by R1 which goes down to ground here. plus one.
You've got to add that plus one on there. So easy. If we've got a 9k feedback resistor and a 1K resistor down to ground here, our gain is 9k on 1K or 9 + 1. Our gain is equal to 10.
So if we feed 1 volt into the input here, we'll get 10 volts on the output. easy. And because we've got positive and negative rails which will get into, we can feed AC or DC signals into here about ground and so we can feed negative uh 1 VT into here and we'll get -10 Vols out. So there you go.
That is the basic configuration of a noninverting amplifier and you might see weird configurations. There might be a capacitor across here or something like that, which we won't get into in this one, but you know the configuration is the same. If you see your input being fed into the non-inverting input and the feedback going back to the inverting input, you know that's a noninverting amplifier And this formula here applies. And from this formula, you can also see why our buffer amplifier had a gain of one before because our feedback resistor is zero was Zero ohms so zero on R1 here which was infinite.
So zero on over infinity or a very large value is 0 + 1. So our gain is one that that's why our buffer had a gain a one Easy. The math doesn't lie. So now we get on to the second of our two major configurations.
We've already looked at the first one, which was the non-inverting amplifier. The buffer was just a variation of that. Now we have instead of the non-inverting amplifier, we have the inverting amplifier. How can you tell it's an inverting amplifier? Well, just like before, we could tell it was a non-inverting one by the signal going into the positive input. Here, the non-inverting input, hence the name non-inverting amplifier. Our signal now goes into our inverting Uh amplifier pin. So hence it's called an inverting amplifier and you'll notice that I've switched the two symbols around here. The positive is now on the bottom.
Our Op Amp hasn't changed I've just done that visually to uh, you know, to make it a bit easier here. and that's what you'll commonly find in schematics and CAD packages and all sorts of stuff. You might find them flipped around upside down, back to front, whoop-de-doo or going all around the place, some pointing down for various feedback passs and all sorts of things. It's exactly the same Opamp.
It's just visually different. You can draw it any way you want. Now, our uh, inverting amplifier. That this one is.
we have the same as before. We have our feedback resistor. We have our negative feedback going to, in this case, our inverting amplifier pin instead of our non-inverting one. So now, uh, we are feeding our in put into Uh through the resistor here.
so it's a different configuration. Our signal is not going directly into the non-inverting pin. And this brings up our next really important concept with Opamps that you really need to understand. And here's where rule number one really comes into play in trying to analyze this thing.
It's called virtual ground. Stick with me. So once again, how do we analyze this? Always go back to your two rules. What's our second rule here? The opamp tries to keep the input voltages the same.
In fact, it will if you've got this non-inverting configuration and you haven't hit the rails yet. So if the amplifiers working normally within normal bounds of your power supply rail, these two inputs will always be the same. So, uh, we're actually connected our non-inverting input down to ground. Here, it's connected to ground.
We're forced it to ground. It's never going to change. So what is the inverting input here going to do? well? Of course. Rule number two.
It's going to be identical. it's going to be the same. So this point is also going to be ground or Zer volts. So this seems like almost like a pointless circuit.
Cuz look at Rule number one: No current flows in or out. So there's no current flowing in or out of that pin. And it's ground. We've got both pins grounded and no current flows in or out.
It's is that. What's the point of having an Opam? It's very confusing concept, but once you grasp it, you go. Oh, that's easy. and it's quite brilliant.
So the Opam remember, does whatever it needs to on the output drives it to whatever voltage positive or negative. In order to make sure that this inverting pin here is equal to the non-inverting pin down here makes them the same. We force this pin so it can't change this pin. All it can do is change the voltage via the nature of the feed back resistor here to make this zero. And trust me, we'll do a practical, uh, measurement of this in a minute and this node here will actually be zero volts. And this confuses the heck out of a lot of beginners. They build up their upam circuit, They start probing around, and they've got their input signal here. You know it's a 1 khz 1vt sine wave for example.
And so they measure this side of the resistor and the signals there. They measure this side of the resistor and it's ground. The Signal's vanished. Where's it gone on? H Strange, but true.
So let's follow this through and use our rules and see if we can analyze this circuit once again. the DC case. To make it make it easy, we've got one volt on the input here. Positive 1 volt with respect to ground of course.
Now we've said before that, trust me, we'll measure it later. but this pin is going to be ground. It is going to be zero volts there always. So all we've got is one Volt across our R1 here, which is 1 K So we're going to have 1 milliamp flowing through there.
Where does it flow? Well, It doesn't flow down here to ground. How can it? Because no current Rule Number one: No current flows into or out of the input pins. So it can't flow through the ground. Here, it has to flow.
It's going through here. it's going somewhere. There's one Volt across that 1K resistor. Ohms law.
always. it must be B So that current is Flowing. Trust me, it can't flow into the input pin when we know it's high impedance. So it must be flowing up here like this through this 10K resistor and it's being sourced from the output.
Remember, this opamp has internal circuitry. It's got an output buffer, so it can actually drive currents into and out of the various supplies back into there. And that is where it's sinking in the current to. And that's the sneaky part about this.
Our current has now been forced up this node here and is flowing through. In this case, our our feedback resistor RF which is 10K I've made it 10 times larger. You'll see why in a minute. Then it's it must be flowing through there.
So we must have a voltage drop across that resistor. Once again, Ohms law always must be obeyed. So if we got that 1 milliamp flowing through our 10K there, we're going to have 10 volt drop across this resistor with positive here and negative here. Aha negative This, These voltages are with respect to the ground here.
Now here's where it gets a little bit tricky. this positive voltage. Here, it's we are going to get the plus 10 Vols across that resistor there. But because this pin is positive, but we're forced, we know this pin is zero. Okay, we know it's zero because we've forced it by way of the amp action. and rule number two here in what's called a virtual ground which I talk about in a minute. Then we have that means if this is ground, this is positive, then we've got minus 10 Vols coming out of here. Bingo There's our inverting amplifier 1 volt in minus 10 volts out.
So our gain. Our formula AV Gain equals r F on R1 There is no + one with the inverting amplifier. The plus one only applies to the other non-inverting configuration. So by way of opamp action, we'll call it and negative feedback here This point.
This node here at the non at the inverting pin is what's called a virtual ground because typically in this configuration, it is actually grounded. Because we've grounded, this pin doesn't have to be. We can feed other voltages into this pin and offset and do all sorts of other stuff, but it's still called. Even if you do feed another pin in here, it's still called virtual ground because it's virtual.
It's not real. It's not hard tied If it was hard tied to ground. If we actually tied that PIN to ground, this thing wouldn't work because all of our current would flow through here, like through this resistor, down to ground and around like that. and then this output here.
Well, it wouldn't know what to do. The output would be zero because there'd be zero volts difference in here. Remember, it's still a differential amplifier as such, so we got zero volts difference here. We're going to get zero out.
We'd have no current flowing through here and we'd have zero volts out. so you can see that it doesn't work unless if you T tied that hard ground. But when it becomes a virtual ground by nature of the opamp action, it all magically works. I Hope that makes sense cuz once you get it, it's really easy.
So functionality wise, it's pretty much exactly like the non-inverting amplifier, except it inverts and that's it. and the gain formula is slightly different. but apart from that, pretty much works exactly the same. But that magic virtual ground is at play in this configuration.
And of course, as with Opamps, they're DC coupled so it works with DC signals. You can just feed in a fixed DC voltage as I said 1 V volt DC in would give minus 10 volts out in this case with these value resistors. or we can feed in a 1V uh, Peak to- Peak or or RMS uh sine wave for example, about ground. so it's centered on ground like this: This is the blue waveform here.
Let's just say that's 1 volt. It's not quite the scale, but you'll get the idea and then our output will be the inverse of that. So when the input Rises the output goes negative because it's an inverting amplifier. Now of course, one of the disadvantages of the inverting amplifier compared to the non-inverting we saw before is that as you can see, there is input current coming from your load here. so you don't want to use this where you have a high impedance load because then it can change the gain equation and Max everything up. That's where you want a non-inverting amplifier or at least a buffer. Some people will actually follow will, uh, put a buffer on the input here and then drive the inverting amplifier. But usually in that sort of case, you'd probably use a non-inverting amplifier.
Now we have to go deeper into this and talk about the power supplies and split rails and all this sort of stuff. And uh, single Supply Op amps. I'll try and keep it as brief as possible, but you saw in this configuration the opamp only has two power pins. Okay, it's usually called V+ and V minus.
Now V minus. You can actually connect that to ground. There is nothing. Regardless of what the data sheets tell you, there's nothing inherent in opamps that make them really a single Supply opamp.
So you can take an opamp that has V+ and V minus and connect this down to ground like that, There's nothing to stop you as long as you meet the minimum voltage specification and don't exceed the maximum Etc So what happens if we did that? In this case, our input is all. Our non-inverting input is also grounded here. Well, now it becomes a problem. You get into the Practical limitations of Opans.
We've been talking about what's called an ideal Opamp up until this point. These rules here aren't strictly true I lied, but there's still a fantastic way. Even professionals used to analyze these circuits as a first order as a first pass. No current flows in or out.
Well, if you've been watching my videos, you'll know I've done a previous video on this talking about input bias current so little, itty bitty, teeny weeny currents can flow into and out of these pins depending on on what type of Op app you're actually got. and that's a real practical uh limitation of these things. And the other one is that I've talked about in previous video which I'll link in down below. If you haven't seen it, the inputs cannot necessarily go right to the rails, be it, uh, whether it's positive negative reference to ground or whatever.
so you can get, uh, what's called railto rail opamps or railto rail input opamps. In this case, if you had a railto rail input Op amp, then yeah, you might be able to get away with this and have the uh invert and have the uh, non-inverting input tied down the ground like this. But hang on. What's the point of that? If you've only got ground, this is an inverting amplifier.
It inverts your signal so if you Fe one volt in, you're going to try. The Opam is going to try and give you one or minus 10 volts out. But how does it do that When you Supply is negative like that, it doesn't work so you have to. Um, it's got no room to do it. so your opamp has to always be powered in the configuration that you expect your input signals to be referenced to. So if we were to use the inverting opamp configuration like this with a single Supply rail like this, and we wanted to amplify AC signals. Well, the signals can't go negative like this. They can get negative on the input, but you're never going to get that negative voltage on the output.
But you still want to amplify your signal cleanly like this. Well, what we need to do is this: zero point needs to go right down the bottom here like this. so we need to offset. So if that's zero volts, we need to offset our input, wave our input and output reference by a certain amount of voltage.
How much? Well, typically half your supply rail to Max maximiz your head room. How do we do that? I hinted at it before you feed in. If this is V+ you would go V+ on two. You would feed that voltage.
half rail in there. You' Usually do that simply by putting a resistor like that, going to V+ and a resistor down there going down to ground and bingo voltage divider. There's your half rail. So we're offsetting our voltage here.
Our virtual ground. Remember this is still called a virtual ground even though it's not going to be. So the voltage here is going to be equal to the voltage here due to our second Opamp rule. So if our power supply is 20 Volts for example, this point here would be half that.
If we make these, you know exactly the same value. Of course, make them the same value half rail. So we're going to have an offset voltage here at this point and that shifts our waveform up and we'll see that in the Practical experiments to follow. Now, as I said, some time back, you might see some other components around here, like some capacitors and things like that around the circuit.
That is to change the bandwidth of the circuit effectively. Um, because we're not going to go into it I'll have to do a second part of this video that goes into opamp bandwidth and things like that. I have done one on C cascading opamp bandwidths, which I'll link in down below. but suffice it to say that an ideal Opamp that we've been looking at has an infinite bandwidth.
It's infinite frequencies and signals, but in practice, no, of course not. Your practical Op Amp might have a one MHz bandwidth or 100 khz bandwidth or something like that. You know it could be a nice fast 100 mahz, but it's always going to have a bandwidth which changes with your gain or gain bandwidth product. and I've done a separate video.
I'll link it in, but sometimes you might see a little bypass capping there. it might be you know, 10 puff or 100 puff or something like that and that's just rolling off the frequency response to that. And likewise, you might see a little cap across something like this. For example, if you have, um, if you are offsetting this thing using a single Supply like this, you know I I Won't go into the details, but basically any noise on this point here will be Amplified and picked up on that virtual ground. So you'll get noise on your output signal so you might stick a big ass. you know one or 10 microfarad cap across here for example and really make that virtual ground really Noise free. But hey, that's that's beyond the basics. One little mistake I Noticed.
Oops. My formula here for the inverting amplifier. It needs a negative in front of it because the gain is actually negative. So it's so the gain is not in this case is not 10K is not 10.
It's minus 10. Oops. So just back to this voltage rail thing. uh, briefly, because it is something that is rather confusing because there is no round pin on an opamp.
There's only the positive and negative. So well, where does your reference go? Well, the reference is part of the external circuit. in this case, back to our non-inverting amplifier configuration. Here's our ground reference here and then our positive and negative Supply is here like this.
So plus 15 Vols and minus 15 volts if we want to feed in a signal that goes both positive and negative. If we're only feeding in a signal that is positive above ground, then this here could be tied down to here like this and then, uh, it has to be above that The output cannot magically go negative. It can only go negative to your ground reference if you have that minus5 volt rail in there clear as mud and just like the inverting configuration, if we wanted to power this from a split, Supply we could have this grounded like this. and then we can add a bias voltage in here like this to actually offset the voltage.
and then you can get into all sorts of uh, weird and wonderful things with AC coupling these amplifiers. All of the Op configurations we're looked at have been DC coupled, but you can actually AC couple them so that's why you start might seing capacitors on the inputs and outputs to the opamps. Now here's a tricky configuration which I'll briefly touch on that combines the two different configurations we've seen before and a couple of the things with looked at. it's the differential amplifier.
You know how I Said opamps are essentially a differential amplifier. That's how they work, but you have to. but they do that in the open loop configuration so they're hopeless. They're useless for that.
But if you combine the N the inverting amplifier configuration that we just saw. so we got the feedback going here, our signal going in. that's a standard Uh inverting configuration and we have exactly those two resistors that we saw before to bias that voltage up. But instead of going to the supply rail, we make that our other differential input and bingo, it becomes a differential amplifier.
I'll let you go through the actual calculation yourself to find out. But basically the difference that we're feeding in if we're feeding in 1 volt into here and 1.1 Vols into here, we have a difference of 0.1 volts and the gain of this amplifier exactly like the inverting configuration. R2 on R1 we used RF before. I'll call it R2 here. So R2 on R1 10K on 1K we have it G and you got to add negative in there so it's a gain of minus 10. but because our bias voltage is not fixed, it's actually the differential input signal. Aha, look what happens. We got one volt here.
We've got our divider here. R1 These two values are the same: R1 is equal to R1 here. R2 is equal to R2 here. they must match precisely to get good common mode rejection ratio, which we won't go into.
But suffice it to say if we got one volt on this point here relative to ground, we'll have 0.9999 repeater at that point there and that becomes our virtual ground. Bingo We have that same voltage there. Then we'll have our 1.1 volts here that has X and then you subtract uh that from that that you get x amount of current flowing through here which then must flow through the 10K which has 1.0 99 volt across it. Subtract the difference there.
It's exactly the same configuration as before with the biased voltage, but then we'll left with an output voltage of minus one. So we've Amplified the difference in our input signal by the gain here. 10. It's not a terrific differential amplifier, but it works.
So we've tamed our Opamp that is a differential amplifier anyway, but pretty unusable. We've actually made it into a pretty usable differential amplifier. Beauty Just combines both those techniques and there's lots of tricky stuff like this you can do with opamps and just briefly. Another one of these tricky configurations goes back to their name, the operational amplifier, and one of those mathematical operations.
the integrator I won't go into integrals and all that sort of stuff. But what? We can do a basic inverting configuration here. except instead of a feedback resistor, we have a feedback capacitor. What does that do? well? Our standard input voltage here.
Following the rule: no current flows in, but we have a virtual ground of course. rule number two. So if that's 1K and that's one volt there, where we have 1 milliamp flowing through that resistor. Where does it flow? Can't flow into the opamp.
It's got to flow up here and through the capacitor. So you've got effectively a constant current of 1 milliamp you've just made. This is now a constant current flowing through this this resistor. And when you have a constant current flowing through a capacitor, you end up with a well.
In this case, it's going to ramp negative down like that. if our input, go. If our input is a step and it goes up like that, the constant current. Because it takes time to charge a capacitor, the voltage on the capacitor will increase like that. I say increase because it's an inverting amplifier, so it's going to go negative, but that's what it does and that's an integrator and that is actually a mathematical integral of your input signal. Anyway, that's way too much Theory more than I wanted to do and longer than I wanted to take actually. But suffice it to remember that these two rules of opamps allow you to analyze practically any configuration. And as a bit of homework, I Go recommend you look at the sum, opamp configuration, the sum in amplifier, and figure out how it works.
because you're going to be using those two rules to figure it out. So I'll leave that one up to you. but enough of that. Let's head on over to the bench here and see if we can measure some stuff.
Make sure I wasn't bullshitting you about this virtual ground stuff. Let's check it out. sounds a bit. sus see if it really works all right, we're at the breadboard.
Let's take a look at an inverting amplifier here because I wanted to show you that virtual ground point there just to show you that there really is no signal there. It actually vanishes in quote marks when you go from the input here to here. and then it magically reappears at the output. cuz that's how an opamp works as I've explained.
Anyway, got a Jelly Bean Lm358 here. It's actually a dual Op amp, so we've just, uh, tied off the Uh terminated the top opamp here. Could probably do a separate video on that on how to properly terminate uh opamps. That might make an interesting video.
Um, thumbs up if you want to see that one. Anyway, here we go: I've got it configured. I've got a A 10K input resistor here 100K feedback. so we' got a gain of 10.
The formula, of course, is the feedback resistor on that one Bingo Easy times 10 So I'm going to feed Uh 2 volts Peak to Peak input. Here we should get Uh 20 volts Peak to Peak on the output. So we're using pretty much near the maximum Supply rail of the Lm358. In this case, I'm powering it from plusus 15 volts.
so we have a split Supply So our ground reference our input signal is reference to ground I should actually draw that on there. There we go. that's clearer. So our input is referenced to ground and our non-inverting input here is referenced to ground and our output is referenced to ground also.
But for signals to go negative, for output signals to go negative, we need a negative rail on here. so we're using minus 15 Vols So plus 15 to power at minus 15 as well. So 30 volt total Supply on there allows us to go positive and negative signals input and output. So let's go over to our power supply.
Here it is: Plusus 15 Vols I Got dual tracking on there and you notice that I've joined the Um supplies here generating a split Supply So this one actually becomes the negative. So this is our positive 15 from here to here and this is our -5 relative to here because we've strapped the positive one over and Tada There we go. we're feeding in our Uh one. We've just got a one khz low frequency signal 2 volts Peak to Peak uh here on the input and you can see our input and output waveforms and these inputs are of course all uh AC coupled and their bandwidth limited as well to 20 MHz to reduce the noise. and we're using our high resolution mode as well. So we get some Box Car average in in there and that's why we got a nice crisp waveform like that. Beautiful! So what happens if we turn our bandwidths back to full? In this case, it's my 1 GHz Tectronics 3000 Series and we turn off high-res mode. Go back to sample mode.
There we go. We get our nice fuzzy waveforms because we got that massively high bandwidth. That's the advantage. you can go into averaging of course, but high res mode does.
Box Car Averaging just cleans it up. Of course you can do envelope mode. Look at that pretty horrible waveform. So when looking at this sort of stuff, you definitely, uh, don't want to use your regular mode.
You want high res mode. If you've got it There you go. we're getting exactly what we expect. Look at that.
uh, 2 volts Peak to Peak. In roughly 20 volts out, there's probably going to be some error due to the Uh resistors in here. Anyway, we're getting our time 10 and of course the blue the blue waveform. There is the input that's 500 MTS per division.
So we're getting our 2 volts Peak to Peak and our output is 5 vs per division. So which is the yellow waveform there? And look at that. And of course, because it's an inverting amplifier, the output is exactly 180 out of phase. It's inverted.
So the moment I'm probing the input and the output. Now, you want to see the virtual ground. Didn't you? What happens if I move my input probe the Blue Wave form here. From the input over to this, you'd expect to see the signal.
But as I've told you and as you should, trust me, let's move the probe over. That is our virtual ground. Point Look Flat's attack. The signal has vanished.
Magic. But of course you. no, it's not magic. it's just standard Op amp.
Behavior with virtual ground on the input. That's how an Op Amp works. And no, the current hasn't magically vanished. the current is going through the resistor.
Ohms law still holds. Current is changing because we've got an AC uh resistor here. There's AC current flowing through this resistor and it's all flowing up here. But this point, by nature of the Opamp action and the negative feedback that is a virtual ground.
our Opamp rule number two: there inputs are the same. The Op Amp changes the output here in order to Ure that that point is equal to that input there. Easy. And that's why we don't see any signal on there.
So trap for young players when you're uh, probing around circuits like this. don't think the signals vanished. Virtual Ground. Remember your Op Out rules always now. I Actually chose the LM 358 for a reason because it is not like a regular Op Amp and not quite like a railto rail opamp. It's sort of halfway in between. Check it out. Here we go it.
It eliminates the need for dual supplies. Okay, you can use it as a single Supply opamp. but as I said, you can use any opamp as a single Supply opamp. but this one is extra special and that allows direct sensing near ground.
So and V out also goes to ground so effectively it's it's It's not rail to rail. it won't go up to the all the way to the positive rail on the input and output, but it will go down to ground. All the negative because an Op amp doesn't have a ground pin, it's the negative rail. so even if we power it from split supplies plus -15 like we are now, it'll still go down to that -5 volt pin or that pin 4.
it'll go down the input will. this input here will allow to sense all the way down to the negative Rail and also so the output will go all the way down to the negative Rail and I'll demonstrate. But what we've got to look at here is a couple of things on the data sheet: our input, common mode range, and our voltage range here. As we said, it goes all the way down to that negative pin or zero volts as they're calling it here.
But on the positive side, this opamp will not go um, sense or go to the output less than 1.5 Vols uh, below or above 1.5 vol below the positive rail v+ there. So if we've got an output signal of 10 Vols for example, the voltage range says if we want to get an output voltage of 10 volts Peak Well, we need a V+ rail of at least 1 and2 volts above that. So 11.5 volts. So what we're going to do is lower the voltages here on these rails.
We're going to lower V+ from 15 Vols down to 11.5 and around about that 11.5 volts because we're getting 10 volts Peak on the output 20 volts Peak to Peak 10 volts Peak We should start seeing Distortion or clipping of our waveform at around about 11 1/2 volts. Let's see if we do. Okay, so here we go. We have 15 volts I'm going to drop it down by 0.1 volts at a time.
you notice that it's split Supply It's dual tracking so our waveform is still looking good. still looking good, but we expect it to start clipping around about 11 1/2 It may not be precise sice this is not an exact value on the data sheet, but there we go. 112. It's still there.
still there. There we go. It's starting to clip. It's starting to clip.
You can see it. It's actually about 11.2 Vols there. But you can start to see that waveform flatten out now I Wind it down even more because this is a not a symmetrical Supply upam. It actually goes down to zero.
We don't start seeing clipping on the bottom here on the bottom rail until a significant time after that. Now we're getting both. but I wind it back up there and that's about 11.1 Vols But we're seeing that clipping on the top and we won't see it on the bottom for time after. So there you go. Just be aware of that. And if we had a a even a worse op amp uh in this respect, like a Lm741 or something like that that can't even go down to the negative rail, we would start to see these clip right roughly at the same time. and you remember that open loop gain I was telling you about how large is it? Well, it tells you a couple of ways in the data sheet. not all data sheets will have it, but this one does Large DC voltage gain.
So it doesn't say it's open loop gain, but that is effectively the DC voltage gain is the gain of the the inherent differential amplifier in there. and they put it in DBS So you use your 20 log uh formula you uh, reverse and you get about 100,000 And likewise here on the data sheet they' got another way to tell you it's called. Now, it's called something different. It's got the large signal voltage gain there.
Uh, it's specified for a certain rail, but there we go, typically 100 and they specify it in volts per molt. So if you, uh, divide 100 volts by 1 molt, what do you get? Same figure 100,000 There's your open loop game. so there's just a quick uh practical demonstration showing the virtual ground effect there and also the voltage. Rail limitations Positive and negative I should do another.
uh part of this video on Opamp limitations. Practical limitations. Things like that that would be interesting. Thumbs up if you want to see that one.
but I got I'll leave you with one last thing and I won't explain it I'll leave it to you to try and figure out I Chose these values higher than what I had on the Whiteboard there. I Chose them for a reason. Let's lower them down to 10K and 1K K here and see what happens with this specific opamp. lm358 H Let's drop these down still quite: High values 1K and 10K they're not.
you know, like 10 ohms or something like that. But let's give it a go. And there it is. 1K Input resistor 10K Feedback resistor Exactly the same gain.
exactly the same input signal. but what's that little funny business going on in there and over there? H And if we measure our virtual ground Point Wow, look at these little spikes there and there corresponding to that little bump in that waveform. Interesting. So as Professor Julius Siller said, why is it so I'll leave that to you to figure out.
Catch you next time.
It all makes sense now. Many thanks 👍
Why don’t you make more opamp videos, there’s not much analogue stuff on YouTube and this video is the most watched video
Great Thanks!
THANK YOU
You are a brilliant teacher. Your ability to explain these concepts in an easily understood and straightforward way is a precious gift. I say this as someone who, many many decades ago, struggled as a student trying to understand so many instructors who did not have the ability to convey their knowledge to their students.
Hi Dave,
I've implemented Schmitt trigger model with op amp using voltage devider as reference input + and feedback. But Found a oscillating 10mhz to 100mhz when input – move near volt reference. So how to solve this issue?
So let me get this straight – a buffer can be seen as 'decoupling' two parts of a circuit? It takes the input and 'copies' it to the output?
Also, how are the powered? How do I get a negative voltage from a battery, for example?
I would really appreciate it if u had a transcript of this. thx tho!
Brilliant tuitorial
49 minutes and didn't cover virtual ground, or in general how to power them
I am trying to repair A pioneer DJM-S9 and the schematics are not freely available. the balanced output has hot and cold left and right that goes through opamps and the cold outputs have fuses on them. Both fuses had blown for the left and right outputs and after replacing them I looked at the outputs and the hot has clipping on the left and right over a certain volume level. After watching this I kind of understand, but I am more confident with digital electronics so a little out of my comfort zone. If I remember the voltage for the +15 and -15v are ok and the hot and cold have the same peek to peek voltage as them come into the circuit. All advice so far is to just replace the £400 board that no one has for sale and I can't ask pioneer they will just not give any help..
Anyone got the answer for the last quiz?
thank you for sharing your knowledge my good sir
I just read the other night in a book, or app note (I'll have to find which) that op-amps were initially developed by phone companies because their amplifiers had unstable gain trying to set it exactly. So insteady, they made an amplifier with entirely too much gain which you could adjust for the necessary application. Does anybody know how much, if any truth there is to this?
great video, quick question does the feedback always feed back to the inverting side (negative input) of the OpAmp?
Test
Hello Dave!
Can you please tell me the reason why Rf in the negative feedback circuit has to be greater than R1 in the case of non-inverting amplifier ?
Thank you for posting this video
@31m49s; Oops.. you are so cute!
Saved this one in applied science.
Why thoese ripples at the end of the video ? Anyone can explain ?
Your video is gold. I modeled both inv amp and non-inv amp in LTspice with MAX4352 op-amp. Input voltage: [0,0.5] volts. Vcc:+5v, Vee: GND. Worked perfect. Thanks for your work!
It’s being over 2 years now am still trying to understand how to get any op amp to work when I add vcc and end 12 volt am getting 12 volt on the output and half is 6 volt negative and 6 positive when I add 33 millivolt the positive voltage don’t get greater because the pnp it’s still on and npn is still am not getting anything of them to stay off am designing a current senor I can get the bjt to turn off even at 12 volt over current on the resistor the two transistor still on so i read the database sheet on I can find anything to staying the output is voltage is zero I use lpm 358 and ua741 op amp and o get the same results I can’t understand how it work in real time as a operation amplifier i use every ic knew to men but op amp is the one ic I can get to work in current sensor circuit only comparator work
first 55 seconds of this video told the whole story, I kept asking WHY OP AMPS? and here it is in 55 seconds.
i watched this with the biggest shit eating eureka grin on my face because it MAKES SENSE NOW
Wireless