A tour of transistors

I guess my problem with almost every proper electronics text is that when they get to transistors, they cover a bunch of deep details and my eyes always glaze over and I never could quite grasp about how to solve the problems I actually wanted to solve.

I’m going to mostly skip to the end here, to build on what I covered in the section on driving LEDs and will touch on further in future sections, covering a lot of the important details without getting too bogged down.

I’m going to ignore using these parts for analog amplification or driving motors or whatnot. If you are driving a motor with a switch, you need to add a clamping diode so it won’t zap the device, but I’ve not needed to play with that.

If you read a little bit into this and decide that, eh, you don’t really care that much about transistors after all… that’s actually fine because the nature of technology is built up with layers of abstraction. It can be useful to know, but most of the complexity of transistors is used to build higher-level devices and you can skip out to another chapter.

MOSFETs

If you get comfortable with these, your designs will be FETed for sure. Because, if you want the one most singularly useful semiconductor part, you want a MOSFET. Especially when you are dealing with digital stuff where you just need some external parts to actually drive the power stuff, you can frequently completely ignore everything about any other kind of transistor.

Mosfet structure

Basically, a MOSFET is a voltage-driven device, almost-but-not-quite a switch. When the difference in voltage across the gate pin compared to the source pin crosses Vgs(th), the gate turns on and the MOSFET starts to operate.

Before the late 1970s, MOSFETs were low power devices and an extremely interesting area in the world of computing devices. Then suddenly people re-designed the MOSFET and created the “Power MOSFET” and suddenly it went from a kinda-interesting low-power device to something that people were using to control massive loads.

Power MOSFETS are extremely efficent these days. This means that you can switch a considerable amount of current through a fairly small package with minimal heatsinking, with a few caveats. Recent innovations like SiC and GaN transistors continue to drive up the efficiency.

One way to measure this is their on-resistance. They seem to have started out being measured as ohms, but modern MOSFETs are measured in milli-ohms (mΩ, notice that the M is not capitalized) instead.

The biggest problem is that a MOSFET is able to be fried by static electricity. The magic happens in a tiny metalized layer and all it takes is a bit too much voltage and you’ve sparked across it and ruined the device.

I’m still a little hazy about the total durability of modern MOSFETs against getting zapped by ESD in corner-case situations. The worst of all possible MOSFET situations is when you have a small-signal MOSFET (say the classic 2N7000) without a built-in ESD diode and you are handling the bare device and create a static spark that’s not even enough that you’d feel it but you just ruined the MOSFET.

Power MOSFETs are different, but in order for this to make sense, you have to understand gate charge. One feature of the MOSFET as compared to a BJT is that MOSFETs have is that the gate, which is what you are using to control the voltage flowing through the device, is made from a tiny layer of silicon oxide or another dialectric and that has a capacitance to it. Not a lot, just a little, but enough that you can’t always ignore it. This, by the way, makes accurately simulating MOSFETs tricky because it throws off what would otherwise be simple equations.

All MOSFETs need this gate capacitance but Power MOSFETs tend to have much higher gate capacitance so it’s harder to actually swing the gate lead far enough fast enough with a simple static spark. Also, you can get MOSFETs with built-in ESD diodes, although apparently it is harder to test a MOSFET + Zener combination in a production line and so manufacturers concluded it was better to ship MOSFETs without a built-in ESD diode.

Furthermore, in the finished device, you can always add ESD diodes.

This leads you to another problem, which may or may not be super-catastrophic. Pretty much all of the good MOSFETs are surface-mount parts, the ESD protected ones doubly so.

This hasn’t presented a huge problem for me. You can get little bits of PCB that you can solder a single SOT-23 or SOT-223 to and that has been my approach to experimentation, and then all of my final designs are just surface-mount custom PCBs anyway.

I’m going to handwave over a lot of things here, doubly so because I’m going backwards and covering MOSFETs before BJTs but there’s some effort made in how MOSFETs were introduced to make them look like regular BJT transistors. There are vanishingly few MOSFETs with extra terminals that let you take advantage of the edge cases that the way a MOSFET packaged in the standard way can’t.

The important thing to note is that your standard MOSFET will work as if it’s a diode in the opposite direction. If you look at the sort of MOSFET symbol that a schematics capture tool will draw, they draw in the diode as part of the symbol. The difference is that the diode has a forward voltage for power flowing backwards, whereas the MOSFET has a very tiny resistance for power flowing forwards.

Sometimes you can get creative and take advantage of what amounts to a built-in diode. Other times, you’ll see a pair of MOSFETs blocking both directions in order to make it a real switch.

Also, if you read any of the MOSFET examples in 70s-80s circuit textbooks and some of this continues even to modern textbooks, they spend a lot of time talking about the things you can do with small-signal MOSFETs, using them as amplifiers, but I’m primarily talking about Power MOSFETs that work amazingly as switches and very poorly as amplifiers. Driving a MOSFET at anything other than on or off means that you are not taking advantage of the extremely low on-resistance. In the off state, it’s blocking power with an extremely high resistance. In the on state, it’s passing power with an extremely low resistance. Neither way creates that much heat. But driving it between the two turns it into a resistor generating heat.

Paramaters and graphs to care deeply about

  • Vdss: Maximum voltage between the drain pin and the source pin. This is the maximum amount of voltage that can flow through the device
  • Vgss: Maximum voltage between the gate and the source pin.
  • Id: Drain current. This is how much power can flow through the device, although in actual practice you may not be able to run Vdss volts at Id through the device without burning it up.
  • Vgs(th): The threshold point at which the MOSFET starts to switch on and barely allow power through. Note that, at the threshold point, this will be at a fairly high resistance so if you have a device with Vgs(th) of 3.3V and you put 3.3V into the gate, it’s not going to allow much power through.
  • Rds(on): This is frequently given at several different Vgs values. This is the resistance through the device when it’s on. So, for example, if I have a device with Rds(on) of 61 mΩ at a Vgs of 4.5V, this means that, electrically speaking, it’s a 61 milli-ohm resistor. Generally, if a device has a Rds(on) specified for a given Vgs, that’s more indicative of what voltage you can drive the device with than the Vgs(th).
  • The transfer characteristic graphs for Rds(on) against Vgs. This isn’t always provided, but it’s usually a great way to see how accurate Vgs(th) is. There are a lot of devices with a Vgs(th) of 1.8 V but then you look at the Rds(on) vs Vgs chart and see that it’s not fully on until you get to 4.5V or so.
  • Qg: This is the number to plug into equations for figuring out how fast gate switching is and how much power it uses up.
  • tD(on) and tD(off): How fast the MOSFET can switch, which determines how high of a frequency you can feed the MOSFET with.

BJT’s

MOSFETs are voltage-driven devices, which means that you can kinda ignore a bunch of the details involved and treat them as black-boxes, even if it’s actually something that requires a lot of electrical engineering to completely grasp.

BJT structure

BJT transistors are the original solid-state electronics device, one that heralded the start of sweeping worldwide changes. So we’re going backwards, actually.

BJT transistors are a different beast from MOSFETs. They are much easier to fabricate and lack the thin gate layer, so they are also harder to zap with static.

The problem is that they are current-driven devices and this means that you need to do some relatively careful tinkering to make sure that the right amount of current flows through the circuit and this also means that it requires a proportional current flow, which puts a hard limit on exactly how much power you can control from a pin that may be only able to deal with a few mA.

This also means that they “waste” energy, which I’ll talk more about later.

At one point, no electronics lab was complete without an assortment of 2N2222 NPN transistors and 2N2907 PNP transistors, but a lot of modern kits won’t include any and I’m not really sure if that’s worth the effort anymore.

Where BJTs (and, for that matter J-FETS) shine compared to MOSFETs is that you can use them as analog amplifiers, except that most of the time, you actually really want an op amp instead of a transistor because you are amplifying or modifying a low-power signal or you are basically building some sort of power amplifier. Oh, and all of the non-ideal properties come into play and you need to do some serious figuring that I can’t do. That being said, if you can find a good non-power MOSFET that’s designed for analog stuff, the math is harder there.

Plus because they are curent driven, you need to make sure that you have resistors to prevent the transistor from frying itself.

Thus, if you are making analog audio stuff like artisinal guitar pedals or eurorack modules, BJT’s are super handy. There are probably BJTs scattered throughout your IC chips that you can basically ignore, because of their analog properties.

However, I’ve generally concentrated on my designs just using MOSFETs and largely ignored BJTs and for the sorts of things that I work on, this seems to work just fine.

The boundary case is that if you are switching things off of a 3.3v or lower GPIO line, the MOSFET won’t necessarily be switching very well and it might be simpler to just use a BJT.

Also, BJT’s can be damaged but they aren’t nearly as susceptible to ESD as a MOSFET.

Darlington transistor pairs

Two BJT’s connected, which means that you use one transistor to switch the other, which gives you much higher gain and therefore you can switch a lot more power with the same amount of current.

Before power MOSFETs were there, you’d use a darlington pair to switch power on and off in much the same way, but most folks use a power MOSFET instead these days.

Again, they don’t really appear to much in my projects, although the ULN2003/ULN2803 7 or 8 channel darlington driver IC is a handy part that’s available as a through-hole part that solves problems nicely.

Where to go from here?

  • Switching power on and off

Posted:

Updated: