MOSFET BURNING WHEN CONNECTED TO ESP32

Thread Starter

amachairas

Joined Mar 9, 2017
17
Finally found it. Someone on reddit suggested that the gate resistor was too high regarding the esp32's pwm frequency (19.5kHz). i removed it and put a 350ohm in its place. It works fine now, with only two casualties :') . I can't figure out the reason it didn't like the 4.7k, guess i should start reading! Thanks everyone for taking the time to asnwer!
 

LesJones

Joined Jan 8, 2017
4,511
Mosfets have quite a large gate to source capacitance. As you now tell us that you are switching it a 19.5Khz the time contstant of this capacitace with the 4.7K resistor will mean that it will be only partly conducting (And therfore disipating a significant amount of power.) for a significant amount of the duty cycle.

Les.
 

panic mode

Joined Oct 10, 2011
5,007
for AO3402, gate capacitance is some 400pF. with 4.7k resistor that creates timing constant of about 1.9uS which is some 7.5% of duration of on and off states (25uS each). while that is less than ideal, i would not think of this a major factor here since load current is only 120mA at worst case and also load is highly nonlinear and without ability to store energy. without doing analysis, i am estimating Pd to be under 200mW which is well under rated 1.2W. i still believe that most likely they died do to static electricity.
 

MisterBill2

Joined Jan 23, 2018
27,607
Semiconductor devices are usually associated with an extensive document called a "data sheet", which normally includes quite a few pages. relating to the abilities and limitations of the devices. Mostly, operation of devices outside their limitations can bring about assorted failures. Using a device in the linear mode often leads to excess internal heating problems.
 

MisterBill2

Joined Jan 23, 2018
27,607
A high value of gate resistor will certainly slow the transition and thus tend to spend a lot more time in the linear region. That has been a problem with switching circuits for many years. Usually solved, but always requiring attention.
 

liaifat85

Joined Sep 12, 2023
200
Hello everyone, recently i bought an rgb led strip and i tried to modify the controller to work with esp32. I desoldered everything from the premade controller except for the mosfets and the 2 resistors you see in the schematic. Mosftets are AO3402 (340s marking). After flashing the esp and connecting to gpio it blinks for few seconds and then it stays partially on. Shorting the gate to source doesn't turn it off. It's a 24v led strip and at first try i didnt have the grounds of powersupply - esp32 connected. I thought that was the problem but it happened on the second mosfet too. What could be wrong. On second try i also removed the 10k resistor.

Thanks in advance!

View attachment 334545 View attachment 334546
Measure the VGS with a multimeter. Also check for accidental short circuits. If you are using a multimeter, check that too. Sometimes these boards create problems.
 

MisterBill2

Joined Jan 23, 2018
27,607
After looking at the original circuit in post #1 IT IS OBVIOUS that the TS has also removed the very important current limiting resistors, or the current regulating circuitry.
OF COURSE the transistor will fail! The cause of the failure is current exceeding the rating causing power dissipation also exceeding the rating.
 

MisterBill2

Joined Jan 23, 2018
27,607
OK, so the TS knows the current under some condition, and that there are some current limiting resistors on the string of LEDs. So it is probably not simply the current that is the problem, but certainly the POWER that is causing excessive junction temperature that leads to the failure.

That POWER=( Vt x It), during the time interval between cutoff and saturation has been a problem for all of the years since the first use of transistors as switching devices. It might be visible in the simulation, or possibly not, depending on the capability of the simulator software and the transistor model. Certainly using an actual oscilloscope to view the drain to source voltage will reveal what is happening.

Also, consider the actual gate drive circuit arrangements used in successful mosfet PWM controls, and the difference will become obvious. Learning from what others have done that worked is a handy tool!
 

D_racon

Joined Oct 4, 2021
18
Facepalm time. Measured Vgs when on and its ~1.5V because i had the brightness set to 50% on the esp. What bothers me though is that i dont see a reason it would burn as the original controller could dim it 0-100%. When first testing it the mosfet was not even close to hot to the touch.
Seems you might have found the problem indeed.
it would depend on the frequency you pwm it at however.
the 4.7k resistor should not be needed for a mosfet as it only needs static charge.
it has advantages and disadvantages,
advantage of protecting the esp if the mosfet would do someting notably weird.
as for a disadvantage it will destroy the mosfet if driven at to high of a frequency relative to the drive voltage.
since a mosfet also acts as a very small capacitor, and the resistor essentially causes it to generate a analog voltage in between the mosfet by making it take longer to charge and discharge the mosfet's capacitance.
as you drive it with 3.3V it only needs to drop 0.8V to get to the 2.5V.
due to this you might not have noticed it as much on 5V compared to 3.3V, next to that on 5V much more current goes through that resistor thus charging the mosfet's capacitance faster.
but this problem mostly occurs when pwming at a to high speed, but as mentioned the frequency where this happens depends a lot on the drive voltage, the closer to the treshold voltage it is the faster it causes problems. 3.3V-2.5V=0.8V 5V-2.5V=2.5V. meaning it is over 3 times as likely to happen on 3.3V compared to on 5V assuming the real world treshold voltage is at 2.5V(in reality it is often slightly lower).

in this case, removing the resistor to the mosfet should probably fix it, you want a mosfet to switch between 0V and driving V in as short a period as possible. ofcource this is for mosfets, not for transistors, since with transistiors you might need to add a resistor.
the wiring you have now is more for a transistor.
a better way to drive it even is to use a logic level shifter to shift it to 5V, or even higher.
one way to do it and protect the esp even more for in critical applications where it should not get damaged even if the mosfet fries itself in a weird way, is to use fast general purpose transistors, those cheap ones which often handle less than 0.5A yet are small and are easily triggered by low voltages(currents actually). you can use one of those and a resistor to make it automatically go on and pull down to turn it off(or the other way around). but as you might need high speeds for the pwm you can also use a npn and pnp transistor to faster shift the voltage to high and low, should slightly increase the efficiency, and those general purpose transistors are very compact and super cheap, and they really do not need to handle around 500mA or such, 20mA in many cases should already be much more than needed, just make sure it won't have both on at the same time, or add a mosfet to protect against that.

still can't say this with certainty as there are many more factors.
next to that, in the modern day it is also worth concidering if you have got real parts or fake ones. many stores selling directly to consumers(allowing small orders with free or cheap shipping) these days regularly sell fake parts, on some popular ones almost all are fake. even with parts like those you often find fake ones, they generally seem to work well, but often lagg in the more rare properties, in this case, the very low voltage to properly turn it on. in others very often the Rds(on) and current capabilities, in some the voltage capabilities or capacitance. also if you got them from a device, think about where you got the device, very often such led controllers are things people get from places like amazon, ebay, aliexpress, etc. which almost always use and sell fake parts, with such devices, they will tend to work when used as intended, but if it was intended for 5V, it might use other mosfets falsely labeled as those, and those other mosfets cannot handle the low voltage as well for example.
 
Top