From 752a06ec0ebf20d6232b13f1ea53fe21fefcefbd Mon Sep 17 00:00:00 2001 From: Sadeep Madurange Date: Mon, 8 Dec 2025 17:34:35 +0800 Subject: Fix list indentation. --- _site/archive/mosfet-switches/bjt.png | Bin 12838 -> 0 bytes _site/archive/mosfet-switches/index.html | 173 -------------------------- _site/archive/mosfet-switches/n_high_side.png | Bin 10825 -> 0 bytes _site/archive/mosfet-switches/p_high_side.png | Bin 10724 -> 0 bytes 4 files changed, 173 deletions(-) delete mode 100644 _site/archive/mosfet-switches/bjt.png delete mode 100644 _site/archive/mosfet-switches/index.html delete mode 100644 _site/archive/mosfet-switches/n_high_side.png delete mode 100644 _site/archive/mosfet-switches/p_high_side.png (limited to '_site/archive/mosfet-switches') diff --git a/_site/archive/mosfet-switches/bjt.png b/_site/archive/mosfet-switches/bjt.png deleted file mode 100644 index 9858fa7..0000000 Binary files a/_site/archive/mosfet-switches/bjt.png and /dev/null differ diff --git a/_site/archive/mosfet-switches/index.html b/_site/archive/mosfet-switches/index.html deleted file mode 100644 index 902d813..0000000 --- a/_site/archive/mosfet-switches/index.html +++ /dev/null @@ -1,173 +0,0 @@ - - - - - MOSFETs as electronic switches - - - - - MOSFETs as electronic switches - - - - - - - - - - - - - -
-
-
-

MOSFETS AS ELECTRONIC SWITCHES

-
22 JUNE 2025
-
-

Recently, I needed a low-power circuit for one of my battery-operated projects. -Much of the system’s power savings depended on its ability to electronically -switch off components, such as servos, that draw high levels of quiescent -currents. My search for a solution led me to MOSFETs, transistors capable of -controlling circuits operating at voltages far above their own.

- -

Acknowledgments

- -

This article is a summary of what I learnt about using MOSFETs as switches. -I’m not an electronics engineer, and this is not an authoritative guide. The -circuits in this post must be considered within the narrow context in which -I’ve used them. All credits for the schematics belong to Simon Fitch.

- -

Preamble

- -

For a typical MOSFET-based switch, we can connect a GPIO pin of a -microcontroller to the gate of a logic-level N-channel MOSFET placed on the low -side of the load and tie the gate and the drain pins of the MOSFET with a -pull-down resistor. This would work as long as the power supplies of the -microcontroller and the load don’t share a common ground. Things become more -complicated when they do (e.g., controlling power to a component driven by the -same microcontroller).

- -

In that scenario, the source potential visible to the load is the difference -between the gate and the threshold potentials of the MOSFET. For example, when -the gate and the threshold potentials are 3.3 V and 1.5 V, the potential the -load sees is 1.8 V. So, to use a low-side N-channel MOSFET, we need the gate -potential to be higher than the source potential, which may not always be -practical. The alternative would be a hide-side switch.

- -

P-channel high-side switch

- -

The following schematic shows how a high-side P-channel MOSFET (M1) could -switch power to a 6 V servo driven by a 3.3 V MCU.

- -

P-channel high-side switching circuit

- -

When the microcontroller outputs low, the M2 N-channel MOSFET stops conducting. -The R1 resistor pulls the gate of the M1 P-channel MOSFET up to +6 V, switching -the servo off. When the microcontroller outputs high on the GPIO pin, M2’s -source-drain connection starts conducting, causing M1’s gate potential to drop -to 0 V, which switches on power to the servo.

- -

N-channel high-side switch

- -

The P-channel high-side switch would be the typical architecture for our use -case. However, if we have access to a potential high enough to safely raise the -gate potential above the threshold such that their difference outputs the source -potential required to drive the load, we can switch on the high side using an -N-channel MOSFET:

- -

N-channel high-side switching circuit

- -

In the schematic, both M1 and M2 are N-channel MOSFETs. When the -microcontroller output is low, M2 stops conducting. This causes the M1’s gate -potential to rise above the threshold, turning the servo on. Conversely, a high -output on the GPIO line switches M2 on, which lowers M1’s gate potential. This -switches the servo off. The R2 pull-up resistor prevents the high impedance of -the output pins at power-up from switching the servo on.

- -

Both topologies require M2 to act as a level converter between circuits -containing the microcontroller and the servo, converting between 0 V and +6 V -or +9 V. M2 is a low-power signal converter carrying less than a milliamp of -current. The gate-source threshold voltage of M2 must be lower than the MCU’s -supply voltage. 2N7000, 2N7002, and BSS138 are popular choices for M2.

- -

The D1 flyback diodes used in the two topologies safeguard the MOSFET from -voltage spikes caused by inductive loads such as servos.

- -

A BJT alternative

- -

A Bipolar Junction Transistor (BJT) is a simpler, cheaper, and more widely -available type of transistor that can be used as a switch.

- -

BJT architecture

- -

In the schematic, when the MCU outputs high, Q2 starts conducting. Q2 amplifies -Q1’s base current. Unlike MOSFETs, which are voltage-driven, BJTs are driven by -base current. Resistors R3 and R4 must be chosen carefully to output the -desired base currents. “How to choose a -transistor as a switch” is an excellent guide on using BJTs as electronic -switches.

- -

Which topology to choose?

- -

The professional community appears to prefer MOSFETs over BJTs. MOSFETs are -more efficient when the switch is on. However, they are more challenging to -drive, especially with a 3.3 V MCU, due to the VGS potentials -required to achieve specified RDS(on) values (i.e., to turn them on -fully).

- -

N-channel MOSFETs have lower on-resistance values, making them more efficient -than P-channel ones. They are also cheaper. However, they are harder to drive -on the high side as their gate potential must be higher than the source -potential. This often requires extra circuitry such as MOSFET drivers.

- -

Further reading

- - -
- -
-
-
- - - - - - diff --git a/_site/archive/mosfet-switches/n_high_side.png b/_site/archive/mosfet-switches/n_high_side.png deleted file mode 100644 index c851768..0000000 Binary files a/_site/archive/mosfet-switches/n_high_side.png and /dev/null differ diff --git a/_site/archive/mosfet-switches/p_high_side.png b/_site/archive/mosfet-switches/p_high_side.png deleted file mode 100644 index 9f5397a..0000000 Binary files a/_site/archive/mosfet-switches/p_high_side.png and /dev/null differ -- cgit v1.2.3