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