One of the main things you’ll do in electronics is switch voltages. However, for both beginners and advanced electrical engineers, the task of choosing a method of switching can be quite difficult. In this post, I’ll discuss some of the more popular ways of switching voltages, where they are used, how they work, and then I’ll summarize them all in a convenient table. It won’t be in any real order, so feel free to use the slider on the side of the page to switch (pun intended) to whatever page you like.
JFET
Starting off weird, we have the JFET, the junction field effect transistor. Discrete JFETs are used less and less these days, however, they have a few very specific and very good uses. JFETs are similar to MOSFETs, but without the body diode. This means that, in essence, the JFET is bidirectional; however, the voltage at the gate (for an n-channel JFET, the more common type) needs to be more negative than the voltage at both of the other terminals. It’s also very important to note that JFETs are depletion-mode, so normally-on. Applying a more negative voltage (n-channel) or more positive voltage (p-channel) than both the drain and the source will turn them off.
Another important property is that at low gate voltage differentials, JFETs have a linear voltage-resistance characteristic. This makes them extremely useful in precision circuits and many analog circuits. As long as you have an additional more negative (n-channel) or more positive (p-channel) voltage source available, driving JFETs is very easy.
Common applications of JFETs are:
- Audio switching circuits
- It’s very easy to use JFETs to switch on/off audio (or generally any) signals. There is a classic JFET audio switch circuit which you can find in, for example, the majority of guitar pedals.
- RF/audio/signal preamplifiers
- The linearity and high-frequency operation of JFETs make them very convenient for preamplifiers. In a class A amplifier configuration, they provide an almost-textbook voltage divider, which makes them easy to analyze and characterize. Sometimes, they can cross over to actual amplifiers too, but their class A operation makes them quite inefficient. Additionally, unlike MOSFETs, they haven’t been developed to have incredibly low on-resistance in saturation.
- Many modern popular operational amplifiers are made with JFETs, particularly low-power ones, because it’s quite easy to switch JFETs on and off.
Transistors
I won’t go too deep into this section because many others have written much more about transistors than I have. I’ll also link you to my component guide, which you can use to find good and cheap transistors for your projects. For more basic information, look at “Understanding Basic Analog – Active Devices” (if the link is gone, look for TI sloa026a)
MOSFET
MOSFETs are used to switch almost everything, and for good reason. Modern MOSFETs are easy to drive, have insanely low on-resistance, and are very affordable. They can be used to switch everything (even AC with some effort), so here is a very inexhaustive list of applications:
- Any type of voltage rail
- Turning things on and off
- Switching power supplies
However, many people don’t know just how much more performance and longevity you can get out of a MOSFET when you go a bit further to add some extra components, so here are some resources where you can learn to use things like:
- Snubber networks
- Gate drive circuits
- Paralleling MOSFETs
- Thermal management
- https://www.ti.com/lit/ml/slua618a/slua618a.pdf (if the link is gone, look for TI slua618a)
- MOSFET-Application-Handbook.pdf (if the link is gone, look for the NXP MOSFET application handbook)
BJT
BJTs are getting quite sidelined due to the amazing advances of MOSFETs in recent times, but they have their uses. Generally, they can do everything that a MOSFET does but are more inconvenient to use due to the requirement to continuously feed them current. Where MOSFETs can be driven with a tiny control signal, a BJT needs an annoyingly non-constant proportion of the current being driven to be active. Due to this current amplification thing, they are used widely in analog circuits. In most modern designs, they’re used for things like:
- Driving LEDs and dimming them without switching
- Amplifying low voltage/low current signals
- Buffering signals
- Driving MOSFETs/relays/other switching devices
- Voltage level translation
In addition, BJTs are slightly more rugged than MOSFETs, so you can see them in noisy applications where EMI and voltage spikes are expected.
IGBT
The IGBT is just a MOSFET controlling a large BJT internally. They’re used for switching DC voltages with a low frequency but a very high voltage and current. They’re much more resilient to nasty external events and are generally very easy to drive. You can see them in a ton of industrial stuff. However, they’re generally large and less efficient than modern MOSFETs. They’re used in most of the same areas as MOSFETs.
High-side/low-side switches
These are essentially a MOSFET with included gate drive circuitry and an internal method to generate a voltage necessary to drive the MOSFET well. This can drastically reduce your circuit footprint and make your design much easier. Many of them also include protection and measurement subcircuits so that you can see the voltage, current, temperature, and energy of what you’re passing through. These keep getting better, cheaper, and more fully featured, so I’m excited by their potential to even replace MOSFETs as the default switching component. It’s like a MOSFET without many of the drawbacks! Their set of features is very device-dependent, so make sure to do a lot of research. In addition, they generally have a higher on-resistance than a MOSFET of the same size because they put a lot more stuff in that same size.
In terms of uses, they’re basically the same as MOSFETs, so I won’t repeat myself here.
Analog switches
These are quite cool and complicated parts that can switch low AC and DC voltages with low currents. They’re very easy to use, but you have to be very mindful of their datasheet characteristics, particularly regarding distortion and other signal-changing effects. However, modern analog switches are very high-quality. Internally, they’re built out of JFETs or 4-terminal MOSFETs. You can find them in many analog circuits used for various tasks – just open up an oscilloscope, and you’ll see a bunch. If you’re an EEVBlog viewer, you’ll notice how Dave notices CD4051s (the analog switch, along with the CD4066) everywhere! They’re used for:
- Switching analog or digital signals
- Acting as a low-current relay
- You can simulate button presses easily with these!
- Multiplexing many analog or digital signals
For digital uses, however, you have to be careful since they can introduce distortion and lower the operating frequency of your signals. Depending on your signal type (or protocol), it may be better to use a specifically digital switch.
You can find out how they work and how to make one yourself here: Selecting the Right CMOS Analog Switch | Analog Devices and Build CMOS Logic Functions Using CD4007 Array – ADALM2000 [Analog Devices Wiki] (see bottom) (if the links are missing, look up the names of the links here).
TRIAC
TRIACs are just 2 BJTs in a trenchcoat (they even look like it!) that are excellent for switching AC voltages. Like IGBTs, they’re generally used in larger and more high-current circuits because their benefits are much more evident at higher currents. You can find them in many kitchen appliances and things like that. If it has an analog dimmer switch, it probably has a TRIAC inside.
It can be quite difficult to drive TRIACs by themselves, so when you want to explicitly control them with some signal, they’re combined with an optoisolator/optotriac. With some capacitor analog circuit wizardry, you can also drive them without one. The main drawback of TRIACs (in my opinion) is the diode-level voltage drop through a TRIAC, which at higher currents, results in a lot of heat being generated.
TRIACs are the basic building block of most solid-state relays (SSRs). SSRs are to TRIACs what high-side/low-side switches are to MOSFETs. Thus, their main uses are:
- AC voltage switching
- AC motor speed control
- AC light dimming (doesn’t work well with non-incandescent lights)
Optocoupler/optotriac
An optocoupler is essentially a BJT with its gate controlled by light rather than current. This is possible due to the photoelectric effect (see the section on photodiodes to learn more). An optotriac is the same but with a TRIAC, which we already mentioned is very similar to a BJT. They’re used whenever you need to isolate two signals from each other. Both devices have an LED inside that lights up the gate of the BJT or TRIAC. Thus, driving them is as easy as driving an LED – because it is!
In addition, because they’re isolated and there is no physical connection between the LED and the switching element, you can protect one part of your circuit from an extremely catastrophic failure on the other (on the level of a lightning strike).
However, they’re generally lower current devices and usually need to be externally buffered. For optocouplers, adding another discrete BJT creates a Darlington configuration, which can then additionally drive a MOSFET or just a voltage by itself. The same applies to the optotriac.
One common mistake people make with these devices, particularly for optocouplers, is sharing the ground between the isolated sides. By doing this, you lose isolation, so you essentially have a mediocre transistor/TRIAC left over. With this, you still have some more circuit protection if one of the sides fails catastrophically, but you can also get that protection with much simpler methods, like the inherent gate oxide protection of a MOSFET or just a combination of diodes, capacitors, and resistors.
The main limitations and differences between these devices are their switching speeds (which can vary widely) and the current transfer ratio (CTR, equivalent to transistor gain).
These devices are useful for:
- Isolating signals
- Eliminating ground loops (e.g. the MIDI protocol)
- Isolating analog subcircuits
- Protecting subcircuits from voltage spikes (and general circuit protection)
Relays
Relays are some of the oldest and most widely used switching elements. They’re extremely rugged – even radiation-proof – and simple to make, install, and switch. They also offer a completely isolated way to switch AC or DC voltages with a very low resistance. However, they have the very significant issues of:
- Requiring comparatively very high currents to switch voltages, thus even more circuitry to turn them on
- Extremely low switching speeds due to the need to mechanically bridge the connection
- Comparatively huge size compared to other elements
- Break much more easily than other switching elements because they’re mechanical
- Inductive spikes when switched on and off can destroy circuits without adequate protection
Reed relays
Reed relays are just very small versions of normal relays. They combine the benefits of relays into a very small package with a similarly low driving current. They’re extensively used in high-performance analog circuits, as they can replace semiconductor analog switches without any of their drawbacks. Nevertheless, they’re still relays, so they suffer from mechanical fatigue, slow switching speed, and relatively high current draw.
Reed relays are used in some measurement equipment, particularly RF equipment, since they introduce much less distortion and other unwanted effects to signals. Their hermetic seal is also very useful in some cases – you can switch down to single electrons! Higher-performance oscilloscopes also use them. I believe that they’re a very underrated part. Their main uses are:
- Switching low-current signals without introducing distortion and unwanted effects
- Isolated signal switching
- Extreme-precision signal switching
Relays (regular)
The “bread and butter” of industrial equipment for the past century, regular relays are used to switch all kinds of signals. In addition to switching, they can also be used for basic logic operations. I’ve already said most of what needs to be said about relays above. They’re a difficult part to spec in since they fail much faster than transistors (comparatively, we’re still talking about years), but offer other amazing benefits. Ultimately, I believe that for DC switching they are mostly obsolete, and the same applies to AC switching, where a solid-state relay can be the better choice in most cases.
Solid-state relays
These aren’t the classic electromechanical relays but rather TRIACs in a box with a bunch of protection circuitry. They are quite expensive but much easier to drive and use. They’re also much more reliable since they have no mechanical parts. Usually, they’re constructed with an optotriac, so they can only switch AC signals. Some are constructed differently, but this will be explicitly stated in the datasheet. If it weren’t for their inherent voltage drop and high price, they’d be the perfect part.
You can learn more here: Basics of Solid-State Relays (if the link is gone, look for TI basics of solid-state relays).
Other methods
Some methods that won’t be included in the summary and are quite obscure but can be useful in very specific applications are:
- Silicon-controlled rectifiers/DIACs/thyristors
- Generally used for extremely-high-power AC switching
- Same family as TRIACs
- Vacuum tubes
- Difficult to drive, difficult to find, and very large, but also quite rugged and have quite a few obscure uses, such as switching insanely high (gigahertz and terahertz) frequencies (a fun read: Introducing the Vacuum Transistor: A Device Made of Nothing – IEEE Spectrum)
- 4-terminal MOSFETs
- If you look at the structure of a MOSFET, it has 4 parts inside, but in 99.9% of cases, MOSFETs only have 3 pins – this is because the additional “body” is connected to the source
- They’re used in analog switches, voltage translators, and many ICs internally
- They’re also used for some obscure and very high-performance amplifier topologies
- Magnetic amplifiers
- Difficult to drive, massive, but can be useful in some obscure applications, like in modern PC switching power supplies
- These are also extensively used in early guided missiles of all kinds because they can be smaller than vacuum tubes, are easy to make, and nuclear EMP resistant (The Vacuum Tube’s Forgotten Rival – IEEE Spectrum)
- “Seminar 500 Topic 7 – Magnetic Amplifier Control” (if the link is gone, look for TI magnetic amplifier control for low-cost secondary regulation)
- They’re completely isolated, which can also make them very easy to use – in a way, they’re like magnetic relays
- Photodiode/phototransistor/photomultiplier
- All of these use the photoelectric effect to switch on but are more practical as measuring devices than switches
- A fun fact is that all semiconductor devices are photodiodes/phototransistors – this is just inherent to PN junctions – so, for example, all WLCSP (exposed die) packages don’t work under most types of light
- Another fun fact is that LEDs are photodiodes, and photodiodes are LEDs – they’re just more optimized to be one rather than the other
- Tunnel diode
- There are some obscure switching topologies with tunnel diodes, but I don’t understand them – this is mostly here because it’s a cool part
- Selsyns
- Not really for switching, very obsolete, but they’re also very cool
- ISFET/BioFET
- A very obscure section of FETs that use different chemical effects to turn on, such as ion concentrations (aka pH sensors) – more for measuring devices than switches, but still very cool
Summary
Type | Relative cost | Relative size | Relative series resistance | Relative maximum voltage | Relative switching speed | Ease of driving | Number of components | DC operation | AC operation | Directionality | Isolation |
JFET | Low | Tiny | High | Medium | Very high | Difficult | 1 (excluding negative voltage generator) | Yes | Yes | Bidirectional | No |
MOSFET/BJT/IGBT | Low | Tiny – Small | Very low | Low – Very high | Device dependent, from low to very high | Easy | 3 (2 resistors) | Yes | No | Unidirectional | No |
High-side/low-side switches | Medium | Low | Very low | Medium | Low – Medium | Very easy | 1 | Yes | No | Unidirectional | No |
Analog switch (ex. CD4066/405x) | Low | Medium | Medium – High | Medium | Medium | Easy | 1 | Yes | Yes | Bidirectional | No |
TRIAC | Low | Low | Medium | High | Low – Medium | Difficult | Variable | Possible, but not recommended | Yes | Bidirectional | No |
Optocoupler/optotriac | Medium | Medium | High | Low | Device dependent | Easy | 2 | Yes (for optocoupler) | Yes (for optotriac) | Depends | Yes |
Reed relay | Medium | Large | Very low | Medium | Low | Easy | 3 (incl. diode and transistor) | Yes | Yes | Bidirectional | Yes |
Relay | High | Very large | Very low | Very high | Very low | Easy | 3 (incl. diode and transistor) | Yes | Yes | Bidirectional | Yes |
Solid-state relay | Very high | Very large | Very low | Very high | Low – Medium | Easy | 1 | Yes, instantaneous switching | Yes, zero-cross switching | Bidirectional | Yes |