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

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

 

19 thoughts on “Building Instructions for a cable that connects LEGO Power Functions (PF) with Mindstorms NXT/EV3”

  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. 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?

  5. Thank you for this explanation which is very clear regarding how to make the cable. However, it doesn’t really explains how it works :
    – how does the EV3 brick detects and identifies the presence of the new device ?
    – how does the EV3 brick controls the motor (e.g. DC voltage ?)

    For me, I think that it would be clearer if the wiring diagram would reuse the naming convention of the book “Hacking your Lego Mindstorm EV3 Kit”
    – Tacho 0 and 1 correspond to Clock and Data signals of the I2C bus
    – M1 and M2 correspond to Analog and Ground

    A possible explanation of the functioning (tbc) is then that :
    – Clock and Data signal on the I2C bus are pulled to high level
    (http://www.ev3dev.org/docs/sensors/i2c-sensor-addressing/) so that the EV3 believes there is a device at address 7F
    – Analog output is used to control the voltage transmitted to the device

  6. I want to build a baja truck and was wondering if one cable could power 2 xl motors, I want to use 4 in total to drive the wheels, but I don’t want to buy a multiplexer because it costs $50 and it needs an external power supply

  7. Is the step “You can then twist the pin 2 cable onto the resistors.” wrong? Shouldn’t it be pin 5 instead pin? Also can you be more specific on the PF cable side of it?

    First, using the PF extension cable has two different ends, which one do I use?

    Second, can you draw out from left to right or top to bottom which side is power on the PF cable so I have a reference point?

    Third, Do I connect power from PF cable to the pin 3-4-6 junction? If so where do i connect the ground from the PF cable?

    I look forward to your response. Thank you.

  8. Can you use this cable to run an EV3 motor through the power functions infrared sensor?

  9. Great work :)

    Do you know if the PF motor can than be controlled the same way as EV3 motor? i mean for degree of rotation, speed etc when it is connected using this newly made cable to EV3 ? Thanks for replying

  10. If I put the PF end onto a PF receiver and then connect the NXT motor to it’s cable end, will the motor react to the receivers’ input?

Leave a Reply

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