mosfet P-channel IRF9540N to control LEDs

HI, I have a doubt to use the p-channel mosfet irf9540n with led’s.
what I want to do is to use the irf9540n to control a maximum of 64 leds(20mA each) at the same time where leds are connected in parallel like photo.
when I do 5V from arduino pin the mosfet is turn OFF instead when I do 0V from arduino pin the mosfet is ON and leds turn ON
(the resistor 10k is a pull up resistor only useful to take mosfet off when for example arduino resetting ).
my problem is that IRF9540n have a Vth from 2 to 4 so can the mosfet work wrong in this configuration especially when i use red leds because their Vled is ~2.2V?

can anyone tell me an name of mosfet p-channel with a Vth lower than the IRF9540n but dimensioned with the current necessary for all LEDs (so 20mA x 64 = 1,28 A than 1,28A x 5V = 6,4 W)?

Browse digikey for: p-channel mosfet single fet logic level gate through hole in-stock!

That should open a smaller list of parts. Sort by price, then browse down the list to find a part with Low Rds and Low gate capacitance at a price you are comfortable with. For example: http://www.digikey.com/product-detail/en/NDP6020P/NDP6020P-ND/1055922

OK Thanks :) Could you explain me why the input capacitance must be shortest?

Gate capacitance consumes a large amount of in-rush current from the I/O pin while it's charging. It's a very small amount of capacitance, so it doesn't take long to charge, and then current consumption is almost zero, but especially if you use PWM, that initial charge time takes a toll on the output drive capabilities of the pin. One option to deal with this is to use a current-limiting resistor between the output pin and the gate of your FET. (Around 100-220R is OK.) However, that raises the slew rate, where the transistor spends more time between fully off and fully on, generating heat in the transistor itself, especially with high-current loads.

Speaking of current limiting, you don't show current limiting resistors on your LEDs. You need one per LED, otherwise, you've just created a one-use LED strobe light.

SirNickity:
Speaking of current limiting, you don’t show current limiting resistors on your LEDs. You need one per LED, otherwise, you’ve just created a one-use LED strobe light.

or maybe a magic smoke generator :wink:

Thank you very much for answer :slight_smile:

SirNickity:
Speaking of current limiting, you don’t show current limiting resistors on your LEDs. You need one per LED, otherwise, you’ve just created a one-use LED strobe light.

yeah the circuit isn’t complete…each cathode of leds are connect to the OUT pin of a TLC5940 that provide to sink 20mA for each led(this is why I don’t put the resistor) and control their brightness…the mosfet are 3 and they control one Red one Green and another one Blue Leds so for example to make purple color I must multiplex the mosfet for control Red leds and the mosfet to control the Blue led…this is what I want to do so to do this I must put a resistor to Gate for reduce the peak current at gate?

alnath:
or maybe a magic smoke generator :wink:

with 64 led’s X 3 for RGB the effect will be epic :smiley:

Looks good to me. (However, you ought to scale your scans down by 50% or so. 1500 pixels width is a bit excessive for a small drawing.)

OK Thanks

SirNickity: (However, you ought to scale your scans down by 50% or so. 1500 pixels width is a bit excessive for a small drawing.)

I'm new in forum but Sorry you're rigth..thanks yet