Arduino getting hot.

I'm building an led cube. I'm using TIP122 NPN transistors to switch the grounds of each layer. When I apply 5V to the base of the transistor to stop current from passing thru it, my arduino UNO gets hot real fast. I have the ground from the led layer hooked up to the emitter. And the collector is grounded. Do I need resistors to fix this problem? Or do I have the correct transistor? Or do I have it wired the wrong way? Please help!!! Thanx!

Describing circuits in words seldom works: post a schematic so we can understand the circuit....

You always need a base resistor on a transistor. You also appear to have the transistor wired in upside down. As Jimbo said, a schematic helps prevent endless 2nd guessing.

A TIP122 is an NPN transistor. You apply current into the base to turn it on, not off. It's on now, because it is upside down and current is flowing thru the body diode. You ground the emitter and hook the grounded end of your LED string to the collector. The other end of the LED string connects to your Vcc supply. Do you have current limit resistors in the base connection and the LED string?

JJBduino: I have the ground from the led layer hooked up to the emitter. And the collector is grounded.

That sounds backwards.

JJBduino: Do I need resistors to fix this problem? Or do I have the correct transistor? Or do I have it wired the wrong way? Please help!!! Thanx!

You should always have a resistor between an Arduino and a transistor base (1K Ohms).

Hey guys, thanks a lot for the help… I’ve attached a couple schematics of how I had it wired before your help and after your help… Very much appreciated!!! It seems to be working great now!! Now for another question… Do most arduino users write their own code? Cause I know I can get code off the Internet but I don’t know if it will be the right code for the way I have my cube hooked up… I’m just a new guy on this forum and have been just getting info off of other sites to build my led cube. I would definitely be interested in knowing how to write my own code… Is there any online courses or books about it? Or is it something I have to just use the “trial and error” method?

JJBduino: Do most arduino users write their own code?

You don't really have a choice if you're not simply copying a project.

JJBduino: I would definitely be interested in knowing how to write my own code... Is there any online courses or books about it? Or is it something I have to just use the "trial and error" method?

The language is called "C++". I'm sure Google can provide thousands of relevant web sites.

You can use trial and error but it'll take you ten times longer. Any time spent doing proper studying is well worth it.

While that of course is true, reading and trying to understand might be difficult. So practicing isn't a bad thing. As you seem to have the Arduino already and haven't got any reading available, you can start by having a peek at some examples. Your IDE came with quite a few examples. Open a some of those and start with the really small ones. Blink shows you how to control a LED or an output pin. Fade shows you how to dim a LED. There's a lot more. You can change blink and fade so they control for instance multiple LEDs. You can combine blink and fade so multiple LEDs fade in and out, maybe at different speeds. Just play with the code and see what happens, you'll learn something. Not unimportant: Have fun !

MAS3: Just play with the code and see what happens, you'll learn something. Not unimportant: Have fun !

Playing with code without knowing what "int" and "char" are, what a function is, what "for" does, what square brackets are for, etc. is for masochists.

If you look back at your two schematics posted and consider the arrow in transistor's symbol it ought to be obvious that the first one was wrong. The arrows in diode and transistor symbols have a very straightforward meaning, they show the direction of conventional current flow.

Thanks for the answers! I looked at some of the code for the different flash patterns of an LED cube and I don't know what all those different terms mean or do... I thought I would have to write code for each individual LED and layer, but now I'm totally confused...!!

While its a bit outdated... reading this should provide you at least a few answers...

http://playground.arduino.cc/uploads/Main/arduino_notebook_v1-1.pdf

I'm not an expert, neither in electronics, or in Arduino, but if you want, take a look at my Led cube project on my signature, and in my blog.

I hope you can get at least 1 good idea from there ;)

Thanks again for the help! That PDF file looks like it'll help a lot. But I'm still not sure about whether I have to write code for each individual led or what? I'm using the Shift out feature with the 74HC595 shift registers so I'm not sure how to do that.