Explanation of OP Amps - Page 1
Forum section: electronics / beginners

author: sonnytiger
author_rank: Frequent Contributor
timestamp: May 08, 2012, 03:26:59 am
content: So no matter how much I read up on them I can not seem to figure out how they work! I have tried a few circuits but they never work either, so I would like someone to explain to me how they would work in an audio setting, IE a guitar amp.

author: Jeff1946
author_rank: Regular Contributor
timestamp: May 08, 2012, 03:51:36 am
content: I will keep it simple. Output is the difference of the inputs times a large number (100,000). Thus the output must be connected back to the input such that the voltage is the same on both inputs. Simplest example plus input to ground and input resistor to negative input and resistor from output back to negative input. Output voltage will be negative of input voltage times output resistance divided by input resistance. The power of negative feedback is that the output is more or less independent of the gain of the op amp.This is just scratching the surface. Things get more tricky with AC circuits. Have fun.

author: sonnytiger
author_rank: Frequent Contributor
timestamp: May 08, 2012, 04:18:09 am
content: Yes this is what i came across and tried out, but it never worked right, though I was using a very old and used op amp chip, could someone recommend me a good op amp ship to do audio stuff with? simple is preferred, for now audio quality will be second.

author: Psi
author_rank: Super Contributor
timestamp: May 08, 2012, 04:29:44 am
content: If you're like me, and need a visual representation to understand things, then this site with animated opamp circuits is exactly what you need.There's nothing like seeing how stuff works visually to help get your head around it.http://talkingelectronics.com/projects/OP-AMP/OP-AMP-1.html

author: free_electron
author_rank: Super Contributor
timestamp: May 08, 2012, 06:38:15 am
content: Right.. Opamps without mathematics... Here we go. The following explanation ises the ideal model... For clarity sake. Later on i will tack on the practicalities and problems... But , for now, ideal opamp.An opamp in its pure form ( without circuitry around it ) is an element that looks at the difference between its two inputs. The output gives an amplified value of this difference.By default this amplification is very large.If you make the + input more positive than the - inpit the output will go to a very large positive value. It will actually saturate against the positive power supply of the opamp.If you make the - input more positive than the + input the output will go towards avery large negative value. In practive it will get stuck against the negative supply of the opamp.If there is NO difference between the inputs then the opamp is in rest and its output will be at half the power supply. If the opamp is powered with + and - 5 volt the output will be 0.If the opamp is powered with + 5 volts and ground the output will be 2.5 volts.Think of it as a balance. By putting weight in one of the scales it tips to one side or the other. The circuitry around an opamp is in balance if there is NO difference between the inputs.This is why opamps are also called differential amplifiers.Now. This is the basis.When we start placing components around an opamp things will start to get interesting.Let's start with the opamp in unity gain.I tie the output of the opamp to its - input.Code:________| |--|-\ || >--+---- out(1v)-----|+/I place 1 volt on the + input. Initially the opamps sees a difference. ( its output is wherever and this is also present on the - input. ). So the 'balance' reacts. The opamp will steer its output the other way. This goes on until the output has reached exactly 1 volt. At this point the balance is stable : both inputs see exactly 1 volt and the opamp is in steady state. It is happy because there is no more difference between its inputs.Great. We made a circuit that can amplify something 1 time. Not very usefull .. ( sometimes it is usefull. )Lets see if we can get this thing to amplify by two...You know the principle of a voltage divider right ? Put two resistors in series and the center tap gives you a weighted ratio ... If i take two resistors of , let's say 1 kiloohm , and place them in series. I apply 2 volts across them .. The midpoint will be at 1 volt. If i place 3 volts i get 1.5 volts in the center.If i make a divider with 1k and 9k , with the 1k at the top i will get 9/10 across the bottom resistor.Code:1k 1k0 -+---/\/\/---+----/\/\/---(+2v)| |<---(1v)--->- +1k 1k0 -+---/\/\/---+----/\/\/---(+3v)| |<--(1.5v)-->- +9k 1k0 -+---/\/\/---+----/\/\/---(+1v)| |<--(0.9v)-->- +So let's see what we can do...I connect a 1k resistor from output to - input. And another 1k from - input to ground.Code:R21kR1 --/\/\/--1k | |(0)-/\/\/--+--|-\ || >---+---- out(1v)-----------|+/I still apply 1 volt on the + input. We know the opamp is only happy if the balance is level ( there is no difference between its inputs. So, in order to get 1 volt on this - input the output needs to be at 2 volts.. We have a divider there made from two resistors. Wow! Our opamp is amplifying ! It makes 2 volts on its output , we divide that off with two resistors and feed this back.There you have it . Amplification. If you change the ratio of the resistors you can set any amplification ( technical term is 'gain') you want. If you make the resistor between out and '-' input 9 kiloohms the output needs to go to 10 volts before the opamp will see 1 volt on its - input, and the system is in balance.Code:R29kR1 --/\/\/--1k | |(0)-/\/\/--+--|-\ || >---+----- out(1v)-----------|+/ /|\|(10v)|\|/(0)So ,we have made a non- inverting amplifier. The name 'non-inverting' comes from the fact that the sign of the output remains equal to the sign of the input. If i inject +1 volt i will get a positive output. If i inject -1 volt i will get a negative output.The gain calculation is simple because we deal with a voltage divider.. Simply divide the resistor value ' over' the opamp ( the one between out and -) by the resistor value that sits between - and ground.But this is a special case where we refer to 'ground'... The opamp is oblivious to ground. It does not know what ground is.Lets look at a more universal approach. Same setup. We place 1k over the opamp , but this time we commect 1k to a 2 volts source.I still apply 1 volt to the + input.Code:R21k Ir2R1 --/\/\/-->-1k Ir1 | |2V)-/\/\/-->-----+--|-\ || >-----+----- out(1v)-----------------|+/What will the opamp do ? Well simple : the rule says 'the opamp is only in balance if there is no difference between its inputs... So it would like to see also 1 volt on the - input. I have applied 2 volts on one side. The opamp will steer its output to ... ZeroAt this point the center tap of my voltage divider is at 1 volt.The easiest way to perform the calculations, without having to memorise equations and special cases is to do the work as currents.The input of an ideal opamp is high impedant. And no current can flow in or out of it. So. I have a resistor of 1k (R1) with one end tied to 2 volts and the other end tied to a pin that would like to be at 1 volt ( or whatever level is applied to the + input ).So the voltage across R1 is : 2 volts - 1 volts = 1 volt. 1 volt Across a 1k resistor is 1 milliampere (Ir1=1mA). Now, we know that current needs to flow in a loop. And that the sum of all currents in a node is zero ( for every current entering , one needs to leave of opposite sign but same magnitude ). 1 ampere in is 1 ampere out.. 1 electron in is 1 electorn out ... No escaping the laws of physics...So we have 1 milliampere flowing towards the - input. Note the usage of the word 'towards'! It is not flowing IN the opamp! So where does it go ? Wel it can only escape through the resistor across the opamp (R2 : the one between - and putput ).So Ir2 = -Ir11milliampere through R2 gives me 1 volt across R2. Since the current is flowing the other way the sign changes. I had 1 volt on the - input and i get -1volt across the resistor R2. So my output voltage is zero.This is the fundamental equation governing opamps. All the others are special cases or simplifications. Forget those. Remember only this one.Lets say i have 2 volt on the + input , 3 volt with 3 k to the -input and 9k across the opamp. What is the output ?Code:R29k Ir2R1 --/\/\/-->-3k Ir1 | |(3V)-/\/\/-->-----+--|-\ || >-----+----- out(2v)-----------------|+/Well ,the opamp is only happy if it sees 2 volt on the - input ( because the + input sits at 2 volts, and then it will be in balance.)So , 3 volt on one side of R1 , 2 volt on the other side of R1 ... That means 1 volt across it. 1 volt over 3k is 1/3 of a milliampere. That same 1/3 needs to run through the 9k , but with opposite sign.This gives me -3 volts across R2... But i already have 2 volts on the - input. So the output sits at 2 + (-3) or -1 volt.So it is very very easy to perform this calculation. Write down the voltages , calculate a current , send the same current through the other resisotr , this results in another voltage. And you know what the output is.The same is true for the inverting opamp.Inverting opamp------------------Lets say i have a 2 volt signal with a 3k resistor to the + input. My - input sits at -1 volt. There is a 4k resistor between + input and output...I still have a voltage divider !Code:(-1V)----------------|-\| >-----+----- out(2v)--/\/\/----+-----|+/ |3k | |-----/\/\/-----4KThe opamp wants to see -1 volt at the + input because i put the + input at -1 volt.So , across the 3k resistor i have 3 volts ( 2 volts on the left , -1 volts on the right .. .). 3 volts in 3 kiloohm is 1 milliampere.1 milliampere in 4 k is 4 volts. Look at the current flow and the signs . I have -1 volts on the left of the 4 k and 4 volts across out. so the other side sits at -1 + -4 = -5 volts. and that is my output !So the equation and method works for any opamp circuit ( inverting and non inverting ) even of there is an offset applied to the other pin.no need to remember equations for when one input is ground , another for when it has an offset , another for non inverting with and without offset or even the equations for summing amplifiers !summing amplifier :----------------------Code:1k Ir3(-2V)-/\/\/-->---- R42K Ir2 | 1k Ir4(4V)-/\/\/-->-----+--/\/\/-->-1k Ir1 | |(2V)-/\/\/-->-----+--|-\ || >-----+----- out(0v)-----------------|+/the opamp wants to see 0 volts on it - input , because i have put 0 volts on its + input.let see :Ir3 : -2 volts across 1k ... = -2 mAIr2 : 4 volts across 2k = + 2 mAIr1 : 2 volts across 1K = + 2mAadd the current : -2 + +2 + +2 = +2mAthat 2mA needs to go out through R4 ... in 1k... is 2 volts. done. end of calculation !you can slap on any crazy voltage left of any of the resistors and apply an offset on the + input. it all does not matter. the working principlpe is simple : calculate the current in any of the resistors. sum them up and send the result through the resistor across the opamp. and you are done. It works for any given 'puzzle'.Opamps in ac behave exactly the same. Only this time, if you have capacitors in the loop : capacitors are frequency dependent. Instead of resistive ohms you have impedances 1/( 2 pi f c ). This gives ac currents. But the equations remains the same. Ditto for filters and anything else you can do with opamps. But, now you don;t have fixed points anymore : you need to sweep frequency and do the calculation for a number of frequencies and plot this out to create the 'bode plot'... not something to do by hand. We got 'compjoeters' to do that !Now, in practice, opamps do have delay , a maximum working frequency , and you can get current in and out of the inpts ( micro or picoampere range ). They drift a bit and the balance is not always neatly centered ( this is called offset )But all these factors just throw in a bit of extra current in the nodes and you can take that into account. In ac you also get phase shift which will affect your signal. But that stuff you do not calculate by hand. We got computers to do that...

author: amyk
author_rank: Super Contributor
timestamp: May 08, 2012, 08:29:14 am
content: Great explanation to go with your other one on transistors!Now you can combine the two in some way and explain how a common bipolar opamp like the 741 works

author: Mechatrommer
author_rank: Super Contributor
timestamp: May 08, 2012, 11:51:12 am
content: one word i found the most make sense to me is..."opamp will try to output anything" so that inverting input will equal noninverting input.

author: free_electron
author_rank: Super Contributor
timestamp: May 08, 2012, 01:22:25 pm
content: Exactly. The output will do whatever is needed to make the difference between the inputs zero.Ecen simpler : the output will do what is needed to level the balance.As for how an opamp works internally , also that is very simple.All you need is three transistors and a couple of diodes.I take two identical transistors and connect their emitters together. From each collector goes a resistor to the supply. The two bases become the two inputs.Code:VCC|-----+------| |< <> R1 > R2< <| || +-------(C)| ||/C C \|(A)----| |-----(B)|\E E /|| |------+----|(1mA)|gndThis is my differential pair.I now make a current sink with a third transistor , two diodes and a resistor or two. I pull current out of the emitters of the differential pair. This current is constant. It can not change. in the above diagram i have drawn this as a 1mA sink.in balnce both branches carry exactlye the same current : 0.5mAIf i drive one of the transistors, there will be more current there than in the other. The sum of the currents cannot change as it delivered by the current sink.So if one transistor conducts more, the other will conduct less.There is you balance... Pick up the output signal (C) in one of the collectors and put an additional amplifier stage behind it and you have an opamp.Of course the transistors need to be identical. Any difference creates offset. They also need thermal coupling.You can actually breadboard this circuit. If you take a good transistor like a bc550. You can make this work really well. You can do it also with jfets and mosfets.Now : if i increase voltage on (A) the current there goes up... the curent in the other side goes down.. that transisotr conducts less. you have a voltage divider R2 is one resistor, the transistor underneath is the other one ... so the node (C) goes ... UP ( R2 is constant and the resistance of the transistor goes up .... )so (A) is the ... non-inverting input. Make it more positive and the output (C) goes more positive.(B) is the inverting input. make it more positive , the current increases in that branch , and point (c) goes DOWN.It's all very simple ...

author: w2aew
author_rank: Super Contributor
timestamp: May 08, 2012, 01:23:10 pm
content: Quote from: Mechatrommer on May 08, 2012, 11:51:12 amThat's what I usually start with: When using negative feedback (which is 99% of the time), the output will go wherever it needs to go in order to make the input voltages equal to each other.Keeping in mind that the inputs draw negligible current (in most cases), one can often figure out what an opamp circuit is doing...Of course, there are limits to how far an opamp can swing its output - some are rail-to-rail, most are not. Similar for the inputs, there is a valid input voltage range that depends on the opamp chosen.

author: nick.sek
author_rank: Regular Contributor
timestamp: May 08, 2012, 01:47:42 pm
content: They began to make sense to me after a long time spent just reading texts and doing projects, but more crucially working up to them like learning about transistors, diode and all that fun matter. A key word that stood out was guitar amp and if your using an op amp 741 it won't really work out as the gain is greatly decreased when frequency goes through it.But in short an amplifier is used to multiple the input signal in order to produce a higher output signal - which can be used for radios, guitars and all that jazz.Just keep at it, and eventually it will make sense.

author: nick.sek
author_rank: Regular Contributor
timestamp: May 08, 2012, 01:52:12 pm
content: Hey, I just remember I made this video, it is a short one but it may shed some light on op-amps for you.

author: caroper
author_rank: Regular Contributor
timestamp: May 08, 2012, 02:31:35 pm
content: Quote from: sonnytiger on May 08, 2012, 03:26:59 amTake a look at the Schematic in this document:http://www.google.co.za/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&ved=0CF8QFjAA&url=http%3A%2F%2Fwww.velleman.eu%2Fdownloads%2F0%2Fillustrated%2Fillustrated_assembly_manual_k4102_rev1.pdf&ei=Qi2pT4fBIdCwhAfJ38W1Ag&usg=AFQjCNGFz1qPRNUxeN103rm9pMhi48miZwIt uses the NE5532A DUAL LOW-NOISE OPERATIONAL AMPLIFIERS from TI.Unfortunately it is assembly instructions for a Kit, so no real circuit explanation, but viewed in light of what others have said in this thread, it will give you an Idea of how a Guitar amp works with Op-Amps.CheersChris

author: Unknown
author_rank: Unknown
timestamp: May 08, 2012, 03:34:13 pm
content: A few more threads like this and this forum is ready to compile a book.Thanks for the great write ups guys.

author: olsenn
author_rank: Frequent Contributor
timestamp: May 08, 2012, 03:44:52 pm
content: The best way I can explain the operation of an op-amp without getting into transistor theory is that:1) No current enters either of the input terminals2) The output terminal will be at whatever voltage is neccesary in order to keep the two input terminals at equal voltage levels3) If the output voltage calculated in step 2 is greater than the positive supply voltage of the op-amp, the output will instead be clipped at this voltage4) If the output voltage calculated in step 2 is less than the negative supply voltage, the output will instead be clipped at this voltageSo, as an example, if you force the voltage at the + input terminal to be Vin, the output will adjust itselt to try to keep the - input terminal to be Vin also. Use math when required to determine what this voltage is.

author: sonnytiger
author_rank: Frequent Contributor
timestamp: May 09, 2012, 12:03:04 am
content: thanks guys, that really helped, I feel like i understand what is going on now.

author: vxp036000
author_rank: Regular Contributor
timestamp: May 09, 2012, 01:12:02 am
content: Close. But in an op amp IC, the resisistive load is replaced by a PMOS current mirror. This transforms the double ended output into a single output without wasting half the voltage, like the resistive load does. With a current mirror load, exactly the same current flows through each PMOS on the current mirror. On the output side of the op amp, we have a load, namely, the output resistance of the amplifying NMOS device and current mirror PMOS device in parallel. The current flowing through the amplifying NMOS device on the output is the sum of the current drawn from the load and the current mirrored from the other half of the amplifier. Therefore, the current flowing through the amplifying NMOS device on the output side is greater than that of the input side, so the voltage is greater. Here is an example applying the same concept, except with BJTs.Quote from: free_electron on May 08, 2012, 01:22:25 pm

author: IanB
author_rank: Super Contributor
timestamp: May 09, 2012, 04:28:55 am
content: Quote from: vxp036000 on May 09, 2012, 01:12:02 amSo were you born a prat, or did you have to learn how to become one?

author: Psi
author_rank: Super Contributor
timestamp: May 09, 2012, 06:35:59 am
content: hehe, i don't think he meant that the way it sounded.

author: free_electron
author_rank: Super Contributor
timestamp: May 09, 2012, 01:55:28 pm
content: Quote from: vxp036000 on May 09, 2012, 01:12:02 amI'm not talkin 'ic' . But yes, you can do that. There are more complex scemes where you steer the top transistors using current mirrors. You can actually steer all transistors in the opamp from current mirrors derieved from a master current source. If you place all of them in the same well and you do a scattered layout you can even get rid of thermal drift and problems with layer thickness deficiencies that would arise during the making of the wafer.But, all of this is extra 'fuzz' that brings nothing new to the table. The basis of an opamp is a diff pair of matched transistors. And even in mos technology you can still get away with two resistors at the top ( and resistors in mos technology can be made with ... A mos... )No need to throw in complicated stuff... Start with simple and build from there on.