How do transistors work, anyway?
The invention of the electronic circuit changed the world. In just over a century, electronic devices upended almost every aspect of our lives — from transportation, to medicine, to the way we interact with each other and have fun.
Despite this, a firm grasp of electronics remains elusive for most. I’m confident that much of the blame lies with the hydraulic analogy — a reimagining of electronic circuits as series of tubes. The hydraulic analogy is seductive to textbook authors but quickly spring leaks. By the time you get to transistors, you’re constructing bizarre two-stage water valves that don’t truly emulate semiconductors — and would give your plumber a headache, too.
Indeed, the mechanics of transistors remain mystifying to most hobbyists, making it hard to comprehend the design of fundamental devices such as operational amplifiers. In this post, I’m hoping to shed some light on the topic — hopefully without bringing up quantum wave functions, but also without reaching for a pipe wrench.
The physics of conduction
Let’s start with a refresher on the physics of conduction. In solid-state electronics, the flow of electricity can be explained by the motion of outer (valence) electrons that skate across stationary atoms or molecules.
In most materials, valence electrons are tightly bound to the substrate, and a considerable energy is needed to knock them out; that energy is often sufficient to set things on fire along the way. This situation is different in metals, where some electrons at their normal energy levels can freely drift from one atom to another — forming what’s known as the electron gas.
The attraction to positively-charged protons confines the electrons to the bulk of the conductor. The mutual repulsion between electrons, on the other hand, compels them to spread as far as possible, filling the entirety of this available space.
It should be underscored that the flow of electricity has less to do with the travels of individual electrons, and more with what can be thought of as pressure equalization in this electron gas. In a typical circuit, the drift of an electron averages millimeters or centimeters per hour. Yet, shoving an extra electron onto a metal wire causes nearby ones to scuttle away — a cascading wave that propagates close to the speed of light.
Such electromagnetic forces can also act across non-conductive gaps; for example, bringing an negatively-charged rod near one end of a metal wire will cause some electrons in the conductor to scamper away toward the other side.
The two most important concepts in electric circuits are voltage and current. Current is a straightforward measurement of the number of electrons traveling through a particular spot in a unit of time. Voltage, on the other hand, describes pressure differentials in the electron gas. The higher the difference between two chosen points, the higher might be the current that flows if you accidentally drop your plumbing wrench across that portion of the printed circuit board.
The case of semiconductors
There is an intermediate class of materials, known as semiconductors, where the outer electrons are nominally immobile, but where only a slight nudge is needed to knock them into a higher-energy state and set them free. This nudging continually happens on its own due to random, room-temperature thermal events.
In semiconductors, these excited electrons soon return to a lower energy state; but in the presence of an external electric field, they might be able to drift a short distance, prompting other electrons to stagger away when it’s their turn. In effect, this process allows a rather weak current to flow.
Pure semiconductors have poor electrical properties, but their conductivity improves significantly in the presence of impurities known as dopants. An n-type dopant, such as phosphorus, adds mobile electrons to the semiconductor substrate, in effect increasing the number of charge carriers available at any given time. A p-type dopant, such as boron, does the opposite — trapping other electrons and thus creating long-lived valence shell vacancies (“holes”) in the base material.
Interestingly, the slack afforded by these holes means that the distribution of non-excited valence electrons can all of sudden shift with ease in response to external electric fields. You can think of this as electrons opportunistically slithering into nearby vacancies, or you can look at holes as weird disembodied “particles” that drift in the opposite direction in a sea of valence electrons. However you approach it, both n-type and p-type materials conduct much better than pure silicon.
It should be noted that doped semiconductors remain electrically neutral. Only the mobility of electrons is changing, not the ratio of electrons to protons in the crystal lattice.
When a p-doped semiconductor is brought into contact with an n-doped one, an interesting phenomenon takes place: some electrons from the n-side cross the boundary and promptly fall into the abundant holes present on the p-side.
This creates a depletion region: an exceedingly thin layer that has virtually all the holes plugged on the p-side, and practically no conduction band electrons on the n-side. The region is no longer electrically neutral, and indeed, it’s held together by an emergent field: negative on the p-side (due to surplus electrons) and positive on the n-side (due to all the unpaired protons still stuck in place).
From the diagram, it should be clear that removing electrons from the right side and adding them to the left side does not accomplish much. The action only serves to increase the strength of the electric field across the junction. It also adds more plugged holes on the p-side and more vacancies on the n-side. In this scenario, the thickness of the depletion region is bound to grow.
Moving the electrons in the other direction is another story. It serves to counter the electric field of the junction, eventually making it disappear. For silicon devices, the voltage needed to get things going hovers around 0.6 V. Past that point, the junction (known as a diode) becomes an excellent conductor — that is, until the voltage drops below that magic threshold again.
Junction field effect transistors (JFETs)
A simple p-n junction may seem uninteresting, but it’s a versatile building block. To illustrate, let’s start with junction field effect transistors that use a reverse-biased p-n junction as a way to moderate the current flowing between their two primary terminals — source and drain:
There are no semiconductor junctions between the two primary terminals. You can find a p-n junction near the control terminal — the gate — but it’s not meant to work as a diode. Instead, it’s kept non-conductive by always holding it below 0.6 V.
When the gate is operated at around 0 V relative to the n-region, the depletion layer is present but very thin, so it doesn’t impede the flow of current between the source and the drain. But as the voltage is lowered, the depletion region expands. By the time you get to perhaps -5 V, it grows so large that it pinches off the conductive path through the n-doped body of the device.
JFETs are remarkable because they respond stoutly to small voltages applied to the gate, making them well-suited for certain types of amplifiers. That said, in most other applications, they have been superseded by another design: the MOSFET.
Metal oxide field effect transistors (MOSFETs)
Much like JFETs, MOSFETs are designed to control the flow of current between their two primary terminals — source and drain — via a variable voltage applied to the gate. That said, their internal architecture is a bit more complex:
The drawing shows an n-p-n junction in the path of the current; because one half of this junction is inevitably reverse-biased, it would appear that the transistor should never conduct.
Of course, MOSFETs have a trick up their sleeve: if a sufficiently high positive voltage is applied to the gate (relative to the “substrate” terminal), the resulting electric field pushes away holes in the p-type material on the other side of the glass insulator — and eventually pulls in mobile electrons from the nearby n-doped regions, forming what’s known as the inversion layer. The resulting junction-free and electron-rich channel bridges the source and the drain. The marvelous property of MOSFETs is that no electrical connection is needed between the gate and the rest of the device. The nearly-perfect isolation of the input signal makes them remarkably efficient.
In theory, MOSFETs could be operated with no special regard to the polarity of their two primary terminals. In practice, most discrete MOSFETs come with the substrate internally tied to the source, turning it into a three-terminal device that, in its “off” state, behaves like a reverse-biased diode — and will unexpectedly conduct if hooked up the wrong way.
MOSFETs are the workhorses of the semiconductor industry. Their main drawback is that it takes a substantial gate voltage to get them going; about 2 V is common for discrete transistors, and as much as 10 V might be necessary to reach the “fully on” state needed to efficiently drive higher-current loads. Compared to JFETs, the required threshold voltage complicates certain signal amplification tasks.
Bipolar junction transistors (BJTs)
Some readers might be wondering why I didn’t begin with the bipolar junction transistor. The answer is simple: the venerable BJT is the oldest truly successful transistor design, but it’s also the messiest of the bunch.
Let’s have a look at the common n-p-n layout. Similarly to a MOSFET, the junction between its main terminals — the collector and the emitter — is nominally non-conductive because one half of it is reverse-biased. Of course, at this point, you should be expecting a hat trick. The BJT trick is that the middle layer is made extremely thin, often around 1 µm; this places the p-side depletion regions on top of each other, and keeps the layer shorter than the usual distance traveled by a thermally-excited electron before it emits a photon and falls back into a hole.
With this detail out of the way, let’s start with the obvious: if you apply a sufficient positive voltage to the control (base) terminal in relation to the emitter, you can overcome the internal electric field of the base-emitter p-n junction and cause electrons from the emitter region to start pouring into the base layer, heading for the control terminal.
Yet, because the base section is so thin, these mobile electrons are effectively waltzing into the collector-base depletion region too, now partly stripped of its electric field. In the presence of a positive collector voltage, many will zap past that second boundary instead of recombining with a base-region hole. In a properly-designed BJT, a relatively small base current can trigger a considerably higher current across the other two terminals.
The idealized drawing of a BJT might imply that it should be a bidirectional device, working equally well if you reverse the polarity of the collector and the emitter. In practice, the emitter region is usually doped more heavily to facilitate the transport of electrons in one direction; in other words, reversing the component is possible, but its performance will be poor.
There are two things that make BJTs messy. First, they’re neither a pure voltage-controlled device, nor a pure current-controlled one: a combination of voltage and current is required to make them tick. Secondly, there is always a forward-biased junction between the collector and the emitter, creating an unavoidable 0.6 V loss for any loads you are planning to drive. In other words, this day and age, sticking to field effect transistors can save you a headache or two.