Pages: [1] 2   Go Down
Author Topic: [SOLVED] Drive 12 RGB's - mosfet or transistor? and which...  (Read 2250 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Jr. Member
**
Karma: 0
Posts: 91
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
« Last Edit: January 27, 2013, 01:20:57 pm by JohannesTN » Logged

United Kingdom
Offline Offline
Tesla Member
***
Karma: 227
Posts: 6639
Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

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.

Offline Offline
Jr. Member
**
Karma: 0
Posts: 91
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Valencia, Spain
Offline Offline
Faraday Member
**
Karma: 152
Posts: 5757
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.


Logged

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

Offline Offline
Jr. Member
**
Karma: 0
Posts: 91
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I think of using PWM, are there anything smarter to use for the purpose?
« Last Edit: December 23, 2012, 03:46:38 pm by JohannesTN » Logged

United Kingdom
Offline Offline
Tesla Member
***
Karma: 227
Posts: 6639
Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

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.

Valencia, Spain
Offline Offline
Faraday Member
**
Karma: 152
Posts: 5757
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

« Last Edit: December 24, 2012, 09:01:29 am by fungus » Logged

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

United Kingdom
Offline Offline
Tesla Member
***
Karma: 227
Posts: 6639
Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

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.

Offline Offline
Jr. Member
**
Karma: 0
Posts: 91
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

best regards, and happy xmas
Logged

Valencia, Spain
Offline Offline
Faraday Member
**
Karma: 152
Posts: 5757
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The reason I like BC337

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

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

Offline Offline
Edison Member
*
Karma: 116
Posts: 2205
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
shall i use a Transistor or a Mosfet?

At that level, it doesn't matter.
Logged

Offline Offline
Jr. Member
**
Karma: 0
Posts: 91
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Offline Offline
Edison Member
*
Karma: 116
Posts: 2205
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Offline Offline
Jr. Member
**
Karma: 0
Posts: 91
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Offline Offline
Faraday Member
**
Karma: 66
Posts: 2588
Now, More Than Ever
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

"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?"

Pages: [1] 2   Go Up
Jump to: