Re: Mosfet and HV coil burning µC
Posted: Sun May 26, 2019 6:45 am
Beside the I think very good tips from others: for MOSFETs to be able to switch their maximum current, they need to be switched (on/off off/on) as quick as possible. Anywhere in between will make the fet dissipate heat and possibly destroy it in the end. MOSFETs tend to store quite a bit of charge in their gate and as the gate is fully isolated, the charge will almost not drain by itself. The ESP8266 has push-pull outputs, so it will try to discharge (and charge) the gate of the MOSFET but it won't do it very efficiently. Also, even though the amount of charge stored in the gate is very small, the rate it which it's charged or discharged is very small, this makes currents flow in between 1 and 20 A (which will probably suprise you). This may very well kill the GPIO sooner or later.
I can recommend to ALWAYS use a MOSFET gate driver (e.g. IR4426 or equivalent). It has a couple of advantages as to connecting MOSFETs to GPIO directly:
- 100% sure the output is push/pull (which is required for proper operation)
- the input has a schmitt trigger so the output is always defined to be completely on or completely off, which makes the MOSFET very probably switch faster than on the GPIO directly
- the output driver fets can sink or source up to 20 A without any problem, and do it fast too, which makes the MOSFETs switch faster, which is better for it's health
- in the unlikely occasion one still messes up, only the driver is broken, not the microcontroller
- but, as far as I am concerned, most important: the input will take almost any CMOS-like level signal and it will output either 0V or Vcc, where Vcc can be anything between 5V and 20V. Most MOSFETs need at least 5-8V to competely turn on (which, again, is required not to blow it). Even if you have a "logical level" MOSFET, it will probably not completely turn on at 3.3V, really.
I can recommend to ALWAYS use a MOSFET gate driver (e.g. IR4426 or equivalent). It has a couple of advantages as to connecting MOSFETs to GPIO directly:
- 100% sure the output is push/pull (which is required for proper operation)
- the input has a schmitt trigger so the output is always defined to be completely on or completely off, which makes the MOSFET very probably switch faster than on the GPIO directly
- the output driver fets can sink or source up to 20 A without any problem, and do it fast too, which makes the MOSFETs switch faster, which is better for it's health
- in the unlikely occasion one still messes up, only the driver is broken, not the microcontroller
- but, as far as I am concerned, most important: the input will take almost any CMOS-like level signal and it will output either 0V or Vcc, where Vcc can be anything between 5V and 20V. Most MOSFETs need at least 5-8V to competely turn on (which, again, is required not to blow it). Even if you have a "logical level" MOSFET, it will probably not completely turn on at 3.3V, really.