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.
Firgelli produced a cable that allowed you to connect an modern PF to NXT directly, but it is also no longer in production.
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:
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.
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.
The next step is to cut the EV3/NXT cable and free the inner cables.
Then you twist the two resistors legs and solder them together.
Then you need to cut the pin 4 cable shorter.
Solder the resistors to the pin 4 cable.
You can then twist the pin 2 cable onto the resistors.
Next you solder the cable to the resistors.
Next you twist the pin 3 and 6 to the end of the resistors and solder them on.
Now you need to put the heat shrinking tubing over the pin 1 and 2 before soldering the pins to the PF cable.
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.
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.
To prevent the cables from being pulled out of the casing you need to attache cable ties to the two ends.
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”.