High side fet switch with different voltages - Page 1
Forum section: electronics / beginners

author: Veketti
author_rank: Regular Contributor
timestamp: January 03, 2024, 05:45:28 pm
content: Dear All,In case I need high side switch and use P-fet and if the switched voltage is same as the control voltage I can directly connect the gate to eg. mcu pin (with maybe small gate resistor). In case I need to switch eg. 12VDC with 3.3V MCU output, it doesn't work as it will never turn off. Then comes to play using n-channel to control the p-channel gate. All the examples I've found are using NPN BJT transistor and none are using N-channel mosfet. The guestion is, can N-Channel mosfet as well used instead of NPN BJT? For example I have bunch of AO3401A and AO3400A's, so as a P-channel using the AO3401A and then MCU controlling the AO3400A to control the P-FET's gate?One other thing that I'm wondering is from the example schematics the NPN BJT's used to have very small base resistors. If calculating the current going through the transistor Ice with tens of kilo-ohms voltage dividers and what not and the Hfe of the transistor I get megaohm value base resistors. Examples show kilo-ohm resistors. Why is that?Thank you

author: MasterT
author_rank: Frequent Contributor
timestamp: January 03, 2024, 07:03:23 pm
content: Sure, you can use N-ch mosfet as voltage translator. A lot of old era N-mosfets were rated at GS voltage 5V or 10V.So, only parameter that needs to be checked in DS is VGS(th) Gate Threshold Voltage ,Reagarding base resistance - look at transition time vs base resistance, to switch load fast enough this time should be small.

author: madires
author_rank: Super Contributor
timestamp: January 03, 2024, 07:29:09 pm
content: Quote from: Veketti on January 03, 2024, 05:45:28 pmTo drive the BJT into saturation, i.e. the BJT is used as a switch and not as an amplifier.

author: Veketti
author_rank: Regular Contributor
timestamp: January 03, 2024, 07:37:58 pm
content: Thanks, that's clear. Is there a reason why all the example circuits are using BJT NPN and not N-Fet's as voltage translator? Is it just due to cheaper price or maybe there is some benefits?

author: madires
author_rank: Super Contributor
timestamp: January 03, 2024, 08:00:01 pm
content: BJTs are jelly bean parts. If you want to use an n-ch MOSFET you would need a logic-level type (3.3V MCU) and an additional resistor between gate and ground to make sure that the MOSFET doesn't turn on when the MCU's IO pin is in an undefined state (power on/off).

author: langwadt
author_rank: Super Contributor
timestamp: January 03, 2024, 08:05:15 pm
content: Quote from: madires on January 03, 2024, 08:00:01 pmnot really an additional resistor, the BJT also needs a resistor, limiting base current

author: madires
author_rank: Super Contributor
timestamp: January 03, 2024, 08:12:58 pm
content: I'd add a gate resistor between the MCU's IO pin and the MOSFET to limit the max current (usually IO pins can drive 20mA).

author: Ian.M
author_rank: Super Contributor
timestamp: January 03, 2024, 08:50:19 pm
content: Yes, if you do it right rather than muntzing it, there isn't a lot of benefit in using a NMOS driver vs a NPN BJT. The NMOS wins on quiescent current, however one can get jellybean 'digital' BJTs with the required base resistors built-in, which is probably about as good as you can do for BOM minimization.

author: Veketti
author_rank: Regular Contributor
timestamp: January 04, 2024, 06:52:57 am
content: Had to use urban dictionary to check that muntzing.Interesting, didn't know about those digital BJT's, looks interesting. One more maybe stupid guestion. If using digital BJT likeDTA113ZCAHZGwhich has 1kohm base resistor. With voltage divider to limit the voltage for the P-Fet gate have collector current for the NPN BJT say 1mA. Then as that DTA113ZCAHZG has built in base resistor of 1kohm, would the base current be 3.3mA with 3.3V MCU output? Or is it impossible to be higher than the collector current, even though the built in base resistor is 1k? I assume it can't be higher and in this case it probably is 10x smaller, being ~0.1mA. Am I correct?

author: Ian.M
author_rank: Super Contributor
timestamp: January 04, 2024, 08:00:07 am
content: No. Firstly you'd want the NPNDTC113ZCAHZG, not the PNP DTA113ZCAHZG for an upwards level shifter!Secondly, the base acts as a diode junction with respect to excess base current, it doesn't reject it, so when the transistor is in saturation the base current does not decrease with decreasing load current.Thirdly, when in the on state, the base emitter diode junction clamps the base end of the 1K resistor at about 0.6V - 0.7V, so the external base current from a 3.3V logic output won't exceed 2.7mA.You mentioned limiting the gate voltage for the P-MOSFET with a divider. That's actually better done by using an ordinary (not 'digital') NPN as a current sink - base direct to the digital output, emitter to a resistor to ground to set the collector current, e.g. 2.7K for 1mA @3.3V logic. Then the collector connects direct to the gate and that current through the gate pullup resistor determines the gate drive (max. Vgs). Its also pretty much held constant as the high side supply voltage varies. The load on the I/O pin is Ie/hFE, so much much lower than the conventional common emitter BJT level shifter. The NPN doesn't saturate so switch-off is considerably faster. The only disadvantage is it cant pull down below the 3.3V rail, so isn't suitable for high side rails that are only a few volts above your logic supply.

author: magic
author_rank: Super Contributor
timestamp: January 04, 2024, 08:59:39 am
content: There is a parallel thread about basically the same thing. You may be interested in this post: one NMOS only, no stinking resistors. Note that this doesn't invert the signal.https://www.eevblog.com/forum/microcontrollers/using-3-3-mcu-to-switch-5v-circuit-with-p-ch-mosfet-what-are-the-pitfalls/msg5256240/#msg5256240(BTW, an NPN couldn't be used instead without adding resistors.)