[SOLVED] Drive 12 RGB's - mosfet or transistor? and which...

Hello Forum

I will create a lamp which can light up in all the colors of the rainbow, i will add some effects like steady light (red, green blue), very fast switching between colors, slowly fading colors etc.

I brought these RGB leds on Ebay:
http://www.ebay.co.uk/itm/110914651159?ssPageName=STRK:MEWNX:IT&_trksid=p3984.m1497.l2649

with these specifications
Red: Voltage 2.4v, 20ma
Green: Voltage 3.4v, 20ma
Blue: Voltage 3.4v, 20ma

I already brought resistors for these, to power them from a 5v voltage regulator. I figured out that i must use a transistor or a mosfet to handle the switching of the LEDs, as the Arduino won't be able to handle the current on the PWM pins. The LEDs will be connected in parallel each which it's own resistor. So i'll use three PWM pins, one for each color

Now my question is, shall i use a Transistor or a Mosfet? - as far as iv'e red the smartest is to use a mosfet, but i don't know if that is correct. The LEDs will use a maximum of 240ma, as far as i figured out(?). As i said, i will have a mode where the LEDs will cycle through colors really fast, so i need a transistor or mosfet that can switch very fast - i don't know if all is capable of that.

I would like you guys to help me find the right mosfet or transistor for my project, as i don't know what to choose, and what to look for, i have played with transistors before, but mosfets is all new to me, so i don't know which is the smartest for my application.

thank you very much.

best regards JohannesTN

You haven't said whether the 240mA is total (so you will be driving 4 RGB LEDs, 80mA per PWM pin) or per colour (driving 12 RGB LEDs, 240mA per PWM pin). But it makes little difference. Unless you are making a PCB and using SMD devices, then transistors will cost a lot less than mosfets. I would use three BC337 transistors, each with a 330 ohm base resistor.

dc42
Thank you very much for your fast answer! - the 240mA is per color, therefore the pwm pins can't handle this. I am NOT going to use SMD components. I would like to ask you, why you would use a transistor rather than a mosfet? - is it just because the transistor is cheaper, or does it have some capabilities i will need, as the mosfet doesn't offer. I am asking because i red somewhere that mosfets are more generally used today, therefore i thought that this would be the best thing to use :slight_smile:
again, thank you very much. I appreciate your help

If you're doing PWM then a transistor will switch faster than a MOSFET (Arduino pins aren't very good for switching MOSFETs quickly).

240mA is well within the average transistor's power rating so I'd go for that. Pretty much any transistor will do.

I think of using PWM, are there anything smarter to use for the purpose?

JohannesTN:
dc42
Thank you very much for your fast answer! - the 240mA is per color, therefore the pwm pins can't handle this. I am NOT going to use SMD components. I would like to ask you, why you would use a transistor rather than a mosfet? - is it just because the transistor is cheaper, or does it have some capabilities i will need, as the mosfet doesn't offer. I am asking because i red somewhere that mosfets are more generally used today, therefore i thought that this would be the best thing to use :slight_smile:
again, thank you very much. I appreciate your help

There are few low to medium-power mosfets available in non-SMD packages. The only ones I know of that would be ideal to switch 240mA are from the ZVN range, e.g. ZVN4206A. In contrast, there are lots of NPN transistors in TO92 or similar packages that will switch 240mA.

fungus:
Pretty much any transistor will do.

I disagree, you need a transistor with reasonable hfe and low saturation voltage @ 240mA. Low-current types such as 2N3904 would not work well in this application.

dc42:

fungus:
Pretty much any transistor will do.

I disagree, you need a transistor with reasonable hfe and low saturation voltage @ 240mA. Low-current types such as 2N3904 would not work well in this application.

Damn, you found an exception!

I'd better name one: 2N2222 (or BC548 for Europeans)

Edit: I meant BC337...

fungus:
Damn, you found an exception!

I'd better name one: 2N2222 (or BC548 for Europeans)

2N2222 - better than 2N3904, but still not ideal for switching 240mA. Minimum hfe and maximum Vce(sat) are is 100 and 0.4V @ 150mA but 30 and 1.6V @ 500mA. So OK for switching 150mA, but not really suitable for switching 500mA. At 240mA I expect the hfe will be OK, but the Vce(sat) is likely to be a little high.

BC548 - definitely not suitable, it's a low current transistor like the 2N3904. On the datasheet I am looking at, minimum hfe is only specified @ 2mA, and maximum Vce(sat) is only specified at 10mA and 100mA.

The reason I like BC337 is that it maintains good minimum hfe at higher currents (100 @ 100mA and 60 @ 300mA), as well as low Vce(sat) (0.7V @ 500mA). The ZTX851 is even better, but expensive and less readily available.

Oh i see, i bet that the BC337 would be just right for me then?

best regards, and happy xmas

dc42:
The reason I like BC337

Brain fart. Yes, that's the one I meant....

shall i use a Transistor or a Mosfet?

At that level, it doesn't matter.

dhenry:
then, when would it matter? - just curious :slight_smile:

I would say that for small current (<500ma) or very large current (>200amp), you are in bjt land. BJT is much easier to drive for small current switching and much more efficient at high current / high frequency switching.

Mosfets are attractive due to its low ohmic values. I would start considering them for 1amp+ switching, or moderate speed (<50khz). Their issue is inefficiency at very high current levels, or difficulty in driving them at high speed.

dhenry:
Thank you, i ordered some BC337, i hope they will do :slight_smile:

So, as you purchased (linked to) common-cathode devices, how are you planning to use the transistors?
[The discussion has been short on detail there.]

Good point, I hadn't spotted that.

Johannes, you need to switch them with PNP transistors, such as BC327.

Damn, it looks like the purchase of the RGB's did go a little too fast... If i had chosen RGB's with common anode i could have used the BC337's right?

but now that mine is the common cathode type, i have to drive them with a PNP transistor such as the BC327?

damn i am a fool...

I've just ordered a few BC327, hope they will solve my "problem"?

I hope you remembered the 330 ohm resistors too.

JohannesTN:
but now that mine is the common cathode type, i have to drive them with a PNP transistor such as the BC327?

Yep.

JohannesTN:
damn i am a fool...

This is how we learn...