< Return to Video

EEVblog #600 - OpAmps Explained - What is an Operational Amplifier?

  • 0:00 - 0:03
    >> Hi, welcome to Fundamentals Friday.
  • 0:03 - 0:05
    Today, we're going to take a look at
  • 0:05 - 0:09
    the operational amplifier or better known as the op-amp,
  • 0:09 - 0:11
    really important building block.
  • 0:11 - 0:14
    Absolutely essential that you understand how they work.
  • 0:14 - 0:17
    Now, there are two ways to learn about op-amps.
  • 0:17 - 0:21
    One is this way, the hard way.
  • 0:21 - 0:24
    We don't want to do it that way, that sucks.
  • 0:24 - 0:29
    So, let's get rid of this and let's do it the easy way.
  • 0:29 - 0:32
    So, what is an op-amp or an operational amplifier?
  • 0:32 - 0:34
    Well, the name operational amplifier
  • 0:34 - 0:36
    comes from the fact that when they were first developed,
  • 0:36 - 0:40
    they were developed to do mathematical operations. Hence,
  • 0:40 - 0:45
    the name operational amplifier and back then, we didn't have digital computers.
  • 0:45 - 0:48
    They used these for analog computers,
  • 0:48 - 0:53
    so analogue mathematical operations; addition, subtraction, integration,
  • 0:53 - 0:56
    differentiation, stuff like that, even that real hard calculus stuff,
  • 0:56 - 1:00
    op-amps could actually do these operations in hardware.
  • 1:00 - 1:02
    Not all this digital software rubbish.
  • 1:02 - 1:03
    So, that's where they came from.
  • 1:03 - 1:06
    So although, we don't have analog computers today,
  • 1:06 - 1:10
    we still use them for those mathematical operations.
  • 1:10 - 1:14
    You can turn an op-amp into an integrator, for example.
  • 1:14 - 1:18
    You can turn it into a summer which is just an adder and things like that.
  • 1:18 - 1:22
    So, they are really useful circuit building blocks but the main thing we've got to look
  • 1:22 - 1:26
    at is the operational amplifier as an actual amplifier,
  • 1:26 - 1:28
    because that's what they're most commonly used for
  • 1:28 - 1:31
    and probably what you'll mostly use them for as well.
  • 1:31 - 1:34
    So, an op-amp is essentially just an amplifier.
  • 1:34 - 1:36
    Yes, it can be used for those mathematical operations
  • 1:36 - 1:39
    but essentially, what it comes down to is
  • 1:39 - 1:44
    this is a differential amplifier and what that means is that,
  • 1:44 - 1:46
    it's got two inputs over here which we'll talk about and
  • 1:46 - 1:49
    an output and it's got some gain in there,
  • 1:49 - 1:52
    because amplifies have a gain.
  • 1:52 - 1:56
    What it does is it takes the difference between these two input signals,
  • 1:56 - 2:00
    amplifies it by its internal gain or what's called open loop gain,
  • 2:00 - 2:03
    and gives you an output voltage.
  • 2:03 - 2:09
    But op-amps really can't be used as differential amplifiers on their own,
  • 2:09 - 2:11
    even though that's what they are.
  • 2:11 - 2:15
    Rather confusing, but an important aspect you should understand.
  • 2:15 - 2:19
    So, why can't this be used as just a differential amplifier,
  • 2:19 - 2:22
    input signal here, output signal with some gain in there?
  • 2:22 - 2:26
    Well, the answer is they are not designed to be used as differential amplifiers as
  • 2:26 - 2:30
    strange as that may seem because they are essentially differential amplifiers.
  • 2:30 - 2:34
    That was that hard circuit you saw over here before was actually
  • 2:34 - 2:38
    the internal circuitry of an op-amp showing it as a differential amplifier.
  • 2:38 - 2:41
    But hey, let's forget about differential amplifiers.
  • 2:41 - 2:45
    I shouldn't even mentioned it, but it is important to understand
  • 2:45 - 2:49
    the operation of how an op-amp actually works.
  • 2:49 - 2:51
    Now, the reason they don't work as differential amplifiers is
  • 2:51 - 2:54
    because the op-amp, the natural gain,
  • 2:54 - 2:59
    the internal natural gain of the op-amp is enormous and that's
  • 2:59 - 3:04
    the first thing you need to know about op-amps is it's not quite infinite,
  • 3:04 - 3:07
    but you can think of it as infinitely large.
  • 3:07 - 3:09
    It's like millions of times and well,
  • 3:09 - 3:11
    the datasheet won't even tell you.
  • 3:11 - 3:14
    So, if we just try to use an op-amp like this with
  • 3:14 - 3:19
    no external circuitry and just feed like one millivolt on the input here,
  • 3:19 - 3:23
    the gain is so large that the output voltage is going to be so
  • 3:23 - 3:27
    huge that it's just not a practical device at all.
  • 3:27 - 3:30
    So, that's why you never see an op-amp without
  • 3:30 - 3:34
    any external circuitry or what's called negative feedback.
  • 3:34 - 3:35
    So, that brings us to
  • 3:35 - 3:40
    our first practical application for the op-amp which is a comparator.
  • 3:40 - 3:43
    Before we look at that, we will look at the symbol here.
  • 3:43 - 3:46
    Now, an op-amp is typically drawn as a triangle like this.
  • 3:46 - 3:49
    It's got two inputs over here and one input here.
  • 3:49 - 3:53
    Sometimes, it might be flipped depending on the ease of
  • 3:53 - 3:57
    drawing your circuit and the way the signal flows but it's exactly the same thing.
  • 3:57 - 3:59
    Now, these two inputs here,
  • 3:59 - 4:04
    the positive input is called the non-inverting input.
  • 4:04 - 4:06
    Easy to remember because it's positive.
  • 4:06 - 4:10
    The inverting input is likewise easy to remember because it's negative.
  • 4:10 - 4:12
    Negative inverts something.
  • 4:12 - 4:17
    So, that's the terminology you should be using when referring to op-amp's.
  • 4:17 - 4:19
    Very important to get the terminology right otherwise,
  • 4:19 - 4:21
    you'll sound like a bit of a deal.
  • 4:21 - 4:23
    Now, there's an output pin here,
  • 4:23 - 4:25
    easy and there's two power supply pins,
  • 4:25 - 4:28
    a positive and a negative one, which we'll talk about as well.
  • 4:28 - 4:31
    So, I mentioned that the gain of an op-amp
  • 4:31 - 4:36
    naturally inside is designed to be enormous, almost infinite.
  • 4:36 - 4:40
    So, what happens if you just feed voltage on the input here?
  • 4:40 - 4:45
    Well, let's assume that we have one volt on our non-inverting input here and we have
  • 4:45 - 4:53
    1.01 volts or slightly above 10 millivolts or even one millivolt above this one here.
  • 4:53 - 4:55
    Well, the amplifier will actually amplify
  • 4:55 - 4:59
    the difference or attempt to amplify the difference between these two inputs.
  • 4:59 - 5:07
    So, the output here will be this huge gain like a million times that one millivolt.
  • 5:07 - 5:12
    So, it'll try and output hundreds and hundreds of thousands of volts and well,
  • 5:12 - 5:16
    it can't do it because well your circuit is only 5,10,15 volts something like that.
  • 5:16 - 5:19
    So, your output is going to saturate.
  • 5:19 - 5:23
    So, if you've got one volt here and let's say,
  • 5:23 - 5:31
    1.001 volts here, then your output is going to go boom right up to V plus.
  • 5:31 - 5:35
    It's just going to saturate right up at the positive voltage.
  • 5:35 - 5:38
    So, we've got ourselves a comparator and likewise,
  • 5:38 - 5:41
    if you switch those voltages around so that
  • 5:41 - 5:46
    the non-inverting input is bigger than the inverting input even by a tiny amount.
  • 5:46 - 5:52
    Bingo. Your output is then going to go from positive and it's going
  • 5:52 - 5:57
    to slam right down to the negative right down here.
  • 5:57 - 6:01
    So, you can see that it's just used as a comparator.
  • 6:01 - 6:03
    It's going to be a very crude comparator,
  • 6:03 - 6:06
    and you can use an op-amp as a comparator in a pinch,
  • 6:06 - 6:12
    but they are quite as good as a proper comparator that you can actually buy.
  • 6:12 - 6:13
    They're designed to be comparators,
  • 6:13 - 6:17
    but hey, we can actually use op-amps as comparators.
  • 6:17 - 6:21
    But that's what happens if you connect an op-amp with
  • 6:21 - 6:26
    no feedback at all and what that's called is the open loop configuration.
  • 6:26 - 6:28
    Because there is no loop. There's no loop.
  • 6:28 - 6:31
    The loop is open and we'll close the loop in a minute.
  • 6:31 - 6:34
    But with an open-loop configuration like that,
  • 6:34 - 6:37
    an op-amp is just a comparator.
  • 6:37 - 6:41
    So, now, that we've got that little non-circuiter out of the way,
  • 6:41 - 6:44
    the odd bowl configuration of the comparator for the op-amp,
  • 6:44 - 6:48
    let's have a look at what way op-amps come really useful,
  • 6:48 - 6:50
    and that's as proper amplifiers.
  • 6:50 - 6:52
    Now, to do that, as I said,
  • 6:52 - 6:56
    we need to go from the open-loop configuration with
  • 6:56 - 6:59
    no feedback to adding what's called negative feedback,
  • 6:59 - 7:02
    and hence, the t-shirt, negative feedback.
  • 7:02 - 7:08
    Once you do that, op-amps become incredibly useful and powerful devices.
  • 7:08 - 7:11
    Now, there are two rules with op-amps.
  • 7:11 - 7:13
    That's all you have to remember.
  • 7:13 - 7:16
    It's fantastic. This is how easy op-amps are.
  • 7:16 - 7:19
    If you know these two rules, if you remember these two rules,
  • 7:19 - 7:23
    you can analyze practically any op-amp circuit.
  • 7:23 - 7:27
    You can't get into the real nitty-gritty details of the performance of it perhaps,
  • 7:27 - 7:31
    but you can look at a schematic and you can understand how it works,
  • 7:31 - 7:34
    and the two rules are very simple.
  • 7:34 - 7:40
    Rule number one, no current flows in or out of these inputs.
  • 7:40 - 7:48
    So, there's nothing flowing in or out of these two input pins, ever. That's it.
  • 7:48 - 7:53
    Nothing. Nothing flows in or out regardless of how you connect the circuit out,
  • 7:53 - 7:57
    whether it was the open-loop comparator configuration we saw before,
  • 7:57 - 8:01
    or whether or not, it's a closed loop configuration and
  • 8:01 - 8:04
    inverting or non-inverting amplifiers we're going to look at,
  • 8:04 - 8:06
    nothing flows in or out.
  • 8:06 - 8:08
    Rule number two.
  • 8:08 - 8:13
    Now, this rule only applies when you have a closed loop like this.
  • 8:13 - 8:16
    It doesn't apply at all to the open loop.
  • 8:16 - 8:18
    One we just saw with the comparator.
  • 8:18 - 8:20
    That's why I did the comparative first even though
  • 8:20 - 8:23
    it might have been a little bit confusing to stop that way.
  • 8:23 - 8:26
    Most people stop op-amp explanations with these two rules.
  • 8:26 - 8:30
    But I wanted to show you that comparative first because to highlight,
  • 8:30 - 8:34
    that rule number two it does not apply or only applies
  • 8:34 - 8:38
    to closed loop configurations with negative feedback.
  • 8:38 - 8:45
    Now, rule number two is the op-amp does whatever it can internally.
  • 8:45 - 8:48
    Internal circuitry, which we won't go into, but it does whatever
  • 8:48 - 8:53
    it can to keep these two input voltages the same.
  • 8:53 - 8:58
    Now, the op-amp can't actually change its input voltage.
  • 8:58 - 9:03
    These are inputs, it has no way to actually drive a voltage out and keep them the same,
  • 9:03 - 9:06
    but it can do it with feedback,
  • 9:06 - 9:10
    and that's why this rule only applies to closed loop configuration.
  • 9:10 - 9:13
    So, the op-amp only has control over its output.
  • 9:13 - 9:17
    But if you have feedback, it will change this output voltage to make
  • 9:17 - 9:21
    sure this input equals this input here,
  • 9:21 - 9:25
    and that's a very powerful rule of op-amps.
  • 9:25 - 9:28
    If you see a closed loop configuration like this,
  • 9:28 - 9:31
    you can be pretty sure, that rule, is going to apply.
  • 9:31 - 9:33
    So, using these two rules,
  • 9:33 - 9:37
    let's look at the simplest op-amp configuration possible,
  • 9:37 - 9:38
    and it's not this.
  • 9:38 - 9:41
    It actually has no external components.
  • 9:41 - 9:46
    So, what it has is the output tied back to the inverting input like
  • 9:46 - 9:48
    this and your phages signal or your voltage
  • 9:48 - 9:51
    into the non-inverting positive input like that,
  • 9:51 - 9:54
    and this is called an op-amp buffer.
  • 9:54 - 9:56
    So, using our two rules,
  • 9:56 - 10:00
    very easy to analyze this op-amp buffer circuit.
  • 10:00 - 10:03
    Let's just do DC, because op-amps.
  • 10:03 - 10:08
    The other thing is op-amps are DC coupled amplifiers like
  • 10:08 - 10:14
    an amplified DC as well as AC signals. It's very important property.
  • 10:14 - 10:17
    So, but let's do the DC case.
  • 10:17 - 10:21
    We're fading one volt into a non-inverting input here.
  • 10:21 - 10:23
    What do we get on the output of our op-amp?
  • 10:23 - 10:31
    Well, look, rule number 2, always applies. When you've got feedback in an op-amp circuit.
  • 10:31 - 10:36
    The op-amp tries to keep these two input voltages identical.
  • 10:36 - 10:39
    So, because of the rule, this inverting input here,
  • 10:39 - 10:42
    is going to be equal to this pin up here.
  • 10:42 - 10:48
    The op-amp will ensure that by driving this output to get this input to match this one.
  • 10:48 - 10:49
    So, if you got one volt here,
  • 10:49 - 10:51
    then we've got one volt here,
  • 10:51 - 10:53
    and because it's just connected by a bit of wire,
  • 10:53 - 10:55
    we got to get one volt out here.
  • 10:55 - 10:57
    That's why it's called a buffer.
  • 10:57 - 11:01
    It's not an amplifier because there is no gain.
  • 11:01 - 11:02
    One volt in, one volt out,
  • 11:02 - 11:05
    minus one volt in, minus one volt out.
  • 11:05 - 11:07
    Whatever the voltage is within
  • 11:07 - 11:12
    the limits of the power supply voltages you see. What you see is that?
  • 11:12 - 11:17
    Well, rule number 1. No current flows in or out of the inputs.
  • 11:17 - 11:20
    So, nothing, no current flows in.
  • 11:20 - 11:22
    So, if you've got a load over here, I don't know,
  • 11:22 - 11:25
    it could be some sort of sensor or whatever.
  • 11:25 - 11:32
    It could be a low pass filter. For example, like you're fading a pulse with
  • 11:32 - 11:35
    modulated signal from your micro-controller or something like that,
  • 11:35 - 11:38
    and then you want to buffer that voltage off there.
  • 11:38 - 11:40
    Because no current flows into the input.
  • 11:40 - 11:45
    This op-amp does not disturb your sensor or your circuit
  • 11:45 - 11:47
    that you're actually trying to do.
  • 11:47 - 11:52
    It's what's called a very high impedance input, essentially open circuits.
  • 11:52 - 11:54
    So, it doesn't disturb anything you hook up to it.
  • 11:54 - 11:59
    But the op-amp has what's called a low impedance output,
  • 11:59 - 12:02
    so it can drive a reasonable amount of current,
  • 12:02 - 12:04
    milli-amps, tens of milli-amps.
  • 12:04 - 12:08
    That sought of things some can go as high as a couple of 100 milli-amps via power op-amps,
  • 12:08 - 12:10
    but it can drive a reasonable amount of current.
  • 12:10 - 12:13
    So, that's why it's buffering the signal,
  • 12:13 - 12:17
    a high impedance signal and giving you a low impedance output.
  • 12:17 - 12:22
    Just allows you to drive things with a sensitive input like that.
  • 12:22 - 12:26
    Pretty easy. Very useful configuration, the op-amp buffer.
  • 12:26 - 12:29
    Now the next configuration we're going to take a look at
  • 12:29 - 12:32
    is what's called the non-inverting amplifier,
  • 12:32 - 12:36
    and this is where we tie him L op-amp based that huge,
  • 12:36 - 12:41
    unwieldy gain that changes everywhere with temperature and it's horrible.
  • 12:41 - 12:44
    Anyway, it's got this massive unusable gain in there as
  • 12:44 - 12:48
    a differential amplifier but as a single ended amplifier,
  • 12:48 - 12:50
    that's what single end domains you fade input here,
  • 12:50 - 12:52
    and it's always referenced to ground.
  • 12:52 - 12:56
    We can use these as a single ended amplifier,
  • 12:56 - 13:01
    and we can time that gain by adding negative feedback on it,
  • 13:01 - 13:05
    and I want to explain negative and positive feedback in the mechanisms and how it works.
  • 13:05 - 13:08
    Because, well, that's for a more advanced topic.
  • 13:08 - 13:11
    But anyway, we fade in a feedback resistor here.
  • 13:11 - 13:12
    Just like we did before,
  • 13:12 - 13:16
    we showed it up but we put a resistor in there and we put a resistor back down to ground.
  • 13:16 - 13:20
    So, what it's doing now is this input, the inverting input,
  • 13:20 - 13:25
    is taking a small portion. This feedback resistor we'll call R_f,
  • 13:25 - 13:29
    is always bigger than R_1 here.
  • 13:29 - 13:35
    So, we've just got a voltage divider here that feeds back a smallest part of the input,
  • 13:35 - 13:37
    and that's essentially what negative feedback it.
  • 13:37 - 13:42
    You're taking a part of the output and you're feeding it back to the input,
  • 13:42 - 13:45
    and there's a very simple formula you need to remember for
  • 13:45 - 13:49
    this non-inverting amplifier configuration.
  • 13:49 - 13:54
    I won't try and derive it, but the gain of this amplifier or what's called A_v,
  • 13:54 - 13:55
    that's the actual terminology used.
  • 13:55 - 13:58
    A_v is just gain. You can use gain.
  • 13:58 - 14:03
    Gain equals R_f. The feedback resistor divided by R_1,
  • 14:03 - 14:06
    which goes down to ground here, plus one.
  • 14:06 - 14:09
    You've got to add that plus one on there. So, easy.
  • 14:09 - 14:12
    If we've got annoying k feedback resistor and a 1K,
  • 14:12 - 14:14
    resistor down to ground here.
  • 14:14 - 14:20
    Now, gain is 9_k or 1K or nine plus one, a gain is equal to 10.
  • 14:20 - 14:26
    So, if we fade one volt into the input here, will get 10 volts on the output, easy.
  • 14:26 - 14:29
    Because we have got positive and negative rials which we'll get into,
  • 14:29 - 14:34
    we can feed Ac or DC signals into here about ground
  • 14:34 - 14:39
    and so we can feed negative one volt into here and we'll get negative 10 volts out.
  • 14:39 - 14:40
    So, there you go.
  • 14:40 - 14:45
    That is the basic configuration of a non-inverting amplifier.
  • 14:45 - 14:47
    You might see weird configurations.
  • 14:47 - 14:51
    They might be a capacitor across here or something like that,
  • 14:51 - 14:52
    which we won't get into in this one.
  • 14:52 - 14:55
    But the configuration is the same,
  • 14:55 - 14:57
    if you see your input being fed into
  • 14:57 - 15:02
    the non-inverting input and the feedback going back to the inverting input,
  • 15:02 - 15:05
    you know that's a non-inverting amplifier,
  • 15:05 - 15:08
    and this formula here applies.
  • 15:08 - 15:13
    From this formula, you can also see why our buffer amplifier had a gain of one before,
  • 15:13 - 15:17
    because their feedback resistor is zero, was zero.
  • 15:17 - 15:20
    So, zero on one here which was infinite.
  • 15:20 - 15:27
    So zero on over infinity or very large value is zero plus one.
  • 15:27 - 15:29
    So, our gain is one.
  • 15:29 - 15:32
    That's why our buffer had a gain of one, easy.
  • 15:32 - 15:37
    The math doesn't lie. So, now we get onto the second of our two major configurations.
  • 15:37 - 15:40
    We've already looked at the first one, which was the non-inverting amplifier.
  • 15:40 - 15:43
    The buffer, was just a variation of that.
  • 15:43 - 15:46
    Now, we have, instead of the non-inverting amplifier,
  • 15:46 - 15:49
    we have the inverting amplifier.
  • 15:49 - 15:51
    How can you tell it's an inverting amplifier?
  • 15:51 - 15:54
    Well, just like before, we could tell it was a non-inverting
  • 15:54 - 15:57
    one by the signal going into the positive input, here.
  • 15:57 - 16:00
    The non-inverting input, hence, the name non inverting amplifier,
  • 16:00 - 16:07
    our signaled nail goes into our inverting amplifier pin.
  • 16:07 - 16:10
    So, hence, it's called an inverting amplifier.
  • 16:10 - 16:13
    You'll notice that I've switched the two symbols around here.
  • 16:13 - 16:15
    The positive is now on the bottom.
  • 16:15 - 16:21
    Now, op-amp hasn't changed, I've just done that visually to make it a bit easier here,
  • 16:21 - 16:24
    and that's what you'll commonly find in schematics
  • 16:24 - 16:27
    and CAD packages and all stuff you might find them flipped around,
  • 16:27 - 16:29
    upside down back to front.
  • 16:29 - 16:31
    Whoop-de-doo, all going all around the place.
  • 16:31 - 16:34
    Some pointing down for various feedback possible.
  • 16:34 - 16:37
    So, that's exactly the same op-amp.
  • 16:37 - 16:39
    It's just visually different.
  • 16:39 - 16:40
    You can draw it anyway you all want.
  • 16:40 - 16:44
    Now, our inverting amplifier, that this one is,
  • 16:44 - 16:47
    we have the same as before. We have our feedback resistor,
  • 16:47 - 16:54
    we have our negative feedback going to, in this case, our inverting amplifier pin,
  • 16:54 - 16:56
    instead of our non-inverting one.
  • 16:56 - 17:02
    So, now we are feeding out input through the resistor here.
  • 17:02 - 17:04
    So, it's a different configuration, our signal is not going
  • 17:04 - 17:08
    directly into the non-inverting pin.
  • 17:08 - 17:12
    This brings up our next really important concept with op-amp that you
  • 17:12 - 17:14
    really need to understand.
  • 17:14 - 17:20
    Here's where rule number 1, really comes into play in trying to analyze this thing.
  • 17:20 - 17:23
    It's called virtual ground. Stick with me.
  • 17:23 - 17:26
    So, once again, how do we analyze this?
  • 17:26 - 17:29
    Always go back to your two rules.
  • 17:29 - 17:31
    What's our second rule here?
  • 17:31 - 17:33
    The op-amp tries to keep the input voltages the same.
  • 17:33 - 17:37
    In fact, it will, if you've got this non-inverting configuration
  • 17:37 - 17:39
    and you haven't hit the rails yet.
  • 17:39 - 17:41
    So, if the amplifier is working normally,
  • 17:41 - 17:44
    within normal bounds of your past [inaudible] rail,
  • 17:44 - 17:48
    these two inputs will always be the same.
  • 17:48 - 17:54
    So, we're actually connected our non-inverting input down to ground here.
  • 17:54 - 17:57
    It's connected to ground. We forced it to ground.
  • 17:57 - 17:58
    It's never going to change.
  • 17:58 - 18:02
    So, what is the inverting input here going to do?
  • 18:02 - 18:06
    Well, of course, rule number 2, it's going to be identical, it's going to be the same.
  • 18:06 - 18:09
    So, this point is also going to be ground or zero volts.
  • 18:09 - 18:14
    So, this seems like almost like a pointless circuit,
  • 18:14 - 18:16
    because look at rule number 1, no current flows in or out.
  • 18:16 - 18:22
    So, there's no current flowing in or out of that pin and its ground.
  • 18:22 - 18:28
    We've got both pins grounded and no current flows in or out.
  • 18:28 - 18:31
    So, what's the point of having an op-amp?
  • 18:31 - 18:33
    It's very confusing concept.
  • 18:33 - 18:38
    But once you grasp it, you go, ugh, it's easy and it's quite brilliant.
  • 18:38 - 18:41
    So, the op-amp you, remember, does whatever it needs to
  • 18:41 - 18:44
    on the output drives it to whatever voltage
  • 18:44 - 18:46
    positive and negative in order to make sure that
  • 18:46 - 18:50
    this inverting pin here is equal to the non-inverting pin down here.
  • 18:50 - 18:53
    Makes them the same. We've force this pin,
  • 18:53 - 18:54
    so it can't change this pin.
  • 18:54 - 18:57
    All it can do is change the voltage
  • 18:57 - 19:01
    via the nature of the feedback resistor here to make this zero.
  • 19:01 - 19:05
    Trust me, we'll do a practical measurement of this in a minute.
  • 19:05 - 19:08
    This node here will actually be zero volts.
  • 19:08 - 19:11
    This confuses the heck out of a lot of beginners.
  • 19:11 - 19:13
    They build up their op-amps circuit, they start probing
  • 19:13 - 19:16
    around and they've got their input signal here.
  • 19:16 - 19:17
    It's a one kilohertz, one volt, side way, for example.
  • 19:17 - 19:23
    And here's how they measure. This side of the resistor and the signals there.
  • 19:23 - 19:25
    They measure this side of the resistor.
  • 19:25 - 19:27
    It's ground, the signals is vanished.
  • 19:27 - 19:32
    where's it gone? Strange, but true.
  • 19:32 - 19:37
    So, let's follow this through and use our rules and see if we can analyze this circuit.
  • 19:37 - 19:40
    Once again, the DC case to make it easy.
  • 19:40 - 19:44
    We have got one volt on the input here.
  • 19:44 - 19:47
    Positive one volt with respect to ground of course.
  • 19:47 - 19:49
    Now, we've said before, that trust me,
  • 19:49 - 19:52
    we'll measure it later but this pin is going to be ground.
  • 19:52 - 19:55
    It is going to be zero volts there always.
  • 19:55 - 20:01
    So, all we have got is one volt across our R_1 here, which is 1K. So,
  • 20:01 - 20:05
    we're going to have, one milli-amp flowing through there.
  • 20:05 - 20:07
    Where does it flow?
  • 20:07 - 20:11
    Well, it doesn't flow down here to ground.
  • 20:11 - 20:14
    How can it? Because no current. Rule number 1.
  • 20:14 - 20:18
    No current flows into or out of the input pins.
  • 20:18 - 20:20
    So, it can't flow through the ground here.
  • 20:20 - 20:24
    It has to flow. It's going through here, it's going somewhere.
  • 20:24 - 20:26
    There's one volt across that 1K resistor,
  • 20:26 - 20:29
    Ohm's law, always that must be obeyed.
  • 20:29 - 20:31
    So, that current is flowing, trust me.
  • 20:31 - 20:33
    It can't flow into the input pin.
  • 20:33 - 20:34
    When we know it's high impedance,
  • 20:34 - 20:38
    so it must be flowing up here like this through
  • 20:38 - 20:42
    this 10K resistor and it's being sourced from the output.
  • 20:42 - 20:45
    Remember, this op-amp has internal circuitry.
  • 20:45 - 20:52
    It's got an output buffer, so it can actually drive currents into
  • 20:52 - 20:56
    and out of the various supplies back into there.
  • 20:56 - 20:59
    That is where it's sinking the current too.
  • 20:59 - 21:02
    That's the sneaky part about this.
  • 21:02 - 21:06
    Our current is now being forced up this node, here,
  • 21:06 - 21:11
    and is flowing through, in this case, feedback resistor R_f, which is 10K,
  • 21:11 - 21:13
    I made it 10 times larger you will see why in a minute,
  • 21:13 - 21:16
    then it must be flowing through this.
  • 21:16 - 21:19
    So, we must have a voltage drop across that resistor.
  • 21:19 - 21:22
    Once again, Ohm's law, always must be obeyed.
  • 21:22 - 21:26
    So, if we have got that one milli-amp flowing through our 10K there,
  • 21:26 - 21:31
    we're going to have 10 volt drop across this resistor with
  • 21:31 - 21:35
    positive here and negative here.
  • 21:35 - 21:41
    Aha, negative. These are voltages are with respect to the ground here.
  • 21:41 - 21:43
    Now, here's where it gets a little bit tricky.
  • 21:43 - 21:46
    This positive voltage here, it's we are going to get
  • 21:46 - 21:49
    the plus 10 volts across that resistor there.
  • 21:49 - 21:55
    But because this pin is positive, but were forced, we know these pin is zero, okay.
  • 21:55 - 21:59
    We know it's zero because we've forced it by Y of the op-amp action
  • 21:59 - 22:03
    and rule number 2 here, in what's called a virtual ground ,
  • 22:03 - 22:04
    which I'll talk about in a minute.
  • 22:04 - 22:08
    Then we have, that means, if this is ground,
  • 22:08 - 22:15
    this is positive then we've got minus 10 volts coming out of here.
  • 22:15 - 22:21
    Bingo. There's our inverting amplifier one vote in minus 10 volts out.
  • 22:21 - 22:30
    So, our gain, our formula A_v gain equals R_f on R_1.
  • 22:30 - 22:34
    There is no plus one with the inverting amplifier.
  • 22:34 - 22:38
    The plus one only applies to the other non-inverting configuration.
  • 22:38 - 22:41
    So, by Y of op-amp action,
  • 22:41 - 22:44
    we'll call it a negative feedback here.
  • 22:44 - 22:46
    This point, this node here,
  • 22:46 - 22:51
    at the inverting pin is what's called a virtual ground.
  • 22:51 - 22:54
    Because typically, in this configuration,
  • 22:54 - 22:58
    it is actually grounded because we've grounded this pin, it doesn't have to be,
  • 22:58 - 23:01
    we can fade other voltages into this pin and
  • 23:01 - 23:04
    offset and do all sorts of other stuff but it's still called,
  • 23:04 - 23:07
    even if you do fade another opinion here,
  • 23:07 - 23:09
    it's still called virtual ground.
  • 23:09 - 23:11
    Because it's virtual, it's not real,
  • 23:11 - 23:14
    it's not hard tied, if it was hard tied to ground,
  • 23:14 - 23:17
    if we actually tied that pin to ground,
  • 23:17 - 23:18
    this thing wouldn't work.
  • 23:18 - 23:22
    Because all of our current would flow through here.
  • 23:22 - 23:26
    Through this resistor down to ground and around like that.
  • 23:26 - 23:29
    Then this output here, well,
  • 23:29 - 23:31
    it wouldn't know what to do the output would be zero
  • 23:31 - 23:33
    because they'd be zero volts are difference in here.
  • 23:33 - 23:38
    Remember it's still a differential amplifier as such.
  • 23:38 - 23:39
    So, we've got zero votes difference here.
  • 23:39 - 23:41
    We're going to get zero out.
  • 23:41 - 23:44
    We'd have no current flowing through here and would have zero volts out.
  • 23:44 - 23:50
    So, you can see that it doesn't work unless if you tied that hard brand.
  • 23:50 - 23:54
    But when it becomes a virtual ground by nature of the op-amp action,
  • 23:54 - 23:56
    it will magically works.
  • 23:56 - 23:57
    I hope that makes sense.
  • 23:57 - 23:59
    Because once you get it, it's really easy.
  • 23:59 - 24:02
    So, if functionality wise it's pretty much exactly like
  • 24:02 - 24:05
    the non-inverting amplifier except it
  • 24:05 - 24:08
    inverts and that's it and the gain formula is slightly different.
  • 24:08 - 24:11
    But apart from that pretty much works exactly the same,
  • 24:11 - 24:16
    but that magic virtual ground is at play in this configuration.
  • 24:16 - 24:21
    Of course, as with op-amps there DC couples or works with DC signals.
  • 24:21 - 24:23
    You can just fade in a fixed DC voltage.
  • 24:23 - 24:27
    As I said one volt DC and would give minus 10 volts out.
  • 24:27 - 24:32
    In this case with these value resistance or we can fade in a one volt peak
  • 24:32 - 24:37
    to peak or RMS sine wave for example, about the ground.
  • 24:37 - 24:38
    So, it's centered on ground like this.
  • 24:38 - 24:41
    This is the blue waveform here.
  • 24:41 - 24:43
    Let's just say that's one volt, it's not quite the scale.
  • 24:43 - 24:48
    But you'll get the idea and then our output will be the inverse of that.
  • 24:48 - 24:50
    So, when the input rises,
  • 24:50 - 24:54
    the output goes negative because it's an inverting amplifier.
  • 24:54 - 24:56
    Now, of course one of the disadvantages of
  • 24:56 - 24:59
    the inverting amplifier compared to the non-inverting we saw
  • 24:59 - 25:04
    before is that as you can see there is input current coming from your load here.
  • 25:04 - 25:08
    So, you don't want to use this when you have a high impedance load.
  • 25:08 - 25:12
    Because then it can change the gain equation and marks everything up.
  • 25:12 - 25:17
    That's where you want a non-inverting amplifier or at least a buffer.
  • 25:17 - 25:19
    Some people will actually follow,
  • 25:19 - 25:24
    will put a buffer on the input here and then drive the inverting amplifier.
  • 25:24 - 25:26
    But usually in that sort of case,
  • 25:26 - 25:28
    you'd probably use a non-inverting amplifier.
  • 25:28 - 25:34
    Now, we have to go deeper into this and talk about the power supplies and split rials
  • 25:34 - 25:37
    and all these sort of stuff and that
  • 25:37 - 25:41
    single supply op-amps or try and keep it as brief as possible.
  • 25:41 - 25:42
    Because assorting this configuration,
  • 25:42 - 25:45
    the op-amp only has two power pins.
  • 25:45 - 25:49
    It's usually called V plus and V minus.
  • 25:49 - 25:51
    Now, v minus you can actually
  • 25:51 - 25:55
    connect that to ground there is nothing regardless of what the daughter
  • 25:55 - 25:58
    she's telling you there's nothing inherent in op-amps that
  • 25:58 - 26:01
    make them really a single supply op-amps.
  • 26:01 - 26:05
    So, you can take an op-amp that is V plus and V minus and
  • 26:05 - 26:09
    connect these down to ground like that.
  • 26:09 - 26:11
    There's nothing to stop you as long as you meet
  • 26:11 - 26:16
    the minimum voltage specification and don't exceed the maximum etc.
  • 26:16 - 26:18
    So, what happens if we did that in this case?
  • 26:18 - 26:22
    Our input is a non-inverting input is also grounded here.
  • 26:22 - 26:25
    Well, now it becomes a problem.
  • 26:25 - 26:28
    You get into the practical limitations of op-amps.
  • 26:28 - 26:32
    We've been talking about what's called an ideal op-amp up until this point.
  • 26:32 - 26:35
    These rules here aren't strictly true,
  • 26:35 - 26:39
    I lied but they still a fantastic way,
  • 26:39 - 26:44
    even professionals use to analyze these circuits as a first order, as a first pass.
  • 26:44 - 26:45
    No current flows in or out.
  • 26:45 - 26:48
    Well, if you've been watching my videos you know I've done
  • 26:48 - 26:52
    a previous video on this talking about input bias currents.
  • 26:52 - 26:55
    A little itty bitty teeny-weeny currents can flow
  • 26:55 - 27:00
    into and out of these pins depending on what type of op-amp you're actually got.
  • 27:00 - 27:04
    That's a real practical limitation of these things.
  • 27:04 - 27:06
    The other one is that,
  • 27:06 - 27:10
    I talked about in previous video which I'll link in down below if you haven't seen it.
  • 27:10 - 27:16
    The inputs cannot necessarily go right to the rials bit,
  • 27:16 - 27:18
    whether it's positive, negative,
  • 27:18 - 27:20
    reference to ground or whatever.
  • 27:20 - 27:25
    So, you can get what's called a rial to rial op-amps or rial to rial input op-amps.
  • 27:25 - 27:30
    In this case, if you had a rial to rial input op-amp then, yeah,
  • 27:30 - 27:33
    you might be able to get away with this and have
  • 27:33 - 27:39
    the non-inverting input tied down to ground like this.
  • 27:39 - 27:43
    But hang on, what's the point of that?
  • 27:43 - 27:45
    If you've only got ground,
  • 27:45 - 27:47
    this is an inverting amplifier.
  • 27:47 - 27:49
    It inverts your signal.
  • 27:49 - 27:50
    So, if you fade one volt in,
  • 27:50 - 27:56
    you are going to try the op-amp is going to try and give you minus 10 volts out.
  • 27:56 - 28:01
    But how does it do that when your supply is negative of that?
  • 28:01 - 28:04
    It doesn't work. So, you have to,
  • 28:04 - 28:06
    it's got no room to do it.
  • 28:06 - 28:08
    So, your op-amp has to always be payload in
  • 28:08 - 28:13
    the configuration that you expect your input signals to be referenced to.
  • 28:13 - 28:19
    So if we were to use the inverting op-amp configuration like this
  • 28:19 - 28:25
    with a single supply rail like this and we wanted to amplify AC signals,
  • 28:25 - 28:29
    well, the signals can't go negative like this.
  • 28:29 - 28:31
    I get a negative on the input but you never
  • 28:31 - 28:33
    go to get that negative voltage on the output.
  • 28:33 - 28:36
    But you still want to amplify a signal cleanly like this.
  • 28:36 - 28:39
    But what we need to do is the zero-point,
  • 28:39 - 28:44
    needs to go right down the bottom here like this.
  • 28:44 - 28:45
    So, we need to offset.
  • 28:45 - 28:47
    So, if that's zero volts,
  • 28:47 - 28:50
    we need to offset our input ref,
  • 28:50 - 28:54
    our input and output reference by a certain amount of voltage. How much?
  • 28:54 - 28:58
    Well, typically, half of your supply rial to maximize your headroom.
  • 28:58 - 29:00
    How do we do that? I hinted at it.
  • 29:00 - 29:04
    Before you feed in if this is V plus,
  • 29:04 - 29:06
    you'd go a V plus on two,
  • 29:06 - 29:08
    you would feed that volt is half rial.
  • 29:08 - 29:13
    They usually do that simply by putting a resistor like
  • 29:13 - 29:18
    that going to V plus and a resistor down there,
  • 29:18 - 29:19
    going down to ground,
  • 29:19 - 29:21
    and bingo voltage divider.
  • 29:21 - 29:22
    They show half rial.
  • 29:22 - 29:27
    So, we're offsetting a voltage here, a virtual ground.
  • 29:27 - 29:30
    Remember this is still called a virtual ground even though it's not going to be.
  • 29:30 - 29:32
    So, the voltage here,
  • 29:32 - 29:37
    is going to be equal to the voltage here due to our second op-amp rule.
  • 29:37 - 29:40
    So, if our power supply is 20 volts for example,
  • 29:40 - 29:46
    this point here would be half that if we make these exactly the same value.
  • 29:46 - 29:48
    Of course, mark them the same value of half rial.
  • 29:48 - 29:55
    So, we have an offset voltage here at this point and that shifts away fro up.
  • 29:55 - 29:57
    We'll see that in the practical experiments to follow.
  • 29:57 - 30:01
    Now, as I said some time back you might see some other components
  • 30:01 - 30:05
    around here like few capacitors and things like that around the circuit,
  • 30:05 - 30:10
    that is to change the bandwidth of the circuit effectively.
  • 30:10 - 30:13
    Because we're not going to go into it I'll have to do
  • 30:13 - 30:17
    a second part of this video that goes into op-amp bandwidth and things like that.
  • 30:17 - 30:22
    I have done one on cascading op-amp bandwidths which I'll linking down below.
  • 30:22 - 30:25
    But suffice it to say that
  • 30:25 - 30:29
    an ideal op-amp that we've been looking at has an infinite bandwidth.
  • 30:29 - 30:32
    It's infinite frequencies and signals but in practice,
  • 30:32 - 30:35
    no of course now you practical op-amp might have
  • 30:35 - 30:39
    a one megahertz bandwidth or a 100 kilohertz bandwidth or something like that.
  • 30:39 - 30:42
    It could be a nice fast 100 megahertz,
  • 30:42 - 30:46
    but it's always going to have a bandwidth which changes with
  • 30:46 - 30:50
    your gain or gain bandwidth product and I've done a separate video, I'll link it in.
  • 30:50 - 30:53
    But sometimes you might see a little bypass capping,
  • 30:53 - 30:56
    there might be 10 buff or a 100 buff, something like that.
  • 30:56 - 31:00
    That's just a rolling off the frequency response of that.
  • 31:00 - 31:05
    Likewise, you might see a little cap across something like this, for example,
  • 31:05 - 31:11
    if you are offsetting this thing using a single supply like this.
  • 31:11 - 31:15
    I won't go into the details but basically any noise
  • 31:15 - 31:19
    on this point here will be amplified and picked up on the virtual ground,
  • 31:19 - 31:21
    so you'll get noise on your output signal.
  • 31:21 - 31:25
    So, you might stick a big OS in one or 10 micro-farad cap
  • 31:25 - 31:30
    across here for example and really make that virtual ground really noise free.
  • 31:30 - 31:33
    But that's beyond the basics.
  • 31:33 - 31:35
    One little mistake that I noticed, oops!
  • 31:35 - 31:38
    My formula here for the inverting amplifier,
  • 31:38 - 31:42
    it needs a negative in front of it because the gain is actually native.
  • 31:42 - 31:44
    So, the gain needs,
  • 31:44 - 31:49
    in this case is not 10, it's minus 10.
  • 31:49 - 31:53
    So, just back to this voltage rial thing briefly,
  • 31:53 - 31:56
    because it is something that is rather
  • 31:56 - 31:59
    confusing because there is no ground pin on an op-amp.
  • 31:59 - 32:02
    There is only the positive and negative.
  • 32:02 - 32:03
    So, we'll, where does your reference go?
  • 32:03 - 32:06
    Well the reference is part of the external circuit.
  • 32:06 - 32:10
    In this case, back to our non-inverting amplifier configuration.
  • 32:10 - 32:12
    He's our ground reference here and then
  • 32:12 - 32:16
    our positive and negative supply is here like this.
  • 32:16 - 32:19
    I plus 15 volts and minus 15 volts.
  • 32:19 - 32:24
    If we want to fade in a signal that goes both positive and negative.
  • 32:24 - 32:27
    If we're only fading in a signal that's positive above ground
  • 32:27 - 32:32
    then this here could be tied down to here like this.
  • 32:32 - 32:35
    Then it has to be above that,
  • 32:35 - 32:38
    the output cannot magically go negative.
  • 32:38 - 32:42
    It can only go negative to a ground reference if you have
  • 32:42 - 32:46
    that minus 15 volt rialling there. Clear as mud.
  • 32:46 - 32:49
    Just like the inverting configuration,
  • 32:49 - 32:52
    if we wanted to pair on this from a split supply,
  • 32:52 - 32:55
    we can have this grounded like this and then we can add
  • 32:55 - 33:01
    a bias voltage in here like this to actually offset the voltage.
  • 33:01 - 33:04
    Then it can get into all sorts of we doing
  • 33:04 - 33:07
    wonderful things with AC coupling these amplifies.
  • 33:07 - 33:11
    All of the opening of configurations we looked at have been DC coupled,
  • 33:11 - 33:13
    but you can actually AC couple them so much.
  • 33:13 - 33:18
    Why is stopped might seem capacitors on the inputs and outputs to the op-amps.
  • 33:18 - 33:22
    Now, he's a tricky configuration which I'll briefly touch on that
  • 33:22 - 33:25
    combines the two different configurations
  • 33:25 - 33:28
    we've seen before and a couple of the things we've looked at.
  • 33:28 - 33:29
    It's the differential amplifier.
  • 33:29 - 33:31
    You know how I said op-amps are,
  • 33:31 - 33:34
    essentially a differential amplifier that's how they work,
  • 33:34 - 33:39
    but they do that in the open-loop configuration.
  • 33:39 - 33:40
    So, they hopeless, they're useless for that.
  • 33:40 - 33:47
    But if you combine the inverting amplifier configuration that we just saw.
  • 33:47 - 33:50
    So, we've got the feedback going here our signal going in,
  • 33:50 - 33:54
    that's a standard inverting configuration.
  • 33:54 - 34:00
    We have exactly those two resistors that we saw before to buyers that voltage up.
  • 34:00 - 34:02
    But instead of going to the supplier rial,
  • 34:02 - 34:09
    we make that other differential input and bingo it becomes a differential amplifier.
  • 34:09 - 34:13
    I'll let you go through the actual calculation yourself to find out.
  • 34:13 - 34:15
    But basically, the difference that we fading in,
  • 34:15 - 34:19
    if we fade it in any one volt into here and 1.1 volts into here,
  • 34:19 - 34:21
    we have a difference of 0.1 volts and
  • 34:21 - 34:25
    the gain of this amplifier exactly like the inverting configuration,
  • 34:25 - 34:30
    negative R_2, on R_1 we used R F before I'll call it R_2 here.
  • 34:30 - 34:33
    So, R_2 on R_1 10K on 1K.
  • 34:33 - 34:36
    We have a gain and you're going to add negative in there.
  • 34:36 - 34:38
    So, it's a gain of minus 10.
  • 34:38 - 34:41
    But because L bias voltages is not fixed it's
  • 34:41 - 34:47
    actually the differential input signal. Look what happens.
  • 34:47 - 34:48
    We got one volt here.
  • 34:48 - 34:50
    We've got a divider it here.
  • 34:50 - 34:52
    R_1 these two values are the same,
  • 34:52 - 34:53
    R_1 is equal to R_1 here,
  • 34:53 - 34:55
    R_2 is equal to R_2 here.
  • 34:55 - 35:01
    They must match precisely to get good common mode rejection ratio which we won't go into.
  • 35:01 - 35:04
    But suffice it to say if I got one volt on this point here relative to ground,
  • 35:04 - 35:09
    we'll have 0.99999 repaid out at that point there,
  • 35:09 - 35:11
    and that becomes our virtual ground.
  • 35:11 - 35:13
    Bingo, I will have that same voltage there,
  • 35:13 - 35:20
    then we'll have a 1.1 volts here that has X and then you subtract that from that,
  • 35:20 - 35:22
    that and you get X amount of current flowing through here,
  • 35:22 - 35:25
    which then must flow through the 10 K which has 1.
  • 35:25 - 35:30
    999 voltage across it subtract the difference there.
  • 35:30 - 35:34
    It's exactly the same configuration as before with the bias voltage.
  • 35:34 - 35:38
    But they will lift with an output voltage of minus one.
  • 35:38 - 35:44
    So, if amplified, the difference in our input signal by the gain here 10.
  • 35:44 - 35:49
    It's not a terrific differential amplifier, but it works.
  • 35:49 - 35:54
    So, we've timed out op-amp that is a differential amplifier anyway, but pretty unusable.
  • 35:54 - 35:58
    We've actually made it into a pretty usable differential amplifier.
  • 35:58 - 36:00
    Beauty. Just combines both of
  • 36:00 - 36:05
    those techniques and there's lots of tricky stuff like this you can do with op-amps,
  • 36:05 - 36:09
    and just briefly another one of these tricky configurations goes back to the name
  • 36:09 - 36:13
    the operational amplifier and one of those mathematical operations the integrator.
  • 36:13 - 36:15
    We won't go into integrals and all that sort of stuff.
  • 36:15 - 36:22
    But what we can do basic inverting configuration here instead of a feedback resistor,
  • 36:22 - 36:25
    we have a feedback capacitor. What does that do?
  • 36:25 - 36:29
    Well, L standard input voltage here following the rule
  • 36:29 - 36:34
    no current flows in but we have a virtual ground of course rule number two.
  • 36:34 - 36:36
    So, if that's one K,
  • 36:36 - 36:40
    and that's one volt there where we have one milli-amp flowing through that resistor.
  • 36:40 - 36:42
    Where does it flow?
  • 36:42 - 36:43
    Can't flow into the op-amp,
  • 36:43 - 36:47
    it's got to flow up here and through the capacitor.
  • 36:47 - 36:53
    So, you've got effectively a constant current of one milli-amp.
  • 36:53 - 36:57
    This is now a constant current flowing through this resistor.
  • 36:57 - 37:01
    When you have a constant current flowing through a capacitor,
  • 37:01 - 37:04
    you end up with.
  • 37:04 - 37:08
    >> Well, in this case, it's going to ramp negative, down like that.
  • 37:08 - 37:14
    If our input is a step and it goes up like that,
  • 37:14 - 37:19
    the constant current, because it takes time to charge a capacitor,
  • 37:19 - 37:23
    the voltage on the capacitor will increase like that.
  • 37:23 - 37:25
    I say increase because it's an inverting amplifier.
  • 37:25 - 37:26
    So, it's going to go negative.
  • 37:26 - 37:28
    But that's what it does,
  • 37:28 - 37:30
    and that's an integrator,
  • 37:30 - 37:35
    and that is actually a mathematical integral of your input signal.
  • 37:35 - 37:38
    Anyway, that's way too much theory,
  • 37:38 - 37:41
    more than I wanted to do and longer than I wanted to take actually.
  • 37:41 - 37:45
    But suffice it to remember that these two rules
  • 37:45 - 37:48
    of op-amps allow you to analyze practically any configuration,
  • 37:48 - 37:50
    and as a bit of homework,
  • 37:50 - 37:54
    I got to recommend you look at the summing op-amp configuration,
  • 37:54 - 37:57
    the summing amplifier, and figure out how it works because
  • 37:57 - 38:00
    you're going to be using those two rules to figure it out.
  • 38:00 - 38:01
    So, I'll leave that one up to you.
  • 38:01 - 38:03
    But enough of that, let's head on over to
  • 38:03 - 38:05
    the benchy and see if we can measure some stuff.
  • 38:05 - 38:09
    Make sure I wasn't bullshitting you about this virtual ground stuff.
  • 38:09 - 38:11
    Let's check it out. Sounds a bit sas.
  • 38:11 - 38:14
    See if it really works.
  • 38:14 - 38:15
    All right, we're at the breadboard.
  • 38:15 - 38:20
    Let's take a look at an inverting amplifier here because I wanted to show you
  • 38:20 - 38:26
    that virtual ground point there just to show you that there really is no signal there.
  • 38:26 - 38:31
    It actually vanishes in quote marks when you go from the input here to
  • 38:31 - 38:33
    here and then it magically reappears at
  • 38:33 - 38:36
    the output because that's how an op-amp works, as I've explained.
  • 38:36 - 38:39
    Anyway, it got a jellybean LM358 here.
  • 38:39 - 38:41
    It's actually a jewel op-amp.
  • 38:41 - 38:45
    So, we've just tie it off the terminated the top op-amp here.
  • 38:45 - 38:50
    We can probably do a separate video on that on how to properly terminate op-amps,
  • 38:50 - 38:52
    that might make an interesting video.
  • 38:52 - 38:54
    Thumbs up if you want to see that one.
  • 38:54 - 38:56
    Anyway, here we go, I've got a configured,
  • 38:56 - 39:00
    I've got a 10k input resistor here, 100k feedback.
  • 39:00 - 39:01
    So, we got a gain of 10.
  • 39:01 - 39:04
    The formula, of course, is the feedback resistor on that one,
  • 39:04 - 39:06
    bingo, easy, times 10.
  • 39:06 - 39:10
    So, I'm going to fade out two volts peak-to-peak input here.
  • 39:10 - 39:14
    We should get 20 volts peak-to-peak on the output.
  • 39:14 - 39:18
    So, we're using pretty much near the maximum supply rail of the LM358.
  • 39:18 - 39:21
    In this case, I'm pairing it from plus/minus 15 volts.
  • 39:21 - 39:24
    So, we have a split supply.
  • 39:24 - 39:25
    So, our ground reference,
  • 39:25 - 39:27
    our input signal is reference to a ground.
  • 39:27 - 39:29
    I should actually draw that on there.
  • 39:29 - 39:30
    There we go, that's clearer.
  • 39:30 - 39:34
    So, our input is referenced to ground
  • 39:34 - 39:38
    and our non-inverting input here is referenced to ground,
  • 39:38 - 39:40
    and our output is referenced to ground also.
  • 39:40 - 39:45
    But for signals to go negative or for output signals to go negative,
  • 39:45 - 39:48
    we need a negative rail on here.
  • 39:48 - 39:50
    So, we're using minus 15 volts.
  • 39:50 - 39:51
    So, plus 15 to pair it,
  • 39:51 - 39:52
    minus 15 as well.
  • 39:52 - 39:55
    So, 30-volt total supply on there,
  • 39:55 - 39:59
    allows us to go positive and negative signals, input and output.
  • 39:59 - 40:01
    So, let's go over to our power supply.
  • 40:01 - 40:03
    Here it is, plus/minus 15 volts.
  • 40:03 - 40:06
    I got dual tracking on there and you notice that I've joined
  • 40:06 - 40:10
    the supplies here generating the split supply.
  • 40:10 - 40:12
    So, this one actually becomes the negative.
  • 40:12 - 40:15
    So, this is our positive 15 from here to here.
  • 40:15 - 40:19
    This is our negative 15 relative to here because we've strapped the positive one.
  • 40:19 - 40:25
    However, and tada, there we go, we're feeding in.
  • 40:25 - 40:28
    We've just got a one-kilohertz low-frequency signal,
  • 40:28 - 40:31
    two volts peak-to-peak here on the input.
  • 40:31 - 40:36
    You can see our input and output wave forms and these inputs are, of course,
  • 40:36 - 40:40
    all AC coupled and their bandwidth limited as well to
  • 40:40 - 40:45
    20 megahertz to reduce the noise and we're using our high resolution mode as well.
  • 40:45 - 40:47
    So, we get some boxcar averaging in there.
  • 40:47 - 40:52
    That's why we got a nice crisp waveform like that, beautiful.
  • 40:52 - 40:55
    So, what happens if we turn our bandwidth spec to four?
  • 40:55 - 41:01
    In this case, it's my one-gigahertz Tektonics 3000 series and we turn off "Hi Res" mode,
  • 41:01 - 41:03
    going back to sample mode, there we go.
  • 41:03 - 41:07
    We get our nice fuzzy wave forms because we've got that massively high bandwidth.
  • 41:07 - 41:09
    That's the advantage. You can't go into averaging, of course,
  • 41:09 - 41:13
    but "Hi Res" mode does boxcar averaging, just cleans it up.
  • 41:13 - 41:16
    Of course, you can do envelope mode look at that, pretty horrible waveform.
  • 41:16 - 41:18
    So, in looking at this sort of stuff,
  • 41:18 - 41:21
    you definitely don't want to use your regular mode.
  • 41:21 - 41:23
    You want "Hi Res" mode if you've got it.
  • 41:23 - 41:26
    There you go, we're getting exactly what we expect.
  • 41:26 - 41:29
    Look at that, the two volts peak-to-peak in roughly 20 volts out.
  • 41:29 - 41:33
    There's probably going to be some error due to the resistors in here.
  • 41:33 - 41:35
    Anyway, we get in our times 10.
  • 41:35 - 41:38
    Of course, the blue waveform there is the input,
  • 41:38 - 41:40
    that's 500 millivolts per division.
  • 41:40 - 41:45
    So, we're getting our two volts peak-to-peak and our output is five volts per division.
  • 41:45 - 41:48
    So, which is the yellow waveform there and look at that.
  • 41:48 - 41:51
    Of course, because it's an inverting amplifier,
  • 41:51 - 41:55
    the output is exactly 180 degrees out of phase.
  • 41:55 - 41:57
    It's inverted. So, at the moment,
  • 41:57 - 41:59
    I'm probing the input and the output.
  • 41:59 - 42:01
    Now, you wanted to see the virtual ground, didn't you?
  • 42:01 - 42:03
    What happens if I move my input probe,
  • 42:03 - 42:08
    the blue waveform here from the input over to this?
  • 42:08 - 42:10
    You'd expect to see the signal.
  • 42:10 - 42:14
    But as I've told you and as you should trust me,
  • 42:14 - 42:16
    let's move the probe over.
  • 42:16 - 42:19
    >> That is our virtual ground point.
  • 42:19 - 42:22
    Look, flat has attack.
  • 42:22 - 42:24
    The signal has vanished.
  • 42:24 - 42:27
    Magic. But of course you know it's not magic,
  • 42:27 - 42:33
    it's just standard op-amp behavior with virtual ground on the input.
  • 42:33 - 42:35
    That's how an op-amp works,
  • 42:35 - 42:37
    and none of the current hasn't magically vanished.
  • 42:37 - 42:39
    The current is going through the resistor.
  • 42:39 - 42:41
    Ohm's Law still holds.
  • 42:41 - 42:44
    Current is changing because we've got an AC resistor here.
  • 42:44 - 42:49
    There's AC current flowing through this resistor and it's all flowing up here.
  • 42:49 - 42:54
    But this point, by the nature of the op-amp action and the negative feedback,
  • 42:54 - 42:56
    that is a virtual ground.
  • 42:56 - 42:58
    An op-amp rule number two there.
  • 42:58 - 42:59
    Inputs are the sign.
  • 42:59 - 43:03
    The op-amp changes the output here in
  • 43:03 - 43:08
    order to ensure that point is equal to that input there.
  • 43:08 - 43:11
    Easy. That's why we don't see any signal on there.
  • 43:11 - 43:16
    So trap for young players when you're probably being around circuits like this,
  • 43:16 - 43:18
    don't think your signal is vanished.
  • 43:18 - 43:22
    Virtual ground. Remember your op-amps rules, always.
  • 43:22 - 43:27
    Now, I actually chose the LM358 for a reason because it
  • 43:27 - 43:32
    is not like a regular op-amp and not quite like a rail to rail op-amp.
  • 43:32 - 43:34
    It's halfway in-between.
  • 43:34 - 43:36
    Check it out. Here we go.
  • 43:36 - 43:38
    It eliminates the need for dual supplies.
  • 43:38 - 43:42
    Okay. You can use it as a single supply op-amp.
  • 43:42 - 43:46
    But as I said you can use any op-amp as a single supply op-amp.
  • 43:46 - 43:49
    But this one is extra special in that it allows direct
  • 43:49 - 43:54
    sensing near ground and V-out also goes to ground.
  • 43:54 - 43:57
    So effectively, it's not rail to rail.
  • 43:57 - 44:01
    It won't go up to the all the way to the positive rail on the input and output,
  • 44:01 - 44:04
    but it will go down to ground or the
  • 44:04 - 44:08
    negative because an op-amp doesn't have a ground pin.
  • 44:08 - 44:09
    It's the negative rail.
  • 44:09 - 44:12
    So, even if we pair it from splits supplies,
  • 44:12 - 44:14
    plus minus 15 luck we are now,
  • 44:14 - 44:19
    it will still go down to that minus 15-volt pin or that pin four.
  • 44:19 - 44:21
    It'll go down the input.
  • 44:21 - 44:26
    This input here will allow to sense all the way down to the negative rail and also
  • 44:26 - 44:31
    the output will go all the way down to the negative rail and I'll demonstrate.
  • 44:31 - 44:35
    What we've got to look at here is a couple of things on the data sheet.
  • 44:35 - 44:38
    Now, input common-mode range and our voltage range here.
  • 44:38 - 44:41
    As we said, it goes all the way down to
  • 44:41 - 44:44
    that negative P and all zero volts as they call it here.
  • 44:44 - 44:46
    But on the positive side,
  • 44:46 - 44:52
    this op-amp will not go since all go to the airport less than
  • 44:52 - 44:59
    1.5 volts below or above 1.5 volts below the positive rail V plus there.
  • 44:59 - 45:03
    So, if we've got an output signal of 10 volts for example,
  • 45:03 - 45:09
    the voltage range says if we want to get an output voltage of 10 volts peak,
  • 45:09 - 45:14
    what we need a V plus rail of at least one and a half volts above that.
  • 45:14 - 45:16
    So, 11.5 volts.
  • 45:16 - 45:20
    So, what we're going to do is lower the voltages here on these rails.
  • 45:20 - 45:24
    We're going to lower V plus from 15 volts down to
  • 45:24 - 45:30
    11.5 and around about that 11.5 volts because we're getting 10 volts peak.
  • 45:30 - 45:33
    On the output, 20 volts peak-to-peak, 10 volts peak.
  • 45:33 - 45:36
    We should start seeing distortion or clipping of
  • 45:36 - 45:39
    that waveform at around about 11 and a half volts.
  • 45:39 - 45:40
    Let's see if we do.
  • 45:40 - 45:41
    Okay. So, here we go.
  • 45:41 - 45:42
    We have 15 volts.
  • 45:42 - 45:47
    I'm going to drop it down by 0.1 volts at a time and notice I have a split supply.
  • 45:47 - 45:49
    It's dual tracking.
  • 45:49 - 45:51
    So, a wave form is still looking good
  • 45:51 - 45:55
    but we expect it to start clipping around about 11 and a half.
  • 45:55 - 45:56
    It might not be precise.
  • 45:56 - 45:59
    This is not an exact value on the data shape but then we go,
  • 45:59 - 46:01
    11 and half it's still there.
  • 46:01 - 46:05
    There we go. It's starting to clip.
  • 46:05 - 46:10
    You can say it. It's actually about 11.2 volts there.
  • 46:10 - 46:14
    You can start to say wave form flattened out.
  • 46:14 - 46:21
    Now, I'll wind down even more because this is not a symmetrical supply op-amp.
  • 46:21 - 46:22
    It actually goes down to zero.
  • 46:22 - 46:26
    We don't start seeing clipping on the bottom here,
  • 46:26 - 46:29
    on the bottom rail, until a significant time.
  • 46:29 - 46:32
    After that now, we're getting both.
  • 46:32 - 46:36
    But I want it back up there and that's about 11.1 volts.
  • 46:36 - 46:39
    But we're seeing that clipping on the top and we won't
  • 46:39 - 46:42
    see it on the bottom for time after.
  • 46:42 - 46:46
    So there you go, just be aware of that and if we had
  • 46:46 - 46:52
    even a worse op-amp in this respect like LM741 or something like that,
  • 46:52 - 46:54
    that can't even go down to the negative rail,
  • 46:54 - 46:59
    we would start to see these rails clip right roughly at the same time.
  • 46:59 - 47:03
    You remember that open-loop gain I was telling you about? How large is it?
  • 47:03 - 47:06
    Well, it tells you a couple of ways in the datasheet.
  • 47:06 - 47:08
    Not all data sheets will have it, but this one does.
  • 47:08 - 47:10
    Large DC voltage gain.
  • 47:10 - 47:16
    So, it doesn't say it's open-loop gain but that is effectively the DC voltage gain,
  • 47:16 - 47:21
    is the gain of the inherent differential amplifier in there and they put it in dB.
  • 47:21 - 47:24
    So, you use your 20 log formula.
  • 47:24 - 47:29
    You reverse that and you get about a 100,000.
  • 47:29 - 47:33
    Likewise, here on the datasheet they've got another way to tell you it's called now,
  • 47:33 - 47:34
    it's called something different.
  • 47:34 - 47:37
    It's called the large signal voltage gain there,
  • 47:37 - 47:40
    it specify for a certain rail. But there we go.
  • 47:40 - 47:44
    Typically, a hundred and they specify in volts per millivolt.
  • 47:44 - 47:49
    So, if you divide 100 volts by 1 millivolt what do you get?
  • 47:49 - 47:51
    Same figure, 100,000.
  • 47:51 - 47:52
    There is your open-loop gain.
  • 47:52 - 47:56
    So, there's just a quick out practical demonstration showing the virtual ground effect
  • 47:56 - 48:01
    there and also the voltage rail limitations for positive and negative.
  • 48:01 - 48:05
    I should do another part of this video on op-amp limitations,
  • 48:05 - 48:07
    practical limitations, things like that.
  • 48:07 - 48:08
    That would be interesting.
  • 48:08 - 48:11
    Thumbs up if you want to see that one.
  • 48:11 - 48:15
    I'll leave you with one last thing. I want to explain it.
  • 48:15 - 48:17
    I'll leave it to you to try and figure out.
  • 48:17 - 48:21
    I chose these values higher than what I had on the white board there.
  • 48:21 - 48:22
    I chose them for a reason.
  • 48:22 - 48:27
    Let's lower them down to 10K and 1K here and
  • 48:27 - 48:32
    see what happens with this specific op-amp LM358.
  • 48:32 - 48:33
    Let's drop these down,
  • 48:33 - 48:35
    still quite high values,
  • 48:35 - 48:38
    1K and 10K, 10 ohms or something like that.
  • 48:38 - 48:40
    But let's give it a go.
  • 48:40 - 48:45
    There it is, a 1K input resistor, 10K feedback resistor.
  • 48:45 - 48:46
    Exactly the same gain,
  • 48:46 - 48:50
    exactly the same inputs signal but what's
  • 48:50 - 48:58
    that little funny business there and over there?
  • 48:58 - 49:02
    If we measure our virtual ground point,
  • 49:02 - 49:05
    look at these little sparks there and there
  • 49:05 - 49:10
    corresponding to that little bumping that wave form.
  • 49:10 - 49:11
    Interesting.
  • 49:11 - 49:14
    So, as professor Julius Sumner Miller said,
  • 49:14 - 49:16
    why is it so?
  • 49:16 - 49:20
    I'll leave that to you to figure out. Catch you next time.
Title:
EEVblog #600 - OpAmps Explained - What is an Operational Amplifier?
Description:

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/

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/

more » « less
Video Language:
English, British
Duration:
49:32

English subtitles

Revisions