Relevant Horowitz and Hill: Pages 169-177 Relevant Lawless: Pages 133-169 for all transistors


There are many, many kinds of transistors that are used for a wide variety of things that could honestly take up the rest of these lab sessions.  At heart, most transistors do the same thing: change the electrical properties across two terminals depending on the voltage/current at a third terminal.  The specifics of implementation vary wildly, along with the uses for each different kind of transistor.  Some transistors are particularly good at acting as essentially electronic switches (letting you turn another thing on/off with a voltage or current) while others are better at amplifying signals (transforming a small change of current/voltage at one terminal to a large change elsewhere)

In this lab, just to get you an idea of what can be done with transistors, we'll start by talking about one particular kind: npn Bipolar-Junction Transistors (BJTs)

A <5 min intro to the physics of BJT transistors; watch if useful.

NPN BJTs are designed to operate such that a small current into the base (B) of the transistor will create a current $\beta \approx 100$ times larger through the collector (C) to the emitter (E) of the transistor.  In this state we say that the transistor is in the forward-active behavior regime.  However, there are two other common possibilities:

  1. Cutoff: If the voltage between the base and emitter isn't at least a diode drop (i.e. 0.6 V), there will be no current through the transistor at all.
  2. Saturation: If following the current gain rule would result in the collector to emitter voltage being zero or less, the transistor will instead saturate such that $V_{CE} \approx 0 V$, and additional current will bass through the transistor's base

For npn Bipolar-Junction Transistors (BJTS), the three well-defined behavior regimes, as shown below.  Note that this is a first-order model; real devices will exhibit small deviations depending on their construction.

There are also pnp transistors, which operate in the same general way except that the base needs to be 0.6 V lower than the collector for it to operate instead. 

Starting out: Identifying your transistor terminals

Unlike diodes, there are no universal markings on transistors that identify their three terminals.  Thus, we'll introduce you to the wonderful world of datasheets!

To start: locate a transistor that is labeled “2N3904L” on the middle line of text on the flat side. They should be in the drawer of components at the front of the room.

If there isn't the 'L' there it's fine, that just denotes a variant in specs that isn't critical for this lab.

It's hard to read the markings!

It can be hard to read the engraving on these, a bright overhead light at a slight angle seems to work well.  You may also have luck zooming in with a phone camera, if you can get it to focus.  

Our trusty transistor!  Note that “UTC” refers to the manufacturer (Uniconic Technologies Co)
and “SLT” is a manufacturer data code.

A cross-section of a BJT transistor, showing the base (silicon), collector (Al connection) and emitter (Au connection). Source

Now that you have the correct part, let's take a look at the datasheet, which contains far, far more information than we need now.

The things we need right now are on the first page: the circuit symbol has the Emitter, Base, and Collector labeled as pins 1, 2, and 3 respectively.  The sketch on the right shows how the numbered pins correspond to the device: if you hold the transistor by the legs with the curved part facing away from you, pin 1 is the leftmost one.  While it isn't stated explicitly, pin 2 is the center one and pin 3 is the rightmost. 

A mapping of package pins to the circuit symbol Mapping package pins to the physical device

The Emitter Follower

The first circuit we'll build is an emitter follower, a circuit whose output “follows” the input.  Not exciting at first, but we'll build up to its usage.

To begin, construct the circuit depicted below, using your variable power supply as the input $V_{in}$.

A compact representation of an emitter follower circuit An expanded diagram that explicitly shows all connections and loops in the circuit

Note that you'll have to change the configuration if you want to explore negative voltages:

If you connect the black terminal to ground and use the red and green terminals for $V_{in}$, the result will be a positive voltage If you connect the red terminal to ground and use the black and green terminals for $V_{in}$, the result will be a negative voltage This is because the voltage on the power supply screen only indicates the difference between the red and black terminals.

Keep the input voltage between $-5V$ and $+5V$ .  If it is too negative, it can damage the transistor.  If it is too high, you can end up in a funky behavior regime for your transistor which is not particularly useful.

HELP! My output is oscillating when it shouldn't be!

Don't panic! This is one area where textbook physics and experimental physics can diverge. When we build the actual circuit, our pins will effectively have very small capacitors across them due to the protoboard's construction (metal plates separated by distance = capacitor). In addition, loops of wire may introduce inductive connections we weren't expecting. The end result is that you can end up building an accidental oscillator, with a frequency from kHz to MHz.

Thankfully, there are a few solutions that may help and have little impact on the rest of your circuit:

Bypass capacitors By adding capacitors between power supply connections and ground, you introduce a path for high-frequency fluctuations that will bypass the rest of your circuit. Meanwhile, the DC behavior will be essentially unchanged.

Our emitter follower with an added bypass capacitor. Note that the exact capacitance isn't critical at all, but smaller capacitors (e.g. in the nF range) will have less impact on the DC behavior.

Note that it's important to place bypass capacitors physically close to the area that might have problems. Placing things two feet away at the supply won't be much use for handling non-ideal behavior.

Base Resistors

The other option that may work is to add a small resistor (~10 - 100$\Omega$) between the input voltage and the transistor base. This helps modify the characteristics of some RLC network we've inadvertently created so that it suppress unwanted oscillations.

Test the limits of your circuit by determining the maximum and minimum values of $V_{out}$ along with the values of $V_{in}$ that produce these extremes.

After you resolve how the circuit responds to DC voltages, let's use a sine wave as input instead. 

Replace the input connection with the function generator, and set the peak-to-peak amplitude to 2V.

What do you observe under these conditions?

Adjust the offset until $V_{out}$ has the same shape as $V_{in}$. 

For what range of offsets does the output “follow” the input?

Putting the transistor to work

So, the emitter follower circuit worked, but it isn't that exciting.  Let's tweak the circuit by adding in an LED on the emitter side.  Note that the longer leg of the LED is the anode, so it should be the one closer to $V_{out}$

A typical LED, along with its circuit symbol. Note that the anode (more positive side) has a leg that is longer than the cathode. In addition, the diode's knee voltage is typically between 2 and 3 V. The other telltale identifier is that the anode connects to the larger internal metallic contacts with a notch in the center
Why the different knee voltage?

Light emitting diodes are designed with different semiconductor bandgaps than normal diodes. For instance, red and yellow LEDs may have a blend of Gallium with Aresenic and Phosphor to create ~2 V bandgaps. Blue LEDs use nitrogen and magnesium compounds to ge a ~3V bandgap. Why? Well when there is a direct 2-3 eV transition in the semiconductor, electrons and holes recombining will produce produce visible light (whose photons have a couple eV of energy). See also

White LEDs are just blue LEDs with a phosphor material that will down-convert some blue photons into other colors of light, which our eyes interpret as white.

LED driver I
Predict how the above circuit will act (i.e., when the LED will be light and when it will be dark) as you vary $V_{in}$ between 0 and +5V. Use the DC power supply for this part.

How do I predict BJT transistor behavior?

  • Check if the base to emitter (BE) junction be forwards biased.

First check if the base to emitter junction could be forwards biased (i.e., have ~0.6V across it) and have a current from the base to the emitter. In this instance, we're comparing $V_{in}$ to 0V. Whenever $V_{in}$ is less than 0.6V, we're in the cutoff regime with no current anywhere in the transistor. In that case, we're finished. Otherwise:

  • Assume the transistor is forward-active and check for contradictions.

In practice, this usually means assessing what the voltage at the emitter would be, figuring out the emitter current, and checking if that would imply that the collector would be at a lower voltage than the base. If not, you're done! Otherwise, assume that the collector and base are at roughly the same voltage, and that any additional current needed is from the transistor's base.

Build the circuit, test your predictions, and resolve any discrepancies.

If there's less than an hour of lab left, skip past this to the third circuit. You can come back if time permits.

While that circuit can work, let's change it up by switching the LED to be on the collector side

Predict how this will change the LED's behavior (i.e. the ranges of inputs that will light the LED)
LED driver II

Build the circuit, test your predictions, and resolve any discrepancies.

Finally, we'll make one last modification, as shown below

Yet another LED driver circuit. Notice that there are now resistors on both the base and collector side, while the emitter is grounded.
Again, predict how the circuit will act (i.e., when the LED will be light and when it will be dark) as you vary $V_{in}$ between 0 and +5V.

Build the circuit, test your predictions, briefly compare the three circuits.

Keep this circuit built on your breadboard!

Your first sensor

We're going to diverge slightly now and have you build a darkness detection sensor.  We can do this by utilizing a photoresistor along with a regular resistor in a voltage divider.

Photoresistors are semiconductor devices whose resistance decreases as more light is incident on them. 

The schematic symbol for a photoresistor.  The arrows are optional. A physical photoresistor.  Note that ours is quite small, about 3mm wide on the top part. A commercial nightlight that uses a photoresistor.  Zoom in on the image to see it just above the brand logo
Using your digital multimeter, measure the resistance of your photoresistor in both ambient light and when covered.

Now that you have this information, your goal is to design a voltage divider circuit (using your DC power supply) that will:

  • Have $V_{out}$ be relatively small ~0.5 V) in ambient light
  • Have $V_{out}$ increase as it gets darker, getting to at least $+3V$ when completely obscured
  • Be constructed only using your power supply, the photoresistor, and one or two other resistors

There is not a unique solution to this problem, so don't worry if your implementation isn't exactly the same as someone else's.  Also don't be concerned about linearity or calibration, we don't have to tools to address that at this point in the course.

Create a diagram or sketch of your circuit, and describe how you expect it to behave

Build and test your circuit.  If it does not behave as expected, include what you did to make it function.
A template for your sensor. You'll want to replace X and Y with the components you're using.

Making a nightlight

Now that you have a darkness detector, let's try and turn it into a nightlight by adding a new LED and resistor to its output:

A depiction of the circuit to be attached to your sensor Full schematic of the sensor and light
Describe what happens when you cover and uncover the sensor.

Now that that (presumably) went poorly, we'll go back to the transistor circuit we built earlier:

The transistor LED driver you previously built Connected light sensor and LED driver
Describe the difference in how the circuit behaves compared to the straightforward implementation.

Lab Recap

In this lab, we walked you though:

  • The basic functional behaviors of a BJT, NPN transistor
    • Cutoff, where there is no current through any part of the transistor
    • Forward-active, where a small current at the base is amplified to much larger currents at the emitter and collector
    • Saturation, where the base voltage is comparable to or higher than the collector voltage, and there may be significant base current
  • How to look up information in a datasheet
    • Datasheets are to electrical components what stackoverflow is to programming.
    • Using datasheets won't be a huge part of this class, but knowing that they exist is essential to even moderately complex circuit design.
  • How to use a transistor as an electrical on/off switch
    • This property is the basis of essentially all modern computing. Being able to conditionally change circuit properties is enough to implement mathematical logic operations, and the rest is built upon that foundation.
    • Different, more power-efficient kinds of transistors are used in most computers but the basic idea is the same
  • How to use a transistor to fix impedance problems
    • Without active circuit elements like transistors, chaining circuits together to do useful operations becomes extremely difficult.
    • We'll introduce operational amplifiers and other integrated circuits later that can do this job much better.

Optional Part: LED control techniques (This is ungraded)

Set the function generator to produce a square wave and vary the frequency.

O.1 At what frequency do you stop seeing individual blinks (on/off cycles) of the lights? This should be somewhere on the order of 10s to 100s of Hz.

Set the frequency well above that which you found in part O.1, scroll down to the 'duty' option and select it.  Look at $V_{in}$  and $V_{E}$  (the emitter voltage) on the oscilloscope as you adjust the duty cycle percentage on your function generator.  

O.2 Briefly describe the effect the duty cycle has on $V_{in}$.   O.3 What effect does altering the duty cycle have on the brightness of the LEDs?  Explain why this happens.