Friday, 22 January 2016

Raspberry Pi - Python Junkbot using ExplorerHat Pro

Junkbots ( are based around using  materials such as drink's cans, broken propellors and motors to produce something that moves by vibration. Previous designs be found at:

The latest tweak to the Raspberry Pi based Junkbot design is to use the combination of Python and Pimoroni's Explorer HAT PRO 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):


Essentially the code spins the junkbot one way and then the other.

If you do use or modify please leave a comment, I would love to see what others do with it.

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.

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