Pages: [1] 2 3   Go Down
Author Topic: Why do people use NPN transistors in order to build a LED cube?  (Read 5225 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 8
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi!

I was wondering one thing: There are many people out there who has built an LED cube with the help of NPN transistors in order to control each layer.
Why do people use NPN transistors in order to control each layer? Isn't it possible to just use a cable to directly connect it to one of the outputs of the Arduino?

Cannot seem to find an answer on the internet, so I am trying to post my question here.
Logged

Hillsboro, OR
Offline Offline
Jr. Member
**
Karma: 1
Posts: 73
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I've never built one, but I'm gonna go ahead and say that they use an NPN transistor to enable the use of an external power supply to power the LED cube, as to not draw too much current from the arduino and burn it up. That way, the arduino just sends the high/low signal, and doesn't have to try and supply the power.
Logged

"Beer is proof that god loves us and wants us happy" - a popular misquote of Benjamin Franklin, but true nonetheless.

Valencia, Spain
Offline Offline
Faraday Member
**
Karma: 150
Posts: 5666
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi!

I was wondering one thing: There are many people out there who has built an LED cube with the help of NPN transistors in order to control each layer.
Why do people use NPN transistors in order to control each layer? Isn't it possible to just use a cable to directly connect it to one of the outputs of the Arduino?

Cannot seem to find an answer on the internet, so I am trying to post my question here.

Arduino pins can only handle a maximum of 40 milliamps.

(and even 40 milliamps isn't recommended for constant use).
Logged

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

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 361
Posts: 17303
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi!

I was wondering one thing: There are many people out there who has built an LED cube with the help of NPN transistors in order to control each layer.
Why do people use NPN transistors in order to control each layer? Isn't it possible to just use a cable to directly connect it to one of the outputs of the Arduino?

Cannot seem to find an answer on the internet, so I am trying to post my question here.

The answer is in how a cube is wired to operate. There are usually individual drivers (either direct avr output pins or shift registers output pins) driving the vertical columns of a cube. And as such depending on how many leds the given pattern wants to turn on for a given cube 'level' (or "layer" if you please) the total amount of current demand for that level can vary from 0 ma to 20ma X the number of leds for that level, so for a 5x5x5 cube there can be as many as 25 leds that must be powered, or 500ma, so the 'level driver' current requirement is way too much for directly connecting to a digital avr output pin, therefore a switching transistor rated for well above the worst case "level" current requirement is needed.

Does that make sense?

Lefty
« Last Edit: April 29, 2013, 10:39:58 am by retrolefty » Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 8
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks for all the answers, yes Lefty it makes very sense. But if I do not want to turn on all the leds at the same time and use multiplexing on the programming, is it possible to skip the transistors for a 5x5x5 cube? BecaUse it seems like the leds are very dim when we have our own LED cube 5x5x5 on, especially when we use multiplexing and we do use transistors
Logged

Valencia, Spain
Offline Offline
Faraday Member
**
Karma: 150
Posts: 5666
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks for all the answers, yes Lefty it makes very sense. But if I do not want to turn on all the leds at the same time and use multiplexing on the programming, is it possible to skip the transistors for a 5x5x5 cube?

Yes but it will be very dim.

BecaUse it seems like the leds are very dim when we have our own LED cube 5x5x5 on, especially when we use multiplexing and we do use transistors

Circuit diagram? Multiplexing scheme...?
Logged

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

Offline Offline
Edison Member
*
Karma: 30
Posts: 2494
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You can buy common anode and common cathode RGB LED's.

But, as pointed out, it's how you go about powering them, do you Source or Sink... take a look at the attached image.



* PNP_NPN_switching-outputs-195x147.jpeg (6.85 KB, 195x147 - viewed 180 times.)
Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 546
Posts: 27363
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

What are you using as current source for the anodes in your cube, and where are your current limit resistor located?
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Offline Offline
Jr. Member
**
Karma: 1
Posts: 60
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Well you can power a 5x5x5 LED cube from the arduino itself by using shift registers and 5 npn transistors for switching to gnd. I run my cube @ ~13mA per led. So if I light up 1 layer it only draw 325mA + some current for the chips/uno itself of the 450mA(or 500mA, however I'm not sure) available. Though its working you can't light up more than 1 layer at the time, because of this you have to multiplex the cube... In my thread there are some pics of my cube as you can see I only use 5 npn transistors:http://arduino.cc/forum/index.php/topic,144057.0.html. You have to use those transistors because the arduino can only sink up to 40mA per pin, with 5 transistors you only need a limited amount of current from the arduino pins to the base of the transistor to switch it to gnd.
« Last Edit: May 01, 2013, 05:40:05 am by WonderTiger » Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 44
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I have a question regarding LED driving, every time I think I understand things I realise I don't. I know this is getting a bit OT, please forgive that but there seesm to be some knowledgable people here, and this does seem to be very close to topic,switching LEDs with NPN transistors.


Basic task : I want to drive some common cathode RGB LEDs with an Arduino. I've got a bunch of IRF520s on hand, also small transistors like 2N2222, BC557.

Does this circuit even make sense? Is it the best way to do what I want to do? (I'll settle for 'works' as a definition of 'best')

Can't inline images ?

I was planning on running the LEDs in 'parallel' ie connecting all their red pins together and so on, then using one FET for each colour channel. I've tried that woth the 220ohm resistors and the current flow is OK, a bit low but the LEDs are bright enough. I know I dont need the FETs, they're 10A units and some little transistors would do fine. Also, PNP transistors would be fine, I just happen to have the IRF530s.

Any help much appreciated.


* fet-lowside-2.jpg (17.48 KB, 512x445 - viewed 110 times.)
« Last Edit: May 09, 2013, 10:12:10 pm by emueyes » Logged

Offline Offline
Edison Member
*
Karma: 30
Posts: 2494
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

another restor to the unconnected led in series with the source of the fet, same as the connected existing one
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 44
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Yep. I put the second LED in there to indicate "more LEDs go here...", that is, the same colours all tied together. Probably wasn't that clear of me in the diagram. If the circuit's OK apart from that I'm happy.
Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 546
Posts: 27363
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

What is the complete IRF520 or IRF530 part number being used?
http://www.digikey.com/scripts/dksearch/dksus.dll?vendor=0&keywords=IRF520
http://www.digikey.com/product-search/en?lang=en&site=us&KeyWords=IRF530

Some are Logic Level, and will switch from 0-5V just fine.
Some are Standard Level, and will not switch full on unless 10V or more is available.
Some are N-channel and are really intended as current sinks (use between cathode and Gnd)
Some are P-channel and are really intended as current sources (use between 5 or 12V and anodes)
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Offline Offline
Newbie
*
Karma: 0
Posts: 44
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The markings on them are:

IRF 530N
I?R 226E
15 5E

? is a marking I can't decipher, looks a bit like a triangle. They're in a TO220 package.

From the IRF530 datasheet, almost all are logic level gated, so they'll switch properly with the Arduinos 5V?  That'd be good news.

I'd read that FETs are better chosen to suit the load given them - not the few hundred milliamps this will use where, but also the FETs have a much lower on resistance, so surely I'm better off doing things the way I'm doing them?

Also, I left a wire out of that diagram, I was just going to connect all the anodes for a particular colour together, then to the resistor and FET, is that OK? At this stage there's only 4 LEDs ie 4 LEDs on each of the RGB channels.



« Last Edit: May 10, 2013, 12:40:50 pm by emueyes » Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 546
Posts: 27363
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Okay, that's an N-channel MOSFET.
Better suited as a switch between cathode  & Gnd, but if you have common cathode RGBs and its a 5V only system then using between 5V and a resistor to each anode might be okay.
If you use 1 resistor and parallel up the Anodes you may get uneven brightnesses, or burn them out if the LEDs have different current flows between them.
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Pages: [1] 2 3   Go Up
Jump to: