How to Create and Code Your Own REMOTE CONTROL Micro:Bot! (EHMS)

by zebke_99771674 in Circuits > Robots

443 Views, 4 Favorites, 0 Comments

How to Create and Code Your Own REMOTE CONTROL Micro:Bot! (EHMS)

micro-bot_Kit_Tutorial_update-13.jpg

Hello and welcome to my article! In this Instructable, I will show you how to create and code your very own Micro:Bot! You can also optionally add many things to this bot, such as trinkets, other external microprocessors (such as Arduino Unos), and even servomotors to create battlebots! However, in this article, I will only show you how to control the bot wirelessly and using radio.

Thanks to the EHMS Intro To Robotics class.

Supplies

images.jpeg

Here's a list of items you need to make this robot.

  1. 2 Micro:Bits (V2)
  2. Sparkfun Micro:Bot Kit https://learn.sparkfun.com/tutorials/microbot-kit-experiment-guide/all#introducing-the-microbot-kit
  3. 4.5 volt battery pack(s)
  4. A computer to upload and create the code
  5. MICROUSB wire

Constructing the Micro:bot

micro-bot_Kit_Tutorial_update-05-GIMPED.jpg
microBot-1_10.jpg

In order to build the robot itself, click the link https://learn.sparkfun.com/tutorials/microbot-kit-experiment-guide/all#assembling-your-robot and follow the steps listed on the website. This process takes a while and can get quite dirty for your hands as the items in the kit leave this black residue! Wash your hands afterwards.

However, if you want the steps right now, here is an extremely condensed version:

  1. Attach both motors to the mounts.
  2. Attach the motor assemblies to the body.
  3. Attach the wheels to said motors.
  4. Install the accelerometers.
  5. Install the nub caster and the struts. Attach the top body on.
  6. Attach the Moto:Bit board.
  7. Wire the board.
  8. Install the batteries and leave them on the undertray of the car.

If you want more intricate details, then just click on the link above the steps.

Coding Our Contraption

instructable images.PNG
instructable receiver.PNG

Now that you have finished constructing the robot, it's time to code! In order to code Micro:Bits, go to the MakeCode Micro:Bit website (https://makecode.microbit.org/#). For this wireless driving project, we need to create two Micro:Bit projects in the coding website. Copy the code in the images.

BEFOREHAND, MAKE SURE YOU INSTALL THE MOTO:BIT EXTENSION.

The first project will consist of the transmitter, which will send code to our other Micro:Bit whenever it's given an input. For this project, I used the buttons on the Micro:Bit itself, however you can also use physical interactions (such as tilt, etc). Whenever a button on the Micro:Bit is pressed, it will send a radio string, which will send instructions to our next Micro:Bit.

When linking these Micro:Bits together, make sure the radio set group code is the same number. For instance, these Micro:Bits use radio group 1.

The second project will consist of the receiver, which will receive the code from the previous Micro:Bit. When this Micro:Bit gets sent a code/input, it will call a function, and therefore cause the robot's motors to move.

After you are finished coding, upload these projects to two separate Micro:Bits using the MICROUSB. You can choose which Micro:Bit is the transmitter or the receiver.

Final Steps!

Now that you have finished coding, install the receiver Micro:Bit to the Moto:Bit board. Make sure that you install the correct Micro:Bit, or else it will not work. Connect the battery pack to the Moto:Bit board and turn on the motors. Make sure the other Micro:Bit (the transmitter) is also connected to power.

To drive forward, press the A and B buttons on the transmitter Micro:Bit at the same time. To turn left, press the A button on the transmitter Micro:Bit. To turn right, press the B button on the transmitter Micro:Bit. To turn stop the robot, flip the transmitter Micro:Bit upside down.

Congratulations! Your robot should be working!

If your robot is not working and you need troubleshooting, consider the following.

Troubleshooting (if Necessary)

Here are some reasons why your robot might not be working.

  • You didn't flip the "motors on" switch on the Moto:Bit board. Even though this seems like common sense, we all forget to do this sometimes.
  • Make sure the code is correct. It should look exactly like my code in the images (and maybe some modifications).
  • Make sure you didn't switch up the Micro:Bits. The receiver should be plugged into the Moto:Bit board on the robot and the transmitter should be plugged into your computer or an external power source.
  • If your robot is moving in reverse, try switching up the motor wires on the board.
  • Make sure that you plug in the battery pack to the Moto:Bit board.

Conclusion and Other Ideas

motobot-04.jpg

Now that your robot is driving wirelessly, you add/do/install so many things to your robot! Some ideas include:

  • 3D printing bumpers and install foam to make bumper cars!
  • Code and install a piezo and create your own horn for your robot!
  • Like the hit TV-show, you can make battlebots! Add some servomotors, needles, saws, or pretty much anything to destroy your opponent's robot.
  • Create your own mock race car! You can 3D print some cosmetic diffusers, rear and front wings, and even a roll cage if you want to! Now, you can drive around Monza Circuit in 1:46 (hopefully)!
  • Be lazy and 3D print some sort of container/box/dispenser. Now, instead of walking to get some snacks, you can drive your robot there for you!