This question already has an answer here:
I'm working on an RGB LED project. I'm using this as the power supply: https://www.sparkfun.com/products/114 It uses an LM317 which according to the data sheet can supply up to 1.5A. The LED's I'm using are these: http://www.adafruit.com/products/314
And the mains power supply I'm using is a 12v DC 2 AMP one.
Here's the problem. If I have just all of the red parts of the LED's lit up (I have 8 LED's), within about a minute the voltage regulator is far too hot to touch and I disconnected it when it started to smell funny. I attached a coin to the heatsink part of the voltage regulator (Not great I know, but I'm still waiting for some proper heat sinks I ordered to arrive) and within about a minute that too was far too hot to touch.
How can this be? Each red part of the LED uses 20mA, so multiplied by 8 that is 160mA. So the circuit isn't drawing too much current, is it? I'm using 150 Ohm resistors for each LED.
Why is it heating up so much, and what am I doing wrong?
(Also, if I powered up all red, green, and blue parts of all 8 LED's, the voltage regulator gets blisteringly hot)
(I've just being reading about "switching" regulators being used as they produce less heat, would this be a better idea?)