A few weeks ago I came across a series of YouTube videos by the IMSAI Guy on an op-amp made from discrete components.  Over a series of posts he describes the circuits that make up a basic op-amp and demonstrates them on a bread board.  I found this very interesting and proceeded to build one myself.  It was to going to be a one or two night affair that has stretched into several weeks.  The issue has been a combination of being away from home for large stretches of time and not being able to concentrate on it, the desire to dig into it more deeply than the videos, and the complex behavior of even this simplified op-amp.


I do recommend the YouTube videos for those who haven't had a formal introduction to op-amps in school.  The videos are a bit long in places but interesting and he teaches in a down to earth way I found easy to follow.  The focus is on how the individual parts work and not on design.  The questions I had after viewing the videos were on design - not because it makes sense to design an op-amp from discrete parts but because the circuits involved are useful ones in their own right and I wanted to understand them more deeply.


It turns out however that op-amps from discrete components are still a thing and an internet search will turn up quite a few hits.  I have an old text book "Electronics Principles" by Albert Malvino from 1993 that was very helpful and describes basic op-amps in some detail.  I was also able to build a working SPICE model that was helpful using the free simulator MIcro-Cap.  IMSAI guy also builds a similar simulator.


The Schematic and Operation


A schematic for the op-amp that was built is shown below.

This is essentially the same op-amp made by IMSAI guy although I am using different diodes and transistors.  Roughly, my brief interpretation of the way it works is this:


Difference Amplifier: R2, Q1, and Q2 make up a differential amplifier - the heart of the op-amp.  Since the total current through the two transistors is fixed by the tail current as described below, a difference between the voltage of the non-inverting and inverting inputs (the base of Q1 and Q2) results in different collector currents in Q1 and Q2.  The base to emitter current vs. voltage curve of the transistors look like a diode.  Once the base voltage of the transistor is high enough to turn it on the current shoots up quite rapidly and small differences in ideally matched transistors mean large differences in the amplified current between the collector and emitter. In an ideal situation with the current fixed and the voltages equal on the non-inverting and inverting inputs the current through Q1 and Q2 will be identical.


Look first at Q1, the non-inverting input.  If the base voltage of Q1 rises the voltage drop across R2 will also increase since the current increases.  In the extreme case all of the current passes through it.  If voltage rises on Q2 the opposite occurs and the voltage drop across R2 decreases.  The varying voltage is then passed on to the amplification stage described below through resistor R4.


Tail Current:  R1, D1, D2, Q3, and R3 make up a current source.  Diode D1 is approximately equal to the voltage drop from base to emitter on Q3. It follows that the voltage drop across D2 will be approximately equal to that across R3 which sets the current through Q3.  As a first approximation the current is 0.7 V / 3300 ohms = 0.2 mA.  A low current is desirable because an ideal op-amp has infinite input impedance and no current flows through the inputs.  In this case the base current will be less than the collector to emitter will by a factor of the gain in the transistor or as a first approximation 200 uA / 100 = 2uA.


A 10 turn, 10 k resistor is used instead of a fixed value for R3 in order to trim the op-amp in the circuit.


Another Current Source:  D3 and D4 form another current source with Q5 and R6. This time the current source will be on the order of 1.5 mA.


Frequency Compensating Capacitor:  There is capacitance in any circuit (especially this one on a breadboard) and this can cause among other things oscillations.  Capacitor C1 allows the designer to select the critical frequency and thus control the frequency response of the op-amp.  It also reduces oscillation.  The critical frequency is 1 / 2*pi*R2*C1.  Given that my op-amp is on a breadboard this calculation is probably way off.


Capacitor C1 also sets the slew rate.  When there is a voltage step between the inverting and non-inverting inputs it drives one transistor into saturation and the other into cutoff.  Capacitor C1 then begins charging or discharging.  The voltage therefore does not change ideally but instead increases or decreases exponentially.  The slew rate is defined as the maximum rate of output voltage change and is the fastest response the op-amp is capable of.


If the voltage swing the op-amp is trying to achieve for a sine wave is too great at a given frequency then distortion occurs and the slew rate may be such that the peak voltage is not obtained.  The maximum frequency the op-amp can operate without slew-rate distortion at a given peak voltage is called the power bandwidth.  Higher power bandwidth is achieved at lower frequencies.


Amplification: Q4 and Q5 act as an amplification stage with very high gain.  Diodes D5 and D6 bias the class B push-pull amplifier which follows.


Class B Push-Pull Emitter Follower:  Finally Q6 and Q7 are a class B amplifier which give the final output.


Non-inverting Amplifier:  R7 and R8 are external to the op-amp and are used to set gain for a non-inverting amplifier with negative feedback.


The Setup and Bread Board


The circuit was built on a breadboard and shown below.  My bench power supply has a single channel so +Vcc was arbitrarily set to 10V to begin and -Vee is 0V.  The input comes from the Keysight DSOX1102GDSOX1102G oscilloscope which can provide a DC or an AC signal with DC offset.  The oscilloscope and several multimeters are also used to analyze circuit behavior.



Here is a closeup of the breadboard.  All resistors were 1% and the transistors in the difference amplifier were matched using an inexpensive "M Tester".  The measured beta of the NPN transistors was 210.  The PNP transistors beta measured 189.



DC Performance


As noted above a SPICE model was set up and was run beforehand.  The gain was set with resistors R7 and R8 to be approximately 4.3 to give an output voltage of about 6.5.  This is about as close as the op-amp can get to the rails.  In the SPICE model below the voltages at nodes is in green surrounded by red ovals and the actual measured voltages are in black in a larger font.  For example, the model was set to give a positive rail of 10V and the measured voltage was 9.98V.


I made an error or two and then had to wiggle wires to get it to work due to a bad breadboard connection but then it became quite stable and as can be seen the results for DC amplification are quite close to the model.  The resistance of R3 (the potentiometer) was adjusted to minimize the voltage difference n the inputs which is why it is at 2.72k instead of 3.3k.  The internal measurements match the model well and gain is right on with reasonable voltage offset after adjustment.  I was quite pleased.


AC Performance


To understand the AC performance the circuit was modified as shown below which passes the AC and removes DC.  The gain was increased to 38.



When the circuit was modelled in SPICE the following output was obtained:


This analysis indicated that the bandwidth of the op-amp is around 1 MHz under the test conditions.  As shall be seen the performance is not so good on the breadboard.  All that stray capacitance and who knows what. In the following video the behavior near the rails, influence of capacitor C1, slew rate, and bandwidth are demonstrated.


In the first video amplification of a sine wave is demonstrated.



In this video the input signal is increased until the output clips as it swings near the rails.



Here the slew rate of the discrete component op-amp is examined.  Removing C1 from the circuit does not produce noticeable effect.  My guess is this is because the breadboard circuit already contains so much capacitance.



In this final demonstration the bandwidth is looked at.





This has been a fun project and I learned a lot from it.  The low gain DC configuration and the SPICE model agreed really well.  There was discrepancy in AC behavior with slew rate and higher frequency but that is to be expected on the breadboard.  I considered soldering something up on perf board but in the end decided not to.  A poorly performing component can sometimes be more instructive than a good performing one and besides if a good performing op-amp is desired then buy one of the many ICs available.


I have a better idea now about how op-amps work and what drives some of the non-ideal behavior but am far from an expert.  Please feel free to correct my interpretations or observations in the comments.  I will leave the breadboard set up for a few more days if anyone is interested in another measurement or observation.