Controlling 'junk' robot - three options

Three approaches to control it will be considered here:
- via Raspberry Pi;
- via Micro:Bit
-via Crumble controller

1. Raspberry Pi based

In this Raspberry Pi based Junkbot design a combination of Python and Pimoroni's Explorer HAT PRO are used to control it. Explorer HAT Pro is a good choice, it can control two motors with a library provided to simplify the programming. For this the Junkbot was the one shown above: a drinks can, pen, LEGO bits, motor and broken propellor.

Before the Explorer HAT can be used the library needs to be installed via the Terminal and the instructions below

curl | bash

Python code to control the junkbot is shown below.

import explorerhat
from time import sleep

def spin1(duration):

def spin2(duration):

2. Micro:bit
what about the recently released Micro:Bits; can it be used to control a junkbot?

2.2 Approach used in the project.
A Micro:Bit was selected for two reasons. First, there was been a BBC supported project to give year 7 (or equivalent) students a Micro:bit (, so they are available in the schools. Secondly, 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 ). Using Micropython via the online editor to program the board and therefore the junkbot connected. The board with the Micro:Bit attached can be seen in the figure above carried on 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():

2.3 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

3. Crumble

Lastly a Crumble controller from Redfern Electronics is used. The crumble controller is an excellent board for this project, it is relatively cheap, it is programmable with it's own graphical language, and it has motor drivers built in. In the figure to the left the parts (apart from adhesive tape) used can be seen.

3.1. Wiring up
Using croc-clips ideally, but loops of wire if not, connect the battery to the controller and also the motors to the controller. Plug in the USB cable into the controller and the computer.

3.2. Running and Controlling
Make sure the Crumble software ( is installed on the computer. 

An example is shown below that drives the motor forward and then backward repeatly. You might need to change the percentage values based on experiment, for the motor used. In the video below the junkbot is shown in action.

Related Links

All views and opinions are the author's and do not necessarily reflected those of any organisation they are associated with. Twitter: @scottturneruon

If you would like to know more about the Junkbots project contact

Popular posts from this blog

Blog usage statistics

Do it yourself: 'Radio' Controlled Micro:Bit Junkbot