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). 
<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="http://www.instructables.com/id/Remix-build-your-own-555/" rel="nofollow"> http://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.
I'm pleased to see some-one using discrete components [and learning]! <br> <br>BTW there are some valid reasons for going discrete; <br> <br>1 - to operate at a higher voltage* <br> <br>2 - for higher frequencies <br> <br>3 - customized waveform <br> <br>4 - higher current capacity ** <br> <br> <br>* possible with the 555 but gets a bit ugly <br>** more cost effective to have a 555 drive a power transistor
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.
woww man! :) congradulation! :)
AWESOME! So AWESOME! This is THE best ever 555 timer instructable!
Really great instructable! I love building analog circuits from salvaged parts, and this project is right up my alley. You've done a fantastic job of breaking a complex subject into smaller more understandable components. Really well done.
Thanks!!! Digital has all but taken over electronics so I've been going analog! <br> <br>I've been practicing breaking complex things down for a while now! None of my friends can bear more than 5 minutes of me talking about electronics unless I speak to them like they are 6 and my dad is a chemist so trying to communicate what I'm doing involves lots and lots of simplifying! <br> <br>
FANTASTIC! I love this kind of projects!!! I'll never actually build my own 555 timer (I'd rather buy one for almost nothing :-)), but I salute you for taking the time and effort to actually DO this! <br> <br>Thanks for making me smile! <br> <br>Y.
Yeah, its much easier and cheaper to buy one than build it and quite honestly, I just wanted to see if it could be done!

About This Instructable


171 favorites


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: