Disclaimer and Social

This page may contain affiliate links. As an Amazon Associate I earn from qualifying purchases.

Tuesday, September 18, 2018

LEGO Mindstorms Motors with Arduino

Found a bunch of my old LEGO Mindstorms robotics stuff and realized that I could still use all the old motors and most of the sensors. The old versions of the motors (RCX 1 & 2) are just 9v DC motors so I can easily control them with an Arduino.

These old motors are super sturdy, reasonably powerful and the gearing makes them great for any hobby level robotics project. And of course, they fit into the entire LEGO ecosystem so they are easy to prototype with.

LEGO Mindstorms RCX motors can be used with an Arduino with Adafruit motor shield
Just a few leftover LEGO Mindstorms Technic motors. And I've got lots more Mindstorms and Technic parts, plus quite a few Bionicle sets. 

I stopped using the RCXs when the software and drivers stopped working on modern systems. I thought about buying the NXT or EV3 versions, but by that time I was already into Arduino or Raspberry Pi and couldn't justify buying another brain and motor/sensor package.

So the motors and other items languished in storage for years. But I wanted to find one of my robot chassis (still assembled after all these years) to use with some beginning roboticists. I was going to 3d print some adaptors for the cheap DC motors. But when I saw the old motors I realized I could just cut the LEGO connector wires and plug them directly into a motor driver.

Normally, I would just upgrade to newer equipment, but I have a dozen of these motors and several robot chassis and mechanical contraptions that are already designed ( and more importantly, already assembled) to work with this style of motor. Since the motors are designed to run on 9v (I remember running them at up to 12v without damage) so I knew they would work well with several of the Arduino motor drivers I already have. I decided to put these handy little motors back to work.

I chose to use Adafruit's Motor Shield. It can handle 9-12v easily and has handy screw terminals for attaching wires. And the well-written library makes it easy for new roboteers to program their creations. It gives you four DC motor outputs (or two stepper motors) as well as two servo ports. And it leaves the analog and digital inputs to use with sensors.



Put the shield on top of a UNO and they are about the same size as the old RCX, so they fit perfectly onto the existing robot chassis. Or use one of the new M4 powered UNO compatibles and have enough power and speed to run a full color touch screen display, Bluetooth, GPS and a 10 DOF sensor board. You could even get one of the smaller boards like a Feather or Teensy.

Compare LEGO Mindstorms RCX brick with the size of an Arduino and Motor Shield combo
The Arduino and Motor Shield are slightly smaller than the original RCX brick, so they can be substituted into any design that uses the old RCXs. And the motor shield gives you an extra motor port and the option to run the motors at higher voltages for that extra boot of power.

Hooking up the motors is simple. Just use one of the Mindstorms motor cable and cut the wire that runs between the two LEGO connectors. You will get two cables, one end with a LEFO connector and one with just wire. Strip a small amount of insulation off the wire. Attach the connector to the motor, then screw down the wires into any of the four ports on the motor shield. Use the LEGO motors like any other DC motor.

Just snip the wire between the connector blocks and attach them to the screw-terminals of the motor shield.

You could get fancy and tin the wire with solder, crimp a pin to the wire, or splice it into a breadboard style wire.

Now build a robot and code the Arduino using the library for the motor shield.

LEGO Mindstorms RCX motors running on an Arduino with Adafruit motor shield
You can run the old LEGO Mindstorms RCX motors using an Arduino and Adafruit's Motor Shield kit. The motors are simple 9v DC motors that are geared to be powerful and sturdy. Plus they fit into the LEGO and Technic universe, so you can build almost anything you can imagine.
For information about connecting to later LEGO Mindstorms kits check out:


As an Amazon Associate I earn from qualifying purchases.
Shop through our Amazon links to help support this site.

Also find me on:

1 comment:

  1. Thanks for your article. I will play with my son’s toy that he left in our garage for over 15 years.
    Good to know someone having same hobby - passionate techno software & hardware people

    ReplyDelete