Building Instructions for a cable that connects LEGO Power Functions (PF) with Mindstorms NXT/EV3

Posted by on Jun 1, 2015 in Documentation, LEGO, Project | 5 comments

Harry Davis and me built a cable to connect a LEGO Power Functions (PF) motor to a Mindstorms EV3. The goal is to enable the EV3 to control PF motors. In particular I wanted to control a RC train motor through an EV3.

LEGO produced a cable (8528) to connect old motors (RCX) to the NXT, but it is no longer in production. You can still get them through Bricklink, but it will cost you dearly. You still need a PF extension cable to convert the old motor plug (RCX) to the current PF plug.

convert cable

Firgelli produced a cable that allowed you to connect an modern PF to NXT directly, but it is also no longer in production.

firgelli nxt pf cable

There are two more solutions but both are more complex and costly. First, you can use the PF Mate from Mindsensors (currenlty $35). It sends IR signals to the IR PF receiver and thereby allows you to control motors even at a distance. The second option is the GlideWheel PF (currently $38) that directly connects a PF motor to the EV3. It also features a rotation sensor so that you can control the PF just like you would control a Mindstorms encoded motor. Both of these solutions offer a great functionality but they are also expensive, in particular since the components necessary for a custom made cable only costs a few cents.

At Amazon you can get a book Make: Lego and Arduino Projects: Projects for extending MINDSTORMS NXT with open-source electronics that will show you how to do such projects, but for now it is time to pull up our sleeves and do it ourselves. TechnicRobot already showed that it can be done but detailed instructions were not yet available. We also built a casing for our cable so that it can be easily integrated into your model. Here is the final result:

EV3 PF Cable - 17

And here is a video that shows our solution at work:

First, you need to have a look at the wiring diagram. You will need one 1k Ohm resistor and one 10k Ohm resistor. These will only cost a few cents in your local electronics store.

connection diagram

Next, you need to have PF cable and an EV3/NXT cable. As for latter, you need to pay extra attention to the sequence of colors on the cables. They differ across brands. On the left you see an original LEGO cable with the sequence blue, yellow, green, red, black and white. The cable on the right has the opposite order. The wiring diagram above uses the original LEGO coloring. In this tutorial I will use a third party cable and the coloring is reversed. I will therefore refer to the pin number and not the color in the following steps.

EV3 PF Cable - 19

The next step is to cut the EV3/NXT cable and free the inner cables.

EV3 PF Cable - 02

Then you twist the two resistors legs and solder them together.

EV3 PF Cable - 03

Then you need to cut the pin 4 cable shorter.

EV3 PF Cable - 05

Solder the resistors to the pin 4 cable.

EV3 PF Cable - 07

You can then twist the pin 2 cable onto the resistors.

EV3 PF Cable - 10

Next you solder the cable to the resistors.

EV3 PF Cable - 09

Next you twist the pin 3 and 6 to the end of the resistors and solder them on.

EV3 PF Cable - 11

Now you need to put the heat shrinking tubing over the pin 1 and 2 before soldering the pins to the PF cable.

EV3 PF Cable - 13

Use a hot air gun or a similar device to shrink the tubes. You can also use the tubes to insulate the ends of the two not used PF cables.

EV3 PF Cable - 14

Now it is time to build the casing. We used a very old 2×4 brick since it did not have any inner pins. I cut out two openings on the sides for the cables.

EV3 PF Cable - 12

To prevent the cables from being pulled out of the casing you need to attache cable ties to the two ends.

EV3 PF Cable - 16

Now you are ready to test the cable. Connect it to an EV3 and use the Port View to check if the motor is detected correctly. If you made a mistake in the wiring it will show “Port Error”.

EV3 PF Cable - 18



  1. Could you tell me if it is possible to run 2 motors XL on the same port. The power there will not be too high for the port ?

  2. It depends on the load. If the two XL motors run without any resistance then this will work.

  3. hi, can i know why must connect the resistors? if didn’t connect the resistors, will it cos any problem to the EV3 or the motor ? tq.

  4. My understanding is that the resistors help the EV3 to identify the motor.

  5. Hi, thanks for sharing how to build the ev3-pf cable. May be the step “You can then twist the pin 2 cable onto the resistors.” might be wrong. Shouldn’t it be pin 5 instead pin?

Leave a Reply

Your email address will not be published. Required fields are marked *