Constant-current LED driver with LM317
Build it step by step
0 of 7 doneCalculate the resistor
1.25 V divided by the current.
Join four 1 ohm resistors
In series for 4 ohms.
Wire the LM317
IN, OUT and ADJ.
Mount the LM317 on the heatsink
Insulate the tab.
Mount the LED on a heatsink
Thermal paste.
Measure the current
Meter in series.
Work out the heat
Volts across the LM317 times current.
How do you build a constant-current LED driver with LM317?
An LM317 with one resistor drives a 1 W LED at a steady 300 mA from a 12 V supply. You need LM317 adjustable regulator, Wirewound resistor 1 Ω 10 W × 4, High-power LED 1 W white (star), Heatsink TO-220 and 12 V 2 A DC adapter. It takes 7 steps and about 60 minutes.
- Level
- Beginner
- Time
- About 60 min
- Parts
- 5
Wiring
| From | To | Why |
|---|---|---|
| 12 V adapter plus | LM317 IN (right pin, front view) | Supply |
| LM317 OUT (middle pin) | Four 1 ohm resistors in series, then LM317 ADJ (left pin) | Current-setting resistor |
| LM317 ADJ and resistor end | LED star anode (plus) | Load |
| LED star cathode (minus) | 12 V adapter minus | Return |
| Heatsink | LM317 metal tab (use an insulating pad if the tab touches anything) | Cooling |
No code needed
The LM317 is usually a voltage regulator, but if you put a resistor between its output and its adjust pin it holds 1.25 V across that resistor, and so the current through it is 1.25 V divided by the resistance. Four 1 ohm resistors in series make 4 ohms, so the current is about 310 mA, steady even when the supply voltage changes. That is exactly what an LED wants, since the brightness depends on current, not on voltage. The LED drops about 3.2 V and the resistor 1.25 V, so the LM317 itself drops the remaining 7 V or so at 0.31 A: that is about 2.4 W of heat, which is why it needs a heatsink and gets hot to the touch. A lower supply voltage wastes less: about 6.5 V is the least that works. The LED star also gets warm, so mount it on a heatsink as well. The LED is very bright, so do not look into it, and use the right polarity on the LED, because a reversed LED simply does not light. Use only a sealed 12 V adapter. There is no code for this build.
Test checklist
What you should see at each check. If a reading is far off, stop and use the troubleshooting list.
| Check | Expected |
|---|---|
| LED | Lights at steady brightness |
| Current | About 0.3 A on the meter |
| Change the supply from 9 to 12 V | Current stays the same |
| LM317 temperature | Warm to hot, not too hot to touch for a second |
If it does not work
LED dim
Check the resistor total and the supply voltage.
LM317 too hot
Lower the supply voltage or add a bigger heatsink.
No light
Check the LED polarity and the pin order.
Still stuck? Find the fault step by step with your multimeter →
Common questions
What parts do I need for the constant-current LED driver with LM317?
LM317 adjustable regulator, Wirewound resistor 1 Ω 10 W × 4, High-power LED 1 W white (star), Heatsink TO-220 and 12 V 2 A DC adapter. Wirewound resistor 1 Ω 10 W × 4: Four in series make 4 Ω, about 310 mA.
How long does the constant-current LED driver with LM317 take to build?
About 60 minutes for a beginner maker, in 7 steps.
How do I know the constant-current LED driver with LM317 works?
LED: Lights at steady brightness. Current: About 0.3 A on the meter. Change the supply from 9 to 12 V: Current stays the same.
LED dim: what should I check?
Check the resistor total and the supply voltage.
LM317 too hot: what should I check?
Lower the supply voltage or add a bigger heatsink.
No light: what should I check?
Check the LED polarity and the pin order.
