Need help calculating the right base resistors for PNP and N-Mosfet

I am working on a Project with some shift registers and a bunch of rgb LED's and need some help in understanding and calculating the right resistor values for the base of my PNP transistors and my N Chanel Mosfets. Down here is an example how it will be connected. (Just an example!) Every Mosfet will have to toggle 25 RGB LEDs and every PNP will have to toggle one color of a LED. The voltage is 5V and the resistors for the LED should fit to the 2,2/3,3/3,4V they need. (120 and 2x 84Ohm)

I already got 2N 3906 transistors an IRF 510 power mosfets todo the job but i struggle in calculating the base resistors for it. Do the mosfet need one? If so what size do they need? (I head a small one to be fast?) How do i calculate the resistor for the PNP correct? (I dont know which value i need to take for example of the Hfe there are several at the datasheet)

One last thing. The controller board will have it's own Powersupply. And i'd like to connect the 4 Lines for the Shiftregister from my arduino to the board.(SPI + 2 extra lines for enable/disable the registers) Does that work without any grounding issues or such?

Thanks alof for your help!
Regards
BennX

For the PNPs, 330 Ohm.

I don't think you can use IRF 510, it's not a logic-level transistor. Look for one that starts with "IRL".

Assuming you find one, you only really need "small" if you're going to PWM it. In any case, 150 Ohms will work.

Thanks alot, Ill try the 330Ohm tomorrow.
I threw a 120Ohm in front of the IRF 510 ant it seems to work without any problem?! (Just read about Mosfets and that i dont "realy" need a resistor in front of it but "you should do") I even noticed that i meight not need the PNP since the register seem to do it without troubles. (20mA per color of an RGB 8 max at a register which can handle 700mW...)

Why using the MOS transistor?
Just turn the PNP transistors off.

The PNP base resistor can be zero ohms, the PNP are connected as an emitterfollower.

Protte

Pelleplutt:
Why using the MOS transistor?
Just turn the PNP transistors off.

The PNP base resistor can be zero ohms, the PNP are connected as an emitterfollower.

Protte

I need to be able to disable some LEDs, so there will be 125LEDs over all in 5 Stages. (Cube) Every Stage get the same color inputs. By disableing the stages i can sett every LED in different colors. (multiplexing at 8khz) So regulary there should just be one LED per PNP and 25x3LEDs per MOS. (Ill give some pictures and explanations when its working)

So do i need a resistor in front of the PNP or do i not need one?

OK with the MOS
No you do not need baseresistors, the emitter follow the base, In this case the emitter will be 0.6 to 0.7 volts higher than the base.

Pelle

Pelleplutt:
OK with the MOS
No you do not need baseresistors, the emitter follow the base, In this case the emitter will be 0.6 to 0.7 volts higher than the base.

Pelle

Thanks alot,
Just checked it and it does work with Multiplexing and so on. Guess it's good to decouple the leds from the registers with it. A bit confusing to toggle 0 but i can handle it.
Regards,
BennX

That looks wired incorrectly.
What happened to the art of drawing schematics?
It looks like you have the N channel MOSFET wired backwards. For N Channel, source goes to ground, and it should be labeled "GROUND" or "GND" or have the symbol for ground, not a (-) floating somewhere near it. And your PNP transistors are also backwards. Emitter on a PNP goes to the more positive voltage, in this case to +5V.

http://opencircuitdesign.com/xcircuit/goodschem/goodschem.html

Pelleplutt:
No you do not need baseresistors, the emitter follow the base

That is only true if the circuit was wired up as an emitter follower, which as polymorph pointed out it is not.

Yes that right. I did not draw it correct. Dont know what happend but it has an incorrect order. So here is an example how i built it. At the Mosfet there are more than one of the LED's i just did draw one here. I think this should be right now. It does work as expected.

It does work as expected.

Except that you are killing those outputs by not having any resistors in the base of the transistors. They need to be in to limit the current into the base and out of the Arduino..

And possibly killing the Arduino.
Seriously, the art of drawing schematics seems to be dead.

Hm so i need those 330Ohm in it to be safe? It is no arduino it is a register. (Got some 220 and 510 here ...)

BennX:
Hm so i need those 330Ohm in it to be safe? It is no arduino it is a register. (Got some 220 and 510 here ...)

Yes that would do it.

Grumpy_Mike:

BennX:
Hm so i need those 330Ohm in it to be safe? It is no arduino it is a register. (Got some 220 and 510 here ...)

Yes that would do it.

So i can throw a 220 in it?. Also got smaler ones or bigger but not "exactly something around 330"

Edit: Works fine to me... Thanks for all the help! really..

Yes 220R would limit the current to 19mA, a bit hight but better than nothing.

i can throw some lower or higher in if it would be better...

Higher would be better, try two 220 in series.

Grumpy_Mike:
Higher would be better, try two 220 in series.

thanks again. I took some 510 which works