Introduction: Arduino-izing Lego Technic Go Kart
This project started out as a quest to find a way to combine ease of Lego Technic chassis building with cheap commodity electronics to motorize and remote control it. I teach robotics workshop and I needed a Lego-based platform for younger kids who grew up with Lego but cannot afford to spend hundreds of dollars to buy power functions, Lego motors, IR remote, and EV3. Thanks to numerous Instructables and Youtube tutorials on integrating Arduino with Lego, I was able to complete this project with a small budget and I hope to incorporate this into my robotics workshop in the future.
The rear axle is attached to a single N20 motor to move the kart forward and reverse via a TB6612FNG motor driver. Front steering is controlled by an SG90 servo motor. Remote control is accomplished by a cheap IR remote/receiver combo. I understand that IR remote is not the best way to control a car but it is the least expensive method to implement and learn about a remote control system so it was a perfect option for this car.
All the Lego pieces are from Lego Technic Go Kart (8256). Since this model is no longer in production, you may have to find a substitute or build a similar chassis out of pieces you already have at your home.
Since this was just a proof-of-concept project and the design changed every minute, I didn’t take detailed step-by-step photos so it may be missing some details. If you have any questions, just post them in the comments section and I'll try to answer them as best as I can.
Step 1: Parts and Tools
- A bunch of Lego Technic bricks (Lego 8256 or similar)
- Arduino Nano or compatible
- N20 gear motor (6V@200RPM)
- 3mm to 5mm Coupler
- SG90 Micro Servo
- IR Remote & Receiver combo
- TB6612FNG Motor Driver
- Mini Breadboard
- 9V conversion booster
- 4 x AA battery holder
- Mini power switch
- Various Dupont cables
- Wire tie
Tools used: screw driver, wire cutter, glue gun, utility knife, etc.
Step 2: Make Custom Motor Mounts
The hard part in this project was to somehow integrate commodity motors into Lego Technic. After several trials and errors, I was able to attach Lego pieces to motors so that they could be integrated into the rest of the Lego chassis.
For the rear motor assembly, I used an N20 motor connected to a Lego axle using 3mm to 5mm coupler as shown in the photo. Lego pins were glued to the sides of the motor.
For the front steering assembly, I used an SG90 servo attached to 3-hole Lego pieces by glue. To meet the width requirement, I had to cut about 2mm from the width of the 3-hole Lego pieces using a utility knife. (CAUTION: A utility knife blade is very sharp and can cause serious lacerations.)
A single-side horn is narrowed slightly so that it fits inside a Lego axle coupler. Glue them together and attached it to the servo motor.
Step 3: Chassis and Body
This step is where your imagination and Lego building skill come into play. The photos show my design but you can come up with your own design as long as the front-steering and rear-drive work.
Step 4: Electronics
Wire all the components according to the diagram. You’ll notice that I use 9v step-up boost converter to power Nano through Vin pin. This eliminates having another 9V battery for the logic. Motors are still powered by 6V. (If you want the car to go little faster, you may connect the Vcc for motor driver to 9V terminal.)
Step 5: Code
First, you have to remove the built-in IR remote from Arduino IDE and install a new IR remote library. Read this Instructables on how-tos (step 3 for removal and step 5 for install).
Then, download the attached Arduino IDE code. Comments in the code should explain what’s going on in the code. It was written for Nano but it should work on other Arduino boards with little or no modifications. If you are using a different IR remote, you may have to change the code to reflect the different encoding for up, down, left, right, and ok(stop) buttons.
IR remote button assignment:
- up: forward
- down: reverse
- left: left
- right: right
- ok - stop
Step 6: Testing
Here is a video. Cheers!