Control RGB LEDS (common cathode) with a Mosfet or a transistor

hey i want to build a rgb lighted Cube with an bluetooth module. this is my template

I have RGB LEDs with a common cathode an i cant control the leds with an N channel Mosfet now i want use a P channel mosfet or an transystor is this possible?

HI,

Assuming your LED power is +12V and your are powering it from a 3.3 or 5V arduino, you would need a driver like the attached.

The N-Mosfet must be a logic level MosFet chosen so the MosFET will be "on" when the gate is given 3.3V or 5V depending on your arduino. Actually the I/O voltage is slightly less than the supply for either.

The P-Mosfet will be selected based on the current you need to supply to your LED(s).

Clipboard01.jpg

Folks differ on whether the 1k in the N-Mosfet Gate is needed or not. It is not functionally required. I like to add it so if the MosFet is miswired you will likely not damage your arduino.

Clipboard01.jpg

hey thanks but i have not much space for many components an why i cant use a P mosfet directly? or a transystor

why i cant use a P mosfet directly? or a transystor

Because for high sided switching you turn on the FET or transistor with a low signal and turn it off with a high signal. If the voltage you want to switch is higher than the signal you have to switch it with then you need a driver first to make the signal of the same level as the voltage you want to switch.

If you supply only partial information you can only ever get a partial answer.

i want to run the rgb leds with 5v same as the arduino output

So something like this then:-
RGB Common Cathode driver.jpg

RGB Common Cathode driver.jpg

JohnRob:
Folks differ on whether the 1k in the N-Mosfet Gate is needed or not.

They also differ on whether the pull down should be on the controller side or the mosfet side of that 1k, if fitted. Technically, the way you have it the 1k and 10k make a divider, which conditions the voltage to the gate. In practice it might make little difference since the divider's very lopsided and gives over 4.5V from 5V, but hey, it's just as easy to put it on the other side where it's technically correct.

Yes grumpy Mike that ist what i searched thanks

will this work? the switch simulate the arduino and yes i know i need a resitor for the LED

will this work?

As drawn no.

the switch simulate the arduino

Not on that simulation it dosn't. You will need to have a change over switch in order to simulate the Arduino.

Also their is no pull up resistor on the gate, meaning that in the time between boot up and the code running the Arduino output will float and cause random LED firings.

Hi BearGear,

I think it might help if you could provide a link to your LED Strips.

@Kenwood120s

I agree with your statement regarding the divider it does reduce the gate voltage slightly (and needs to be addressed). The only reason I often suggest the pull down is near the MosFet is because often the MosFets are on a different "board" often a plug in test board. So if the wire to the Arduino is not connected, the MosFet will remain "off" rather than float around.
All these type of decisions are application dependent and have benefits and drawbacks. Your point is well taken and I will likely mention it next time the opportunity comes up.

The pull down can be 100k, 1M or larger if you want, then the divider issue is non-issue. Typical gate
capacitances are a few nF, the time constant with a 1M resistor will be of the order of a few milliseconds.

will this work? the switch simulate the arduino and yes i know i need a resitor for the LED

As GM said, no, it will not work as drawn. Start by changing the N channel device shown to P channel, add a gate pull-up, a series resistor and an led and you've got a simulation starting point.

avr_fred:
As GM said, no, it will not work as drawn. Start by changing the N channel device shown to P channel, add a gate pull-up, a series resistor and an led and you've got a simulation starting point.

Which is exactly the circuit I posted in the first place.

hey im useing standart RGB LEDS with a common cathode from eastlion.
i want to control these with bluetooth, the scetch is working fine.
did i really undertand this that i cant use Nchannel mosfets?

did i really undertand this that i cant use Nchannel mosfets?

You can not control a common cathode LED with N channel FETs.

You could use NPN transistors wired in the emitter follower mode, but with a 5V signal you will only get a high voltage of 4.3V.

If you want control a common cathode LED you need P channel FETs or PNP transistors.