Go Down

Topic: [SOLVED] Drive 12 RGB's - mosfet or transistor? and which... (Read 2 times) previous topic - next topic

JohannesTN

Dec 23, 2012, 08:45 pm Last Edit: Jan 27, 2013, 07:20 pm by JohannesTN Reason: 1
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

dc42

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.
Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

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 :-)
again, thank you very much. I appreciate your help

fungus

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.


No, I don't answer questions sent in private messages (but I do accept thank-you notes...)

JohannesTN

#4
Dec 23, 2012, 09:37 pm Last Edit: Dec 23, 2012, 09:46 pm by JohannesTN Reason: 1
I think of using PWM, are there anything smarter to use for the purpose?

dc42


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 :-)
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.


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.
Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

fungus

#6
Dec 24, 2012, 12:34 pm Last Edit: Dec 24, 2012, 03:01 pm by fungus Reason: 1


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...

No, I don't answer questions sent in private messages (but I do accept thank-you notes...)

dc42


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.
Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

JohannesTN

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

best regards, and happy xmas

fungus

No, I don't answer questions sent in private messages (but I do accept thank-you notes...)

dhenry

Quote
shall i use a Transistor or a Mosfet?


At that level, it doesn't matter.

JohannesTN

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

dhenry

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.

JohannesTN

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

Runaway Pancake

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.]
"Hello, I must be going..."
"You gotta fight -- for your right -- to party!"
Don't react - Read.
"Who is like unto the beast? who is able to make war with him?"

Go Up