Proper MOSFET driver for 30N06L - Page 1
Forum section: electronics / beginners

author: help_me_pick_username
author_rank: Contributor
timestamp: November 21, 2019, 09:26:24 pm
content: I have a project where I am controlling a 10 watt LED with an ESP8266. The LED runs at 12 volts and the ESP8266 at 3.3 volts. I have a 30N06L MOSFET that is controlling the LED via pwm. Since the MOSFET is being driven by 3.3 volts, it's not being driven to 100% output. I have burnt two ESP8266's so far when I tried to use a BJT to control the MOSFET instead.At this point I don't want to burn another ESP8266 so I'm looking for a suitable mosfet driver IC that I can use to drive the MOSFET properly.

author: aheid
author_rank: Regular Contributor
timestamp: November 22, 2019, 05:15:42 pm
content: Could it be you wired the BJT wrong and got 12V onto the GPIO pin? Find it hard to believe you bricked the whole thing by simply forgetting a base resistor for the BJT.Could you perhaps post schematic of what you've tried so far? Also, which BJT?

author: help_me_pick_username
author_rank: Contributor
timestamp: November 23, 2019, 06:24:18 am
content: I think I did wire the BJT (2N3906) wrong when I burnt the first one. Since I'm powering this project with an 18v power supply, yeah. 18v to the 3.3v tolerant GPIO pin. Umm, so I didn't actually use a base resistor for the BJT in either scenario, I didn't think that it was that important (reading your reply, I guess I was very wrong).The first time, the was an audible sound, and I could smell the burnt chip (after I took off the shielding, I could clearly see where the chip ruptured). The second time though, it was completely silent, there was no smell. (The second time though, I'm pretty sure I used 12v from the buck converter to supply the BJT instead).I was honestly being really careful the second time when I wired up the circuit, was it the lack of a base resistor that got me?

author: Circlotron
author_rank: Super Contributor
timestamp: November 23, 2019, 06:31:12 am
content: What is the pwm frequency? Probably doesn’t need to be much more than 100Hz. Low frequency means low switching losses.

author: help_me_pick_username
author_rank: Contributor
timestamp: November 23, 2019, 12:15:37 pm
content: Some quick googling shows that the default switching frequency for the ESP8266 is 1kHz.

author: aheid
author_rank: Regular Contributor
timestamp: November 23, 2019, 07:12:03 pm
content: A PNP, if you hooked that with emitter to 18V and base to GPIO then no wonder the microcontroller fried, think about the voltage drop over the base-emitter junction and what voltage would present itself a the GPIO pin.Anyway, I've attached a LTSpice file for a simple driver circuit. It uses a pull-up resistor, R1, to drive the gate high when the GPIO pin is low. When the GPIO pin is high, it turns on the NPN transistor, which drives the gate low. R2 here is just to ensure the gate is discharged when the circuit is without power.In the attached screenshots you can see the effect of the base resistor Rb. Note the scale of the current (blue trace) in the two screenshots. In this case the voltage source driving the "GPIO pin" in the simulation is an ideal voltage source, so can source and sink as much current as it needs to. In reality the actual GPIO pin has internal resistances etc so results won't be quite as bad as this, but it's still informative I think.I've also attached screenshots of the rise and fall time of the gate voltage. One concern when driving MOSFETs is that these transition periods should be short, because the MOSFET dissipates a lot of power when it's in this in between state, the linear region as it's called. I'm no expert, but I think the graph shows the R1 value is low enough. I'm considering the MOSFET to be fully saturated at Vg = 8V, which is slightly conservative.Note that the NPN driver means the load will be on when the GPIO pin is low or not driven (ie before the ESP8266 starts). If this is an issue you could add a PNP transistor between the GPIO and NPN, but hooked up to the 3.3V line instead. I can show an example if you wish.

author: help_me_pick_username
author_rank: Contributor
timestamp: November 24, 2019, 09:49:32 am
content: Woah! Thanks for the schematics. Super useful, but the only problem is I won't have another ESP to try this with until at least a few more weeks.

author: aheid
author_rank: Regular Contributor
timestamp: November 26, 2019, 03:30:25 am
content: You can build the circuit without the ESP, and test it by connecting the lead that would be going to the ESP to GND or 3.3V / 5V to emulate the GPIO pin being high or low. Double check connections before powering up.Once you have verified it works it should be safe to connect the ESP.

author: james_s
author_rank: Super Contributor
timestamp: November 26, 2019, 04:33:18 am
content: You absolutely need a base resistor to drive a BJT. Take a step back and take the time to learn how to use transistors as switches, you should be able to pick up the fundamentals in an evening, it's not complex and it will save you a lot of time and damaged parts.

author: help_me_pick_username
author_rank: Contributor
timestamp: December 08, 2019, 01:04:59 am
content: Quote from: james_s on November 26, 2019, 04:33:18 amDoes anyone have a link to a proper tutorial/guide on how to drive a BJT? That goes over absolutely everything?

author: jonroger
author_rank: Regular Contributor
timestamp: December 08, 2019, 03:11:38 am
content: I would look into a different mosfet - one that is fully on at 3.3V.

author: james_s
author_rank: Super Contributor
timestamp: December 08, 2019, 03:18:45 am
content: If you want "absolutely everything" you'll want to go get yourself a stack of textbooks. These should get you started though:https://www.electronicshub.org/transistor-as-a-switch/https://jeelabs.org/2012/11/12/high-side-switching/

author: help_me_pick_username
author_rank: Contributor
timestamp: December 08, 2019, 11:09:29 am
content: Quote from: aheid on November 26, 2019, 03:30:25 amI built your circuit and tested it, and it works! Thank you. I have attached a picture of my schematic at the moment. One change I made, I connected the MOSFET pull-up resistor to 12v instead of 18v VCC, since that leads to about 10v on the pin, which is enough to fully saturate the MOSFET (I think), and leads less heat dissipation when BJT is active.I have not tested the circuit with the ESP yet.

author: james_s
author_rank: Super Contributor
timestamp: December 08, 2019, 10:50:36 pm
content: In the future you can make a schematic a lot more readable by moving things around a little. For example place R2 vertically and connect it directly to the voltage rail instead of having it loop around like that.