If you're seeing this message, it means we're having trouble loading external resources on our website.

If you're behind a web filter, please make sure that the domains *.kastatic.org and *.kasandbox.org are unblocked.

Main content

Summing op-amp

This op-amp circuit outputs the sum of two input voltages. You can do analog arithmetic on signals. Created by Willy McAllister.

Want to join the conversation?

Video transcript

- [Voiceover] Another form of an op-amp circuit is called the summing op-amp. We're gonna work through how this one works. Let's draw in here now is an inverting op-amp circuit with a single input. We're gonna call this this will be V. We'll call the VA for now. And we have V out. And we worked out what how this worked before where V out was a function of VA times the ratio of these two resistors. And now I'm gonna add a little twist to this and we're gonna analyze a different kind of circuit. So I'm gonna add another resistor right here. Like this. And a second input. We'll call this VB. And so I have RB, or sorry, RA here. This will be RB. And we'll call this R feedback. And the question again is now, what is V out in terms of the inputs, VA and VB? We're gonna use the idea of a virtual ground. Virtual ground. The idea of a virtual ground applies to most op-amp circuits, and it's a really useful way to simplify the analysis. And when we use a virtual ground one of the things I like to do is just draw a little symbol here like that, for my virtual ground. The virtual ground, as a review, if the voltage coming out of this op-amp is in a reasonable range, sort of a plus or minus 10 volts, or something like that. And because the gain of this op-amp is so enormous on the order of 100,000, or a million that means that, when this is working properly that these two voltages will be really close together. They'll be only microvolts apart, at most. And, because they're so close we can just say, let's just say they're the same for the purposes of analyzing this circuit. And, since this input is at zero volts this is at zero volts. That means that this input is very close to zero volts. So this node here this node here, we say is at a virtual ground. So let's move ahead, let's analyze this circuit and what we want to find is we want to find V out as a function of VA and VB. Let's see if we can do that. So looking at my circuit the other thing I know about op-amps that's really important always is, that the current going into an op-amp input is zero, or practically zero. And for the purposes of what we're doing here we can treat it as zero. All right. So, we have zero volts on this node. We have zero current going this way. So let's go after let's go after this current right here. Let's figure out what that is. So we'll call that I. And we can express I in terms of VA and VB in these two resistor values. So we can write I equals, now what is it? Well, we have IA here. And we have IB flowing here. That means that I equals IA plus IB. All right. And let me write IA and IB in terms of Ohms Law here. So we get I equals, what is IA? IA is this voltage divided by RA. And this voltage is VA minus zero volts. So it's VA over RA. And now let's write down what's IB? IB we look at this voltage here. This voltage is VB minus zero. Or just plain VB over RB. All right, so that's one step. We've written this current in terms of what's going on on the input side over here. Now one thing we know, because this current is zero, we know, what? We know this current is I. And, if I's going into RF we'll label the voltage on RF like that. So now let's write an expression for I in terms of RF and this voltage here. What is this voltage here? Well, let's look at the two ends. This is zero volts on this node here. And on this side it's V out. So, the current there, the current on that side equals it's zero minus V out. So minus V out divided by RF. That's Ohms Law for this resistor right here. Now we know that this current equals this current. So let's just set these two expressions together. So I'll do that over here. I can write minus V out over RF equals this one VA over RA plus VB over RB. Now we can get the final function I'm just gonna multiply through by RF on both sides. And we get V out equals take the minus sign with us minus RF over RA times VA plus RF over RB times VB. So that's our answer. That's V out as a function of VA and VB, the two inputs. And you can see that the resistor ratio, there's two resistor ratios here, that are participating in the answer. So it helps to do a little special case of this. Let's let all the resistors be the same. So we'll say that RA equals RB equals RF. And just to pick a real number we'll just say they're all equal to 10 K ohms. And let's see what this becomes now. Now we have V out equals, we still have the negative sign. So this is some sort of inversion going on here. RF over RA is one. So it's just VA. And RF over RB is one. So this says VB. So this is what gives us the nickname for this expression which is called a a summing op-amp. Let's say I want to use my summing op-amp in an application where what I want is I want V out to equal say minus two times VA plus three times VB. Okay, this is what I want. How do I do that? So, these two coefficients here are functions of the resistor values. That was our original expression up here. So what I want is RF over RA to equal two. And I want RF over RB to equal three. So I can pick values it's the same RF and so I get to adjust RA and RB in here. So I can pick component values. So if I pick RF equals 12 K ohms. Then I can pick RA equals six K. And RB equals four K. And that would give me the ratios I want and that would implement this function here. So I'm gonna go fill those out on the top schematic. We'll just write those in. And we'll go fill these in here. So what we said was RF was 12 K. RA was six K ohms. RB would be four K ohms. And we've designed a circuit that implements our summing function. So, so this is a pretty useful op-amp circuit.