Introduction: LEGO & Micro:bit RC Tank

About: I used to teach middle school science, but now I run my own online educational science website. I spend my days designing new projects for students and Makers to put together.

Here's a fun LEGO project that uses our Bit Board and micro:bit to power an RC tank, and another Bit Board and micro:bit to work as a remote control. We've listed all the LEGO parts we used, and also provided the needed code for the remote control transmitter and receiver.

If you like our projects and want to see more of what we get up to each week please follow us on Instagram, Twitter, Facebook, and YouTube.

Supplies

Step 1: How Does a Tank Work?

  • Tank Steering works differently than steering for a car. Most cars have rear wheels that are fixed and cannot turn/pivot left or right, and front wheels that can turn/pivot left or right. The turning/pivoting of the front wheels allows the car to make left and right turns (while moving) in addition to just going forward and backward.
  • For a tank the wheels do not turn/pivot left or right, but by spinning the "wheels" (which typically have a set of tracks attached to them) a tank can drive left or right, or even spin around clockwise or anticlockwise depending on if the wheels on opposite sides of the vehicle are turning the same direction or opposite directions.
  • Tank steering is similar to how a wheelchair works. If both wheels spin the same direction one of them rotating faster will allow for turning of the vehicle. If they are spinning opposite directions the vehicle will spin around.
  • Our Obstacle Avoiding Robot and WALL-E projects both use a form of tank steering.

Step 2: Gather Electronic Parts

  • We're going to use a Crazy Circuits Bit Board along with a micro:bit and two LEGO Compatible 360 Degree Servos. (We'll power it all with a 2 AAA Battery Pack.)
  • The electronics portion of this project will be very easy since we just need to plug the two servos into the Bit Board and then plug the battery pack into the Bit Board.

Step 3: Gather LEGO Parts

  • Gather all of the LEGO parts needed to build the tank chassis.
  • If you don't have these exact parts you can often make substitutions. For instance, if you have longer axles they can still work, or if you have half bushings instead of regular bushings they should work fine.
  • LEGO is about building what you want to build! Consider our guide a suggestion for your own build which should be based on the parts you have available.

Step 4: Build the Frame

  • The frame will be built using 6 LEGO Beam Frame 5 x 7 parts.
  • Connect them as shown using 10 LEGO Technic Pin with Friction Ridges and Slots.

Step 5: Reinforce the Frame

  • Once your frame is complete you'll want to reinforce it using 4 LEGO Beam 15 parts.
  • On the top we placed them centered between the front and rear of the vehicle.
  • On the bottom we offset the beams by one hole on the LEGO frame, putting them closer to the rear of the vehicle.
  • You'll need to make sure you leave the center hole on the side of each frame piece open for the axles to go through,

Step 6: Add Four of the Axles

  • Next we'll add 4 of the LEGO Axle 8 pieces.
  • Use 12 LEGO Bushing to hold the axles in place.
  • Each axle gets three bushings. Two on the outside, and one on the inside.
  • We need to use two separate axles for each "pair" of wheels because they need to spin independently of each other. One long axle won't work.

Step 7: Add the Axles With Gears

  • The last two axles will be used to drive the vehicle, so we need to add a LEGO Gear with 16 Teeth Unreinforced along with a LEGO Half Bushing.
  • Like the first four axles, there are two bushings on the outside, and then the gear and the half bushing go on the inside of the frame.

Step 8: Add the Sprockets

  • Slide the 6 LEGO Technic Sprocket Wheel 40.4 parts onto the axles.
  • At this point your vehicle could probably roll around!
  • In the next step we'll add the treads so the drive sprockets can transmit motion to the other sprockets.

Step 9: Build the Treads

  • You'll need 58 LEGO Large Tread Link to build your treads as each side uses 29 treads.
  • Connect the treads together to form two sets of treads, but don't connect them into a loop yet!

Step 10: Add the Treads

  • Wrap the treads around the sprockets and attach into a loop by clicking the two end treads together on each set of treads.
  • You should now have a full set of treads on each side of your tank!

Step 11: Add the Servo Beams

  • We'll use the 4 LEGO Beam 7 parts to raise and mount the servos to the proper position.
  • Use 2 LEGO Technic Pin with Friction Ridges and Slots for each beam and connect them to the frames as shown.

Step 12: Add the Servos

  • For each servo press a LEGO Gear with 24 Teeth into place on the servo shaft.
  • For each servo use 2 LEGO Long Pin with Friction parts to attach the servo as shown,
  • Make sure the servo wires are facing upward.
  • Make sure the gears line up when putting the servos in place.

Step 13: Tank Chassis Complete!

  • You should now have a complete tank chassis!
  • Fun fact: In vehicle building this is what would be referred to as a rolling chassis.
  • We still need to add power & control. Also known as batteries and a micro:bit

Step 14: Gather More LEGO Parts

  • Gather the LEGO parts shown so we can attach our Bit Board to the tank chassis.
  • We're basically making 4 "legs" for the Bit Board so it can be fit into the frame pieces of the chassis.
  • As always, if you don't have these specific parts, others can work. Longer axles? No problem! Less bushings? You can probably still make it work.

Step 15: Build the Bit Board Legs

  • Slide 3 of the LEGO Bushing parts onto a LEGO Axle 8.
  • Repeat using a second LEGO Axle 8 and 3 more LEGO Bushing parts.
  • Do the same with the two LEGO Axle 5.
  • Place the Bit Board onto the "legs" and add 4 LEGO Bushing pieces to the top.
  • You should have a Bit Board with 4 adjustable legs ready to mount to the tank chassis.

Step 16: Mount the Bit Board and Battery Pack

  • We chose a very simple method of adding the 2 AAA Battery Pack. We just taped it to the bottom of the Bit Board!
  • Alternately, you can find a way to mount it to the tank chassis beneath the Bit Board, but we though this method was easy and allowed it to work as one single unit.
  • Once you've got the assembly ready you can slide it into the holes of the frame.
  • You can add 2 LEGO Half Bushing to the bottom to hold the Bit Board in place if you want. (Totally optional!)

Step 17: Connect the Servos

  • With the Bit Board mounted onto the tank chassis we can now plug in the servos.
  • Plug in the servo connectors with the orange wires next to the numbered pins. The red wire will then be in the + (positive) column and the brown wire will be in the - (negative) column.
  • One servo should be plugged into Pin 13 and the other servo should be plugged into Pin 14.
  • With the servos connected we're ready to load the code onto the micro:bit, so let's keep going!

Step 18: Load the Code

  • Connect a USB cable to the micro:bit and then plug it into your computer.
  • We'll be using makecode.microbit.org to program our board. It uses a simple drag and drop block interface.
  • We're going to load the following code for our Tank Motion program: https://makecode.microbit.org/_iwd5Vt2kK54U
  • Load the code, but don't press the button yet! We're not quite ready...

Step 19: Prepare for Testing

  • Okay, you've got your tank assembled and the code is loaded. We're almost ready to test.
  • If you've still got the USB cable connected you can remove it now.
  • If the tank is on a table you might want to put it on the floor.
  • You'll need to connect the battery pack to the Bit Board for power.
  • One more thing! Make sure the wires running from the servos and the battery pack are not in danger of getting hit by the treads! Secure them away from the treads using LEGO, tape, or rubber bands.

  • Okay, we're ready for testing!

Step 20: Test It Out!

  • The code won't do anything when you first load it onto your micro:bit as it's waiting for you to press a button.
  • So as long as you've disconnected the USB cable, plugged in the battery pack, and placed the tank on the floor...
  • You can press Button A on the micro:bit!
  • Your tank should go through a series of movements. It should go straight, turn left, go backwards, turn right, and then stop.
  • Remember that in the code we set our speed to 30 which is slow, but good for testing. Later we'll change it to 100 for maximum speed!
  • Did it work? If not, re-check all the previous steps. If everything did work properly, we can keep going!

Step 21: Take It Further

  • There's no doubt our LEGO Tank is totally awesome... but what would make it more awesome?
  • How about a Remote Control for our Tank? Let's keep going and make our tank and RC tank.

Step 22: What Is Remote Control?

  • You're probably familiar with remote controls. Usually you press a button and something happens!
  • You may have used a remote control to open a garage door or to change the channel on a TV.
  • Some remote controls use infrared light (like the TV remote) and some use radio signals (like the garage door remote).
  • Our Remote Control system will use the Bluetooth radios built into the micro:bit so one micro:bit can send signals to another micro:bit
  • Our first micro:bit will be a transmitter (which sends signals) and our second micro:bit will be a receiver (which receives the signals).
  • Since our LEGO Tank already has a micro:bit to make it move we just need to build a transmitter and then update the code to make it work.

Step 23: Build the Transmitter

  • We'll need to connect two thumbsticks using F/F Jumper Wires. You'll need just three wires per thumbstick.
  • Plug the Left Thumbstick VRX into Pin 1, +5V into the + (positive) column, and GND into the - (negative) column.
  • Plug the Right Thumbstick VRX into Pin 0, +5V into the + (positive) column, and GND into the - (negative) column.
  • Make note of the orientation of the thumbsticks! The connection pins are on top. If you rotate the thumbstick 90 or 180 degrees the direction you move the stick won't match the direction the tank moves.
  • We used our 3D Printed Thumbstick Holder and 3D Printed Battery Holder but you can always get creative with LEGO, tape, and rubber bands.

Step 24: Load the Transmitter Code

Connect a USB cable to the micro:bit and then plug it into your computer.

We'll be using makecode.microbit.org to program our board. It uses a simple drag and drop block interface.

We're going to load the following code for our Tank RC Transmitter program: https://makecode.microbit.org/_U2xVirfvU1uR

Step 25: How the Transmitter Works

  • Each thumbstick will control a set of tracks. One for the left tracks, and one for the right tracks.
  • There are three positions; forward, reverse, and stop. Using combinations of those with the two sets of tracks will allow our tank to go forward, backward, turn left, turn right, and stop.
  • Since our thumbsticks are analog sensors we are just checking for a specific value to be higher or lower than the input.
  • There is no speed control with this method, but it is a feature that could be added with new code.

Step 26: Load the Receiver Code

Step 27: Test It Out!

  • You're ready to test out your remote controlled tank!
  • We placed our tank top of some LEGO bricks for the test, just so we could more easily observe it. (And so it wouldn't roll away!)
  • Does the motion of the treads match the movement of the thumbsticks? If not, step through the guide again to make sure you've got it all right.
  • If everything is working as it should, enjoy your new Remote Control LEGO Tank!

Step 28: Take It Even Further!

  • How can we make our RC LEGO Tank even more awesome? How about adding a LEGO Gripper to grab things!?
  • We're working on it, and we'll have another guide done soon showing you how to add this to your tank.
Make it Move Challenge

Runner Up in the
Make it Move Challenge