by adafruit_support_mike » Tue Jan 08, 2013 4:47 pm
An op amp is an active device, so KVL and KCL won't help you much. In fact, the usual practice is to assume the input impedance is infinite so it's 'invisible' to KVL (doesn't cause any voltage drop) and KCL (no current flows in).
By itself, an op amp is just a very high-gain amplifier. The voltage at the output will be the difference between IN+ and IN- times, oh, 50,000 or so. If IN+ = 1v and IN- = .5v, the output will want to be (1v - .5v) * 50,000, or 25,000v. In practice, the output will just hit VCC and stop there. If IN+ = .5v and IN- = 1v, the output will want to be (.5v - 1v) * 50,000, or -25,000v. Again, in practice the output will just go to the negative rail.
The only input values that don't slam the output into one rail or the other are the ones that are very close together.. if IN+ is one microvolt higher than IN-, the output will be (1uV * 50,000) = 50mV higher than IN+. If IN+ is 1 microvolt below IN-, the output will be 50mV less than IN+.
It's more or less impossible to keep two voltages that closely in sync independently of each other, so we use passive components around the op amp so the output controls the input.
Let's say we short the output directly to IN-.. it can't do any harm since we assume both IN+ and IN- have infinite impedance. If the voltage at IN- is less than the voltage at IN+, the output will shoot towards VCC as before, but now it will drag IN- with it. You can't go from "below IN+" to "as high as the output can go" without crossing the IN+ voltage along the way, so eventually IN- will sit at exactly the same voltage as IN+. When that happens there's no reason for the output voltage to rise any more (IN+ - IN- = 0), so the upshot is that we have a circuit that pulls IN- and OUT as close to IN+ as it possibly can.
The output will resist moving away from the value of IN+ as strongly as it can.. if you try to move the voltage at IN- up 1uV, the output will pull 50mV the opposite way. That 50,000:1 gain is now fighting any attempt to move IN- away from the value of IN+.
Now let's make things a little more interesting: instead of shorting the output to IN-, let's put a 1k resistor between them. Left to itself, the circuit will still balance so IN- and OUT are exactly equal to IN+. If we pour 1mA of current into the node where the 1k resistor meets IN- though, things get interesting:
IN- has infinite impedance, so no current leaves the node through IN-. That means all the current has to leave the node through the resistor, and the far end of the resistor is tied to OUT. 1mA through 1k of resistance produces 1v, so if OUT doesn't move, the voltage at IN- will rise by 1v. We've already established that OUT is 50,000 times easier to move than IN- though, so OUT will drop until IN- is exactly equal to IN+ again.. in this case, 1v below IN+.
Now, I sort of hand-waved that 1mA into existence, so let's introduce an actual component: let's connect one end of a 100 ohm resistor to the node where IN- meets the 1k feedback resistor. To get 1mA through it, we need a voltage drop of 100mV, so the free end has to sit 100mV higher than IN- (which equals IN+). If we lower the free end to 100mV below IN+, we'll get 1mA flowing out of the IN- node, and the only thing that can supply that current is the 1k feedback resistor. OUT will rise until IN- equals IN+ and the currents flowing through both resistors are equal, and crunching those numbers puts OUT 1v above IN+. Whenever the free end of the 100R input resistor changes, the output of the op amp will move ten times as far the opposite way.. making the circuit an inverting amplifier with a voltage gain of 10.
So: by itself an op amp does little more than compare the voltage of IN+ and IN- and send the output to whichever rail leaves IN+ between IN- and OUT. The components around the op amp are what make it do interesting things. Those external components do obey KVL and KCL, but you need the assumption "if there's feedback to IN-, the voltage at IN- will always be the same as the voltage at IN+" to make the math work.
When you void a product warrany, you give up your right to sue the manufacturer if something goes wrong and accept full responsibility for whatever happens next. And then you truly own the product.