How to do it yourself: Microbit Junkbot

What is a Junkbot?
For this project, it is a moving ‘bot’ made from waste materials, combined with an electric motor and a programmable device (in this case a Micro:Bit) to control (or try) it. An example is shown below. More details on junkbots can be found at

Stage 1 - The start of a Junkbot
This stage is relatively simple. Tape some pens or straws to a drinks can.

Stage 2 - Physical arrangement of Microbit and motor control board

The control part is this via a Micro:bit ( Kitronik produce a motor driver board, and provide quite a bit of support for it, for the Micro:Bit (the latest version of the board can be found at ). A 6v battery pack is connected (see on the left of the image) and wires going to a motor are attached to the first block on the front left (marked as motor A).

The overall arrangement is show below, including a broken propellor as an unbalanced load to make the motor vibrate - the propellor was to hand but if you can secure something a clothes peg this could be used.

Stage 3 - Built Junkbot
Now we just need to put them together by taping (or fixing somehow) the motor to the junkbot built in stage 1. A further possibility is to attach the Micro:Bit, motor driver board and battery pack to the junkbots; but this adds weight.

Stage 4 Code
 Using Micropython via the online editor to program the board and therefore the junkbot. 
An example piece of code is shown below:

from microbit import *

def startIt():

def leftTurn(duration):
def stopIt():

while True:
   if button_a.is_pressed():
   if button_b.is_pressed():

Unplug the Micro:bit from the motor driver board and download the code to the microbit. Unplug the download cable and plug the Micro:Bit back into the motorboard, with the battery pack attached there is enough power for the Micro:Bit and the motor - don't plug in any other power including the programming cable when it is in the motor driver board.

Stage 5 In action

Suggested Resource List
  • Small Electric Motor
  • Kitronik Motor Board
  • Battery Pack
  • BBC Micro:bit
  • Pens
  • Junk (Can or Bottle)
  • Wires
  • Tape
  • Scissors
  • Broken Propeller or un-balanced load
  • Screw Driver

Related Links

All opinions in this blog are the Author's and should not in any way be seen as reflecting the views of any organisation the Author has any association with.

1 comment: