Arduino Meets Lego: The Ultimate DIY Robotics Project

Cyrus Tabrizi, 8/29/13
IMG_4122
Step 8: The Lego RC Car

      If you didn’t find anything else in this Instructable fun, this part’s for you. Think back to your childhood. Bring back all those hours you spent lost in colorful modular bricks. Or think all the way back to this morning when you skipped breakfast to play with your Legos…I’m not the only one...right?
IMG_4101
      The bulk of the RC Car is Lego. That means that you can basically build anything you want and, by the end of this, you’ll be able to send that monstrosity into the kitchen to wreak havoc from a remote location. My focus, for now, at least, will be on what I built: an all-wheel drive (with differentials), all-wheel steering, servo-powered Lego car. It is built from an assortment of Lego Technic pieces that I’ve collected over the years from sets and online stores (I highly recommend Bricklink for fulfilling all your Lego needs). The good thing is, though, that most of the parts are the more common ones, and the ones that aren’t so common are relatively new, so you can find them easily online (or use that ingenuity to work out an alternative contraption!).

IMG_3652 IMG_4115

      It begins with each axle. The front and rear axles are identical and each operate separately from each other. While an arrangement could be made that would cut servo-usage in half by connecting both axles and syncing them together manually (i.e. running axles along the length of the vehicle to connect the steering and drive together), I thought that keeping them separate was just too clean of a solution. Each axle, then, has its own steering rack and differential—a differential is what allows the car to travel so smoothly. Essentially, it eliminates the problems caused when a vehicle is driving through a turn. When it does, the wheels on the outside of the turn will travel over a greater distance (and, thus, will turn more) than the wheels on the inside of the turn. If the two wheels were connected directly, either the axle would break or one of the wheels would start slipping. A differential allows rotational motion to be transferred to both of the wheels, while not dictating whether the split is even or not. It is driven by a bevel gear mounted perpendicularly to it. Universal joints run the rotational motion the differential provides through the steering joints and through to the wheels. The steering rack that turns the wheels back and forth is driven by a bevel gear and a geartrain—this geartrain makes sure that the limited rotation of the controlling servo motor is enough to turn the steering rack through its full range of motion.

IMG_3580
      All and all, the axle is rather standard function-wise, but the hardest part was fitting those functions into a small, but sturdy frame that was compatible with Servo motors. There are actually two parts to this: the first part is getting the output shaft of the servo to attach to a Lego axle; and the second part is getting the servo casing to fit nicely in a Lego housing.

IMG_3018 IMG_3019

      The former I did with the use of the Servo attachments (normally included with the servo) and few Lego pieces—it’s just a matter using the right Servo attachment and of aligning the Lego wheel to the attachment well. If it’s not aligned properly, it will cause the axle to shift around when rotated, which is bad.
      Getting the Servo to fit snugly into a Lego frame took a while to figure, but it is possible without the addition of tape or non-Lego objects.
      Once the Servos are connected, you can build the rest of the chassis around them with no limitation on size or shape. Just consider where you will want to mount the electronics and batteries, and whether or not there is enough clearance on the sides for the wheels to turn without hitting the chassis.