Arduino Forum

Using Arduino => General Electronics => Topic started by: mwhens on Aug 27, 2011, 07:19 pm

Title: Best mosfet for switching DC from 5v Arduino pin.
Post by: mwhens on Aug 27, 2011, 07:19 pm
For home automation I want to switch some DC current ranging from 0-60v.
Some 48v led series, strike plates, and allot more.
I want to build some universal switching boards that I can use for all DC switching that I need.
It needs to switch fast enough to use PWM from an Arduino pin. And works perfect on 4-5v.
For 220v AC I will use solid state relays (ebay.com).

I ones used a mosfet IRF540N (old one) for switching fans and leds, but I want to choose the best available, and also more watts.

Someone advised me this one...

IRLZ34NPBF rom International Rectifier
55V, 30A, max.68W
http://www.irf.com/product-info/datasheets/data/irlz34npbf.pdf (http://www.irf.com/product-info/datasheets/data/irlz34npbf.pdf)

Rds On (Max) @ Id, Vgs: 35 mOhm @ 16A, 10V
Vgs(th) (Max) @ Id: 2V @ 250µA
Gate Charge (Qg) @ Vgs: 25nC @ 5V
Input Capacitance (Ciss) @ Vds: 880pF @ 25V

But the 68Watt is a little low, I would like a heavy mosfet.
On Digikey I see lots of heavy mosfets, But I'am not sure if they work wel with an arduino pin/5v. Or if they switch fast enough for PWM?
I selected some...


STP60NF10 from STMicroelectronics
http://www.st.com/internet/com/TECHNICAL_RESOURCES/TECHNICAL...046750.pdf
100V, 80A, max.300W

Rds On (Max) @ Id, Vgs: 23 mOhm @ 40A, 10V
Vgs(th) (Max) @ Id: 4V @ 250µA
Gate Charge (Qg) @ Vgs: 104nC @ 10V
Input Capacitance (Ciss) @ Vds: 4270pF @ 25V


or


IRLB3036PBF-ND from International Rectifier
http://www.irf.com/product-info/datasheets/data/irlb3036pbf.pdf
60V, 195A, max.380W

Rds On (Max) @ Id, Vgs: 2.4 mOhm @ 165A, 10V
Vgs(th) (Max) @ Id: 2.5V @ 250µA
Gate Charge (Qg) @ Vgs: 140nC @ 4.5V
Input Capacitance (Ciss) @ Vds: 11210pF @ 50V


or


IRL3705NPBF from International Rectifier
http://www.irf.com/product-info/datasheets/data/irl3705npbf.pdf
55V, 89A, max.170W

Rds On (Max) @ Id, Vgs: 10 mOhm @ 46A, 10V
Vgs(th) (Max) @ Id: 2V @ 250µA
Gate Charge (Qg) @ Vgs: 98nC @ 5V
Input Capacitance (Ciss) @ Vds: 3600pF @ 25V


I will use a small transistor on the pins so it can give more than 20mA. But will these heavy mosfets work?
What are the disadventages of these heavy mosfets, I don't know allot about mosfets, Don't know anything about those 4 lines of specs like RDS, VGs, Qg or CISS.
Title: Re: Best mosfet for switching DC from 5v Arduino pin.
Post by: AWOL on Aug 27, 2011, 07:34 pm
Unless you put a driver between the Arduino and the MOSFET, you should really be looking for "L" suffix (Logic) devices.
A 10V VGS isn't going to saturate with a 5V Arduino input, so your device is going to get HOT.
Title: Re: Best mosfet for switching DC from 5v Arduino pin.
Post by: MarkT on Aug 27, 2011, 07:50 pm
Firstly you can usually ignore the current rating as power-dissipation is the limiting factor (without substatial heatsinking).

The key spec is the Rds(on).   Calculate the power dissipation for your load with P=I^2R.  For large currents you are likely to want a heatsink (say if the dissipation is more than 1/3 watt.)

Secondly beefy MOSFETs have high input capacitances.  Very high input capacitances.  You can drive the gate from the Arduino with a resistor to limit the pin's current to a safe level for the microcontroller (say 25mA max - 220 ohms).  However this means slow switching (many us) leading to a large power-dissipation pulse in the MOSFET while it switches.   For low to medium power loads at low to moderate PWM frequencies this is fine, but driving a high powerload at high frequency PWM this will become prohibitive.

Arduino default PWM is 1kHz or 500Hz depending on the pin, so this isn't too big an issue unless you change it.

If you want faster/more efficient switching you need a MOSFET driving chip to charge/discharge the gate capacitance quickly (drivers are usually 0.2 to 1A or so).  I've used a MIC4422 before which can drive pretty much any MOSFET hard from a simple logic signal.  These driving chips need proper decoupling (but can level shift from 5V to 12V to allow non-logic MOSFETs to be used)

There is one more issue you need to be aware of which is capacitive coupling between drain and gate.  For high voltage loads the voltage swing in the output can couple to the gate strongly enough to _require_ that the gate is driven by a low-impedance source (a few ohms) to prevent voltage spikes on the gate (these can damage the gate oxide and whatever is driving the MOSFET)

The more voltage and current being switched, the more important this is.  I would recommend for high current loads over 20V or so to always use a MOSFET driver chip to prevent this being an issue.  Also logic-level MOSFETs are more sensitive to this problem.
Title: Re: Best mosfet for switching DC from 5v Arduino pin.
Post by: mwhens on Aug 27, 2011, 07:53 pm
You mean I can't use one of these mosfets?
Are you sure, Vgs(th) (Max) is only between 2-4v.
Title: Re: Best mosfet for switching DC from 5v Arduino pin.
Post by: retrolefty on Aug 27, 2011, 08:07 pm

You mean I can't use one of these mosfets?
Are you sure, Vgs(th) (Max) is only between 2-4v.


What you really have to do is read the datasheet for the specific device. Most have a graph showing source/drain current flow Vs gate/source voltage. For switching duty you want to select a device that will force the device to it's best Ron value with the 4.5 to 5 volt gate/source voltage applied. Most devices described as "Logic Level" will do that, but it's really on you to determine via datasheet analysis. Gate threshold value is a related spec, but doesn't define the complete situation as far as gate voltage Vs actual load being switched, Vs heat dissapation.

Also those very large MOSFETS have very large gate capacitance values putting demands on the device supplying the gate voltage. The arduino output pins are pretty husky but even they might struggle with the gate charging and discharging current requirements of those largest devices, this can 'slow' the mosfet switching time and result in higher heat dissapation even to the point of mosfet destruction if maximum rated current is being switched. Those hugh current rated mosfets are almost always better being driven by special MOSFET gate driver chips. So if your planning on trying to switch a 50 amp load on and off, you should research proper gate drive requirements to insure the mosfet stays in it's SOA, safe operating area.
Title: Re: Best mosfet for switching DC from 5v Arduino pin.
Post by: MarkT on Aug 27, 2011, 08:08 pm
Vgs(th) is the threshold voltage, its the gate voltage at which it switches OFF, not turns fully ON.

Its usually about 0.5 to 1V for a logic level device.
Title: Re: Best mosfet for switching DC from 5v Arduino pin.
Post by: retrolefty on Aug 27, 2011, 08:14 pm

Vgs(th) is the threshold voltage, its the gate voltage at which it switches OFF, not turns fully ON.

Its usually about 0.5 to 1V for a logic level device.


Actually gate threshold voltage is the gate voltage where the device just starts to conduct, perhaps just microamps or milliamps (i.e. threshold of conduction), not it's off voltage. The important spec is only avalible via datasheet graph, gate voltage that results in meeting best (least) Ron value, or at least a Ron good enough for the load being switched Vs resultant heat dissaption of the mosfet.

Lefty
Title: Re: Best mosfet for switching DC from 5v Arduino pin.
Post by: mwhens on Aug 27, 2011, 08:55 pm
Thanks for all your information, but I don't understand it all.
I made a drawing showing what I want to do, this is the basic principle...

(http://www.mwhens.nl/switchingbasic.jpg)

How I switched some leds a couple of years ago was this way.
I used a IRF540N that came with the Arduino starters kit.
It worked perfect, did not get hot, I used it with 12v, 3A...

(http://www.mwhens.nl/switchingbasic2.jpg)

I now want to make an switching board that I can install in all kind of places for switching DC.
Someone advised me a modern logic mosfet instead of the old IRF540N.
He advised me this one...
IRLZ34NPBF
datasheet:http://www.irf.com/product-info/datasheets/data/irlz34npbf.pdf (http://www.irf.com/product-info/datasheets/data/irlz34npbf.pdf)
Would this work the way I show for loads under 68 watt?

But I may need more than 68 watt, I gues a max. of 48v, 2-4A.
Thats around 100-200 watt.
So I thought, for $1,- I buy a more heavy mosfet to switch a little bit more in case I need it.
I can't understand all those datasheets, I see so much graphs.
Can I simply ask whats the biggest mosfet I can easily use the way I drawed?
No one of the mosfets I posted above?
As far as I know they are all logic level's.
Title: Re: Best mosfet for switching DC from 5v Arduino pin.
Post by: dc42 on Aug 27, 2011, 09:22 pm
The power you can switch is NOT the power rating of the mosfet. A mosfet can switch much more power than it dissipates if it is selected properly and driven properly. Here's a quick guide to choosing a mosfet:



I use type STP40NF10L which is rated at 100v max, 40A max, Rds(on) max = 0.036 ohm max at Vgs=5v and Id=20A. So it will comfortably drive your 48v 4A load and will dissipate only 0.6 watts in the steady state. The IRLZ34NPBF that you mention would also be suitable, but has lower voltage/current ratings  and a slightly higher Rds(on), so it may get a little warmer.
Title: Re: Best mosfet for switching DC from 5v Arduino pin.
Post by: retrolefty on Aug 27, 2011, 09:24 pm
Well some of us are trying to explain the meaning of the specifications so that then you may learn and then use that new knowlege to make your own choices. However you seems to just want someone to say, "use this one, it should work fine".

Someone will undoubtedly eventually make that choice for you, but will that help you in the future when you have to again select a component from a raft of choices?

PS: that small transistor looking device in the picture of the arduino that is going to give you "more then 20ma", you are going to have to identify what it is, why you think you need it. I suspect it will not work at all as you suspect it will.

Lefty

Title: Re: Best mosfet for switching DC from 5v Arduino pin.
Post by: mwhens on Aug 27, 2011, 10:15 pm
I want to learn, but it all seems so complicated to me, mostly all the graphs.
But I try to understand.

You use the STP40NF10L. That would be a better option you say.
When I compare them I see it has a higher voltage and amp rating, that I can understand.
It has also other differences I can't understand...

The STP40NF10L has Rds(on) max "33 mOhm @ 20A, 10V" The IRLZ34NPBF has "35 mOhm @ 16A, 10V"
I don't understand this, your talking about 0.036 ohm max at Vgs=5v and Id=20A.
What does this digikey spec tells me, and wich would be better, lower Ohm's?

There are more differences...
The STP40NF10L has "Vgs(th) (Max) @ Id" = "2.5V @ 250µA"
The IRLZ34NPBF has "2V @ 250µA"
Vgs should be as low as posible I believe?
The STP40NF10L has "2.5V @ 250µA" the IRLZ34NPBF has "2V @ 250µA"
The STP40NF10L has a higher Vgs? That means thats a plus for the IRLZ34NPBF?
Another spec,
Gate Charge (Qg) @ Vgs, STP40NF10L has "64nC @ 5V" the IRLZ34NPBF has "25nC @ 5V
"
Does that mean the IRLZ34NPBF need less than half the power to switch than the STP40NF10L?
Thats another plus for the IRLZ34NPBF?
Another spec...
Input Capacitance (Ciss) @ Vds, The STP40NF10L has "2300pF @ 25V", the IRLZ34NPBF has "880pF @ 25V
". The STP40NF10L has much more with it's 2300pF. Does that mean how much power is needed to switch on? The IRLZ34NPBF is the better one here?
Title: Re: Best mosfet for switching DC from 5v Arduino pin.
Post by: retrolefty on Aug 27, 2011, 11:13 pm

I want to learn, but it all seems so complicated to me, mostly all the graphs.
But I try to understand.

You use the STP40NF10L. That would be a better option you say.
When I compare them I see it has a higher voltage and amp rating, that I can understand.
It has also other differences I can't understand...

The STP40NF10L has Rds(on) max "33 mOhm @ 20A, 10V" The IRLZ34NPBF has "35 mOhm @ 16A, 10V"
I don't understand this, your talking about 0.036 ohm max at Vgs=5v and Id=20A.
What does this digikey spec tells me, and wich would be better, lower Ohm's?

Yes lower Ron is better, but very little differenc .033 ohms Vs .035 ohms, and your using it at 4 amps load, so no reason to pick one over the other just on this specification alone.

There are more differences...
The STP40NF10L has "Vgs(th) (Max) @ Id" = "2.5V @ 250µA"
The IRLZ34NPBF has "2V @ 250µA"
Vgs should be as low as posible I believe?
The STP40NF10L has "2.5V @ 250µA" the IRLZ34NPBF has "2V @ 250µA"
The STP40NF10L has a higher Vgs? That means thats a plus for the IRLZ34NPBF?

No, all should be looked at at what the Ron and current flow allowed with 4.5 to 5vdc on the gate. These threshold values all fall in the 'logic level mosfet' catagory, again no deal breaker or maker here.

Another spec,
Gate Charge (Qg) @ Vgs, STP40NF10L has "64nC @ 5V" the IRLZ34NPBF has "25nC @ 5V
"
Does that mean the IRLZ34NPBF need less than half the power to switch than the STP40NF10L?
Thats another plus for the IRLZ34NPBF?
Another spec...
Input Capacitance (Ciss) @ Vds, The STP40NF10L has "2300pF @ 25V", the IRLZ34NPBF has "880pF @ 25V
". The STP40NF10L has much more with it's 2300pF. Does that mean how much power is needed to switch on? The IRLZ34NPBF is the better one here?

Both those spec give an indication of how much charging and discharging current the arduino output pin has to supply to make the mosfet switch from on to off and off to on. Lower capacitance is better in this case and I would make it the deciding factor if all other specs meet the application.

Again I'm concerned about that small transistor you show in your picture. One usually tries to drive a power mosfet directly from the arduino output pin to the gate of the mosfet. Arduino ground must be wired to the external power supply negative terminal. Lastly it's a good idea to wire a 10k ohm resistor directly from the gate to source terminal on the mosfet. This will insure the mosfet turns off if you happen to turn off power to the arduino, but external power for the mosfet load is still on.

Title: Re: Best mosfet for switching DC from 5v Arduino pin.
Post by: mwhens on Aug 27, 2011, 11:47 pm
Ok, a little bit more clear now, thanks.

I was thinking about putting on all output pins of the arduino an small transistor.
If all outputs would be high, the Arduino can't power everything I think. To be sure of this, I tought, why not boost it with an transistor.
Can that be a problem?
How much current wil an mosfet use normally? 2mA or something?

Good idea about the resistor.
Any other ways to make it an safer switch circuit?
Some spook about fuses and zenerdiodes and resistor on the gate, don't know what it all does, or if it's usefull.
But I like to be on the safe side.

Ok, I now know it is thermal watts. But how much would the IRLZ34NPBF be capable of switching, and how much thermal watts would make for example the 48v 4A?

And also, the 5v and ground from the Arduino will be provided by a long (around 5-20meter) Cat6 cable. That would be ok right?
Title: Re: Best mosfet for switching DC from 5v Arduino pin.
Post by: retrolefty on Aug 28, 2011, 12:09 am

Ok, a little bit more clear now, thanks.

I was thinking about putting on all output pins of the arduino an small transistor.
If all outputs would be high, the Arduino can't power everything I think. To be sure of this, I tought, why not boost it with an transistor.
Can that be a problem?

Yes it can be, depending on how you wire up the transistor, what kind (NPN or PNP or mosfet), and if you mind if there is a logic inversion as a result of adding this 'driving transistor'. Not saying it can't be made to work if wired correctly, just that your picture won't work, and it shouldn't be needed.

How much current wil an mosfet use normally? 2mA or something?

Once the mosfet is fully on or off it draws 0 (yes zero!) ma from the output pin, it just draws current during charging and discharging the mosfets gate on the transition of turning on to off or off to on. Some people like to put a 200 ohm series resistor between the output pin and the mosfet gate to limit the peak current to protect the output pin, but it probably would work fine without it.

Good idea about the resistor.
Any other ways to make it an safer switch circuit?
Some spook about fuses and zenerdiodes and resistor on the gate, don't know what it all does, or if it's usefull.
But I like to be on the safe side.

Well resistor in series with the gate we just talked about. Fuse on your external power supply always a good idea, unless it already has automatic overcurrent shutdown protection. No zener needed anywhere.  

Ok, I now know it is thermal watts. But how much would the IRLZ34NPBF be capable of switching, and how much thermal watts would make for example the 48v 4A?

Power dissapation is a hard thing to calculate, but most of the loss is the I squared R loss, where I is the load currect and R is the Ron resistance of the mosfet when it's turned on. Other losses are the transision losses developed during the short periods between turning on to off and off to on, so are related to the PWM switching speed being used. The Arduion PWM switching frequency is under 1khz I think, so I would think you can ignore it. Make no mistake thermal watts dissapation is the limiting thing that keeps one from using a 40 amp rated mosfet at 40 amps actual load, only with massive heat sink with fan cooling would one reach the current limit. Heat is the limiting factor. However at 4 amps you probably won't even feel them warm up, or very little. If you can touch them and it doesn't raise a blister, then you are OK.  ;)

And also, the 5v and ground from the Arduino will be provided by a long (around 5-20meter) Cat6 cable. That would be ok right?

That is a pretty long distance. I would check out the system using short (under 1 foot) first to see if everthing works ok. Then  later try a longer run and check if mosfets get too much hotter or not. You can always add simple 8 pin DIP mosfet gate driver chips to support longer cable runs if they are required.  
Title: Re: Best mosfet for switching DC from 5v Arduino pin.
Post by: mwhens on Aug 28, 2011, 12:26 am
Where can I find a tutorial about using a mosfet gate driver?
Does it need any extra power supply?
Is it easy to use?
Title: Re: Best mosfet for switching DC from 5v Arduino pin.
Post by: retrolefty on Aug 28, 2011, 12:36 am

Where can I find a tutorial about using a mosfet gate driver?
Does it need any extra power supply?
Is it easy to use?

Yes pretty easy, signal input, signal output, power and ground. Your Arduino +5vdc would power one fine, most have two channels in a single 8 pin package, so you can use it for two digital output/mosfets per package. You would look for the "low side driver non-inverting" varity:

http://www.ti.com/lit/ml/slub005a/slub005a.pdf

Certainly other manufactures offer similar chips. I bought some cheap on E-bay several years ago, forget the device number and don't want to try and find them at this time.  ;)

Again I would test without it and only look into them if the long cable run turns out to be a problem.
Title: Re: Best mosfet for switching DC from 5v Arduino pin.
Post by: dc42 on Aug 28, 2011, 10:14 am
The short answer is that both the IRLZ34N and the STP40NF10L are suitable for your application. You don't need a mosfet driver for your application, you can drive them directly from an Arduino pin through a series resistor in the range 100 to 220 ohms, with a 10K to 100k resistor connected from the pin to ground to ensure the mosfet is off when the Arduino powers up and the pin hasn't yet been set to be an output.

Regarding the switching time, the important factor is the total gate charge at the source-drain voltage you are switching. This charge is made up of the gate-source charge, which is more or less constant, and the gate-drain charge, which increases with voltage because of the Miller effect. So when you see that the total gate charge is greater for the STP40NF10L than for the IRLZ34N, part of the reason for this is that the total gate charge for the STP40NF10L is quoted at Vds=80v but for the IRLZ34N it is quoted at 44v. However, even allowing for this, the IRLZ34N has lower total gate charge when switching 48v.

You can calculate an order-of-magnitude estimate for the switching time using the formula t = QR/V where Q is the total gate charge, R is the series resistor and V is the gate voltage you are using. You only need to use a MOSFET driver if you need the switching to be faster than this figure, bearing in mind that you don't want R to be less than about 100 ohms.
Title: Re: Best mosfet for switching DC from 5v Arduino pin.
Post by: mwhens on Aug 28, 2011, 10:28 am
Ok, I will test it first.

But I want to know about the capacitance of the mosfets.
It seems, if you want an low resistance/high efficiency mosfets, the capacitance goes up.
A small capacitance, and the resistance is getting higher.
Also a higher voltage will make the capacitance allot higher.
I need to find a good balance between the two.
the STP40NF10L seems like a good balance, but does have more capacitance than IRLZ34NPBF.
But I want some more voltage, the IRLZ34NPBF goes to 55v, close to my 48v.
So to have more headroom my first shoice goes to the STP40NF10L.
But how translate those capacitance into mA?
When the mosfet is charging, how much current is flowing for a 880pF @ 25V capacitance?
I gues no matter how high the capacitance, they all switch fast enough for PWM, but just use more current to switch?
How can I calculate how high the capacitance can go?
And I gues I can't measure it with a multimeter because of the short peaks?
Title: Re: Best mosfet for switching DC from 5v Arduino pin.
Post by: dc42 on Aug 28, 2011, 10:40 am

But I want to know about the capacitance of the mosfets.
It seems, if you want an low resistance/high efficiency mosfets, the capacitance goes up.
A small capacitance, and the resistance is getting higher.
Also a higher voltage will make the capacitance allot higher.
I need to find a good balance between the two.
the STP40NF10L seems like a good balance, but does have more capacitance than IRLZ34NPBF.
But I want some more voltage, the IRLZ34NPBF goes to 55v, close to my 48v.
So to have more headroom my first shoice goes to the STP40NF10L.
But how translate those capacitance into mA?
When the mosfet is charging, how much current is flowing for a 880pF @ 25V capacitance?
I gues no matter how high the capacitance, they all switch fast enough for PWM, but just use more current to switch?
How can I calculate how high the capacitance can go?
And I gues I can't measure it with a multimeter because of the short peaks?


Ignore the capacitance, concentrate on the total gate charge. The peak current when charging the gate is (5v - a_little)/R where R is the series resistor. That's the point of having a series resistor, and why it shouldn't be less than 100 ohms - you don't want to exceed 40mA output per Arduino pin.

I agree that 55v is uncomfortably close to the 48v you are switching - particularly as the 48v supply is probably unregulated, in which case it may be somewhat higher than 48v when all the LEDs are off.

To get a very rough estimate for the switching losses:



In fact for your LED+series resistor load, if most of the 48v is dropped across the LEDs then the switching losses will be much less than this figure.
Title: Re: Best mosfet for switching DC from 5v Arduino pin.
Post by: mwhens on Aug 28, 2011, 11:32 am
Thanks for your help, but that to complicated for me.
The only thing I'am not sure of is how much current a mosfet use from the Arduino pin.
Can someone show how to calculate the current peak with for example this mosfet?
http://www.st.com/internet/com/TECHNICAL_RESOURCES/TECHNICAL_LITERATURE/DATASHEET/CD00003023.pdf (http://www.st.com/internet/com/TECHNICAL_RESOURCES/TECHNICAL_LITERATURE/DATASHEET/CD00003023.pdf)

Quote
The peak current when charging the gate is (5v - a_little)/R where R is the series resistor. That's the point of having a series resistor, and why it shouldn't be less than 100 ohms - you don't want to exceed 40mA output per Arduino pin.


I understand how to limit the current. But as everyone is saying, you need to drive the mosfet so that it has enough current. But how do I know whats enough.
If I can booste the Arduino pins to 250mA, would that be allot better for some mosfets, and get less hot?
If I do not use a series resistor, thats best for the mosfet?

One Arduino pin may be good for a 40mA peak, but If i use 20 outputs with mosfets, it can't deliver that 40mA anymore on each pin.
Thats why I was thinking about using a small transistor to make each pin 250mA ( I used this transistor to power some 5mm leds that one pin could not provide, and that worked perfect with PWM)
I don't see way this would not work with a mosfet.
Title: Re: Best mosfet for switching DC from 5v Arduino pin.
Post by: MarkT on Aug 28, 2011, 11:38 am
The 40mA rating for Arduino pins is an "absolute maximum" rating - you should not be going near than value, 25mA is a reasonable limit to ensure reliable operation and prevent the chip dying.  For most "abs max" ratings you want to back off by a significant factor, not go near the limit (its the point when some chips start to get permanently damaged - also most max ratings are for single exposure, not repeated...)   

If there is a "continuous" rating or "recommended" rating, use that, not the abs max.

For the same reason using a 55V MOSFET for 48V isn't safe - switching transients can be as much as the supply voltage due to stray inductance in wiring, so in general 48V load means 100V rated MOSFET.  Don't skimp on ratings, things will fail.
Title: Re: Best mosfet for switching DC from 5v Arduino pin.
Post by: dc42 on Aug 28, 2011, 12:01 pm

The 40mA rating for Arduino pins is an "absolute maximum" rating - you should not be going near than value, 25mA is a reasonable limit to ensure reliable operation and prevent the chip dying.  For most "abs max" ratings you want to back off by a significant factor, not go near the limit (its the point when some chips start to get permanently damaged - also most max ratings are for single exposure, not repeated...)


Current limits per pin are normally the result of local thermal limitations, so drawing 40mA or even a bit more for a very short period (we are talking about less than 1 microsecond here) isn't going to damage the device. Drawing 40mA from a pin continuously is a different matter.


For the same reason using a 55V MOSFET for 48V isn't safe - switching transients can be as much as the supply voltage due to stray inductance in wiring, so in general 48V load means 100V rated MOSFET.  Don't skimp on ratings, things will fail.


Both the power mosfets we are talking about are avalanche rated and can drive significant inductive loads without a protection diode, so that doesn't apply here.
Title: Re: Best mosfet for switching DC from 5v Arduino pin.
Post by: dc42 on Aug 28, 2011, 12:19 pm

I understand how to limit the current. But as everyone is saying, you need to drive the mosfet so that it has enough current. But how do I know whats enough.
If I can booste the Arduino pins to 250mA, would that be allot better for some mosfets, and get less hot?
If I do not use a series resistor, thats best for the mosfet?


The switching time for those mosfets driven from an Arduino pin via 100 to 220 ohms works out at less then one microsecond. So if your PWM frequency is 10KHz or less, we are talking about switching losses of less than 1% of the load power. OTOH if you use a PWM frequency of 100kHz, the losses could be nearer 10% and you would need either a mosfet driver or large heatsinks on the mosfets.

According to the reference, the default PWM frequency is around 490Hz. So the switching losses will be low and you definitely do not need mosfet drivers. If you're worried about the total peak current supplied by the chip when switching lots of mosfets from different pins, you could increase the gate resistors to 470 ohms.
Title: Re: Best mosfet for switching DC from 5v Arduino pin.
Post by: MarkT on Aug 30, 2011, 06:26 pm


The 40mA rating for Arduino pins is an "absolute maximum" rating - you should not be going near than value, 25mA is a reasonable limit to ensure reliable operation and prevent the chip dying.  For most "abs max" ratings you want to back off by a significant factor, not go near the limit (its the point when some chips start to get permanently damaged - also most max ratings are for single exposure, not repeated...)


Current limits per pin are normally the result of local thermal limitations, so drawing 40mA or even a bit more for a very short period (we are talking about less than 1 microsecond here) isn't going to damage the device. Drawing 40mA from a pin continuously is a different matter.

One failure mode from excess current is electromigration - unless the datasheet makes it clear the abs-max rating is a thermal one we cannot make such an assumption.  Also high switching currents could overload the on-chip decoupling leading to unpredictable behaviour.


Quote



For the same reason using a 55V MOSFET for 48V isn't safe - switching transients can be as much as the supply voltage due to stray inductance in wiring, so in general 48V load means 100V rated MOSFET.  Don't skimp on ratings, things will fail.


Both the power mosfets we are talking about are avalanche rated and can drive significant inductive loads without a protection diode, so that doesn't apply here.


Avalanche breakdown in MOSFETs is the situation when they dissipate the most power and is the easiest way to blow them up - unless you are sure you can calculate the energy dissipation correctly its much wiser to use conservatively rated devices (certainly at high voltages where pulse energies are much bigger).
Title: Re: Best mosfet for switching DC from 5v Arduino pin.
Post by: dc42 on Aug 30, 2011, 07:13 pm

Avalanche breakdown in MOSFETs is the situation when they dissipate the most power and is the easiest way to blow them up - unless you are sure you can calculate the energy dissipation correctly its much wiser to use conservatively rated devices (certainly at high voltages where pulse energies are much bigger).


Agreed - but you were talking about transients caused by stray inductance, so the energy we are talking about is tiny.
Title: Re: Best mosfet for switching DC from 5v Arduino pin.
Post by: marioR on Sep 07, 2011, 09:02 pm
I'm interested in doing something similar, can any one tell me which transistor the OP is using to amplify the 20mA to 240mA with the PWM signal...

Is the diagram correct, on the first page, I really don't want to blow anything up.

Thanks