BJT to turn on MOSFET - Page 1
Forum section: electronics / beginners

author: Stupid Bear
author_rank: Contributor
timestamp: August 16, 2023, 11:09:57 pm
content: I see a lot of circuits that stick a BJT between the MCU and the Mosfet. Is this necessary if my MCU pin is tristate and can can pull the gate high or low with a resistor (depending on P or N channel)? The Arduino can do a quasi-tri state by configuring the IO. Is there some other reason to use a BJT.[ Specified attachment is not available ]

author: langwadt
author_rank: Super Contributor
timestamp: August 16, 2023, 11:24:25 pm
content: Quote from: Stupid Bear on August 16, 2023, 11:09:57 pmthe tristated mcu pin can only handle being pulled up to maybe 5V maximum

author: zilp
author_rank: Frequent Contributor
timestamp: August 16, 2023, 11:28:09 pm
content: Quote from: Stupid Bear on August 16, 2023, 11:09:57 pmIn the specific case: The AVR won't like 82 V on its pins.There is not reason why a µC couldn't directly drive a MOSFET, it's all a matter of matching voltage levels and currents.

author: Stupid Bear
author_rank: Contributor
timestamp: August 16, 2023, 11:44:05 pm
content: say i use it as a high side P channel. Can't I just flip the IO pin between ground and high-Z and the pull up resistor would pull it to any voltage I choose? Or am I making some blunder here?

author: langwadt
author_rank: Super Contributor
timestamp: August 16, 2023, 11:52:12 pm
content: Quote from: Stupid Bear on August 16, 2023, 11:44:05 pmthe MCU pin is only high Z between 0 and maybe 5V

author: Kim Christensen
author_rank: Super Contributor
timestamp: August 16, 2023, 11:53:51 pm
content: There are intrinsic diodes on IO pins except for very specialized ones:

author: Stupid Bear
author_rank: Contributor
timestamp: August 17, 2023, 12:09:09 am
content: A picture is worth a thousand words. LOLThank you.

author: RFDx
author_rank: Regular Contributor
timestamp: August 17, 2023, 06:05:21 am
content: The first example needs at least another resistor in series with the BJT.

author: Peabody
author_rank: Super Contributor
timestamp: August 17, 2023, 02:19:03 pm
content: But you might switch the low side with an N-channel mosfet, and drive that directly (through a resistor) from the GPIO pin. You would just have to be sure that the GPIO voltage when high is high enough to turn on the mosfet.

author: Stupid Bear
author_rank: Contributor
timestamp: August 17, 2023, 02:24:12 pm
content: So would this work or is still a reason to use a bjt?

author: Manul
author_rank: Super Contributor
timestamp: August 17, 2023, 02:54:46 pm
content: Quote from: Stupid Bear on August 17, 2023, 02:24:12 pmYes, it will work, of course.Quote from: Stupid Bear on August 16, 2023, 11:44:05 pmThe problem is not only ESD diodes (which will not allow to pull above IC VDD), but also the maximum drain-source voltage of the output mosfet. There is never such thing as "any voltage", real world devices will fail atsomevoltage. How high is "some" in this case, I can't tell you, but generally if the IC is rated to work at 5V maximum, I doubt that the mosfets inside will tolerate much more than 10V drain-source.

author: DavidAlfa
author_rank: Super Contributor
timestamp: August 17, 2023, 03:59:35 pm
content: Why this? P-fet needs 0Vgs to turn off - How are you going to supply that (82v) with the mcu?Even setting the pin as input or Hi-z, the internal ESD diode will clamp the voltage to VDD, thus introducing 82V there!A bjt allows a simple way of pseudo-isolation.Anyways, the P-fet won't be happy with 82VGS!This circuit woudl need a resistor divider or a zener to make sure it stays at safe levels.A N-fet could be driven directly by the pin, but most-fets (It's a joke, don't kill me!) will conduct poorly with 3.3V/5v, being ~12V the standard practice.There're specialized parts with very low VGS, though you'll rarely find them in your local electronics shop, they're still in the Pleistocene selling IRF840s and such.

author: Peabody
author_rank: Super Contributor
timestamp: August 17, 2023, 05:41:10 pm
content: Furthermore, even if you are switching 5V with a 5V processor using a P-channel, if power to the processor should ever fail, but remain at the mosfet's source, the protection diode will begin to conduct as the processor's Vcc drifts to ground, and the mosfet will turn on. But using an NPN with the P-channel, or using an N-channel, will require the GPIO output to be active high to turn on the power, which is what you want.

author: Zero999
author_rank: Super Contributor
timestamp: August 17, 2023, 08:16:16 pm
content: That's a quick way to destroy a MOSFET.Move the base resistor to the emitter and reduce the collector resistor value. Now you have a common emitter amplifier.The voltage across the emitter resistor is about 0.6V less than the base voltage:VE= VB-0.6 = 3.3-0.6 = 2.4VThe current throw it can be calculated using Ohm's law:IE= VE/R = 1.4/1000 = 0.0024 =2.4mAAssuming hFEis high enough not to matter, the collector current can be considered to be equal to the emitter current.The voltage across the collector resistor and therefore the gate drive, again can ba calculated using Ohm's law:V{RC} = 4300*0.0024 = 10.32VA base resistor is unnecessary, because the base current limits itself, as the emitter voltage rises, with the base voltage. The only time it might be a problem is if the higher voltage supply is disconnected and the emitter resistor's value is low enough to draw too much current from the microcontroller's output, but it'll be under 2.4mA in this case, which is of no concern. If it's a problem in another design, add a base resistor to limit it to within the maximum rating.

author: DavidAlfa
author_rank: Super Contributor
timestamp: August 17, 2023, 09:05:34 pm
content: I'd prefer to use a base resistor anyways, it provides protection if the fet gate blows, and so does the bjt.

author: Zero999
author_rank: Super Contributor
timestamp: August 17, 2023, 09:16:58 pm
content: Quote from: DavidAlfa on August 17, 2023, 09:05:34 pmIf the MOSFET blows, the BJT will still survive. It's highly unlikely it will also blow.Anyway, if this was going to be built commercially, it wouldn't matter either way, since most companies just toss the whole board.