Custom LEGO Power Functions 9V Power Supply

In all the GBC videos I saw, there was an endless line of the classic train controllers, used for powering the motors from a wall supply instead of a battery pack. And it makes perfect sense, except it's missing a feature that is essential for using a servo motor or IR receiver: the fixed 9V and ground lines that the Power Functions cables has.

Classic LEGO train controller

The Power Functions Standard

In the old days, motor cables had two wires. It could be attached to a train controller or a battery pack, and it could power the motors with up to 9 Volts, with switchable polarity to change the direction. The Power Functions cable on the other hand has 4 wires (see picture below). The middle two are the same control lines as with the old ones, but the outer two are a fixed 9 Volts and a ground line. The point is, that these two never change polarity or voltage level, and they are used exclusively for the servo motor and the IR receiver.

Power Functions connector pins

Power Functions connector pins and cable. C1 and C2 are the classic control lines, with adjustable voltage and polarity.

Power Functions from a Wall Supply

One solution would be to buy a Power Functions Rechargeable Battery Box [1] and keep it plugged in, although I don't have one so I cannot confirm if it works.

I went with a different approach. I had built my own Power Functions 9V power supply, which can use the old train controller's 10V AC wall adapter, or any 12V DC adapter that you can buy for cheap.

First, I took a look at what the train controller had, and I was suprised to see how simple the whole thing is. Basically there's a very sturdy little voltage regulator, which can be manually set to a specific voltage level using a set of voltage divider resistors, depending where the big rotary wheel stands. This regulator is the KA317 [2]. It features:

  • Output current in excess of 1.5A
  • Output adjustable between 1.2V and 37V (used between 0V and 9V)
  • Internal thermal overload protection
  • Internal short circuit current limiting

I had the luck of testing out that short circuit protection once, and it works, and so does my train controller, luckily. That 1.5 Amps of maximum load though... keep in mind, that most motors consume around 0.3A to 0.5A under normal load, and up to 3 times as much when stalled [4].

Train controller inside

Inside view of the train controller. The rings on the right are for the rotary wheel. The outer ring is for setting the voltage level, while the inners are for switching the polarity.

Train controller panel

Same circuit board from the component side, featuring the voltage regulator at the bottom.

Knowing the specs, I did a search for a similar voltage regulator but with a fixed 9V output, and found the L78S09CV [3], which can even do an additional half Amp, up to a total of 2.

The Schematics

The circuit is very simple. For the input I'm using two different DC connectors in parallel. One is a size 5.5 / 2.1 mm, which is compatible with the LEGO wall supply, the other one is a 5.5 / 2.5 mm, which is a common size for universal power supplies you can buy. The diode bridge [5] turns the input alternating current (AC) into a direct current (DC). It also works with direct current as an input; it either does nothing, or corrects the polarity, so the input can really be anything as long as it's below the maximum input voltage the voltage regulator can take (18V in this case).

Input and diode bridge

The two input connectors are parallel, so either one can be used, but only one at a time. The power switch has to break both lines, since either can be the power line. And lastly, the diode bridge makes sure the output is a direct current.

Power regulator and feedback LED

Left fig.: A very big capacitor is necessary to smooth out the voltage level, in case it comes from an alternating current. The smaller ones are for noise protection.
Right fig.: This is the "power on" LED, placed after the voltage regulator.

The Final Assembly

The circuitry

The voltage regulator got a heat sink, just like in the train controller. It's made out of aluminium, so it won't corrode like iron, plus it's much easier to work with. Having it is important because it will become hot, even when the load is below maximum.

The box

The box follows a left handed principle: power comes in left and goes out right, so the box is supposedly placed on the left side to whatever it is powering. With that, the switch is supposed to be pressed with the left index finger, while the box is held down with the rest.

The connectors on the back

The connectors on the back. A size 3.5 / 1.3 mm DC connector is used for the output (left), while the 5.5 / 2.5 mm and 5.5 / 2.1 mm ones are used for the input (right).

The cable

And of course the output cable with the Power Functions connector. I bought an official Power Functions extension wire and cut it in half. Then used the half with the legacy connector (the light gray one) and soldered a size 3.5 / 1.3 mm DC connector to the cut end. The control lines are connected randomly, so their polarity is always fixed.


  1. LEGO Power Functions Rechargeable Battery Box
  2. KA317, 3-Terminal Positive Adjustable Regulator - alldatasheet.com
  3. L78S09CV, 2A Positive Voltage Regulator - alldatasheet.com
  4. LEGO® 9V Technic Motors compared characteristics
  5. Diode bridge - Wikipedia