Another day, another circuit. This one is a little more complex than the LED/Resistor circuit I made the other week. Having read about transistors I decided to design and build a NAND gate. The final circuit is very similar to the one discussed in the XGS ebook (below is the original circuit schematic from the very same e-book - which I highly recommend; a print version will be out soon as well )
Aside from being a little blurry the photo below shows my version of the NAND gate circuit built from two transistors, three resistors, two switches and an LED. The hardest part was finding a suitable 5V regulated power supply. I really need to buy a variable supply.
The far right of the image is where the +5V power is sourced, the far left is used as GND. The LED is connected to the +5V line via a resistor which results in the LED being lit by default. At the bottom right you should be able to make out the two switches. These connect the +5V supply to the base node of the two transistors (via one of the two 10k ohm resistors). Thus the switches control the input for the two transistors 1 or 0.
The collector of the first transistor is connected to the same resistor as the LED, with the emitter of this transistor feeding the collector of the second transistor. Finally the emitter of the second transistor is connected to GND.
The result of this is that when both switches are closed, the base of each transistor receives a sufficient voltage to start conducting from collector1 to emitter1 which feeds collector2 to emitter2 and finally running to GND. This gives us a working NAND gate. A 1 & 1 signal will result in a 0 i.e the LED will be off since both transistors are conducting to ground. Any other combination will result in a 1 as one (or both) transistor does not conduct, so we get a flow through the LED.
To most this probably isn’t the slightest bit impressive, it’s hard to appreciate the amount of background knowledge needed in order to understand how and why even a simple circuit works, as well as analyse it; until you have done it yourself. So although it isn’t much to look at, I’m please with myself none the less :)
One lesson to take away from this is that it’s only once you begin to understand the basics that you start to finally realise how much more there is yet to learn. BTW I managed to get the joystick position to control the state of the LED that I mentioned in my previous XGS blog entry.