MOSFET circuit critique, please - Page 1
Forum section: electronics / beginners

author: sgofferj
author_rank: Contributor
timestamp: February 27, 2025, 12:22:33 pm
content: Mh, I'm not exactly a beginner but I'm returning to the hobby after about 30 years break. I have drawn up a MOSFET high side switch which I BELIEVE should work but if anybody has time and motivation, I'd appreciate some feedback.The MOSFET is a HL6042 from the JLCPCB basic selection with VDS: -20V and ID: 5A. Datasheet:https://jlcpcb.com/api/file/downloadByFileSystemAccessId/8564879511792603136The optocoupler is an EL3H7-G - nothing fancy - should light up at about 5mA and work reliably at 10mA. Datasheet:https://www.everlighteurope.com/custom/files/datasheets/DPC-0000031.pdfThe goal is to switch and potentially PWM 12V loads up to about 3A (lights for my electric tricycle) from a 3.3V TTL level (ESP32).Questions basically are:- Will it explode?- Did I miss anything?- Can I stuff 8 of those on a PCB side by side or do I need to pay attention to anything additionally then?Why opto instead of N-channel MOSFET? Mostly because I'm lazy but in case bad things happen, it should protect the ESP32 a little better, so only one channel of the PCB is fried and not everything. At least, that's the idea.

author: Zero999
author_rank: Super Contributor
timestamp: February 27, 2025, 12:38:06 pm
content: The output is drawn upside down, which might confuse some people here.It inverts the logic i.e. turns off the load when the input is high: presumably this isn't an issue?It will work at low frequencies, but will struggle with high frequency PWM, because the MOSFET requires a considerable charge to be transferred in and out of the gate and your drive circuit has a fairly high impedance.

author: sgofferj
author_rank: Contributor
timestamp: February 27, 2025, 01:16:17 pm
content: Quote from: Zero999 on February 27, 2025, 12:38:06 pmThat's expected, yeah.QuoteImpedance calculation is one of the things I barely remember and even back then had my problems with... But the PWM frequency is IIRC 1kHz. If that's too high, I can of course still change the circuit.

author: Benta
author_rank: Super Contributor
timestamp: February 27, 2025, 04:00:48 pm
content: I see no reason for R4, it just halves the gate voltage.

author: BadeBhaiya
author_rank: Regular Contributor
timestamp: February 27, 2025, 04:09:37 pm
content: Quote from: sgofferj on February 27, 2025, 01:16:17 pm1KHz should be fine, no problem whatsoever. With this setup you can go upto ~20KHz. Higher if you decrease R5, but then again I'm not account for turn on time, and other stuff.I think you should change the MOSFET to a larger package. I wouldn't trust a SOT-23 to handle anything above a few 100s of mA. Max 1A continuous.The Rdsof HL6042 is ~50mΩ. At 3A that's a power dissipation of 450mW. HL6042 has a junction to ambient thermal resistance of 357C/W. That will make the junction of the MOFET rise to 160C above ambient. The MOSFET's datasheet says 150C is the most the junction should get heated to.

author: Solder_Junkie
author_rank: Frequent Contributor
timestamp: February 27, 2025, 06:06:10 pm
content: For very little money you can get seriously high Amperage MOSFETs. I use 100A rated ones in power supply protection circuits, they are surface mount and approximately 5mm square. Type DMT6002.SJ

author: Zero999
author_rank: Super Contributor
timestamp: February 27, 2025, 06:57:13 pm
content: Quote from: Benta on February 27, 2025, 04:00:48 pmThe maximum gate voltage of the HL6042 is only 10V. Applying 12V might blow it up, or at the very least shorten its life.Quote from: BadeBhaiya on February 27, 2025, 04:09:37 pmIndeed, that package is definitely too small to switch that current. Manufactures normally exaggerate their current ratings. Always do the thermal calculations.Quote from: Solder_Junkie on February 27, 2025, 06:06:10 pmBear in mind a larger MOSFET will have a much greater gate charge. This circuit will not be able to switch a DMT6002 at 1kHz, 50% duty cycle. It won't charge/discharge the gate fast enough. The OP's MOSFET is much smaller and stands a reasonable chance of working, within certain limits. More below.Quote from: sgofferj on February 27, 2025, 01:16:17 pmThe MOSFET's get looks like a capacitor and the resistors slow down the charge and discharge, which limits the switching speed.It depends on the duty cycle, not just the frequency. 1kHz at 1% or 99% duty requires much faster switching than 20kHz at 50% duty. It will probably be fine at 1kHz, as long as the duty cycle is kept within about 10% to 90%.

author: sgofferj
author_rank: Contributor
timestamp: February 28, 2025, 06:18:39 am
content: Thank you all! Back to the drawing board then... I think, I'll go for something TO-220 then which I can hand solder. Let's see what I find. I doubt, my old notes will be of much value here.

author: Zero999
author_rank: Super Contributor
timestamp: February 28, 2025, 09:01:39 pm
content: Quote from: sgofferj on February 28, 2025, 06:18:39 amI've noticed the ground on the input is the same as the output. Why are you using the opto-coupler, when you don't need isolation?

author: sgofferj
author_rank: Contributor
timestamp: March 01, 2025, 09:14:29 am
content: Quote from: Zero999 on February 28, 2025, 09:01:39 pmThat was probably an oversight in the symbol selection in KiCAD. I don't strictly need isolation but I wanted to separate the 12V from the TTL in case the MOSFET fails badly, so I only have to replace the MOSFET and not throw away the whole board. But I'm redrawing everything based on a 1N2222 (PZT2222A) and IRF4905 drawing I found in my old notes. At the moment I'm trying to google the thermal calculation BadeBhaiya mentioned above and apply them to that circuit.Edit:And I'm trying to figure out impedance calculation.

author: Zero999
author_rank: Super Contributor
timestamp: March 02, 2025, 07:18:55 pm
content: Quote from: sgofferj on March 01, 2025, 09:14:29 amA BJT will protect your microcontroller from the MOSFET failing.Here's a circuit I designed awhile ago. RL represents your load. V1 is the power (12V in your case) and V2 is the output from your micro. If the MOSFET fails, then Q1 will still be fine, so long as it's rated to the full supply voltage.It should work in your application, with no change to the resistor values.The voltage across R2:VR2= V2-0.7, so 3.3-0.7 = 2.6V.Current through R1I = V/RI = 2.6/1000 = 2.6mAAssume the current gain of Q1 is very high so the current through R1 and R2 is for all purposes equal.Voltage across R2 and therefore the gate and source of the MOSFET.V = I*RV = 2200 *0.0026 = 5.7VThe resistor values are lower than in your circuit, so it will switch faster. It also takes less current from your MCU.

author: sgofferj
author_rank: Contributor
timestamp: March 13, 2025, 11:25:10 am
content: Quote from: Zero999 on March 02, 2025, 07:18:55 pmThanks! I have been busy with life in the meanwhile but I'm still on this project. I'll try to follow your explanation. It all sounds familiar but it has been some time since I did this myself.

author: Picuino
author_rank: Super Contributor
timestamp: March 13, 2025, 12:22:30 pm
content: This is the schematic of a brushless motor controller, from which you can take ideas about the activation of the mosfet transistors.

author: Picuino
author_rank: Super Contributor
timestamp: March 13, 2025, 12:26:24 pm
content: The Gate Threshold Voltage of your transistor is too low (-0.3v to -0.9v).I think a transistor with a higher threshold voltage would work better.