Step 39Build the controller: Transistor array
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 Step | Download PDFView All Steps | Next Step » |
































































































![Hard Wired LED Cube: [No Programming]](http://img.instructables.com/files/deriv/FTD/SF1T/GO8DC8KW/FTDSF1TGO8DC8KW.SQUARE.jpg)















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.
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.
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
Thanks!
I'm not the author, but I think 1k ohm should be safe for them.
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
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.
If yes wich one is the right to chose or wich characteristics should I looking for?
Thanks
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
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
Thanks
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
How big is the Pull-Up Resistor (e.g. 10k, 1k...)?