Chapter 6
IN THIS CHAPTER
Learning about the miracle device of electronics
Comprehending the basic operation of a transistor
Surveying the many different types of transistors
Using a transistor as an amplifier
Using a transistor as a switch
Building some simple transistor circuits
I was born just a few years after the beginning of the transistor age. As a young boy, I sometimes took the back off of our old black-and-white television set (when my parents weren’t home) and marveled at the neat electronic stuff inside. Besides the huge picture tube, the most interesting gadgets in there were the little glass tubes the size of my thumb. As I remember it, there were hundreds of them, each one glowing with a comfortable warm orangish glow.
By the time I was old enough to start studying electronics, that old TV set was replaced by a new color set that wasn’t nearly as interesting to look at inside. The big picture tube was still there, but all the little glowing thumb-sized tubes had been replaced by little silver cans smaller than a thimble.
Transistors had taken over, and I hated them. Tubes were much more interesting than transistors. They got hot and glowed. You could see little wire structures inside them — little towers with meshes and grids and who knows what else. Transistors just looked like little thimbles. It was as if someone had built a television set out of stuff they found in my mom’s sewing drawer.
I was quite certain that the spaceships on my favorite TV shows like Star Trek, Lost in Space, and Land of the Giants were all run on tubes, not transistors. It wasn’t until I found out that real spaceships like Gemini and Apollo were filled with transistors and had nary a tube that I decided maybe transistors were okay. If they were good enough for NASA, they were good enough for me.
In the 40 years since my dad bought that first color television set, the little thimble-sized transistors have given way to transistors that are literally millions of times smaller. Nowadays, we can put 100 million transistors on a single piece of silicon crystal about the size of your fingernail.
In this chapter, you take a look at what transistors are and how you can put them to use in your own circuits. Along the way, you build a few simple transistor circuits to learn how they work.
Here’s an interesting thing about the transistor: When it was invented in 1947, it didn’t really do anything that hadn’t already been done before. It just did it in a radically different way.
The basic idea behind a transistor is that it lets you control the flow of current through one channel by varying the intensity of a much smaller current that’s flowing through a second channel.
Think of a transistor as an electronic lever. A lever is a device that lets you lift a large load by exerting a small amount of effort. In essence, a lever amplifies your effort. That’s what a transistor does: It lets you use a small current to control a much larger current.
Figure 6-1 shows several of the many different kinds of transistors that are available today. As you can see, transistors come in a variety of different sizes and shapes. One thing all of these transistors have in common is that they each have three leads.
Devices that performed the function of transistors had been around for 30–40 years prior to the invention of the transistor. They were called vacuum tubes. A vacuum tube consisted of a vacuum chamber made from glass or metal, a heating element that heated the space inside the chamber, and electrodes that protruded into the chamber. (I use past tense here because although vacuum tubes still exist, they really aren’t used all that often.)
One specific type of vacuum tube was called a triode; it had three electrodes. In a triode, a large current flowing through two of the electrodes (called the anode and the cathode) could be regulated by placing a wire grid (called the control grid) between the cathode and the anode. Applying a small current to this grid slowed down the flow of electrons between the cathode and the anode.
It didn’t take long to figure out that you could use a fluctuating signal such as a radio or audio wave on the control grid. When you did that, the current on the anode followed the fluctuations of the control grid current, but with much larger variations. Thus, the triode was an electronic lever: Small variations in current at the control grid were amplified to create large variations in current at the anode.
The vacuum tube triode was patented in 1907 and was the key invention that enabled the development of radio, television, and computers. But vacuum tubes had many serious limitations: They were expensive to manufacture, big (the small ones were about the size of your thumb), required a lot of power to operate, generated a lot of heat, and lasted only a few years before they burned themselves out.
The transistor changed all that. A transistor performs the same function as a vacuum tube triode, but using semiconductor junctions instead of heated electrodes in a vacuum chamber. Although the transistor didn’t do anything that the vacuum tube triode didn’t already do, it did it in a radically different way that had huge advantages over the vacuum tube. The earliest transistors were small, required very little power to operate, generated much less heat, and lasted much longer than vacuum tubes.
There are many different kinds of transistors. The most basic kind is called a bipolar transistor. Bipolar transistors are the easiest to understand, and they’re the ones you’re most likely to work with as a hobbyist. As a result, most of this chapter focuses on bipolar transistors. I describe some of the other types of transistors later in this chapter. But for now — indeed throughout this entire book — you can assume that whenever I use the term transistor by itself, I’m referring to a bipolar transistor.
Now let’s peer inside a transistor to see how it works.
In the previous chapter, you learn that a diode is the simplest kind of semiconductor, made from a single p-n junction, which is simply a junction of two different types of semiconductors, one that’s missing a few electrons and thus has a positive charge (p-type semiconductor) and the other with a few extra electrons, thus having a negative charge (n-type semiconductor).
By itself, a p-n junction works as a one-way gate for current. In other words, a p-n junction allows current to flow in one direction but not the other. A diode is simply a p-n junction with leads attached to both ends.
A transistor is like a diode with a third layer of either p-type or n-type semiconductors on one end. Thus, a transistor has three regions rather than two. The interface between each of the regions forms a p-n junction. So another way to think of a transistor is as a semiconductor with two p-n junctions.
Figure 6-2 shows the structure of two common types of transistors along with their schematic diagram symbols. The details shown in this figure are explained in the following paragraphs.
One way to make a transistor is with a p-type semiconductor sandwiched between two n-type semiconductors. This type of transistor is called an NPN transistor because it has three regions: n-type, p-type, and n-type. It’s shown in the top part of Figure 6-2.
The other way to make a transistor is just the opposite, with an n-type semiconductor sandwiched between two p-type semiconductors. This type is called a PNP transistor because its three regions are p-type, n-type, and p-type. It’s shown in the bottom part of Figure 6-2.
Each of the three regions of semiconductor material in a transistor has a lead attached to it, and each of these leads is given a name:
These two current paths are important in a transistor:
Here are a few additional points to ponder concerning transistors before we move on to more details:
Most circuits that you can build with an NPN transistor can also be built with a PNP transistor. But if you do, you must remember to flip the power connections.
Yes, there are reasons why the terms collector, emitter, and base were chosen for three leads of a transistor. Unfortunately, those reasons have to do with the internal operation of the transistor at a level that’s deeper than you really need to go for this book. So please take my word for it: The guys who invented the transistor didn’t choose the terms collector, emitter, and base just to confuse you.
Transistors are more complicated devices than resistors, capacitors, inductors, and diodes. Whereas those components have just a few specifications to wrangle with, such as ohms of resistance and maximum watts of power dissipation, transistors have a bevy of specifications.
You can find the complete specifications for any transistor by looking up its data sheet on the Internet; just plug the part number into your favorite search engine. The data sheet gives you dozens of interesting facts about the transistor you’re interested in, with charts and graphs only a rocket scientist could love.
If you happen to be a rocket scientist and you’re thinking about using the transistor in a missile, by all means please pay attention to every detail in the data sheet. But if you’re just trying to do a little on-the-side circuit design, you need to pay attention to only the most important specifications — these in particular:
The most common way to use a transistor as an amplifier is shown in Figure 6-3. This type of circuit is sometimes called a common-emitter circuit because, as you can see, the emitter is connected to ground, which means that both the input signal and the output signal share the emitter connection.
The circuit in Figure 6-3 uses a pair of resistors as a voltage divider to control exactly how much voltage is placed across the base and emitter of the transistor. The AC signal from the input is then superimposed on this bias voltage to vary the bias current. Then, the amplified output is taken from the collector and emitter. Variations in the bias current are amplified in the output current.
You might remember from Chapter 2 of this minibook that a voltage divider is simply a pair of resistors. The voltage across both resistors equals the sum of the voltages across each resistor individually. You can divide the voltage any way you want by picking the correct values for the resistors. If the resistors are identical, the voltage divider cuts the voltage in half. Otherwise, you can use a simple formula to determine the ratio at which the voltage is divided. (If you want to review this formula, feel free to refer to Chapter 2 of this minibook.)
If you look at the schematic diagram in Figure 6-3 and squint your eyes just a bit, you might see that there are actually two voltage dividers in the circuit. The first is the combination of resistors R1 and R2, which provide the bias voltage to the transistor’s base. The second is the combination of resistors R3 and R4, which provide the voltage for the output.
In reality, there’s a third resistor in the output voltage divider: the collector-emitter path in the transistor itself. In fact, one common way to explain how a transistor works is to think of the collector-emitter path as a potentiometer (a variable resistor), whose knob is turned by the bias voltage. For a more detailed explanation of this, see the sidebar titled “The magic pot.”
This second voltage divider is a variable voltage divider: The ratio of the resistances changes based on the bias voltage, which means the voltage at the collector varies as well. The amplification occurs because very small variations in an input signal are reflected in much larger variations in the output signal.
Because this is tricky stuff, look at this circuit more closely:
One of the most common uses for transistors is as simple switches. In short, a transistor conducts current across the collector-emitter path only when a voltage is applied to the base. When no base voltage is present, the switch is off. When base voltage is present, the switch is on.
In an ideal switch, the transistor should be in only one of two states: off or on. The transistor is off when there’s no bias voltage or when the bias voltage is less than 0.7 V. The switch is on when the base is saturated so that collector current can flow without restriction.
Figure 6-4 shows a schematic diagram for a circuit that uses an NPN transistor as a switch that turns an LED on or off.
Look at this circuit component by component:
You might be wondering why you’d need or want to bother with a transistor in this circuit. After all, couldn’t you just put the switch in the LED circuit and do away with the transistor and the second resistor? Of course you could, but that would defeat the principle that this circuit illustrates: that a transistor allows you to use a small current to control a much larger one. If the entire purpose of the circuit is to turn an LED on or off, by all means omit the transistor and the extra resistor. But as you work with more advanced circuits, you’ll find plenty of cases when the output from one stage of a circuit is very small and you need that tiny amount of current to switch on a much larger current. In that case, the transistor circuit shown here is just what you need.
In Project 18, you build the circuit shown in the preceding section. The circuit uses a transistor to switch on an LED using a current that’s much smaller than the LED current. The schematic for this project is the same as the schematic shown in Figure 6-4.
Figure 6-5 shows the completed project.
If you feel like experimenting a bit after you complete this project, here are couple of suggestions:
In this project, you build a circuit that uses a transistor to drive an LED. The transistor allows a small amount of current to control a larger amount of current that passes through an LED. The circuit includes two LEDs: one on the base and one on the emitter. Both LEDs light up when the push button is pressed, but the LED on the emitter circuit glows brighter than the one on the base circuit, demonstrating the transistor’s current gain.
To complete this project, you’ll need wire cutters, wire strippers, and a multimeter.
Throughout these steps, use the negative (–) bus strip on the bottom of the board for ground and the positive (+) bus strip on the top of the board as the positive voltage.
Mount the push button on the breadboard so that it straddles holes G3, I3, G5, and I5.
Orient the button so that when it’s pressed, the circuit is closed between G3 and G5.
Mount the transistor.
The following table shows the connections for each of the three transistor leads:
Lead |
Hole |
Collector |
B4 |
Base |
B5 |
Emitter |
B6 |
Mount the LED.
Mount LED1 so that the cathode (the shorter lead) is in hole A6 and the anode (the longer lead) is in hole A10.
Connect the battery holder.
The red wire should go in the any hole of the positive bus at the top of the breadboard; the black wire should go in any hole of the negative bus at the bottom.
Press the push button.
The LED lights up. When you release the button, the LED goes out.
Congratulate yourself!
You’ve built your first transistor circuit!
A gate is a basic component of digital electronics, which you learn all about in Book 5. Gate circuits are built from transistor switches that are either ON or OFF. There are a total of 16 different kinds of gates, and you learn about all 16 of them in Book 5, Chapter 2. For now, though, I want to introduce you to one of the simplest of all gate circuits, called a NOT gate, which simply takes an input that can be either ON or OFF and converts it to an output that’s the opposite of the input. In other words, if the input is ON, the output is OFF. If the input is OFF, the output is ON.
Figure 6-6 shows the schematic diagram for a circuit that uses a single transistor to implement a NOT gate. Here’s how the circuit works:
Project 19 shows you how to build the one-transistor NOT gate circuit on a solderless breadboard. The completed project is shown in Figure 6-7.
In this project, you build a simple NOT gate circuit that uses a transistor to invert an input signal. That is, if the input signal is on, the output if off; if the input signal is off, the output is on. One LED is used to indicate the status of the input, and a second LED is used to indicate the status of the output. The schematic for this circuit is the same as the schematic shown in Figure 6-6.
The only tools you’ll need complete this project are wire cutters and wire strippers.
Throughout these steps, use the negative (–) bus strip on the bottom of the board for ground and the positive (+) bus strip on the top of the board as the positive voltage.
Mount the push button on the breadboard so that it straddles holes G1, I1, G3, and I3.
Orient the button so that when it’s pressed, the circuit is closed between G1 and G3.
Insert the jumper wires.
Insert the four jumper wires as follows:
From |
To |
J3 |
Any hole in the positive bus on the top of the breadboard |
H12 |
H16 |
F10 |
Any hole in the negative bus on the bottom of the breadboard |
A16 |
Any hole in the negative bus on the bottom of the breadboard |
Insert the resistors.
Insert the two resistors as follows:
Resistor |
From |
To |
F1 |
F6 | |
I15 |
Any hole on the positive bus on the top of the breadboard |
Insert the transistor.
The following table shows the connections for each of the three transistor leads:
Lead |
Hole |
Emitter |
G10 |
Base |
G11 |
Collector |
G12 |
Insert LED1.
Insert the cathode (the shorter of the two leads) in hole I11 and the anode (the longer of the two leads) in hole I6.
Insert LED2.
Insert the cathode (the short lead) in hole E16 and the anode (the long lead) in F16.
Connect the battery holder.
Insert the red lead in any hole of the positive bus at the top of the breadboard and the black lead in any hole of the negative bus at the bottom of the breadboard.
Insert the four AA batteries into the battery holder.
When the batteries are connected, LED2 lights up to indicate that the button is not pressed.
Press the push button.
LED2 goes dark and LED1 lights up to show that the button is pressed.
Release the push button.
The LEDs return to their original status.
An oscillator is an electronic circuit that generates repeated waveforms. The exact waveform generated depends on the type of circuit used to create the oscillator. Some circuits generate sine waves, some generate square waves, and others generate other types of waves. Oscillators are essential ingredients in many different types of electronic devices, including radios and computers.
One of the most commonly used oscillator circuits is made from a pair of transistors that are rigged up to alternately turn on and off. This type of circuit is called a multivibrator. If the circuit is designed to continuously cycle between the two transistors, it’s called an astable multivibrator because the circuit never reaches a point of stability — that is, it never decides which of the two transistors should be on, so it just keeps flipping back and forth between the two. Astable multivibrators are great for producing square waves.
Figure 6-8 is a generalized schematic diagram for an astable multivibrator made from a pair of NPN transistors.
Examine this circuit to see how it works. When you first power it on, only one of the transistors turns on. You might think that they would both turn on, because the bases of both transistors are connected to +V, but it doesn’t happen that way: One of them goes first. For the sake of discussion, assume that Q1 is the lucky one.
When Q1 comes on, current flows through R1 into the collector and on through the transistor to ground. Meanwhile, C1 starts to charge through R2, developing a positive voltage on its right plate. Because this right plate is connected to the base of Q2, positive voltage also develops on the base of Q2.
When C1 is charged sufficiently, the voltage at the base of Q2 causes Q2 to start conducting. Now the current flows through the collector of Q2 via R4, and C2 starts charging through R3. Because the right-hand plate of C2 is bombarded with positive charge, the voltage on the left plate of C2 goes negative, which drops the voltage on the base of Q1. This causes Q1 to turn off.
C1 discharges while C2 charges. Eventually, the voltage on the left plate of C2 reaches the point where Q1 turns back on, and the whole cycle repeats.
Don’t worry if this all seems confusing. It is. If the details seem baffling, just think of the big picture: The dueling capacitors alternately charge and discharge, turning the two transistors on and off, which in turn allows current to flow through their collector circuits. Back and forth it goes, like an amazing rally at Wimbledon that no one ever wins … the players just keep lobbing the ball back and forth forever, until their batteries run out.
Here are a few other interesting things to know about astable multivibrators:
Alternatively, you can use a third transistor to couple the multivibrator with an output load, as shown in Figure 6-9. Just connect the emitter of one of the multivibrator transistors to the base of the third transistor and connect the load to the collector, as shown in the figure.
This arrangement has two advantages. First, the load itself interferes with the multivibrator circuit if you take it directly from the collector of Q1 or Q2. By using a third transistor, you isolate the load from the multivibrator circuit. And second, the output is much closer to a true square wave when the coupling transistor is used; without it, the output isn’t a clean square wave because of the effects of the capacitor charging.
In Project 20, you build a circuit that uses an astable multivibrator to alternately flash two LEDs. LED flasher circuits are a favorite of electronic hobbyists because flashing LEDs have all sorts of fun uses. For example, you can add creepy blinking eyes to a jack-o’-lantern for Halloween, or you can add blinking warning lights to your model railroad layout. Figure 6-10 shows the finished LED flasher project.
The LED flasher circuit is simply an astable multivibrator similar to the one shown in Figure 6-8. The only differences are that I’ve added LEDs to the collector circuit of each transistor and filled in the resistor and capacitor values. With the values I selected for this project, the lights alternate quickly, a bit faster than once per second.
If you feel like experimenting a bit after you complete this project, here are a couple of suggestions:
In this project, you build a circuit that uses a two-transistor astable multivibrator to flash two LEDs in sequence. You’ll need a small Phillips-head screwdriver, wire cutters, and wire strippers to build this project.
Throughout these steps, use the negative (–) bus strip at the bottom of the board for ground and the positive (+) bus strip on the top of the board for the positive voltage.
Insert the jumper wires.
Insert the four jumper wires as follows:
Length |
From |
To |
inch |
F10 |
Any hole in the negative bus at the bottom of the breadboard |
inch |
F17 |
Any hole in the negative bus at the bottom of the breadboard |
1 inch |
F11 |
F20 |
inch |
H13 |
H18 |
Insert the capacitors.
Insert the two electrolytic capacitors as follows:
Capacitor |
– |
+ |
C1 |
I13 |
J12 |
C2 |
I20 |
J19 |
Be sure to observe the correct polarity of the capacitors. The negative lead is marked with minus signs.
Insert the transistors.
The following table shows the connections for each of the three transistor leads of the two transistors:
Lead |
Q1 |
Q2 |
Emitter |
G10 |
G17 |
Base |
G11 |
G18 |
Collector |
G12 |
G19 |
LED |
Cathode (Short) |
Anode (Long) |
LED1 |
J7 |
Any hole in the positive bus at the top of the breadboard |
LED2 |
J24 |
Any hole in the positive bus at the top of the breadboard |
Resistor |
From |
To |
R1 (470) |
I7 |
I12 |
R2 (100K) |
J11 |
Any hole in the positive bus at the top of the breadboard |
R3 (100K) |
J18 |
Any hole in the positive bus at the top of the breadboard |
R4 (470) |
H19 |
H24 |
Connect the battery holder to the breadboard.
Attach the red lead from the battery holder to any hole in the positive bus strip at the top of the solderless breadboard.
Attach the black lead from the battery holder to any hole in the negative bus strip at the bottom of the breadboard.
Enjoy the show!
The LEDs alternately flash as long as you leave the batteries in.
That about does it for our foray into transistors — and in fact, that wraps up our survey of the most common types of discrete electronic components (that is, components that contain just a single part in a single case). If you’ve worked your way through all the chapters in this minibook, you now know the basics of resistors, capacitors, inductors, diodes, and transistors.
In a way, that’s all there is. What remains are clever ways to combine these components into different kinds of circuits that you can put to different kinds of uses.
In Book 3, you learn how to use integrated circuits, which enable you to replace a whole circuitful of discrete components with a single tiny chip. Integrated circuits are simply a way to combine a bunch of semiconductors, resistors, and capacitors into a single tiny package.
On you go!