3 Simple Ways to
Share What You Make

With Instructables you can share what you make with the world — and tap into an ever-growing community of creative experts.

PhotosPhotos

Share one or more photos of a project, recipe, or whatever you've made, quickly and easily.

Step by StepStep-By-Step

Share your step-by-step photos with text instructions of what you made so others can do it too!

VideoVideo

Share your how-to video. You'll need your embed code from a video site such as YouTube.

LED Cube 8x8x8

Step 39Build the controller: Transistor array

Build the controller: Transistor array
«
  • IMG_6433.JPG
  • IMG_5963.JPG
  • IMG_5964.JPG
The transistor array is responsible for switching on and off GND for each layer in the LED cube.

Our first attempt at this was an epic fail. We bought some transistors rated for over 500mA, thinking that would be plenty of juice. We don't remember the model number.

The LED cube worked, but it wasn't very bright, and the brightness was inversely proportional to the number of LEDs switched on in any given layer. In addition to that, there was some ghosting. Layers didn't switch completely off when they were supposed to be off.

Needless to say, we were kind of disappointed, and started debugging. The first thing we did was to add pull-up resistors to try to combat the ghosting. This removed almost all the ghosting, yay! But the cube was still very dim, bah!

We didn't have any powerful transistors or MOSFETs lying around, so we had to come up with another solution.

We posted a thread in the electronics section of the AVRFreaks.net forum, asking if it was possible to use two smaller transistors in parallel. This is the only option available to us using the parts we had on hand. The general response was, this will never work so don't even bother trying. They even had valid theories and stuff, but that didn't deter us from trying. It was our only solution that didn't involve waiting for new parts to arrive in the mail.

We ended up trying PN2222A, NPN general purpose amplifier. Ideally, you'd want a switching transistor for this kind of application, but we needed 16 transistors of the same type. This transistor was rated at 1000mA current, so we decided to give it a try.

For each layer, we used two PN2222As in parallel. The collectors connected together to GND. The emitters connected together, then connected to a ground layer. The base of each transistors was connected to it's own resistor, and the two resistors connected to an output pin on the ATmega.

We soldered in all the transistors and turned the thing on again, and it worked, perfectly!

If you know what you are doing, you should probably do some research and find a more suitable transistor or MOSFET. But our solution is tried and tested and also does the trick!

1) Start by placing all 8 all transistors on the PBC and soldering each of their pins.

2) Run a solder trace between the the emitters of all 16 transistors. Connect this solder trace to GND.

3) Solder in a resistor for each transistor, the solder the resistors together in pairs of two.

4) Run kynar wire from the output pins on the ATmega to each of the 8 resistor pairs.

5) Solder together the collectors of the transistors in pairs of two and run solder trace or wire from the collector pairs to an 8 pin header.
« Previous StepDownload PDFView All StepsNext Step »
28 comments
Apr 8, 2012. 2:56 PMarighi1 says:
(removed by author or community request)
Apr 10, 2012. 12:01 AMgokhank says:
hepsi bu _emalar1n ben bu _emadan yapt1m.instructables ve chr te_ekkürler
Feb 24, 2012. 7:43 AMtimmer2 says:
How about using a TIP120 NPN darling inplace of the two transistors?
Feb 24, 2012. 8:30 AMtriumphtotty says:
Works a treat. I think I used TIP121s because I had a few knocking around, but they're the same basic spec. I used 860Ohm base resistors (again, because I had exactly 8 in a pack), but anything from around 150 to 1K should work just fine!
Mar 31, 2011. 12:04 AMtrunet says:
you're using Rb = 1k as said on component list right?

I tried to do some math and I want to know if this is correct.

Ic = 0.02A * 64 leds = 1.28A (maximum current per transistor)

hFE(min) = 5V * (1.28A / 0.04A) = 160
(atmega328p can supply 40mA or 0.04A per pin)

Rb = (5V * 160) / (5V * 1.28A) = 125Ohm

- BC639 is the best match for the transistor(if not can you indicate one that is OK).
- 150Ohm is the resistor to use connected on base not 1k

For the pull-up resistor you can stick with a 4.7k resistor.
Jun 30, 2011. 4:38 PMledartist says:
Sorry but your formula seems incorrect. If you want to give the maximum base current of 40mA to the transistor, the formula in this case would be:

Rb = (5V - 0.7V) / 40 mA = 107.5 ohm (I'd use 120 ohm to be safe)

Where 5V is the output voltage of ATMega, 0.7V is the base voltage drop (nominal). Then just apply Ohm's law to get the value of the register.

Yes 1K ohm is too high for this project for sure.


Jan 23, 2012. 8:20 AMTechNotes says:
How did you get the 40 mA in your equation?
Jan 23, 2012. 11:52 AMtrunet says:
I took from atmega328p datasheet. Each atmega pin can handle up to 40mA.
Sep 15, 2011. 6:08 AMvijirvy says:
hi , i tried this project almost i done but setting the fuse bit i have some problem
i use avrdude first lower bits write successfully after the chip didn't respond (power on failed) i check the power and all is correctly work.

please tell me how to set the fuse bits in extreme avr burner


can i use atmega16 for atmega32?

reply urgent.....

thank you
Sep 13, 2011. 8:13 AMyww336600 says:
WHAT IS THE VALUE OF RESISTANCE R20 --R28???

Thanks!
Sep 13, 2011. 2:18 PMledartist says:

I'm not the author, but I think 1k ohm should be safe for them.


Jul 3, 2011. 11:54 AMbkeaton says:
Reading these posts is probably more important than most realize. After reading yours, I examined both the multiplexer board here and the one shown on the 8x8x8 addendum instructable. Both photos show 100 ohm resistors, not the 1k called for in the parts list. We're talking about soldering in 64 resistors of the incorrect size! Many thanks to you for posting the correct size for this resistor. BTW, your Aurora 9x18 RGB LED art? Gorgeous!
Sep 15, 2011. 6:08 AMvijirvy says:
hi , i tried this project almost i done but setting the fuse bit i have some problem
i use avrdude first lower bits write successfully after the chip didn't respond (power on failed) i check the power and all is correctly work.

please tell me how to set the fuse bits in extreme avr burner


can i use atmega16 for atmega32?

reply urgent.....

thank you
Jun 30, 2011. 5:09 PMtrunet says:
Thanks for the correction ;)
Apr 4, 2011. 11:29 AMbernutu says:
I'm having a problem with my cube! I found the problem (I have to use pull up resistors) but I don't know where to put them! Any idea? Thanks!
Apr 4, 2011. 12:06 PMtrunet says:
just take a look on schematics. you have to put between VCC and the cable going to your led layers.
Apr 4, 2011. 12:15 PMbernutu says:
Yeah but between transistors and the shift register, or after the transistors? I'm sorry but I'm a bit dumb in electronics!
Apr 4, 2011. 1:06 PMtrunet says:
transistor collector -> led layer <- PULLUP RESISTOR <- VCC
Apr 4, 2011. 1:26 PMbernutu says:
It doesn't work, but thanks anyway!
Oct 10, 2011. 10:35 PMthe_burrito_master says:
64 LEDs x 20MA = 1280MA Guy's just go for 1500-2000MA transistors and you'l have no trouble with double transistors.

Personally I've never used more than 15 leds on on one transistor so I had no idea they'd get dim like that, interesting, I thought the transistor would have just been over driven and put off a fireworks show.
Oct 10, 2011. 10:45 PMthe_burrito_master says:
http://www.mouser.com/ProductDetail/Fairchild-Semiconductor/KSC2500CTA_Q/?qs=sGAEpiMZZMtvtNzZ3W%252bLwKi4g93EPApRYpDSR8f9%2f4Y%3d Should work. cant beat a 10 cent 2 amp transistor :D
Sep 15, 2011. 3:15 AMartur36 says:
Can I use a array of Darligton Transistor Ic instead of the discrete Transistors like the ULN2804?
If yes wich one is the right to chose or wich characteristics should I looking for?
Thanks
Sep 16, 2011. 4:32 AMartur36 says:
I again I "googled" a lot about kinds of transistors and arrays and discovered that I need a PNP type transistor array like UDN2981
Sep 17, 2011. 3:12 AMSteel Chameleon says:
Sure you need PNP Transistors? The ones in the schematic are NPN, maybe the ULN 2803A would be what you need.
Sep 17, 2011. 5:50 AMartur36 says:
In my search I realize that ULN28xx family use one common collector and 8 emitters linked to VCC wich means that is not suitable for the project because the flow current needs to be in the oposite direction.
The UDN2981 have 8 collectors and a common emitter linked to Ground wich is the right direction for the current flow for this project, at least is what i have understood when i googled it
Sep 17, 2011. 9:37 AMSteel Chameleon says:
The ULN 2801A-ULN 2805A each contain eight darlington transistors with Common Emitters and integral suppression diodes for inductive loads. (Datasheet extract)

I double checked but the 2803A has 8 darlington pairs with common emitters tied to ground and individual collector outputs. What looks like a common collector output is the suppression diodes but they are really only needed for use with inductive loads to protect the IC from any emf feedback. You could probably get away without connecting this for just driving LED's although It wouldn't hurt to connect it.
The 2803A also has it's own 2.7k input resistor for 5V TTL and CMOS applications which is perfect for the Arduino's output pin voltage so you wouldn't need any extras. Plug and Play.

I hope after all this investigating i'm right as i've ordered two :P
 
Sep 17, 2011. 10:51 AMartur36 says:
In that case is great because ULN is cheaper, at least in Portugal, I have one in "stock" I will try to experiment to see if it will work, thanks a lot
Sep 17, 2011. 2:57 PMSteel Chameleon says:
Let me know the outcome as I'm using the same with an Arduino Uno, i'll post my results here when i'm done.
Sep 17, 2011. 3:47 PMartur36 says:
I have tested with a simple circuit with 2 LEDs only and it worked just fine with linked only imputs and outputs desired and Ground linked in the respective pin of the IC
Sep 16, 2011. 4:33 AMartur36 says:
Hi someone can post the formula to achieve the right value of transistors Output Current
Thanks
Mar 14, 2011. 12:25 PMarsenala5 says:
How is this type of pull up resistor called and what value is it ( 5k? ) ?
Sep 15, 2011. 6:09 AMvijirvy says:
hi , i tried this project almost i done but setting the fuse bit i have some problem
i use avrdude first lower bits write successfully after the chip didn't respond (power on failed) i check the power and all is correctly work.

please tell me how to set the fuse bits in extreme avr burner


can i use atmega16 for atmega32?

reply urgent.....

thank you
Sep 4, 2011. 5:24 AMvijirvy says:
what is the value of pull up resistor and how many pins? how it connected? i have 9 pin resistors? would i use it?
Jan 6, 2011. 4:28 AMPrivatHost says:
Hello,
How big is the Pull-Up Resistor (e.g. 10k, 1k...)?
Jan 6, 2011. 6:52 AMnixnope says:
Should not matter much, but if you use 5k you should be good no matter what.
May 30, 2011. 5:30 AMVick Jr says:
so 1 4.7k Ohm 10 pin resistor network would work?
Jan 17, 2011. 8:40 AMbrandon248 says:
Where did you connect these pull up resistors? Do you mean pull-down resistor? I just don't see what you are pulling high... :S
Jan 17, 2011. 2:33 PMbrandon248 says:
Ah, thanks chr. I was confused as to where you added the pullup resistors at first, that makes sense now... Thank you!
May 15, 2011. 2:19 PMrobertjoellewis says:
Why is it necessary to use 16 transistors? Why can't you just use 8? Sorry if I am missing something. Newbie here.

Pro

Get More Out of Instructables

Already have an Account?

close

All Steps Viewing
View all steps of an Instructable on the same page when you're a Pro Member.

Upgrade to Pro today!
651
Followers
7
Author:chr
I like microcontrollers and LEDs :D