LM317 heat

I am setting up an LM317 to drop from 12v to 9v, and I am not entirely clear on whether I need to add a heat sink.

This is coming from the 12v pin on a hard drive power supply. I think it is 2A? Does that sound correct? I am running this in to a 2N-3904 transistor, which in turn flips a relay that has a 320ohm coil. Does that all sound sane, or perhaps I am misunderstanding something?

Apologies for my neophite understanding of voltage and amps, I am working on it!

You're dropping 12V to 9V so that's a 3V drop across the LM317.
Your coil is 320 ohm, 9V / 320 ohms = .028A of current flowing through the LM317.

.028A * 3V = .084W of heat. Not much, but still always a good idea to use a heatsink.

Why not save yourself the 317 and simply put a 270ohm resistor in series with the relay feed from the switching transistor.

Where are the other resistors?

jackrae:
Why not save yourself the 317 and simply put a 270ohm resistor in series with the relay feed from the switching transistor.

that would alter my voltage that drastically? or are you thinking that the coil will not mind the extra voltage?

Lets see the coil spec.

OK, that was a waste. That -is- a 12V rated coil. Why do you want to use 9V? 9V is the -minimum- pickup voltage.

Wasted effort:
320 ohm coil at 9V is about 28.1mA. 12V coming in. So you need to drop out 3V. That is 1/3 of 9V, and so 1/3 of 320 ohm should drop out 3V. Therefore, about 100 ohms.

12V/(320 + 100) = 28.7mA

Just right. Resistor power rating? VI = P and then double that for the minimum resistor rating.

3V x 28.7mA = 86mW x 2 = 172mW

So an 1/8W resistor is too small (125mW), but a 1/4W resistor is just fine.

Don't forget the resistor between the Arduino and the transistor base. 1k will work just fine.

Hah, thanks for the explanation and sorry I need so much help.

I have flipped this one over with 5v, so I was even considering using 5v briefly. But 9v (or more) seemed like a better idea. If the coil is happy with 12v, and I have a nice 12v inbound line, yes I should simply use that.

So, any idea why this relay say 5v all over it when that number does not seem to match any of its specs?

"Min. Switching Load 10mA 5VDC"

Still, seems weird to me, too.

Relay contacts have to be "self cleaning" and they use the energy of the spark at the time of opening to perform the cleaning. Contacts (generally silver plated) which carry extremely little current will eventually oxidise and fail to provide a good electrical circuit unless either gold plated or hermetically sealed. Platinum used to be used as high integrity contact points for MIL-spec relays.

jackrae:
Platinum used to be used as high integrity contact points for MIL-spec relays.

And telephone impulser relay contacts.