Arduino Meets Lego: The Ultimate DIY Robotics Project

Cyrus Tabrizi, 8/29/13
      As you might have guessed from the title or seen in the video, the project I've been hinting towards consists of two parts: a completely custom Arduino remote control, and a servo-powered RC Lego car!
      The Lego part of the RC vehicle is a medium-sized chassis built around a Lego drivetrain with four-wheel drive and four-wheel steering. The RC part is a set of four standard hobby servos powering the drivetrain; an Arduino, for controlling everything; and an XBEE radio, for communication with the remote control. There is also an onboard power supply (it’s an RC car! Of course it has one!).
      The second part of the project is the remote control. It’s about the size of a Gameboy Advance; has a 2.2” LCD color display; is built around an Arduino microcontroller; has a joystick, two potentiometers, and four buttons for input; and has the same type of XBEE radio module the RC vehicle does. All of this is housed in a custom enclosure made entirely from laser-cut acrylic. The remote control supports USB cable operation via the serial port on the Arduino, but it can also be operated off a 9V battery which can be mounted onboard, allowing the entire remote to be operated, well, remotely. Fun stuff.
      Now that you know what you’ll be making, we can start actually making it.
      Everything you'll need file-wise is available for download here (it's a zip folder).
Included in the zip file are the latest Inventor part files (.ipt's), the combined AutoCAD drawing (.dwg), and the latest Arduino code for the car and Handuino (.ino's) and I'll let you all know if I make updates or improvements to these!


IMG_4079 copy

Step 1: Designing the Remote Control..

      The first step to making a remote control of your own design is deciding what types of inputs and outputs/feedback you want your remote control to have. You should also consider what form factor you want your remote to have, because this may affect what types of inputs and outputs you can fit in it.. You could make it like the stand-up RC car controllers, with their steering knobs and triggers; you could make it larger and give it two joysticks and a couple of flip switches, like those RC plane remotes, or you could make it to your heart’s content and give it a built-in speaker for voice feedback and force-sensitive touch control (that's not a bad idea...)—the possibilities are only limited by your imagination... and the size of the battery you want to carry along with you (I'm not kidding).       For my remote, I eventually decided that I wanted something I could carry in the palms of my hands, like the Gameboy Advance I used to play with many years ago; something with a variety of input types, because I wanted to be able to use it for different applications; and something with immersive feedback capabilities so that I could know what was going on without the use of my computer.

IMG_4117 IMG_4116

      Considering all this, I decided to give it a 2.2” LCD TFT color display from Adafruit Industries, because it was well-documented, well-priced, and known for its Arduino compatibility (most of Adafruit’s selection is!); four push-buttons in typical game-controller configuration; two potentiometers with custom 3D-printed caps for precise, but comfortable rotary input; and an off-the-shelf joystick with analog horizontal and vertical output (it was also supposed to let you click the joystick and use it as a button, but that function never actually worked as advertised).
      After figuring out what I wanted, I did some conceptual sketches. This "design phase" is particularly important depending on how you plan to manufacture the actual enclosure (case, body etc.) of the remote. In my case, I planned to laser-cut the entire enclosure from transparent acrylic. This, however, is somewhat of a luxury if you're a student (like myself). Luckily, my school happens to have one that I can use (if I had one of my own I would be using it all the time), but don't worry if you don't have access to one, because not only are there other materials you can make your enclosures from, but there are other means of getting your parts laser-cut or 3D-printed for you! For example, Ponoko is one online service that can ship you your custom-made parts, but if that's too expensive or not your style, you should consider another building material, like Sugru, or consider cutting out your parts with an X-Acto knife. If you do use an X-Acto knife to cut out your parts, you probably won't be able to have them fit together without adhesives, but it still functions just as well (the design I laser-cut fits together without tape or adhesives).
      If you do have access to a laser-cutter or 3D-printer (or on online service that can provide you with those tools), you'll have to design those parts using computer-aided design (CAD) software (like Inventor). The benefit of this type of software is that, in addition to being able to make parts precisely and with all sorts of features, you can also make the parts in an assembly and see how they all come together (we'll go over this later). Before you can do this in a computer, though, you should plan it all out on paper.
      To plan your design out, you need to start by getting all the dimensions of the parts you want to use. Often this can be done by looking up the dimensions or original spec sheets for the parts online, but occasionally you may have to measure them yourself in the case that a specific dimension is not available or if you want to double or triple-check something. In the case that you do want or have to measure something yourself, I recommend the use of a caliper—they’re great for making precise measurements quickly and conveniently so, if you don’t have one, I highly recommend picking one up from your local hardware store or online.