Czy wolisz polską wersję strony elektroda?
Nie, dziękuję Przekieruj mnie tamHow to use a MOSFET as a high side switch?
To use a MOSFET as a high-side switch, place the MOSFET between the positive supply and the load, so the load remains connected to ground.
There are two common approaches:
This is usually the easiest method.
+V
|
|
Source
P-MOSFET
Drain
|
+---- Load ---- GND
A P-channel MOSFET turns on when its gate is pulled below its source.
\[ V_{GS} = 0 \]
\[ V_{GS} < 0 \]
For example, with a 12 V supply:
\[ V_{GS} = 0 - 12 = -12 \text{ V} \]
+12 V
|
|
S
P-MOSFET
D
|
+------ Load ------ GND
|
G
|
R1
|
+12 V
|
+---- R2 ---- NPN or small N-MOSFET ---- GND
|
MCU signal
A clearer version:
+12 V
|
|
S
P-channel
MOSFET
D
|
Load
|
GND
Gate drive:
+12 V
|
Rpullup
|
+------ Gate of P-MOSFET
|
Collector / Drain
NPN or small N-MOSFET
Emitter / Source
|
GND
MCU pin ---- resistor ---- base/gate of small transistor
| MCU output | Small transistor | PMOS gate | PMOS state | Load |
|---|---|---|---|---|
| LOW | OFF | Pulled to +12 V | OFF | OFF |
| HIGH | ON | Pulled toward GND | ON | ON |
This circuit is logic-inverting: a logic HIGH turns the load ON.
Typical value:
\[ 10\,k\Omega \text{ to } 100\,k\Omega \]
This keeps the MOSFET OFF when the control signal is floating.
Gate ---- Rpullup ---- Source
A small resistor in series with the gate can reduce ringing and switching noise.
Typical value:
\[ 10\,\Omega \text{ to } 100\,\Omega \]
For slow on/off switching, this is often not critical. For PWM, it becomes more important.
Most MOSFETs have a maximum gate-source voltage of:
\[ V_{GS(max)} = \pm 20 \text{ V} \]
So if you have a 24 V supply and pull the gate directly to ground:
\[ V_{GS} = 0 - 24 = -24 \text{ V} \]
That can destroy the MOSFET.
For supplies above about 15 V, add a Zener clamp between gate and source.
Example:
+24 V
|
S
P-MOSFET
D
|
Load
|
GND
Gate-source protection:
Gate ----|<|---- Source
12 V or 15 V Zener
For a P-channel MOSFET, the Zener is connected to limit the negative gate-source voltage magnitude.
A common choice is a 12 V or 15 V Zener between gate and source.
An N-channel MOSFET is electrically better in many power applications because it usually has lower \(R_{DS(on)}\), lower cost, and better current capability than an equivalent P-channel MOSFET.
However, it is harder to drive on the high side.
+V
|
D
N-MOSFET
S
|
+---- Load ---- GND
To turn on an N-channel MOSFET:
\[ V_G > V_S \]
Usually you need:
\[ V_{GS} = 5 \text{ V to } 10 \text{ V} \]
depending on the MOSFET.
But in a high-side circuit, when the MOSFET turns on, its source rises close to \(+V\). Therefore the gate must be driven above the supply rail.
Example with a 12 V supply:
\[ V_G = 12 + 10 = 22 \text{ V} \]
So a normal 3.3 V or 5 V microcontroller output cannot directly drive an N-channel MOSFET as a proper high-side switch.
If you connect it like this:
MCU pin ---- Gate
|
D
+12 V ---- N-MOSFET
S
|
Load
|
GND
the MOSFET behaves like a source follower, not a fully enhanced switch.
If the gate is driven to 5 V, the source may only rise to roughly:
\[ V_S \approx VG - V{GS(th)} \]
That might be only 2 V to 4 V at the load, not 12 V.
Also, \(V{GS(th)}\) is not the voltage needed for low-resistance switching. It is only the voltage where the MOSFET just begins to conduct a small test current. For power switching, use the datasheet \(R{DS(on)}\) rating at a specified gate voltage, such as:
\[ V_{GS} = 4.5 \text{ V} \]
or
\[ V_{GS} = 10 \text{ V} \]
A high-side driver generates a gate voltage above the source.
Typical driver methods:
| Method | Can stay ON continuously? | Typical use |
|---|---|---|
| Bootstrap high-side driver | Not indefinitely | PWM, half-bridges, motor drives |
| Charge-pump high-side driver | Yes | Static load switching |
| Isolated gate driver | Yes, if isolated supply is continuous | High voltage, isolated systems |
| Smart high-side switch IC | Yes | Automotive, protected load switching |
A bootstrap driver uses a diode and capacitor to create a floating supply above the source node.
Simplified circuit:
+12 V
|
D
N-MOSFET
S
|
+---- Load ---- GND
High-side driver:
Driver HO ---- Gate
Driver VS ---- Source
Driver VB ---- Bootstrap capacitor ---- VS
The bootstrap capacitor charges when the source node is low. When the MOSFET turns on, the capacitor “rides up” with the source and keeps the gate above it.
Bootstrap drivers usually cannot maintain 100% duty cycle forever because the bootstrap capacitor slowly discharges.
So bootstrap drive is excellent for:
It is not ideal for:
For continuous ON operation, use:
| Feature | P-channel high-side | N-channel high-side |
|---|---|---|
| Circuit complexity | Low | Medium to high |
| Gate drive requirement | Pull gate below source | Drive gate above source |
| Efficiency | Lower for same die size | Higher |
| \(R_{DS(on)}\) | Usually higher | Usually lower |
| Good for simple DC switching | Yes | Yes, with proper driver |
| Good for high-current loads | Sometimes | Usually better |
| Good for high-frequency PWM | Possible, but less ideal | Preferred |
| 100% duty-cycle operation | Easy | Requires charge pump or isolated driver |
A high-side switch is placed between the positive supply and the load.
+V ---- Switch ---- Load ---- GND
This is different from a low-side switch:
+V ---- Load ---- Switch ---- GND
High-side switching is often preferred when the load must remain referenced to ground. This is common in:
Suppose you want to switch a 12 V load from a 3.3 V microcontroller.
+12 V
|
|
S
P-channel MOSFET
D
|
Load
|
GND
Gate network:
+12 V
|
47 kΩ
|
+-------- Gate of P-MOSFET
|
1 kΩ
|
Drain/Collector
small N-MOSFET or NPN
Source/Emitter
|
GND
MCU GPIO ---- 1 kΩ to 10 kΩ ---- base/gate of small transistor
| Component | Typical value | Purpose |
|---|---|---|
| PMOS gate pull-up | 10 kΩ to 100 kΩ | Turns PMOS off |
| Gate series resistor | 10 Ω to 100 Ω | Reduces ringing |
| NPN base resistor | 2.2 kΩ to 10 kΩ | Limits MCU/base current |
| NMOS pulldown device | 2N7002, BSS138, etc. | Pulls PMOS gate low |
| Zener gate clamp | 12 V or 15 V | Protects \(V_{GS}\) |
Do not choose the MOSFET only by current rating. The datasheet current rating is often based on ideal thermal conditions.
Check these parameters:
Choose:
\[ V{DS(max)} > V{SUPPLY} \]
With margin.
For a 12 V system, use at least a 20 V or 30 V MOSFET.
For a 24 V system, use at least a 40 V or 60 V MOSFET, depending on transients.
Power loss is approximately:
\[ P{cond} = I^2 R{DS(on)} \]
Example:
Load current:
\[ I = 5 \text{ A} \]
MOSFET on-resistance:
\[ R_{DS(on)} = 30\,m\Omega \]
Power loss:
\[ P = 5^2 \times 0.03 = 0.75 \text{ W} \]
That may require substantial copper area or heatsinking.
Check:
\[ V_{GS(max)} \]
Usually it is \(\pm 20\text{ V}\), but not always.
Do not select a MOSFET just because it has:
\[ V_{GS(th)} = -2 \text{ V} \]
for a P-channel device, or:
\[ V_{GS(th)} = 2 \text{ V} \]
for an N-channel device.
The threshold voltage only indicates where the MOSFET barely starts conducting. For switching, check \(R_{DS(on)}\) at your actual gate drive voltage.
For example, for a P-channel MOSFET driven from a 3.3 V system, look for \(R_{DS(on)}\) specified at:
\[ V_{GS} = -2.5 \text{ V} \]
or:
\[ V_{GS} = -4.5 \text{ V} \]
depending on the available drive.
If the load is inductive, such as:
you need a path for the inductive current when the MOSFET turns off.
For a high-side switch with load to ground, a common flyback diode placement is:
+V
|
High-side
MOSFET
|
+------ Load ------ GND
|
|
Cathode
Flyback diode
Anode
|
GND
So the diode is connected across the load:
Diode cathode -> switched load node
Diode anode -> ground
This clamps the switched node slightly below ground when the switch turns off.
For faster release of relays or solenoids, instead of a simple diode, you may use:
If you only turn the load on and off occasionally, a resistor pull-up/pull-down gate drive is usually acceptable.
For PWM, however, gate charge matters.
The MOSFET gate behaves like a capacitor. Every switching cycle, the driver must charge and discharge it.
Approximate switching drive current:
\[ I_G \approx QG f{SW} \]
where:
If the gate transitions are slow, the MOSFET spends too much time in its linear region, causing extra heat.
For PWM applications:
Typical applications:
Smart high-side switches often integrate:
This usually does not work as a proper switch because the gate is not driven above the source.
A MOSFET with \(V_{GS(th)} = 2\text{ V}\) is not necessarily fully on at 2 V.
Use the datasheet \(R_{DS(on)}\) condition.
Pulling a PMOS gate to ground in a 24 V or 48 V system can destroy the gate oxide unless clamped.
Always calculate:
\[ P = I^2 R_{DS(on)} \]
and verify junction temperature.
Motors, relays, and solenoids require flyback or clamp protection.
For a simple high-side switch, use a P-channel MOSFET:
+V -> PMOS source
PMOS drain -> load
load -> ground
gate pulled up to +V = OFF
gate pulled low = ON
For a more efficient high-current switch, use an N-channel MOSFET, but drive it with a proper high-side driver, charge pump, bootstrap driver, or isolated gate supply.
The key rule is:
\[ \text{MOSFET control depends on } V_{GS}, \text{ not gate voltage alone.} \]
For high-side switching, always think in terms of the gate voltage relative to the source.