Step 8: More on the Comparators

A large amount of my time and research was spent on the comparators. My goal was to research some about them then design my own circuit. Eventually that failed and I ended up using a tweaked version of what is shown in the datasheet schematic. Throughout the process I have learned a lot about the theory of how these circuits work so I want to share some of that with you.

I have already said that the heart of these comparators is the differential amplifier, specifically the long tailed pair. What the heck is that? I also mentioned that a diff. amp. amplifies the difference between two voltages. The long tailed pair is a common type of diff. amp. that gets its name from the resistor or other current limiter that tails off of two transistors (or vacuum tubes). The first image shows a basic long tailed pair made using 2 transistors and 3 resistors. The tail resistor connects to the emitters of the transistors; it should be larger than the two resistors that connect the collectors to Vcc. Those two resistors should be equal. Here is a (very) basic explanation:

When both inputs are at the exact same voltage, let's say 1/2 Vcc, the transistors are "on" the same amount so equal current flows through them and into the tail resistor. There is a voltage drop on both collectors but the difference of voltage between the two is 0. When the voltage of one input rises some, that transistor becomes "more on" so more current can flow through, raising the voltage at the emitters and dropping the voltage of the collector more. This rise in emitter voltage creates "back flow" into the other transistor which turns it off more. When that transistor turns off, less current flows through it so the voltage at its collector rises. So now the difference between the two collector voltages is very large, due to a small change in input voltage.

Like I said, basic. There are a few issues with the circuit: 1. Small value differences in the collector resistors unbalances the output. 2. The output is a difference of two signals, we need a single output signal. 3. When the input voltages ave very close, the output voltage difference becomes very small. How do we solve these issues? Well, there are two easy ways to improve the design. One amplifies the input and the other amplifies the output, while also solving the other issues.

Let's start with amplifying the output. Enter the current mirror. In the second image you can see the basic current mirror consists of 2 PNP transistors, one of which has its collector and base connected, a resistor tying that transistor's collector to ground, and an output from the other transistor's collector. The current mirror limits the current of the left side (in this image) to the current that flow through the right side. The transistor with its base and collector tied together acts as the control side. When the resistor drops the voltage toward ground, the transistor starts to turn on because the voltage of its base is being lowered. Then current starts to flow through the transistor which raises the base voltage until there is a balance between the amount of current flowing through the transistor and resistor. The bases of the two transistors are connected so the second transistor also turns on but only to the amount that the first one is at. Thus, the current of the second transistor is limited to the current flowing through the control transistor. How does this help the diff. amp?

First off, it helps to balance the collector current of the transistors because the current of one side is actively limited by the current of the other side. Secondly, it gives one single ended output instead of a differential output. Because one side is being used to control the current, only the other side can be used for an output. Finally, it amplifies the output. Whenever there is a difference between the inputs, one side of the diff. amp. allows more current to flow and the other side allows less. If the side that allows more current is the side that the mirror control transistor is on, then the current mirror allows more current on both side. The excess of current on the other side raises the voltage. When the opposite happens and the side of the diff. amp.  that allows more current is on the mirror's load side, the control side allows very little current so there is a voltage drop on the load side. The amount that the voltage varies is much greater than before and now its only on one output.

Now the diff. amp. works much better; it is balanced much better, it has only one output, and the output has been amplified some. The first two issues have been solved, but the third hasn't been solved fully, yet. The diff. amp. with a current mirror makes a good differential stage for an OP amplifier, but it still isn't optimal for a comparator. When the input voltages become close, the output still doesn't have a sharp transition. The way to improve that is to amplify the input.

If you take a look at the third image, you can see a diagram of the Darlington transistor, or sometimes Darlington pair when two discrete transistors are used. Invented by Sydney Darlington in 1953, the transistor is designed to create very high gain by using two transistors. A signal applied to the input gets amplified by the first transistor. The current flows through the transistor and out of its emitter. The current then goes into the base of the second transistor, which amplifies it further. The result is a gain approximately equal to the gain of the first transistor multiplied by the gain of the second. If we replace the two transistors of the long tailed pair with Darlington pairs, we can increase the amplification of the diff. amp. greatly because each input will be amplified by two transistors instead of just one.

If you look at figure 4, you can see the long tailed pair with a current mirror and Darlington transistors. This circuit is very good as a comparator because it has very high gain from the current mirror and Darlington transistors which allows the inputs to be extremely close together without the output "dropping off." The circuit is also very balanced and has a single output because of the current mirror.

This is a very well designed circuit and has taught me a lot. Hopefully you have learned some too (if you didn't already know or understand it). 
hi buddy :) very nice and illustrative instructable thank you very much. ☺ from your bio and instructables, i can figure out that, you are also Nikola Tesla fan like me, is it? <br>nice?
<p>It did not work for me. Starting having problems at the threshold comparator. At the end, the guide just stopped, at the part where I was supposed to connect the wires like the IC datasheet which was hard because I didn't know what the names were. Overall a good guide on the beginning, but at the end it seemed a bit rushed.</p>
<p>Hi, @Teslaling!</p><p>I'm really interested in building one 555!</p><p>Do you think I could use 2 resistors (4k7) in parallel instead of the 1k resistor?</p><p>Thanks a bunch. Great work!</p>
<p>A great video that explains the 555 and one of its uses, <iframe allowfullscreen="" frameborder="0" height="281" src="//www.youtube.com/embed/kRlSFm519Bo" width="500"></iframe></p><p>It's only part 1 of 4, and the 4 parts go together for making a computer clock. In fact, the whole computer series and the YouTuber are great.</p>
<p>I am currently building this, and am running into what I think is an issue. I am testing the threshold and trigger comparators, but the LED is always on. However, when I plug it into VCC and Ground respectively, it does brighten up significantly. Is this an issue or what?</p>
<p>There were no problems at all. Worked on the first try! Excellent instructions.</p>
<p>I have a problem. I have been building this for 3 days and I cannot get it to work. Also, there is a problem with the parts list vs. your schematic. The list shows 11 4.7k resistors and 2 1k resistors. The schematic shows 10-4.7k and 3-1k. Which one is correct? (I suspect the schematic is the right one). I don't expect that my first sentence is worth a darn for asking for help.Oh, also, I am using 2n2222 for NPN and 2n5551 for PNP. Is that part ok? The tests all pass (after correcting a few mistakes). It is obvious that everyone here is smarter than I am. Congratulations to all those who made this and it works. I am very impressed. BTW-Your 'ible is fantastic. I know the problem is between the chair and the workbench. TIA. </p>
How many amps or Ma can I get in the output
Awesome, have a question, the output drivers can put the Vcc on the output???<br>I See a resistor divider in the base of output drivers so i think the output should be 4.7k(Vcc-0.7V)/5.7k. <br>
<p>what i understand is that you made 555 timer ic circuit using transistor that cool, but not everybody can make this i means its not that simple. techmess(.)page(.)tl</p>
<p>that's nice</p>
<p>this is very complected &amp; very expensive </p>
<p>Why so complicated ? You can make one without all those transistors, or did i miss something ?</p>
<p>This is an awesome tutorial! It took me a few days, but I was finally successful, after I realized a wiring mistake I made. I only did the breadboard version, I don't think I need to solder up the permanent version. I learned a lot, thanks!</p>
<p>That is cool. Thanks for taking the time to make this awesome instructable. I will try this and things like this in the near future. Favorited and followed.</p>
<p>I've bought 2 of these online and I'm trying to make a blinky for fun. Here's the problem: it wont blink. But it lights up.</p>
<p>try changing your capacitor size to arouns 22-100 uf</p>
<p>I made it and I did an instructable on it giving an explanation on exactly where to put all the components on a perf board. You can check it out here: <a href="https://www.instructables.com/id/Remix-build-your-own-555/" rel="nofollow"> https://www.instructables.com/id/Remix-build-your-...</a></p><p>Thank you for the inspiration, and I hope that I can get you vote for the remix contest as well as the others. This project is awesome and it worked perfectly, once again thank you.</p>
<p>Wow! This is of the best instructable i ever seen! </p><p>I can't wait to make one! :)</p><p>You just earn a Follower!</p>
<p>Hi!! May I know where are those arrows connected to? I'm trying to simulate the circuit that you made because the other 1 is more complex than yours! Thanks! Cheers</p>
The arrows represent the connection to the positive supply rail.
<p>That is awesome. Certainly the best how-to I've seen on here....</p>
i was wondering what the capacitor on the pcb version was for, stabilising power supply?
Yes, exactly.The 555 is notorious for being very noisy, especially when the output changes. I threw the capacitor on it because there was room for it and so I didn't forget during testing. I must not have mentioned it anywhere in the instructable.
thanks for the help :)
Hi! great work. I'm kind of new to electronics and started to experiment with building oscillators with the 555. my question is would an oscillator (for a synth) sound better with a discrete 555? Thank you!
It would make no real difference. The discrete 555 and an IC function the exact same way so it wouldn't matter. You would be better off using an IC because they are cheaper, easier to use, and don't take an hour of soldering to be ready to use.
should make an atari punk console all on one board without any ICs
Nice work,try make Core2Duo Procesor :-) !
Hahaha!!! That would be nearly impossible!!!
it'd make a very interesting project, it'd only take up half a room, though if you do it right you could overclock it to massive degrees.
Nah, do and Xeon or an i7. Get some speed goin :)
How about an ATmega128p (Arduino)
yes!!!!! do the atmega then make an arduino board around it
Wow great tutorial! <br>This can show how IC's are all actually simple electronic circuits compressed together.
no do this with tubes :P
Challenge Accepted!
i look forward to the result and i am even willing to supply triode tubes <br>
The first thing I have to do is figure out how some of the elements can be implemented using tubes and how they would connect together. Actually building some circuits wouldn't be for a while but if you would be interested in supplying some triodes, I only have a few on hand and I know that I will need more. This should be a very cool project. I haven't worked with VTs other than with a guitar pedal.
well send me a pm and we will arange is so that the rest to happen
Nice job, you are not only very clever but a great teacher. Thanks!
Thank you very much dude, i really appreciate it. You helped me to finish a school work and i also understood how a ne555 works.
Looking at your board vs. the chip... ICs are the only reason our computers aren't still the size of a barn....
Exactly! What is really amazing is that the 555 IC only has about 25 transistors in it. A 8 pin PIC or AVR has several hundred thousand to a few million in the same exact package!
I'm sure due to manufacturing constraints there is an upper physical limit to just how many components can be put on a die in a particular package but in practice there is very little relationship between the two characteristics. Something the examples you cited point out clearly. What is amazing about the 555, that you failed to mention, is that such a simple device has been so popular for so long. <br> <br>What is more amazing is that many of the tasks the more complex micro-controllers are put to today could easily be accomplished using things as simple as the 555 is.
It does get smaller every year pretty much... We are fitting some 3 Billion transistors into a processor now (thats just average), but with Haswell and intel going down to 5nm production (hopefully by 2015!), we will see massive speed increases...
5nm by 2015 is pretty optimistic. There are physical limitations they've run up against at 22nm. Being as less than 22nm is shorter than the wavelength of light they use with masks to process dies. There are interference games they can play to get a little under that but I don't think the technique can be extended very far. I've heard of some 18nm stuff perhaps that is as low as they can go? The way the industry has been going lately I wouldn't hold my breath for any massive speed increases either. First off no one needs it, second there is no competition on the high end anymore to drive it. <br> <br>The way forward seems to be parallelization, multicores and clustering. Maybe teaching kids how to program again.
If you are referring to historical computers then you should compare them to their peers now, which are physically large systems. <a href="http://en.wikipedia.org/wiki/IBM_Sequoia" rel="nofollow">The most powerful supercomputer</a> today takes up 3,000 square feet of floor space, which is a square almost 55 feet on a side. Which is almost twice the physical size of <a href="http://en.wikipedia.org/wiki/Eniac" rel="nofollow">ENIAC</a> which was dubbed by the press a &quot;Gigantic Brain&quot;.<br> <br> Back then there really were no &quot;our&quot; computers so your comparison is basically flawed in that respect.

About This Instructable




Bio: I like to make things that move, sense, calculate, compute, blink, and make noise. I like making things that create high voltages, electrical arcs, and ... More »
More by Teslaling:The Valve Caster 2.0: Tube Boost and Overdrive Build Your Own 555 Timer Helios 3: Homemade Rocket Candy Powered Rocket 
Add instructable to: