Javascript Menu by

All it can eat LED

DC, AC, 5 Volts, 15 Volts, it does not matter anymore. This simple circuit turns any LED into a silicon omnivore. The circuit simplifies adding using LEDs for illuminating model houses, train cars, switch panels, etc. The LED will light up with a predefined brightness, regardless of the voltage being used.

This universal LED power supply can be used with AC and DC from about 4 Volts up to 36 Volts. Here is how it works... The B80 rectifier turns the input voltage into DC for the LM317 voltage regulator. The LM317 is wired as a constant current source. The resistor sets the desired output current. Change the resistor to create a higher or lower constant output current.

You can connect both a single LED or a series of LEDs to the output terminals. The value of the resistor does not change if you add multiple LEDs; the LEDs are connected as a series and the same current flows through all of them. The minimum voltage input will go up slightly with each LED you add to the chain.

The desired output current determines the value of the resistor. Most LEDs need a 30 mA current, but smaller SMD LEDs can take no more than 15 or 20 mA. When you order LEDs online the maximum current is often listed in the specifications. If you buy you hardware in a shop, ask what the maximum current is. The resistor can be calculated as follows:

R (in Ohm) = 1.25 / I (current through the LED in Amps).

Example: a standard 30 mA LED needs a resistor of 1.25/0.030=41.7 Ohm. Rounded up to the nearest standard value, you end up buying a 47 Ohm resistor.

Resistor value
LED current Resistor, rounded value
40 mA 33 Ohm
30 mA 47 Ohm
20 mA 68 Ohm
10 mA 120 Ohm

The circuit board is small, but still easy to assemble. The big soldering pads on the bottom (in the photo next to the ’s’ of ‘soldering side’) can be used to add a capacitor, i.e. to keep the LED from flickering when you use it to illuminate a train car. The value of the capacitor will depend on the available space and might require a bit of experimenting.

When assembling the board, please note the correct placement of the rectifier and the LM317. The parts can be ordered from Conrad or Reichelt. Or you can buy them from a shop near you. The components should not cost you more than €0.60.

Amount Description
1 B80D rectifier (DIL)
1 LM317 (LZ) voltage regulator
1 resistor 1/4 Watt (see text)

Adjustable version

There is a slighly larger version of the board with space for an adjustable resistor (size PT10, flat). The adjustable resistor is connected in series with the normal resistor. By tweaking the resistor you can adjust the brightness of the LED within limits. Choose the value of the normal resistor to match the maximum current through the LED (as outlined above). The adjustable resistor shoudl be 200 Ohms or more, depending on how much you want to dim the LED.


The board in use: it powers a chain of two LEDs to illuminate the workshop at Buitenlust.

Boards are available in the shop →

2012, 2014



All it can eat LED

Adjustable LED power supply

4 to 36 Volts, AC or DC

1 LED or several LEDS in series

Regular and SMD LEDs

Board size 35 x 10 mm


For use in a.o.:

Illumination of model houses

Switching panels

Locomotives and train cars

© Huib Maaskant - Alle rechten voorbehouden -