Here is a handy LM317 constant current calculator/tool. It allows you to quickly calculate the set resistor and the heatsink (is needed).

Sections of the calculator

Constants

Ambient temperature – this is the temperature of the surrounding air / environment. You can increase this variable accordingly.

Thermal Resistance, Junction-to-case, θ_{JC} – taken from LM317 datasheet. Different packages have different value.

Thermal Resistance, Junction-to-ambient, θ_{JA} – again, see this value in the datasheet

Thermal Resistance, Case-to-heatsink(no thermal compound), θ_{CH} – this one is an conservative estimate. It’s better to calculate worst case scenario then optimistic scenario. It will be lower in real world if you use thermal paste.

Inputs

V_{IN} – the input voltage. To minimize the heat it’s recommended to use as low value as possible. Bare in mine that you still need about 2.5V across LM317.

I_{SET} – this one is clear. Input your desired current value.

R_{LOAD} – input the load resistance. This one will give you the V_{F} value which is the resulting voltage across the regulator. If resulting value is lower than 2.5V V_{F} is displayed in red. This means that the regulator will not work.

θ_{HS} – this is the thermal resistance of the heatsink. You should be able to get this value from its datasheet. The better the heatsink the lower the value.

Formulas

R1 = I_{SET} x 1.25V – calculated value in Ohms

V_{OUT} = I_{SET} x R_{LOAD } – calculated value in volts

P_{IC1} = (V_{IN} – V_{OUT}) x I_{SET } – calculated value in watts

P_{R1} = I_{SET}^2 x R1 – calculated value in watts

tº_{IC1 =} tº_{AMB} + P_{IC1} x θ_{JA } – calculated value in ºC

tº_{IC1HS} = tº_{AMB} + P_{IC1} x (θ_{JC} + θ_{CH} + θ_{HS}) – calculated value in ºC

**LM317 spreadsheet >>>LINK<<<**

## jawa

thankyou sir