CS 352 Lecture 6 – Transistors and Diagrams
Dear students,
Today we close out our discussion of the low-level electronic circuitry and begin our ascent to higher levels of abstraction. We start by replacing relays with transistors. The problem with relays is that they tend to be slower to activate, harder to miniaturize, and have a shorter life span than other electronic switching technologies. They are electromechanical—their moving parts were fundamentally slow and prone to wear and failure.
At the time of the transistor’s invention, vacuum tubes were the popular switching technology. They were faster than relays, but they generated a lot of heat and also failed frequently. The ENIAC could not be powered down, because powering it back on blew out many of the tubes. Some folks at Bell Labs were looking for something better, and they came up with the transistor. This technology behaves like a relay, but the only moving parts are the electrons.
My Snap Circuits set has two transistors in it, both bipolar junction transistors. One is NPN, which is a sandwich of two materials with extra electrons (N) surrounding a material with missing electrons (P). It has three leads called the base, emitter, and collector. The base leads into P, the collector carries electrons out from one N, and the emitter carries electrons into the other N. Normally no electrons flow through the switch, but when positive voltage is applied to the base, electrons will flow from the emitter to the collector.
Let’s use that NPN transistor to create a not gate and see how it compares to the relay approach.
How exactly do transistors work? Well, they are made of silicon. Silicon is pretty easy to find; it is the dominant element in Earth’s crust. It’s also a group IV element, meaning that it has four electrons in its valence shell. It would really like to bond with other atoms to reach the magic 8. If it bonds with other silicon, we’ve got a crystalline insulator.
However, if you sprinkle some arsenic in the crystal structure, what happens? Arsenic is a group V element, so four of its outermost electrons bond and the fifth is a relatively free agent, happy to circulate through a circuit. A structure like this, with extra electrons, serves as the N material of a transistor.
If you sprinkle boron in instead, boron’s outer three electrons don’t quite reach the magic 8 from its four silicon neighbors. A structure like this, missing some electrons, serves as the P material of a transistor.
Normally electrons won’t flow from P to N. But they will if you apply voltage to the base.
The big takeaway of all this transistor talk is that we are allowing circuits to be electrically switched. Imagine if you were a train conductor and you needed to switch tracks. You’d have to stop the train, disembark, go pull a lever, and then get the train going again. That’s a slow and clumsy process. Imagine instead that the switch could be activated in other ways, like from your cell phone. That’d save you a lot of time. This is what transistors do for us.
Our Snap Circuits examples used human-activated switches. For authenticity’s sake, let’s create a circuit with an Arduino that uses electricity to activate the switch. Let’s send an SOS signal.
After soaking up all these low-level ideas, it’s time to rise above to a higher level of abstraction. Instead of thinking about how electricity flows through a transistor, we will combine them up into AND, OR, and NOT gates, which we abstract away with cute little diagrams. We will do a few diagramming problems together:
Here’s your TODO list:
- Read The Twisted Legacy of William Shockley. Please understand that I fully reject Shockley’s beliefs on race. I ask you to read this article for two reasons: 1) because mixed-bag Shockley helped pioneer an amazing technology whose impact on our field cannot be overstated, and 2) because I think we will not completely understand modern racial tensions if we are not aware of the racist perversion that has been percolating over the last two centuries to produce the current state of affairs. On a 1/4 sheet, jot down 2-3 questions or observations from the reading.
See you next class!
P.S. Here’s the code we wrote together in class…
sos.ino
void setup() { pinMode(13, OUTPUT); delay(10000); } void dot() { digitalWrite(13, HIGH); delay(250); digitalWrite(13, LOW); delay(100); } void dash() { digitalWrite(13, HIGH); delay(250 * 3); digitalWrite(13, LOW); delay(100); } void s() { dot(); dot(); dot(); delay(1000); } void o() { dash(); dash(); dash(); delay(1000); } void loop() { s(); o(); s(); delay(10000); }