Disclaimer and Social

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

Showing posts with label driver. Show all posts
Showing posts with label driver. Show all posts

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:

Friday, April 13, 2018

Mythical Vibrator Found?

I might have found one of the legendary LRA vibration motors. I can't be sure yet, but all the signs are there. It looks like a standard ERM, but it acts more like a piezo and its magnet is incredibly powerful. (Check out the update - it is and it kind of works)


Is this an LRA linear resonant actuator virator motor in an old cell phone.
So is this an LRA vibration motor? It looks like a standard ERM pancake motor. But it's got a really strong magnet and operates like a piezo. I'm going to hook it up to my haptic driver controller and test it out.


What's the big deal? Well the LRA (Linear Resonant Actuator) is rumored to have a better feel for haptic feedback devices. When your phone vibrates, or the screen clicks or taps or buzzes when you touch it - that's an LRA.

An LRA acts like a speaker. When current is applied, a weight moves back and forth in a linear motion. Like a speaker, this allows you to create complex waveforms that can be felt kind of like you hear waveforms in music.

Compared to a regular ERM (Eccentric Rotating Mass) vibrator, LRAs provide a wider range of sensations. That's why they're used for tactile feedback in all your phones.





You can find standard  ERMs everywhere, from the tiny disk shaped motors in a bristlebot, to the huge versions in your back massager. They are cheap, readily available and easy to work with. But they have a very limited vocabulary. All you can really do is adjust the speed and duration. Even with modern controllers, you can't use ERMs for sophisticated feedback tasks.

By contrast, LRAs are difficult to source and many use connector sizes I'm not comfortable working with. You also need to be either a serious programmer or buy a specialty controller board to use them. I do own one of those controller boards, a haptic feedback driver, so I can test my newly found vibe as soon as I figure out how to tweak the registers. Luckily, this motor is also large enough and uses connectors that I can see without a magnifying glass.

If I get it working without blowing anything up, I will certainly post my experiences here.


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

Also find me on: