Go Down

Topic: Logic Mosfet as another Mosfet driver (Read 1 time) previous topic - next topic

LucidWolf

Sep 01, 2019, 05:37 pm Last Edit: Sep 01, 2019, 05:38 pm by LucidWolf Reason: Add pic
Greetings,

Once again the datasheets confused me because there is too much info for a beginner.
I might just be doing this wrong as well.  (I know I am I should be using a driver chip... I just have so many 2N7000 Mosfets.)

I want to drive an 12V LED strip (~5amp, sizing for ~6amp) with an IRF520.  Why an IRF520 because I was incorrectly under the impression it was logic level.  (I realize now that at 5v i get 1 amp max.)

No biggie I have lots of 2N7000 as well so I thought it should be easy to daisy chain to get my Vgs up to 12V and get that sweet sweet power.  I guess this is what a MOSFET driver would do but probably better?

Now I am confused.  
1.) Should I voltage divide Vgs for the IRF520 to limit my current in case of a short?
2.) What is an appropriate current for the 2N7000 to drive a IRF520?  Capacitance equations?
I don't know if this is similar to a pull up resistor that 1k range because at 100K range noise and speed is going to affect operation.  Worse case I will just try things. :)

3.) Also if I am putting out 10watts of heat what size of heatsink at room temperature.
Is there some sort of heatsink rule of thumb guide?  Or is common practice to try it if it gets to hot make it bigger?   :D  Also the 0.27Ohms holds for 100% on as well as duty cycle if i can soak the heat correct?

4.) For the 2N7000 i dont need a current limiting resistor since its voltage based correct?  I just need to pull down or up as applicable.


I am starting to have more of the application questions.  Any guides out there that walk me through a MOSFET datasheet when going logic to MOSFET with a driver or transistor?

Thanks.


jremington

In order to turn on a MOSFET, the voltage on the gate must be higher than the voltage on the source by a certain amount. To be safe when using a non-logic-level MOSFET, that voltage difference should be about 10V.

Use those two facts to explain to us why the posted circuit won't work.

LucidWolf

#2
Sep 02, 2019, 06:05 am Last Edit: Sep 02, 2019, 06:07 am by LucidWolf
Well when you put it that way... sounds like I asked what octane of gas is better for putting out a fire.  :D

So I have faulty assumptions .  I want 12v at the IRF520 gate but if that occurs the 2N7000 source is now at 12v and then the Vgs is -7volts so the transistor cannot open.
Is this what is called latching? 

I did my analysis when the thinking the 2N7000 was closed and could open then ignored the change in states when it opens.  If I put the 2N7000 after the voltage divider, it doesn't mater because whether its on or off the voltage is always 12v if the PSU can source the current.


Also if i used a p-type mosfet then I would not be able to pull the voltage up enough to full switch off reverse problem.  Since my Vgs = (-12 to -7) and my Vds is -12.


I guess to use only mosfets you would have to build it like a logic gate, with a P and N type on either side of the IRF520.  Similar to a CMOS gate?  Or am i way off base and a MOSFET pair is not like a CMOS gate.

I realize at this point the real answer is use the right parts (transistor at the arduino) but still just trying to learn.  I like to know the edges of the right path.  So the wrong way to do it is more helpful in me learning how to find my own path so thank you for the response.  :)



LucidWolf

Wait the logic output still can only peak at 5V because once the voltage on the gate hits that level i am unsaturated and off....

Ok i think its starting to gel a bit here.

I guess i just have to post it first and show my ignorance before i realize it.
Still ignorant but learning.

larryd

#4
Sep 02, 2019, 06:20 am Last Edit: Sep 02, 2019, 06:24 am by larryd
Maybe it's because it is late here, but I don't understand what the problem is.

Here is a cheat sheet that might be of some interest.

The motor can be replaced with the LED strip.









No technical PMs.
If you are asked a question, please respond with an answer.
If you are asked for more information, please supply it.
If you need clarification, ask for help.

wvmarle

Also if i used a p-type mosfet then I would not be able to pull the voltage up enough to full switch off reverse problem.  Since my Vgs = (-12 to -7) and my Vds is -12.
Correct - that's one of the reasons we don't normally use p-mosfets in this kind of circuits.

Now you have two options: replace either MOSFET by a resistor.

The easy way is to replace the BS250 pMOS by a pull-up resistor to 12V. That way the moment you switch off the 2N7000, the gate of the IRF540 is pulled up to 12V and it switches on.

You can in fact also replace the 2N7000 by a pull-down resistor. Then you also need a unconventional power supply arrangement: connect the +5 and +12V together; keep the ground side of the two separate. Now the positive rail becomes your reference - you may call this 0V, or GND, your original grounds become -5V and -12V respectively. This will work perfectly well, but it requires you to remember that what you call GND is arbitrary, and you can declare any potential your 0V reference. Also by convention most power supplies have the ground connected, rather than the positive side.

Quality of answers is related to the quality of questions. Good questions will get good answers. Useless answers are a sign of a poor question.

LucidWolf

#6
Sep 02, 2019, 10:58 am Last Edit: Sep 02, 2019, 10:59 am by LucidWolf Reason: Pics
Thank you.  

I was already on the path of using the 2N7000 as a sink after a pull-up.  
Your discussion on connecting my positive rails to create a -V setup for the P-type that really gave me a good base.

I don't know why but I mentally really like being voltage controlled instead of current when doing a PWM.
I notice most stick to a transistor to gate the mosfet.  I do see a cost difference which maters on big scale.

So how come I don't see Mosfet/Mosfet that often for driving a load?
I would prefer to stock only Mosfet for switching unless i go analog.  Then again that is probably an ignorant statement.  :D

Since this is a lamp I am going to probably pull down at the Arduino and default it on.
Also for my other questions sounds like getting a pull down resistor try it and adjust as long as you are not over the specs you can play safely.

Thanks again.


wvmarle

I was already on the path of using the 2N7000 as a sink after a pull-up. 
Your discussion on connecting my positive rails to create a -V setup for the P-type that really gave me a good base.
Just remember it's not recommended as you'll run into all sorts of problems, as pretty much everything uses negative ground. Also nMOS are more efficient and cheaper than pMOS devices.

Quote
I don't know why but I mentally really like being voltage controlled instead of current when doing a PWM.
Then definitely don't use any of these setups. It's too slow, you're going to keep your MOSFETs too long in half-open state as the pull-up slowly discharges the gate, causing heat and a generally poor performance.

Use a logic level MOSFET so you can control them directly with the gate (use a gate resistor of at least 250Ω to limit current to 20 mA and a 10k or so pull-down to ensure the MOSFET remains off while the Arduino starts up). For big MOSFETs driving big loads you need a gate driver (and then you may consider using a regular MOSFET, as those drivers will have no problem bringing the gate to 12V).

Quote
So how come I don't see Mosfet/Mosfet that often for driving a load?
Must be because you've been living in a cave for the past few decades. Can't think of another explanation as using a MOSFET as power driver is the norm.

Quality of answers is related to the quality of questions. Good questions will get good answers. Useless answers are a sign of a poor question.

LucidWolf

Quote
Must be because you've been living in a cave for the past few decades. Can't think of another explanation as using a MOSFET as power driver is the norm.
I realize MOSFET is a power driver, I just meant all the "drive a motor with an Arduino guides" use a NPN Transistor to drive a MOSFET if you need more power.  And never explain how to tune it.

Quote
Then definitely don't use any of these setups. It's too slow, you're going to keep your MOSFETs too long in half-open state as the pull-up slowly discharges the gate, causing heat and a generally poor performance.
So since i am using a slower mosfet to drive another mosfet this is why a transistor/mosfet is used instead in Arduino guides because it can discharge the gate quicker.  (It still looks like its using a pullup to recharge.) The problem is again i dont know what I am looking for in the datasheet. 

The PWM period for the "slow pin" nano is around 32,000ns.  (31.2kHz)
The 2N7000 turn off/on is 20ns@500mA drain.  (Adding delay and rise time from spec sheet.)
The  IRF520 turn off/on is 80ns@9.5A drain! 

So if I am only using .18A*/6A i should be faster or no worse correct? Or is this one of those RC type time factor deals (and I am once again asking what octane of gas is better for putting out fires)?
*Note: If more current is required to charge the gate R2 = ~800Ohms to use 70% of the 1/4W capacity.

So if i limit my PWM to a 6% duty cycle 16/255 in Arduino min pin before i shut it off.  Then only 5% of the time the MOSFET is switching. 


I really want to be able to read the datasheet on these and understand what I am doing.  It's still a fire hose of data and ends up confusing me.

Thanks for spoon feeding.


wvmarle

Those times are WAY, WAY longer, especially with your circuit.

Look at the gate charge of the thing: the total is about 94 nC. You can crudely approximate this as a 94 nF capacitor. To switch on the MOSFET, the gate voltage has to rise to >8V. You do this by charging the gate (that 94 nF cap) by a 12V supply through a 10k resistor. That makes switching it on about 1 ms.

There is a lot more to this calculation if you want to do it properly; but this is good enough for an indication of how long it takes to switch on. I think it's obvious what will happen when you try to do a 500 Hz PWM on this thing... about 500 ms per second it's in the process of switching on, regardless of your duty cycle.

Switching off is much faster as that's done by switching on the small N-MOSFET, so you're pretty much shorting the gate to GND. It may conduct 500 mA peak or even more (see datasheets for the limits here - things like the gate resistance of the IRF540 come in play here as well), for a pretty fast turn off.

On the other hand take the IRL540. Its gate charge is a bit less at 64 nC, so let's call that a 64 nF cap. This can be charged from an Arduino pin with a 250 Ohm resistor to limit the current to 20 mA. It'll be on at 4V, you charge at 5V, now the time to switch it on is about 26 us. Almost two orders of magnitude faster. Switching off will take about the same time. That will do quite nicely.

Then there are MOSFET gate drivers, they use external capacitors to charge/discharge the gate with currents of a few A... then you may be getting into the ns range for switching.
Quality of answers is related to the quality of questions. Good questions will get good answers. Useless answers are a sign of a poor question.

LucidWolf

#10
Sep 02, 2019, 05:09 pm Last Edit: Sep 02, 2019, 05:24 pm by LucidWolf Reason: forgot equation Rule of Thumb
I just found How to read a power MOSFET Datasheet and thank you for confirming how to rule of thumb a gate charge.  

Thank you for putting numbers to them. I am curious where the 94nC came from.  I see the IRF520 spec says total gate charge of 16nC so at 0.015A (12V with R=800 pullup) 16nC/0.015A = 1000ns or 1ms so same answer.  That's not even including the time it takes for the 2N7000G to turn on which i could not find a total gate charge.  I guess i need to learn capacitance and charge discharge.

Either way I am putting the soldering gun down and once again waiting on the mail man...  :(  
Seems that is most of my time with this new hobby.

Need to get the shipping cost up so was going to order some:
IRLB8721PbF -> Adiafruit recommended
IRL540 -> See it in a lot of guides
Heatsinks and Pads

Let me know if there are something else useful for controlling power.

Is there any good drivers that I should buy if I ever want to jump the switching speed of non-logic Mosfets?
I was looking at a MAX620 from MAXIM.  Just to play around to build my own power supply, but then again there are better ICs for power switching.  :D

And with this i will stop bothering the hive mind.

Thanks again.







wvmarle

I was looking at the IRF540 data sheet. Anyway those numbers are not much better than ballpark numbers, but do give a good idea on what you're up against.

One thing to consider: the current into the gate goes down as the charge goes up, as the potential over the current limiting resistor goes down. That's one complexity. Another is that the gate voltage remains pretty much constant at VGS, TH for a while as the gate continues to charge, see fig.6 in the datasheet. This would speed up the charging a bit. But the gate resistance itself slows it down...

This all makes normal capacitor charge curves not accurate for the gate charge, but still gives a good idea.

Quality of answers is related to the quality of questions. Good questions will get good answers. Useless answers are a sign of a poor question.

TomGeorge

Hi,
Depending on the PWM frequency, why not just use an opto-coupler to switch the MOSFET gate?

Tom... :)
Everything runs on smoke, let the smoke out, it stops running....

LucidWolf

#13
Sep 05, 2019, 03:24 pm Last Edit: Sep 05, 2019, 03:35 pm by LucidWolf Reason: Picture + typo
Greetings

Tom,
Oddly enough a opto-coupler that can pull the 1/2 an amp i need to smash that gate open start being called mosfet opto gate drivers.   :)   My biggest issue is a pull-up resistor is slow unless i want to get a high wattage low resistance one.  Or twist 4 1/4 watt resistors together to get a pullup current that doesn't smoke the resistors when I sink the gate to ground. :)

wvmarle,
I ordered a bunch of parts to play with and my cheap-o-scope showed up as well.
So I am going to try and learn this a bit better so I know how to run PWM's at non-logic level voltages.

So my quiz to myself:
Not that I would do this but I think i understand the schematic to drive a mosfet with just transistors looking at the gate drivers.

In the below schematic:
Pin is ON (pull up default) then - Q1 and Q4 are on, therefore Q3 is off and Q2 the mosfet has no charge and is drained by Q4 so Load is off.
Pin is OFF then - Q1 and Q4 are off and Q3 is on therefore the Q2 mosfet gate is charging 12V at peak amperage of 5V/1.2k*20hfe = 0.083A into the Q2 gate and Load is turning on.
Using Qtotal as estimate Switching time = 16.0nC/0.083A = 100ns or 3% PWM period. +60ns for feeder transistors.



Do i get it enough to be dangerous?  :)

As stated before real gate drivers can source amps of current and can switch in the 100s of kHz with built in safety features.

In my LED lamp i am just going to dim to a certain amount and below that i will just switch off.  The IRLB8721PbFs will act reasonably well (Qtot = 8nC @5V) at the 20mA sourced by the Arduino for LED PWM ~300 ns switching.

Thanks again.

wvmarle

Do i get it enough to be dangerous?  :)
Absolutely. Q3 being an NPN type with 5V at the base will not allow the gate to even reach 5V. That should open the MOSFET a bit, with high resistance, high losses, high heat and possibly smoke and fire.

To get the gate high enough Q3 has to be a PNP type, and that again makes it hard to switch off. Furthermore, a PNP and an NPN with the bases connected like that will switch each other on, resulting in a short, and moments later they'll die in a puff of smoke.

Seriously, just get a gate driver or get a logic level MOSFET.
Quality of answers is related to the quality of questions. Good questions will get good answers. Useless answers are a sign of a poor question.

Go Up