100% found this document useful (1 vote)
2K views162 pages

Home Robotics - Maker-Inspired Projects For Building Your Own Robots (PDFDrive) PDF

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
2K views162 pages

Home Robotics - Maker-Inspired Projects For Building Your Own Robots (PDFDrive) PDF

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 162

First published in Great Britain in 2018 A catalogue record for this book is available from

by Aurum Press an imprint of the British Library.


The Quarto Group
The Old Brewery Edited by Philip de Ste. Croix
6 Blundell Street London Photography by Daniel Knox
N7 9BH Designed and produced by Sue Pressley and
Paul Turner, Stonecastle Graphics Ltd
www.QuartoKnows.com
The author would like to thank Michael Berry
© Quarto Publishing PLC 2018 and Martin Faulkner for proofreading, Jutta Knox
Text © Daniel Knox 2018 for her patience during all the late nights that
he spent working in the garage, and his nieces
Daniel Knox has asserted his moral right to Emily and Isabel Phillips for all their great
be identified as the Author of this Work in robot ideas.
accordance with the Copyright Designs and
Patents Act 1988. ISBN 978-1-78131-700-6
Digital edition: 978-1-78131-768-6
All rights reserved. No part of this book may Softcover edition: 978-1-78131-700-6
be reproduced or utilised in any form or by
any means, electronic or mechanical, including 1 3 5 7 9 10 8 6 4 2
photocopying, recording or by any information
storage and retrieval system, without permission 2018 2020 2022 2021 2019
in writing from Aurum Press Ltd.
Printed in China
Every effort has been made to trace the
copyright holders of material quoted in this
book. If application is made in writing to the
publisher, any omissions will be included in
future editions.
Maker-inspired projects for
building your own robots

Daniel Knox
Everyone can enjoy building robots – it’s easy and great fun!

Start with our Basic Bots that use simple components, progress to

the more advanced Simple Robots controlled by the BBC micro:bit

and with practice, you’ll soon be building the great Smart Makes

with confidence.

CONTENTS
INTRODUCTION 6
TOOLS GUIDE 10
COMPONENTS GUIDE 12
BASIC TECHNIQUES 15

BRISTLE BOT 18
A battery-powered vibrating motor transforms an everyday
nail brush into a crazy machine that will skitter energetically
around on your table top.

SQUIBBLE BOT 24
By attaching a couple of marker pens to an upturned drinks
cup, we can make a bot that produces mind-blowing scribbles
of its own accord.

BUTTERFLY BOT 30
Building on the techniques we learned in Bristle Bot, two
BASIC BOTS toothbrush heads are turned into a space-age butterfly that
skips along on its own.
PAGE 16
ROBO ROACH 36
Robo Roach is equipped with insect-like feeler sensors that
alert it when it encounters an obstacle and cause it to steer
away from the obstruction.

SPIRO BOT 48
This robot brings the Spirograph toy into the 21st century
as we build a machine that creates psychedelic patterns of
amazing variety.
02
AVATAR 58
This project introduces you to computer programming using
the JavaScript Blocks Editor to control the display on a
BBC micro:bit

SCUTTLE BOT 66
Scuttle Bot transforms a metal tin into a machine that moves
around under the control of a program on your mobile phone.

CATAPULT BOT 78
The Catapult Bot uses an infra-red motion sensor to activate
the catapult’s firing mechanism when movement is detected.

GARDEN GUARDIAN 88
SIMPLE ROBOTS Robotics comes to your aid with this brilliant little machine
that alerts your phone when a pot plant needs to be watered.
PAGE 56
WALKING ROBOT 98
This robot tackles a considerable technical challenge – how to
walk on two legs – and pulls it off with an ingenious solution.

ROBO WARRIOR 112


Fighting robots don’t have to be massively complicated to
be effective in the combat zone – this lightweight warrior
packs a mighty punch.

CNC WRITER 126


This project introduces readers to the world of computer
numerical control as we build a cool machine that can
write messages on a pad.

MARS ROVER 142


NASA sent one to explore the surface of Mars, and here we
learn how to construct an intelligent all-terrain rover vehicle
along the same lines.
SMART MAKES
PAGE 110 RESOURCES 158
INDEX 159
Introduction
Building robots can at first seem like an impossible challenge, but

really the only skill that you must have is a passion for making

things – everything else is just a matter of learning and practice.

01
In this book I will show you how to build a
number of different robots; some can walk, Basic Bots
others can draw and a few are inspired by Every roboticist must start
machines that help humans every day. As somewhere and there’s
you build these simple machines, you will no better place than using what’s readily
learn to put together electronic circuits, available around the home. This first chapter
write pieces of software and use various features a series of simple mechanical
tools to assemble the bots. Who knows, once robots that will hone your basic skills. These
you have got a taste for it, you may develop projects include Bristle Bot, Squibble Bot
into one of our star robotics engineers? and Butterfly Bot – a trio of vibration robots
that can skitter about. Robo Roach uses a
readily available chassis that can be adapted
to create an autonomous touch-sensitive
robot that finds its own way around, while
Spiro Bot can create amazing drawings on
its own.

6 HOME ROBOTICS
02 Simple Robots
Many robots use small electronic
devices to imbue them
with intelligence and precision control.
Programming can at first seem a little scary,
but in reality it’s just thinking about the
world in an ordered, systematic way. To
help you take your first steps into the world
of software, I will teach you a graphical
programming language that is simple to
learn. Every piece of software also needs
something to run on and so I have selected
the BBC micro:bit as our embedded platform
of choice. It’s extremely simple to upload
new programs to and has a lot of cool
sensors built in. With these simple programs
and the micro:bit, we will build a variety
of intelligent machines including Walking
Robot and Scuttle Bot that can sense and
interact with their environment.

INTRODUCTION 7
03 Smart Makes
Once you have mastered
the earlier projects, you
important rules to follow, but don’t worry – I
will teach you all you need to know and show
will probably want to take on something a you how to build a simple machine that can
bit more complicated. The three advanced be easily adapted and customized. If you
robots in this book have been designed to have access to a laser cutter, I have designed
give you the flexibility to expand and modify a template to help you get started with your
them as you see fit. They do require a few combat bot. If you don’t have access to one,
more tools and parts than the other robots, don’t worry – stiff cardboard works fine
but don’t worry – there is a simple step-by- too. I have also created a file complete with
step guide to help you build them. a step-by-step guide to help you configure
The first of them is a Robo Warrior your transmitter if you want to change the
designed for combat. Fighting with small robotic way the robot is steered. All the files can be
machines is a popular competitive sport that found and downloaded here: https://github.
is enjoyed around the world. There are a few com/danielknox/Robot_Warrior.

8 HOME ROBOTICS
The second project, CNC Writer, is a The real Mars Rover must rank as the
type of CNC (Computer Numerical Control) ultimate remote-controlled robot. The final
machine. In industry, robots are commonly project in the book shows how to build your
used to perform repetitive tasks over and very own machine that can roam about rough
over again with high precision. Finding the terrain. It is controlled from your mobile
parts for a CNC machine might sound really phone. At its heart, this robot uses a board
expensive, but everyday objects around the based on the popular Arduino platform –
home actually use similar components. So this board can easily be expanded to accept
for this project we will ‘go green’ and recycle additional sensors and there are also many
some old discarded electronics to build popular software libraries available to help
our own mini CNC Writer. This machine add new functionality. Arduino commonly
functions like and understands the same uses a text-based programming language
language (GCode) as its larger counterparts. known as ‘C++’. This programming is too
Like our other advanced projects, I have long and complex to be described in this
prepared the software files for you, so you book, so to keep things easy and fun for you I
just need to build the physical machine. The have already done the hard part!
files that you will need to go with our step- All the software that the robot needs can
by-step guide can be found here: https:// be found here: https://github.com/danielknox/
github.com/danielknox/CNC_Machine. Mars_Rover.

INTRODUCTION 9
Tools guide
Some basic tools and a few household items are all you need to

start building your own robots. Tools are also useful for doing

any running repairs that might be needed.

Marker pen Cross-head screwdriver Flat-head screwdriver

Nut driver Engineer pliers Precision snips

Retractable knife Multimeter Glue gun

10 HOME ROBOTICS
Crimping tool Wire stripper Safety glasses

Cordless drill Drill bits Drilling vice

Rotary multi-tool Cut-off disc Soldering iron and solder

Helping hands Hex/Allen keys Computer

TOOLS GUIDE 11
components guide
Every robot featured in the book has a specific list of required

components, but here’s an overview of some of the most

important bits of kit that you will need to acquire.

AAA battery holder with wires AA battery holder with wires Switchable AA battery holder with
wires

AA 4.5-volt battery holder with switch AAA switched battery holder for BBC Modified battery box
micro:bit

Tamiya battery cable 4.8V NiMH battery NiMH battery charger

12 HOME ROBOTICS
20 AWG and 22 AWG stranded wire Ring electrical crimp terminals Terminal strip

Mobile phone vibrator motor 3-volt motor 6-volt geared robot motors with wheels

SPDT momentary switches with long Continuous rotation servos 9g servo


lever

Servo tester BBC micro:bit Arduino Uno

COMPONENTS GUIDE 13
DFRobot bipolar stepper controller DFRobot Romeo BLE PIR sensor

Metal tin (e.g. a mini survival tin) MakerBeam Project box

Bolts, nuts and washers Screws with nuts (e.g. socket head) 90-degree-angle L brackets

45-degree-angle MakerBeam brackets 5mm threaded rod Hex standoff spaces

14 HOME ROBOTICS
BASIC TECHNIQUES
Step-by-step guidance is provided to show you how to build

each project in this book, but there are a few basic techniques

that are worth mastering from the very beginning.


SOLDERing

1. Plug in and heat up soldering iron 2. Tin the tip with a thin layer of solder 3. Apply tip of hot iron to solder
Rotary tool

1. Insert cutting disc and tighten 2. Grip item securely in vice 3. Cut part at correct angle
GLUE Gun

1. Plug in and heat up glue gun 2. Insert glue stick 3. Dispense hot glue

BASIC TECHNIQUES 15
01
BASIC BOTS
BRISTLE BOT
SQUIBBLE BOT
BUTTERFLY BOT
ROBO ROACH
SPIRO BOT

These five fun projects use simple components and

everyday objects that you may have around the house.

Start building!
Bristle bot
You don’t need many parts or any specialized tools to make

Bristle Bots; as a result, they are extremely easy to build and

are a great place from which to set out on your journey to

become a robot master.

1 AAA battery holder with wires


components

2 paperclips snapshot
1 nail brush Some Bristle Bots can become quite
1 3-volt motor fancy, with steering controls and
2 googly eyes high-performance brushes taken
1 terminal strip from electric toothbrushes; however,
1 piece of cardboard at their heart, all Bristle Bots are
generally built with the same basic
parts: a brush and a vibrating motor.
So, grab some bits and then let’s get
started with building our first robot.
retractable knife
tools

flat-head screwdriver
marker pen
engineer’s pliers
scissors
hot glue gun

BRISTLE BOT 19
1 Take the AAA battery holder
and wrap the exposed wire ends
around the 3-volt motor’s terminals – they’re
the bits that look like little brass ‘ears’ (A).
These types of motors don’t mind what
way around you wire them, so don’t worry
about which wire goes to each terminal. You
can use a soldering iron to secure the wires
A permanently in place, but twisting the wires
around the terminals works too. If you do
use a soldering iron, be careful as these tools
get very hot.

Take the 2
terminal strip
and use a knife to cut-off a
single segment; be careful as
the knife blade is very sharp.

3 Then with a flat-head screwdriver


loosen one of the terminal’s
screws. Slip it over the 3-volt motor’s shaft
(the bit that turns) and tighten the screw
back up. Check to make sure that the shaft
can still turn freely; if it doesn’t, undo the
terminal’s screw, ease it away a little bit from
the motor’s body and then retighten it.

20 HOME ROBOTICS
To fashion the 4
Bristle Bot’s
eye stalks, unbend one of
the paperclips so that it
is roughly straight. Now
create a small loop at one
end of the paperclip – the
loop does not need to be
perfect. At the opposite end,
form another loop, offset at
roughly 90 degrees to the
first. To neaten it up, use
the cutting edge of a pair of
pliers to remove any excess
wire. Repeat this step for the
second paperclip.

5 Take a sheet of
thin cardboard
and place the nail brush
upside down on top of it.
Hold the nail brush securely
in place while you trace
around it with a thick marker
pen. Lift the nailbrush off the
cardboard. Now use a pair
of scissors to cut around the
shape. The cut-out doesn’t
need to be perfect, but try
to make it roughly the size,
or slightly smaller than the
nailbrush.

BRISTLE BOT 21
6

You now have several parts that As the hot glue hardens quickly, you’ll need
we need to glue together in to work fast – don’t worry about completely
order to assemble the Bristle Bot. For the covering the cardboard with glue, a little bit
next step, it helps to place a large sheet of is fine! Put down the glue gun and press the
cardboard on the table that you are working sticky side of cardboard onto the nail brush.
on, to protect it from any hot glue that may Choose the side with the fewest amount of
drip. Plug in your hot glue gun and wait for bristles for this, otherwise your robot won’t
it to heat up; be careful as hot glue guns get have any legs!
very hot. When it seems to be ready, take a Next take one of the paperclips and using
glue stick and place it in the hole at the end the hot glue gun, attach one of the googly
of the glue gun. Pull the trigger and if the eyes to one of the looped ends, repeat this
glue comes out of the nozzle, you’re ready to step with the second paperclip. We’ve nearly
go. Be very careful as the glue remains very finished constructing the Bristle Bot.
hot for a while after it is dispensed.
Take the cardboard cut-out and using the
hot glue gun, deliver a bead of hot glue to
cover the edge and middle of the cardboard.

22 HOME ROBOTICS
Now take the 7
motor and
battery holder you assembled
earlier and glue these to the
top of the cardboard cut-
out; the terminal segment
should hang off one of the
long sides of the nailbrush A
(A). Place and glue the
AAA battery holder behind
the motor (B). Finally, glue
each of the eye stalks to the
cardboard, one on each side
of the motor.
B

How it Works
Insert an AAA battery into the battery holder and the motor should
begin spinning. When placed on a smooth surface, like a table-top
or tiled floor, the Bristle Bot should shuffle randomly about. Just be
careful that it doesn’t fall off your table. The bristle moves because
the terminal block unbalances the motor’s rotation, which in turn
causes a lot of vibration to be transmitted through the nailbrushes’
bristles. The minimal surface contact of the bristles with the smooth
surface means there is little friction, allowing the Bristle Bot to move
around easily. Normally motors vibrating in this way could pose a
serious problem, but in this case we need this vibration to make our
Bristle Bot move.

BRISTLE BOT 23
Squibble bot
In our last project, we used a vibrating motor to cause our

robot to move about on a flat surface. Here we add some

extra bits to create a robot that doodles.

1 AAA battery holder with wires


components

1 3-volt motor SNAPSHOT


2 googly eyes It is a nice idea to attach
2 or 3 differently coloured whiteboard markers pens to bristle bots, so
1 large plastic party drinks cup that they make all sorts of
2 colourful pipe cleaners colourful doodles while
1 glue stick they jiggle about.
1 nail (about the thickness of the motor shaft)
1 large sheet of paper (at least A3) For this project, instead of
using a vibrating motor, we
will craft a small ‘wheel’ to
retractable knife create a robot that spins
tools

cutting mat around – this gives our


hot glue gun robot the ability to make
small piece of sandpaper snazzier doodles.

SQUIBBLE BOT 25
1 Plug in your hot glue gun and
wait for it to heat up. While it
is warming up, bend each pipe cleaner at
one end so that the bend is roughly 2.5cm
(1in) long.
When the glue gun is ready, insert a
glue stick into it. Dispense a small bead of
hot glue onto the back of each googly eye
and then attach the long end of each pipe
cleaner to it. You now have two eye stalks for
your robot.

BRAINWAVE
Protect your work surface by placing
a large sheet of cardboard on the
table that you are working on; this
will help to shield it from any hot
glue that may drip..

While the glue gun is still


warm, dispense a small amount
of glue to the short end of each eye stalk
and attach them to the top of the plastic
drinks cup; you need to leave about a 2.5cm
(1in) gap between them. When the glue
has hardened, bend your eye stalks to give
your robot a more ‘alien’ look. You can now
unplug the hot glue gun, but don’t put it away
as we will need it again later.

26 HOME ROBOTICS
3

B D
C

We are now going to assemble 4


the motor for our robot (A) to
let it walk about. First take a spare hot glue
stick (B) and use a retractable knife to cut
a short bit off (around 1.2 cm or ½ inch);
make sure you do this on a cutting mat, so
you don’t damage the table. We want to slip
this cut-off (C) onto the shaft of our 3-volt
motor, but before we can do that we need to
make a small hole in one of the ends. The
easiest way to do this is to slowly twist a
small nail (D) into the hot glue stick – if it’s Take the AAA battery holder
too hard to go in, try gently heating the glue and wrap the exposed wire ends
stick a little to soften it. around the 3-volt motor’s terminals. As with
Once you have made a small hole, slip our previous robot, it doesn’t matter which
the cut-off portion onto the motor’s shaft. way around the wires go to the terminals.
It doesn’t have to fit all the way onto the You may wish to use a soldering iron to
shaft, but you want it gripped tightly. You can secure the wires permanently in place, but
test this by trying to spin the glue stick and twisting the wires around the terminals
making sure it doesn’t come off the shaft. works well too.

SQUIBBLE BOT 27
We now have all the parts we 5
need to assemble our robot,
so switch the hot glue gun on again and get
some spare sticks to hand – we are about to
do a fair bit of glueing.
First glue the AAA battery holder onto
the top of the plastic drinks cup; it should fit
neatly between the eye stalks that we stuck
on earlier.

6
How it Works
First place a large sheet of paper on a smooth
surface, such as a tiled kitchen floor. Hold the
robot in the air and insert an AAA battery into the
battery holder – the shaft of the motor should begin
spinning. When placed on the centre of the sheet
of paper the robot should begin to spin and skitter
about; make sure you’re ready to catch it before it
runs off the paper, as you don’t want the robot to
Next, glue the mark the table or floor.
motor onto the The robot moves because the motor is rotating
bottom of the cup. You want counter to the body of the drinks cup, and this
the hot glue stick cut-off causes the cup to begin to rotate. The glue stick acts
that’s on the motor’s shaft like a small wheel, its surface helps to provide grip
to rotate freely below the between the motor and the surface of the paper – it
bottom of the cup. also flexes slightly on the shaft allowing the robot to
It helps to use a small piece skitter around.
of sandpaper to roughen
up one side of the motor –
apply hot glue to the body of
the motor and then press it
onto the drinks cup.

28 HOME ROBOTICS
Finally take the caps off two or three whiteboard
markers and dispense a bead of glue along one side of
the body of each pen. Attach them to the drinks cup at a 45-degree
angle; the tip of each of the pens should come down to roughly the
bottom of our cut-off piece of glue stick. Space the pens evenly
around the body of the drink cup.

SQUIBBLE BOT 29
BUTTERFLY BOT
Our first Bristle Bot was cute, but it’s currently rather lonely. This next

creation is mechanically similar to the first one, but it uses a much

smaller motor to produce the required vibrations.

1 AAA battery holder with wires


components

2 toothbrushes (toothbrushes with angled bristles SNAPSHOT


work even better than straight ones) This bristle bot is a
2 googly eyes great introduction
1 mobile phone vibrator motor to some important
1 colourful craft bead tools, particularly the
spool of enamelled craft wire rotary multi-tool and
sheet of ‘fantasy’ film the soldering iron.
PVA glue
lead-free solder

drill vice rotary multi-tool


tools

safety glasses (e.g. Dremel)


engineer’s pliers tealight (fairy) candle
wire strippers lighter/matches
scissors brush
helping hands small piece of
hot glue gun sandpaper
soldering iron

BUTTERFLY BOT 31
1 Once your soldering iron has
reached the right temperature
it’s time to connect the two wires to each of
the terminals on the small phone vibration
motor. First ‘tin’ the exposed wire ends; use
the helping hands to hold the two wires and
then use the soldering iron to melt the solder
onto the exposed wires. Remove the wires
from the helping hands.
Grip the vibration motor in one of the
Plug in your soldering iron – be crocodile clips of the helping hands, so that
very careful as soldering irons you are able to work easily on the two small
get very hot (they need to be able to melt a metal terminals. Touch one of the terminals
soft metal). While it is warming up, use the with the tip of your soldering iron and gently
pliers to cut the wires of the AAA battery press one of your tin wire ends against it (A).
holder to a shorter length, leaving one wire When the solder melts, move your iron away
longer than the other. Strip the insulation to let the solder cool; once it does, you can
off the ends of the wire to expose a small stop pressing the wire against the terminal.
amount of bare wire. Repeat for the second wire.

32 HOME ROBOTICS
Put your battery and motor to 3
one side. Grip a toothbrush in
the drill vice so that the bristles overhang the
end of the vice. Insert a cut-off disc into the
chuck of your rotary tool. Put on your safety
specs and then plug the rotary tool into an
electrical outlet and set it to a high speed.
Cut off the end of the toothbrush using the
rotary cutter. (You don’t need to press down
hard on the toothbrush to make the cut, the
tool will do the work for you.) Repeat for the
second toothbrush.

4
brainwave
How your wings
look is entirely up
to you, so don’t be
afraid to experiment
with different lengths
of wire until you’re
happy with the way
they look.

Put the toothbrushes to one and cut it using the pliers. Form a loop with
side and unplug your rotary the enamelled wire, and twist the ends to
tool. We are now going to make two wings stop it unravelling (B). Cut another length of
for our bristle bot – this same process can wire and form a second smaller loop. Twist
be used to make wings for all sorts of toys. the ends of both loops together, and trim the
Unwind a length of wire from the spool ends with your pliers if that’s needed.
of enamelled craft wire (around 15cm/6in)

BUTTERFLY BOT 33
Use a brush to apply a small 5
amount of PVA glue to the wire
(not too much) and stick it down on a small
sheet of fantasy film – you may need to
press down gently on the wire to make sure it
sticks to the film. Be careful not to move the
wire around too much as the glue will smear
on the surface. Let the glue dry (this will take
a few hours). Once it has dried, use a pair of
scissors to cut around the wings – leave a bit
of excess film on the edges because it will
shrink and harden when it is heated. Repeat
steps 4 and 5 to make a second wing.

6 Use a match to light a tealight candle. Gently


bring your fairy wing near to the flame (but not
actually touching it). The heat of the flame will cause the
film to harden and shrink. You will notice that the film goes
through a range of brilliant colours, but be careful – if it gets
too hot, holes will form. To avoid this, gently move the wing
above the flame and don’t spend too long on this step (a
couple of seconds is more than enough). Repeat this step
for the second wing.

34 HOME ROBOTICS
7

We now have
all the parts to
assemble our robot. To do
this, plug your hot glue gun into
an electrical socket and let it heat
up. When it is ready, apply a small
amount of glue along the bottom of the
AAA battery holder. Attach the two toothbrush ends to
one end of the battery holder. Now use a small piece How it Works
of sandpaper to roughen up the flat surface of the Insert an AAA battery into
small mobile phone vibrator (this will help it to stick). the battery holder and the
Dispense a small amount of glue onto this surface and small motor should begin
attach the motor to the bottom of the AAA battery spinning. When placed on
holder (it should sit behind the two toothbrush ends). a smooth surface, such as
Flip the robot over and attach the two wings using a a table-top or tiled floor,
small bead of hot glue; you will have to support them the Butterfly Bot will start
while the glue is cooling. to shuffle randomly about
Finally, apply a small amount of glue to each of the – just be careful that it
two googly eyes and attach them to the front of the doesn’t fall off your table.
robot (away from the motor end!). A small bead can
also be added to give the Butterfly Bot a cute nose!

BUTTERFLY BOT 35
robo roach
Many robots use small computers known as microcontrollers to sense

and adapt to their environment. However, it’s also possible to make a

reactive robot that only uses mechanical parts (so you don’t need to

write any computer code).

1 AA battery holder
components

1 magician robot chassis kit snapshot


2 6-volt geared robot motors Our robot cockroach is exactly that
with wheels – it’s able to explore its surroundings
2 SPDT momentary switches and move around any obstacles
with long lever that it encounters just by using two
2 paperclips switches and some wires. Building
length of 20 AWG stranded wire a robot chassis can be quite difficult
for a beginner roboticist, so we will
make our lives easier by adapting a
simple off-the-shelf chassis that is
soldering iron with stand easy to come by. However, if you’re
tools

solder (lead-free) feeling adventurous, it possible to


hot glue gun build a similar chassis using some
cross-head screwdriver thick cardboard and the liberal use of
wire strippers adhesive from a hot glue gun.
helping hands
retractable knife

ROBO ROACH 37
1

We will be mounting the motors


onto the magician chassis first:
to do this you will require the T-shaped
mounts and the bottom plate (the one with
the motor wheel cut-outs). Slot a T-shaped
mount through the inner slots; the T piece
should prevent the mount going all the way
through the bottom plate.
Align one of the 6-volt motors against motor. Push a bolt through the mounting
the mount that you have just installed – holes and screw on a nut on the opposite
the metal motor of the motorized gearbox side – this can be fiddly, so insert the bolts
should face towards the straight-edged and loosely attach the nuts before tightening
rear of the bottom chassis. Take another everything.
T-shaped mount and place this against the Repeat this step for the second motor.

38 HOME ROBOTICS
2 We are now going to wire the
motors to the battery and the
switches. The next few steps take some time
and are a little complicated, so it is worth
studying the picture on the left to understand
where the wires will be going.
Plug in your soldering iron and allow it
to heat up.

Cut a length of 3
wire, so that it is
long enough to run between
the two motors and expose
a portion of wire using a pair
of wire strippers. Loop the
wire strands around one of the
terminals on each of the two
motors.
Cut and strip another length
of wire, so that it is will reach
from one of the motors to
the front of the plate (around
10cm/4in). Loop its wires
through one of the terminals
that already has wire strands
wrapped through it and then
thread the other end through
a nearby hole in the chassis to
emerge on the front side of the
plastic plate. Solder all of the
wires to their terminals, so that
they are secure.

ROBO ROACH 39
4 Flip the plastic
plate over and
hold your AA battery holder
against it. Wrap the loose
wire end around one of the
positive terminals – this
type of terminal is the one
that looks like a spring. If
you wish you can solder this
wire in place, but be careful
not to melt the plastic. Once
you have done this, put the
plastic plate to one side for
the time being.

We will now solder wires to each of the switches. Put one of


the switches into a pair of helping hands, and melt a little bit of
solder onto each of its legs – this will make it much easier to attach the wires
in a minute. Now cut and strip three lengths of wires, each approximately
15cm (6in) long. Put one of the wire strips into the spare croc clip on the
helping hands and melt a little bit of solder onto the exposed wire. Repeat
this for each of the wires.
Finally solder the ‘tinned’ end of each wire onto one of the legs of the
switch (A), make sure you don’t ‘bridge’ any of the connections (each wire
and solder joint should only touch one leg).
Repeat this step for the second switch.

40 HOME ROBOTICS
5

ROBO ROACH 41
Look at each switch closely and Use the wire strippers to expose
you should see that each leg has the wires that connect to the
code letters above it: NC (Normally Closed), ‘NC’ terminal on both of switches. Twist
NO (Normally Open) and C (Connected). the two exposed wires together and use the
The reason for these three terminals is that soldering iron to solder the twisted pair of
terminal ‘C’ changes what it is connected wires.
to, depending if the switch is being pressed Flip the plastic chassis plate over and find
down or not. the terminal that is opposite to the one that
Take the wire running from one of the we soldered earlier (a non-sprung terminal).
terminals labelled ‘C’ and use the wire Melt a small amount of solder onto this
strippers to strip the non-exposed end of the terminal, but be careful not to metal the
wire. Loop this end around one of the non- plastic. Now solder the twisted pair of wires
soldered motor terminals. Repeat this step to this.
for the other switch, looping its wire around
the remaining motor terminal. Solder each
of these terminals.

42 HOME ROBOTICS
7 The remaining
wires from the
terminal marked ‘NO’ (A)
should now be stripped and
twisted together.

ROBO ROACH 43
9 Now solder this
A pair of wires
onto the remaining positive
terminal (the spring-like one)
of the AA battery holder (A).
That’s it! We have now
completed all of the solder-
ing. Time to unplug and put
away the soldering iron.

Plug in the 10
hot glue gun
and let it warm up. Flip the
plastic plate back onto its
underside so that you can
see the motors. Gently bend
the wires so that each of
the switches reaches the
curved edge of the motor
plate at the front of the bot.
The highest point of each
of the metal levers should
point towards the side of the
plastic plate that is nearest
to them.
Once the glue gun is
hot, glue each of the two
switches to the plastic plate.

44 HOME ROBOTICS
Flip the plastic plate over 11
and take the risers from
the magician chassis kit – they look
like long hexagonal pieces. Attach
these to the plastic plate, one in the
middle of the chassis and one on each
side – you should be able to imagine
drawing a triangle between these
risers.

12

Unbend each of the paperclips Once the glue has hardened, make sure
and form them so that they are that the switch is still able to toggle on and
shaped like insect feelers. Apply some hot off; if it doesn’t, use a knife to break away
glue to each of the switch levers and attach some of the hardened glue so that it moves
a ‘feeler’ to each one. Press down to make more freely.
sure the feelers are firmly attached.

ROBO ROACH 45
13

Take the wheels from the The remaining plastic plate can
magician chassis kit and slip now be attached to the metal
them onto the plastic mounts of each of the risers. Flip the robot over and place the
motors. You should also have a caster ball plastic plate on top of the risers. Adjust the
wheel in the kit (A); install this onto the back plate so that it is aligned with the bottom
of robot chassis (the end that is opposite the plate and then screw it into place. After all
switches). that hard work, our robot is complete!

46 HOME ROBOTICS
14

How it works
Remove the top plastic plate to insert some batteries into the battery holder – keep
a firm hold of the Robo Roach so that it doesn’t run away. Screw the top plate back
onto the robot. Put the roach onto a smooth floor – if it starts to drive backwards
you may have to swap the motors around! When the roach encounters an obstacle,
one of the motors should stop turning because the paperclip feeler will move and so
flip the switch temporarily to an off position. This causes the roach to turn. Much
like larger, more expensive robots, our roach’s sensor can only ‘see’ certain types of
obstacles; it should be fine when reacting to walls and objects with large surfaces,
but it might get tripped up by smaller thinner items, such as table legs.

ROBO ROACH 47
spiro bot
Our earlier Squibble Bot produced marks on paper, but the results

were fairly random. The robot that we are about to build has much

better drawing skills than our Squibble Bot and is able to replicate the

results obtained from a classic toy known as a ‘Spirograph’.

1 switchable AA battery 10 3mm nuts


components

holder with wires 4 3mm bolts (12mm snapshot


2 6-volt geared robot length) Spirographs produce
motors with wheels 6 3mm bolts (40mm curves by using
1 clothes peg length) mechanical gears, but
6 coloured lollipop sticks 6 3mm spring washers gears can be hard to
1 6mm sheet of wood length of 20 AWG fashion without some
6 3mm washers stranded wire fancy equipment and
some complicated
maths. Instead, we
will use lollipop sticks
soldering iron with stand and motors to make
tools

hot glue gun a simple robotic arm


rotary multi-tool (e.g. Dremel) with 1-3mm drill bits that can move a pen
drill vice on its own.
safety glasses
marker pen
masking tape
flat-head screwdriver
cross-head screwdriver
engineer’s pliers

SPIRO BOT 49
1 We are now going to drill holes
into each of the lollipop stick
bundles, using the marks as guides. First
place one of the lollipop stick bundles into a
drill vice, so that it is held securely in place;
you don’t want to drill into the vice, so let it
overhang a little bit.
Set up the rotary multi-tool with a 1mm
drill bit; to do this, loosen the tool end of the
Take a lollipop stick and using a rotary tool, so that you can insert the drill bit
marker pen draw a small ‘X’ in into the collet (the gizmo that holds the tool
the middle of it. Make two other small marks in place), then retighten the nut. If the drill
at each end – you should leave enough room bit doesn’t fit, you’ll probably have to swap
for the 3mm drill bit to be able to make a the collet for a different sized one.
hole at the centre point of each mark. Take a Put on your safety specs and plug the
second lollipop stick and mark a small ‘X’ at rotary tool into an electrical socket. Set the
each end (no need for a mark in the middle rotary to a relatively fast speed and drill
of this one). into the wooden lollipop stick at one of the
marks – don’t force down hard on the drill
head as these tools are not designed for that
2 kind of use; just gently press down on the
lollipop stick.
When you are through the bundle of
sticks, stop the tool and repeat for the other
marked holes. The holes you have just made
are called ‘pilot’ holes – they help guide
larger drill bits. Once you have drilled the
first set of holes, replace the drill bit with a
Place the first lollipop stick on 3mm sized one. Repeat the process again,
top of two unmarked sticks and drilling each hole out neatly.
wrap some masking tape around them to
secure them tightly together; keep the tape
clear of the marks as you need to be able
see these. Do the same for the other marked
lollipop stick. You should now have two neat
bundles of sticks.

50 HOME ROBOTICS
3 4

Put the bundle of lollipop sticks


to one side and remove one
of the robot wheels from the 6-volt geared
motor. Place this wheel into your vice and
tighten it so that the wheel is secure. You
will notice that the wheel hub has several
dimples, one on each spoke. With your
rotary tool, drill a hole through one of these
dimples; as before, make a pilot hole first,
before you use the 3mm drill bit. Repeat this
with the second 6-volt motor wheel.

5 Plug in your hot glue gun;


remember to protect your work
surface. While the glue gun is heating up,
unwrap the bundles of lollipop sticks.
Take one of sticks that has only a hole
at each end and put a three-quarter-length
bead of hot glue along one of the edges of
the lollipop stick. Stick the clothes peg onto
this bead of glue, so that it overhangs the
stick. When the glue hardens, you should still
be able to open and close the clothes peg
normally. Once this is done, you can unplug
the glue gun.

SPIRO BOT 51
6

We are now going to make the middle holes should line up with each other.
‘scissor’ mechanism for our Spiro Fasten these together with a bolt, washer,
Bot. Take a 3mm bolt and put a washer on spring washer and a nut. Now attach this
it, then put this bolt through our clothes peg cross shape to the clothes peg mechanism
lollipop stick; start with the hole nearest the that we just made; overlap the holes and
clothes peg. Take another lollipop stick that then put a bolt, washer, spring washer, nut
only has two holes and put the bolt through combination through each of them. We have
one of its holes. Now add a spring washer nearly finished this step.
onto the bolt and finally a nut. Tighten the Finally take the two wheels that we drilled
bolt. The washer allows the mechanism holes into earlier and using a longer bolt
to move smoothly and the spring washer attach each wheel to the remaining holes
prevents the nut from loosening. All of our on our lollipop stick scissor mechanism.
holes will observe this same sequence: bolt, Tighten all of the bolts using a screwdriver.
washer, lollipop stick 1 and 2, spring washer We have now finished assembling the
and a nut. scissor mechanism – nice one!
Take the two lollipop sticks that have three
holes, and make a ‘X’ shape with them – the

52 HOME ROBOTICS
Put the two 7
6-volt motors
onto the edge of the sheet
of wood about 10cm (4in)
apart from one another. With
a marker pen, mark around
the edges of the motors.

8 Take apart one


of the motors
with a cross-head screw-
driver. Position the shell
of the motor using the
markings on the wood as a
guide. With a scribe (or a
paperclip), mark the position
of the motor mounting holes
onto the wood plate – do this
for both motors.

Move the motors out of the way 9


and get your rotary multi-tool
out again. Using the rotary tool, drill each of
the mounting holes that you marked on the
wooden board; don’t forget to protect your
work surface from the drill and to wear your
safety glasses.

SPIRO BOT 53
10 11

You will notice that the motors Reassemble each motor and put
do not lie flat on the wooden them back on the wooden plate.
surface because there is a white wheel mount Line the holes that you made in the board up
coming out of both sides. Although each with the mounting holes of each motor, and
side of the motor looks very similar, they are then put a 40mm bolt through each one and
actually subtly different – one has a small secure it in place with nuts underneath the
raised dome and the other side doesn’t. On board. Tighten these up, so that the motors
the side without a raised dome it is possible are held securely to the wooden board.
to pull the white mount off. Do this to each
of the motors. I find it helpful to take each
motor apart and gently use a screwdriver
to push up on the internal gears – the white
wheel mount should fall off.

How it Works
Put a sheet of A4 paper in front of the robotic arm, and make sure that the tip of
the pen still touches the paper when the arm is fully retracted (you can manually
turn the wheels to do this). Secure the piece of paper to your work surface using a
little bit of tape on each of the corners. Put two fresh batteries into the AA battery
holder and move the switch to its ‘On’ position. The arm will now begin moving
and producing a drawing. When you’re happy, switch off the Spiro Bot. If you wish,
you can move it to a new position on the paper and start it again – this can produce
some really cool-looking patterns.

54 HOME ROBOTICS
Plug in your soldering iron and 12
let it warm up. While it is doing
so, cut a short length of wire with the cutting
edge of the engineer’s pliers – the length
should be enough to stretch between the two
motors. Loop the wire through one of the
terminals on each of the motors and solder
it in place – if the motor terminals are facing
towards the wooden panel, it is possible to
remove the motor from the gearbox and
swap it round. Now take the AA battery box
and solder one lead to each of the remaining
motor terminals. You can now switch off the
soldering iron.

Take the scissor mechanism that you built earlier and slot the
wheels onto the mounting posts of each motor, the mechanism
should hang over the wooden board. Carefully open the jaws of the wooden
peg so that its able to grip a marker pen, adjust the pen’s position so that the
tip of the pen sits just slightly touches your work surface. Job done!

SPIRO BOT 55
02
SIMPLE ROBOTS
AVATAR
SCUTTLE BOT
GARDEN GUARDIAN
CATAPULT BOT
WALKING ROBOT

Using the BBC micro:bit to provide the brains for these

cool projects, you will soon learn how to adapt the

ideas to dream up your own brilliant robot designs.


avatar
Our previous projects all used simple mechanical and electrical

components to allow our robots to move and interact with their

environments. However, more complicated robots commonly use

small devices known as microcontrollers.

1 BBC micro:bit
components

snapshot
Microcontrollers give robots more advanced
functionality. They are like small mini computers.
While they’re not very good for familiar tasks like
browsing the internet, they are excellent at doing
or monitoring things repeatedly – they are brilliant
at this because they can perform these tasks
extremely quickly.

Microcontrollers need to be programmed for them


PC/laptop computer to be able to know what tasks they should perform.
tools

micro USB cable Programming is commonly done using something


that looks a bit like a strange text language, but this
is not very user-friendly for new roboticists. Instead
we will use a graphical programming language where
we can build programs by dragging and dropping
‘blocks’ onto a screen.

AVATAR 59
If you have ever used the programming language ‘Scratch’ at home or
at school, you should feel confident about the programming part of
these projects. If not, don’t worry as this project is all about guiding
you through writing your first program.

1 Launch the JavaScript Blocks Editor from


the micro:bit website (microbit.org). When it
loads, you should see a pane with a picture of a micro:bit,
a number of tabs that contain different kinds of blocks, and
a pane which contains two blocks ‘on start’ and ‘forever’.
The ‘on start’ block, like its name suggests, performs tasks
that should happen when your micro:bit is first switched on
– this block is useful for setting the initial state of things. The
‘forever’ block repeatedly executes the same tasks over and
over again as fast as the microcontroller can go. This is why
microcontrollers are great at doing simple tasks repetitively.

2 Click on the ‘Basic’ blocks tab and drag a ‘show


icon’ block onto the pane with the ‘on start’ and
‘forever’ blocks. You will notice that the ‘show icon’ block has
a little notch in the top part of it, this means that it needs
to be connected to something in order to work. Drag and
release the ‘show icon’ block so that the notch connects
to ‘on start’ block. If you have speakers plugged into your
computer, you should hear a ‘click’ sound. The pane with
a picture of a micro:bit should now change to show an
image of a heart. This pane simulates the running of your
program and is useful to test things without having to keep
downloading your program to your micro:bit. Click the heart
icon that’s currently on display in the ‘show icon’ block and
click on the happy face. You should see that the simulator
now updates itself and instead of showing a heart, it is
instead displaying a happy face.

60 HOME ROBOTICS
3 4

Frequently when programming


we need our program to
remember things; for example, if we wish
to count the number of times someone We now want our program to
presses a button, the program will need a do something based on whether
place to store that counter. This is known as or not our happiness variable is less than
a variable and is one of the most important ‘0’. In programming this is known as an ‘if
concepts in many programming languages. else’ statement. If something is ‘true’, it will
The JavaScript Blocks Editor also has the perform an action, if not, it will perform a
ability to create variables, so let’s make one. different action. To do this, click on the
First click on the tab labelled ‘Variables’. A ‘Logic’ tab and drag in the ‘if true, then, else’
few blocks should appear, but they are for an block. Connect this block to the existing
existing variable called ‘item’. This will not ‘forever’ block.
do. Instead, click the button labelled ‘make a
variable’. When it asks you to give it a name,
type ‘happiness’. We should now see that the
‘Variables’ tab contains a new block called
‘happiness’. Drag a ‘set item to’ block to the
main pane and connect it to our ‘show icon’
block. Click on the dropdown menu labelled
‘item’ and choose ‘happiness’. Now when
our program first runs, behind the scenes
our happiness variable gets set to 0. When
programming it is very good practice to
initially set your variables to a known value.
Something my students often forget to do!

AVATAR 61
Currently our ‘if true, then, 5
else’ block is incomplete. This
is because it doesn’t know what to check
to see if the statement is true. We want our
program to check whether our happiness
variable is less than ‘0’, which means we
wish to compare the value of happiness to
0. Click the ‘Logic’ tab again and drag in the
block ‘0 < 0’. It should connect to the ‘if ’ part
of our ‘if true, then, else’ block.

This block is currently checking


to see if ‘0’ is less than ‘0’
(something that is false). Click on the 6
‘Variables’ tab and drag a ‘happiness’ block to
the screen. Replace the first of the zeros, so
that the statement now reads ‘if happiness <
0’. Now whenever our happiness variable is
less than ‘0’ it will perform one set of actions,
and whenever it is equal to or greater than
‘0’ it will perform a different set of actions.
Because these blocks are connected to the
‘forever’ block, this check and set of actions
will be performed over and over again.

Although we are now able external happens to our micro:bit, in this


to check the value of our case, if button A gets pressed. Drag in a
happiness variable, you might notice that second ‘on button A pressed’ block. You will
currently it is only ever changed in one place notice that this new block has been greyed
on start. It is not much good if our happiness out. This is because we already have a ‘on
is only ever ‘0’, so let’s fix that. Click on the button A pressed’ block, so the language is
‘Input’ tab and drag the ‘on button A pressed’ confused why you need a second. Click on
block to the screen. Unlike the previous the ‘A’ in this new block and choose ‘B’ from
blocks that we added, this one doesn’t the dropdown menu – you should find that
have a notch in its top – this is because it the block is no longer greyed out.
performs actions as soon as something

62 HOME ROBOTICS
7

brainwave
Our program now knows that we want to do Don’t confuse the A
something whenever we press button A or and B buttons with
button B, but it doesn’t know what. Click on the ‘Variables’ your keyboard letters.
tab again and choose the ‘change item by 1’ block. Drag You need to click on
and connect it beneath our ‘on button A pressed’ block. As the A and B buttons
before we are not interested in changing the value of ‘item’. on the micro:bit
So, click on ‘item’ and instead choose ‘happiness’ from the simulator screen.
dropdown box. Create another one of these blocks and
connect it beneath ‘on button B pressed’.

AVATAR 63
9

The smart roboticist will spot that currently


button A and B do the same thing. It will
increase the value of the variable ‘happiness’ by ‘1’. While a
happy robot is always a good thing, it is pointless having two
buttons to do the same thing, so change one of the ‘change
item by 1’ blocks, so that it reads ‘change item by -1’. Now
this button will decrease the value of the variable ‘happiness’
by ‘1’ whenever it is pressed.

Our program is nearly complete. like the micro:bit to display. I went with a
We have a variable called ‘sad’ face. Try the simulator out and you
‘happiness’ that is initially set to 0 when the should find that the happy face changes when
program starts, and this can be changed by you press the button that was associated
pressing either button A or button B. We with the ‘change item by -1’ block; however,
also have a happy face on our micro:bit’s it currently doesn’t change back when we
LED screen. press the other button two times. To fix this,
To finish our program, let’s make just drag another ‘show icon’ block onto
something happen whenever our happiness the screen and attach it to the ‘else’ part
variable is less than ‘0’. To do this, drag a of the ‘if, then else’ block. Change the icon
‘show icon’ block from the ‘Basic’ tab and to anything you like. Now you should find
connect it to the ‘then’ part of the ‘if, then, that the simulator changes between the two
else’ block. Choose an icon that you would pictures when you press the buttons.

64 HOME ROBOTICS
10

How it Works
Congratulations, you have just written your very
first computer program. If you like, download
the program and copy it onto your micro:bit. If
you have a battery pack for the micro:bit you can
plug it in and show your friends away from your
computer. This is because when you download
your program from the Javascript Blocks Editor,
it is turned into something that your micro:bit
can understand and run. Your program gets
stored on a little bit of memory on the micro:bit.
Unless you delete it, it’ll still be there years from
now. Have a go at trying out some of the other
blocks in the Javascript Blocks Editor and watch
their effect on the simulator.

AVATAR 65
scuttle BOT
In this project, we will use some off-the-shelf motors, known

as continuous servos, and a little bit of programming to have a

cheeky-looking robot scuttling about in no time.

2 continuous rotation 1 pair of googly eyes


components

servos 5 3mm screws with nuts Snapshot


1 metal tin (e.g. a mini (8mm) (e.g. socket head) Many of our previous
survival tin) 1 roll of double-sided robots used small
1 AAA switched battery adhesive foam tape motors to provide
holder for BBC micro:bit 1 BBC micro:bit motion. They were
5 ring electrical crimp 1 roll of insulation tape easy to put together
terminals (red, 3.2mm) as they only required
1 AA 4.5-volt battery a battery, a motor
holder with switch and a little bit of
wire. The Scuttle
soldering iron with stand terminal crimping tool Bot is a bit more
tools

solder (lead-free) marker pen complex, but if you


Allen key (for 3mm square needle file follow the step-by-
socket head) superglue step instructions,
wire strippers mobile phone or tablet you’ll soon take your
drilling vice with Bluetooth LE skills to the next
rotary multi-tool connectivity level.

SCUTTLE BOT 67
Motors that are to be controlled from an electronic device
like the BBC micro:bit generally require additional pieces of
electronic circuitry to be able to switch them on and off, and
to change their direction. In this project, we will use a special
type of motor that is capable of precise movements – the
servo motor.

Clamp the
metal tin into
the drilling vice and position A
one of the continuous
rotation servos about a third
from the end (A). Mark the
position of the edges of
the servo on the tin using
a marker pen. Put a cut-off
disc into the rotary multi-
tool and, using the markings
as a guide, cut out a box to
allow the servo to fit into the
metal tin (B). Take care not
to make the cut-out too big
as the ‘wings’ of the servo
will be used to secure the
motor into place. Repeat this
step for the opposite side of
the tin. We also need to make B
a small square-shaped hole
in one of the top sides of the
survival tin – this should be
approximately 1cm (1/3in)
wide.

68 HOME ROBOTICS
2

B
A

We need to modify the terminals on


the servos to make them compatible
with the connectors on our BBC micro:bit. First
snip away the existing terminals (A) and use a
pair of wire strippers to expose some bare wire
from beneath the insulation. Slip a ring terminal
connector over the wire and, using a crimping
tool, make a crimped connection (B). Repeat this
for all of the wires for each of the servos. If you want,
you can use a single crimp for each of the positive (red)
and negative (brown) wires, just make sure that the orange
wires have their own individual connectors. (If you are going
to do this, you must do step 3 first.)

Insert a servo into each of the


sides of the survival tin and use
a blob of adhesive on the servo ‘wings’ to
form a strong bond with the tin.

SCUTTLE BOT 69
Servos need a 4
comparatively
large amount of current
(more than our BBC micro:bit
can provide) and roughly 5
volts to operate correctly.
We need to modify
a battery box so
that we are able to
run both the servos
and the BBC micro:bit at
the same time. First cut off
the connector from the AAA
battery box and use a pair of
wire strippers to expose a bit
of the bare wire on each of
the wire ends. Thread the
pair of wires
through the hole of the 4.5-
volt AA battery box.

The metal terminals


inside the battery box
can be lifted using a small flat-
head screwdriver. Lift up the metal 6
terminal that the existing red
coloured cable connects
to. Using a soldering iron,
solder the additional red
cable to this connector (the
positive terminal).

70 HOME ROBOTICS
The remaining black cable needs
to connect to the middle spring
connector. It is possible to raise each of the
metal terminals slightly to allow this cable
to run along the bottom of the battery
compartment. By soldering the black A
cable to this connector, we are
connecting two AA batteries in
series to the power cable for the
BBC micro:bit. AA batteries measure
roughly 1.2 to 1.5 volts each, so two of
these in series will produce approximately
3 volts which is what the micro:bit needs to
operate. The other existing connector will
supply 4.5 volts to our servo motors. Solder
the black cable to the rear of the middle
spring terminal (A). As this has not been
soldered before, you might find it easier to
metal a little bit of solder onto this terminal
first, before trying to solder on the wire. The
finished job should look like this (B).

SCUTTLE BOT 71
8 8

Insert AA batteries into the battery box and close the lid. Now
apply a bit of double-sided adhesive tape to the top of the
metal tin and use this to attach the battery box to the tin. The battery box
wires should thread through the hole that we made earlier in the metal tin.

9 Glue the pair


of googly eyes
onto the unmarked side of
the metal tin.

72 HOME ROBOTICS
Open the 10
lid of the tin
and, using the
crimping tool, crimp a ring
connector onto each of the
exposed wires of the battery
box.

We are now ready to wire up our Scuttle Bot.


First secure the red (4.5-volt) cables together
using a 3mm nut and bolt through the ring connectors
(A). Wrap the bare metal of these connectors in a
bit of insulation tape to prevent accidental contact
with other parts of the robot. Connect the black
connector and the two brown cables of the
servos to the ‘GND’ pad of the BBC micro:bit.
A

11

SCUTTLE BOT 73
Finally connect each of the orange cables
from the servos to pad ‘0’ and ‘1’ of the
micro:bit respectively.
The hardware for our Scuttle Bot is now complete.

74 HOME ROBOTICS
13

We are now going to write a blocks under each of the ‘on gamepad button
basic program for our Scuttle A …’ blocks. One of the blocks under each
Bot to allow it to be controlled from a of the ‘on gamepad button A …’ needs to be
mobile phone. To enable the Bluetooth changed to P1 – this is because we want to
set of blocks, click on the ‘Add Package’ control both of our servo motors.
tab in the ‘Advanced’ options and choose Finally, we need to adjust the values
‘Devices’, accept the warning that we will of the ‘servo write pin … to 180’ blocks.
have to remove the ‘radio blocks’. Now Continuous rotation servos stop moving
click on the ‘Devices’ tab and drag two ‘on when set to 90; values below this to ‘0’ move
gamepad button A down’ blocks into the the servo in one direction and values above
programming area. Change one of the blocks this to ‘180’ move the servo in the opposite
to ‘on gamepad button A up’. direction. Set the values to ‘0’ and ‘180’ for
Now drag four ‘servo write pin P0 to each block beneath ‘on gamepad button A
180’ from the ‘Pins’ tab and put two of these down’ and set the value of the two blocks
beneath ‘on gamepad button A up’ to ‘90’.

14

Drag a further two ‘on gamepad button A down’ blocks


to the programming area and change these to button ‘B’.
As before, drag two ‘servo write pin P0 to 180’ blocks underneath
each of these and adjust them as shown.

SCUTTLE BOT 75
15

Again, drag a further two ‘on gamepad button


A down’ blocks to the programming area and
change these to button ‘C’. Drag two ‘servo write pin P0 to
180’ blocks underneath each of these and adjust them as
shown.

16

Finally, drag a further two ‘on gamepad button


A down’ blocks to the programming area and
change these to button ‘D’. Drag two ‘servo write pin P0 to
180’ blocks underneath each of these and adjust them as
shown. Phew! No more blocks needed.
Download the program to the BBC micro:bit – make sure
that the battery box is switched off and that the micro:bit
power cable is unplugged before you do this.

76 HOME ROBOTICS
How it Works
Unplug your BBC micro:bit from your computer and plug in the battery connections.
To control our Scuttle Bot we need two applications on our tablet or mobile phone –
the official ‘micro:bit’ app and the ‘micro:bit Blue’ app by Martin Woolley. Within the
official ‘micro:bit’ application, follow the instructions to pair your micro:bit with your
mobile phone or tablet. Once you have successfully paired your device, you can
now load the ‘micro:bit Blue’ application and choose the ‘dpad’ application. The left
gamepad should now let you control your Scuttle Bot. And away you go!

SCUTTLE BOT 77
CATApult bot
For this project, we will use an internal feedback loop to control

the firing ‘pin’ of a small catapult. Combined with a simple

movement sensor, we can make our catapult fire automatically

upon unsuspecting intruders.

1 servo 1 BBC micro:bit


components

1 project box 1 roll of insulation tape SNAPSHOT


1 modified battery box 1 PIR sensor The Scuttle Bot used
(see Scuttle Bot) 1 servo tester continuous rotation
1 drinks bottle cap 1 piece of cardboard servos to let our
6 ring electrical crimp selection of lollipop robot move about
terminals (red, 3.2mm) sticks under our command.
5 3mm screws with nuts rubber bands Normal servos are
(8mm) (e.g. socket head) interesting devices;
you can make them
move to different
Allen key (for 3mm socket head) positions and an
tools

wire strippers internal circuit board


drilling vice and sensor ensures
rotary multi-tool that they move to,
terminal crimping tool and remain at, that
marker pen position – this is
superglue known as an internal
feedback loop.

CATAPULT BOT 79
1

Cross two lollipop sticks to form Using five lollipop sticks, form a
an ‘X’ shape and wrap an elastic square shape (with two lollipop
band around the junction to secure the sticks sticks on one side). Use elastic bands
in place. Repeat this step with a second pair to secure each corner of the square – it
of lollipop sticks. helps to first wrap the elastic band around
each end of the stick and then around both
stick ends.

80 HOME ROBOTICS
Place your pairs of ‘X’ lollipop
sticks on each side of the square
and wrap an elastic band around their ends
to join them as illustrated.

Raise the pairs 4


of ‘X’ lollipop
sticks and use two additional
sticks to brace them. One
stick should be fixed in the
internal part of each ‘X’ and
another should brace the
bottom part of the frame.

CATAPULT BOT 81
Glue the cap of a plastic drinks bottle onto a lollipop stick to
form a firing arm. Install the firing arm on the catapult – the
bottom part of the lollipop stick needs to be placed in front of the stick
bracing the bottom part of the main frame. The top of the stick, near the
drinks bottle cap, needs to be positioned behind the lollipop stick that braces
the top part of the main frame. Now loop a rubber band around the bottom
of the firing arm and stretch this to the back of the catapult. Glue the entire
frame onto a piece of cardboard.

82 HOME ROBOTICS
Attach the servo to the servo 6
tester and plug the tester into
a 5-volt power source. Select the ‘neutral’
mode on the tester so that the servo’s arm
moves to the ‘90’ position. If you do not
have a servo tester, you can find this position
by rotating the actuator arm to each of its
extremes and then moving the arm to the
middle point.

7 Unplug the servo from


the servo tester and
cut away the connector using snips,
then expose a little bit of wire using
wire strippers. Crimp a set of ring
electrical crimp terminals to each of
these bare servo wire ends. At the
same time crimp a set of terminals
to three additional wires (usually
supplied with your PIR sensor). This
will let us connect our servo and
sensor to our BBC micro:bit.

Clamp the project


box into the vice
and use a rotary multi-tool
to cut out a hole for the
PIR sensor in the lid. Also
create two smaller holes
in the front and back of
the box, through which we
can thread our battery and
servo wires.
8

83
We are now going
E A
to connect the
catapult pieces. Install the
+
PIR sensor into the lid of the
box and thread the battery and
servo cables through the holes
that we just made. Now connect
the red cable from the servo
to the red lead that is coming
in from the 4.5-volt battery
box (A); use a nut and bolt to
secure these in place and wrap B
a bit of electrical insulation C
tape around the connection to
prevent it from touching other D
parts of the robot. 9
Now tie the black and brown cables
from our servo, PIR sensor and battery box
to the ‘GND’ pad on the BBC micro:bit (B).
Connect the power cable (C) from the PIR
to the 3V pad on the BBC Microbit. Finally,
connect the yellow middle cable of the PIR
sensor to pad ‘0’ (D) of the micro:bit and the
orange cable from the servo to pad ‘1’ (E).

KEY
A 4.5v
B GND
C 3V
D PIR Signal
E Servo Signal

10

84 HOME ROBOTICS
11

Assemble the Create a new variable in the BBC micro:bit IDE


catapult by by clicking on the ‘Variables’ tab and selecting
fitting the lid on the project the ‘Make a Variable’ option. Call the new variable ‘Armed’.
box and glue the servo to Now drag a new ‘set item to 0’ block beneath the ‘on start’
the catapult. The ‘neutral’ block and change ‘item’ to ‘Armed’. Drag a ‘servo write pin
position of the servo should P0 to 180’ block (from the ‘Pins’ tab) beneath this and set the
hold back the firing arm. We value to 90 , change the pin from ‘P0’ to ‘P1’. This means
are now ready to get on with when we power on our BBC micro:bit it will tell the servo to
the programming. move to its ‘neutral’ position.

12

We want a way to arm our catapult so that it doesn’t fire as


soon as we turn it on. To do this, drag a ‘on button A pressed’
block to the programming screen (from the Input tab). Drag a ‘pause (ms)
100’ block beneath this (from the Basic blocks tab) and set the value to
5000. This will mean our program will wait five seconds before executing
the next statement. From the ‘Variables’ tab drag a ‘set item to 0’ block
and place this beneath our wait statement. Change the variable name
from ‘item’ to ‘Armed’ and change the value to ‘1’.

CATAPULT BOT 85
13 Drag an ‘on pin P0
released’ block to
the programming screen (the
block can be found in the ‘Input’,
‘More’ tab). This means when
the state of that pin changes, our
BBC micro:bit will immediately
execute the blocks nested within
that statement.

86 HOME ROBOTICS
14
Brainwave
It’s possible to modify
this program with some
of the blocks we used
for Scuttle Bot. With a
little bit of ingenuity,
you can control the
catapult from your
mobile phone.

Drag an ‘if then’ block to


the programming screen and How it Works
connect it to the ‘on P0 released’ block (the Unplug your micro:bit from your
block can be found in the ‘Logic’ tab). This computer and plug in the battery
new block will check to see if our micro:bit connections. Pull back the firing arm
has been ‘Armed’. To do this, drag from the and hold it back with the servo arm.
‘Logic’ tab a ‘0 = 0’ block and place this after When you are ready, press the ‘A’
the ‘if ’ part of our ‘if then’ block. Now from button on the micro:bit to arm the
the ‘Variables’ tab drag an ‘Armed’ block to catapult. You now have five seconds
the screen and replace one of the ‘0’s with to take cover! After this time, if the
this block. Change the remaining ‘0’ to ‘1’. PIR sensor detects any movement
Finally drag a ‘servo write pin P0 to 180’ it will immediately tell our servo to
block (from the ‘Pins’ tab) and nest this after move its position so that it no longer
the empty ‘then’ statement. holds back our firing arm – bombs
Our program is now ready to download away!
to our BBC micro:bit.

CATAPULT BOT 87
GARDEN GUARDIAN
In everyday life I’m not much good at keeping my house plants alive

because I always forget to water them. However, robots are brilliant

at doing mundane, everyday tasks without fail, so perhaps we can

harness our robot-building skills to solve this problem.

1 metal tin (e.g. a mini 3 ring electrical crimp


components

survival tin) terminals (red, 3.2mm) SNAPSHOT


2 sprung ballpoint pens 5 3mm x 5mm nuts and For this robot project
1 large toggle switch bolts we will use an
2 googly eyes 1 soil hygrometer sensor inexpensive sensor
1 BBC micro:bit (for Arduino) and a little bit of
1 AAA switched battery 1 roll of electrical programming to give
holder for micro:bit insulating tape our robot the ability
(with batteries installed) to watch over our
indoor plants and to
alert us when they
rotary multi-tool safety spectacles need watering.
tools

(Dremel) needle file (flat)


engineer’s pliers small flat-head
drill vice screwdriver
crimping tool multimeter with
wire strippers continuity mode (useful
superglue or glue gun to have)
marker pen

GARDEN GUARDIAN 89
It’s common to use a variety of sensors to allow a robot
to respond to changes in its local environment. In this
project, we will use a sensor that allows our robot to
detect the amount of moisture that is present in soil –
a hydrometer sensor

Place the resistive soil moisture sensor on the


back of the metal tin. Use a marker pen to trace BRAINWAVE
the outline of the hygrometer sensor (A). Extend the outline Make sure that you
onto the short side of the metal tin (B). use a permanent
marker pen on the tin
or else your hand is
likely to rub off the
marks that you make.

90 HOME ROBOTICS
2 Lay the metal tin flat in a drill vice and
ensure that it is held tightly. Insert a cutting
disc attachment into your rotary multi-tool. Put on
your safety spectacles and plug in the rotary tool.
Using the cutting disc, cut a small slot into the
metal tin for each of the legs of the hygrometer
sensor – be extremely careful as cutting discs can
shatter or slip. Don’t put too much pressure on the
tool while it is cutting (lighter passes are better). It
is normal for sparks to be produced while you are
cutting into the metal tin. Once you have made the
holes, use a flat needle file to deburr the edges.

3 Test that the legs of the


hygrometer sensor will fit
through the holes that you just made. If they
do, use the marker pen to mark the sensor’s
mounting holes onto the tin.

Put the metal tin back into the


vice and ensure that it is held
securely. Swap the rotary cutting disc for a
small drill bit in the rotary multi-tool. Drill two
pilot holes on each of the markings you just
made. Once you have produced these pilot holes,
enlarge them with a 3mm drill bit.

GARDEN GUARDIAN 91
5
While the metal tin
is still secured in
the vice, use the marker pen to
trace around the battery holder’s
power connector – make the
tracing on the opposite side to
the sensor holes.

Re-insert the cutting disc into


the rotary multi-tool and cut
out a small square hole so that the battery
holder’s power connector will pass through.
Remember, only press lightly on the tool
and always wear your safety glasses. Once
you have made the hole, deburr it using the
needle file.

Insert the hygrometer sensor 7


into the metal tin and align the
mounting holes. Use the 3mm nuts and bolts
to secure the sensor into the metal tin.
You could coat the inside of the tin with
electrical insulating tape to help to prevent
the metal tin from damaging the electrical
components.

92 HOME ROBOTICS
A
B

The hygrometer sensor should have come with


some prototyping wire connectors; however, BRAINWAVE
they are not compatible with the terminals on the BBC If you have access
micro:bit But don’t worry, we roboticists are clever folk. We to a multimeter, use
just need to modify them. First, strip away three wires from the continuity mode
the bundle and snip off one end of their connectors using to check that there
the engineer’s pliers (A). Use the wire strippers to expose the is a good electrical
bare copper wire. Slip one of the wires through an electrical connection to each
crimp terminal, the insulation should be inside the crimp’s end of the wires.
shroud with some wire exposed near the ring side of the
crimp. Using the crimping tool, crimp the connector – to
do this, put the electrical crimp into the appropriate jaw on
the crimping tool and then press down hard to squeeze the
crimp (B). The deformed crimp should hold onto
the wire tightly. Repeat this step for the
other connectors.

GARDEN GUARDIAN 93
Dismantle both Take the large 10
ballpoint pens toggle switch
to salvage their springs. and glue two googly eyes
Springs are extremely onto the front; hot glue or
useful devices as they can superglue is perfect for this.
apply a constant force to an The googly eyes can be glued
object; however, our Garden however you like; personally
Guardian doesn’t need them I like one of the googly eyes
for that. Instead, gently pull to be smaller than the other.
on each spring to make it a It looks wackier.
little longer. Put the springs
to one side.

11 11

A B

Then glue the toggle switch you trouble, use a little bit of sandpaper to
head to the top of the metal roughen the metal surfaces. Now flip the
tin (on the side opposite the moisture robot over and glue the battery holder onto
sensor). Attach each spring onto the sides its back (B). Our robot is now complete, but
of the metal tin (A). If the parts are giving we still need to program its brain.

94 HOME ROBOTICS
Start a new project in the 12
JavaScript Blocks Editor for
the BBC micro:bit. To start our program,
let’s drag a ‘show icon’ block underneath
the existing ‘on start’ block. The ‘show icon’
block can be found in the ‘Basic’ blocks
tab. Edit the ‘show icon’ block by clicking
on the default dropdown menu and select
whatever image you wish to use. I chose a
heart because I want my micro:bit to give a
representation of my plant’s health.

Our hygrometer sensor stops 13


outputting a digital signal
whenever the soil moisture drops below
a set level. For our micro:bit to be able to
detect this we need to drag in an input block.
Click on the ‘Input’, ’More’ blocks tab and
drag the ‘on pin P0 released’ block onto the
screen. This block will execute the code that
is connected to it whenever it detects a low
signal on the pin P0.
As our Garden Guardian’s purpose is to
warn us when our plants need watering, let’s
drag in some blocks under this to grab our
attention. First drag in another ‘show icon’
block and connect it underneath the ‘on pin the ‘Add Package’ tab and choose ‘devices’.
P0 released’ block, we can set the image to Accept the warning that we will have to
anything we like. remove the ‘radio blocks’. Now click on the
We could finish there, but let’s also get new ‘Devices’ tab, and drag and connect the
the Garden Guardian to contact our mobile ‘raise alert to display toast’ block underneath
or tablet. This requires Bluetooth to be our existing ‘on pin P0 released block’. Toast
available on our mobile or tablet device and is not really relevant to our plants, so click
for the micro:bit app to be installed. If you on the ‘display toast’ tab and choose one of
have this, in the JavaScript Blocks Editor click the alarms.

GARDEN GUARDIAN 95
Currently, our Garden Guardian will 14
display a small heart whenever our
plant needs watering – but what if I then water
my plants? Currently the small heart will remain.
To fix this, drag in a ‘on pin P0 pressed’ block
from ‘Inputs’ tab. This block will execute code
whenever the signal goes high on the pin P0, so
let’s put another ‘show icon’ block underneath this.
We will change its picture, so that it matches the
one that we have under the ‘on start’ block.
The software is now ready for our Garden
Guardian, so download the program that we
have just made onto the micro:bit by clicking
the ‘Download’ button and copying the file onto
it. If you are on a PC, this should be appearing
as a USB mass storage device – if you are on a
different platform, follow the guidance provided
by the BBC micro:bit website on how to do this.

How it Works
Switch on the battery pack and put the Garden Guardian into a plant pot. Open
the front of the tin and use a small flat-head screwdriver to adjust the little dial
(potentiometer) on the hygrometer breakout shield. This dial adjusts the threshold
at which the shield will emit a digital signal; keep adjusting this until the screen
changes from the full heart to the small heart picture. When this happens, irrigate
the soil with a little bit of water – you should find that the alarm stops and the LED
display switches back to the full heart picture.
This happens because the electrical resistance of the probes changes
depending on the amount of moisture in the soil. The small breakout board that is
connected to these probes is looking at the resistance and comparing it against a set
value (selected using the little dial). Depending upon the output of this comparison,
the breakout board may or may not emit a signal on the ‘digital out’ pin.

96 HOME ROBOTICS
Our Garden Guardian is
nearly ready to protect our
plants. So, let’s finish its assembly. Attach
the breakout shield (A) that comes with
the hygrometer sensor to the sensor
probes by using the spare
prototyping cables (it’s the
side with only 2-pin headers). On the other
side, attach a crimped cable to each of
the terminals labelled: VCC, GND (B) and
DO (C). The ring electrical crimp should
be bolted to the micro:bit terminals. VCC
goes to the terminal labelled ‘3V’ (D),
GND goes to the terminal labelled ‘GND’,
and DO goes to the terminal labelled ‘0’
(see diagram below).
Put the micro:bit into the metal tin
and attach the battery power connector
wire to the battery input connector on
the micro:bit (it’s the connector on the
top right). Our robot is now complete and
ready to protect our indoor plants.

B key
A Breakout shield
A B GND wire
C DO
D 3V/VCC wire

C D

GARDEN GUARDIAN 97
Walking robot
For our final intermediate project, we will construct a basic

walking robot. It demands a bit of ingenuity, but once up and

running we will be giving Asimo (an expensive robot built by

Honda) some healthy competition in no time.

4 servos
components

1 modified battery box (see Scuttle Bot) with Snapshot


AA 1.5-volt batteries installed For humans, walking
6 ring electrical crimp terminals (red, 3.2mm) is an instinctive
5 3mm screws (12mm length) with nuts (socket head) action to which we
1 BBC micro:bit don’t give a second
1 roll of insulation tape thought. However,
1 servo tester for robots, walking
2 dog tag blanks is very difficult. In
recent years, some
very expensive robots
Allen key (for 3mm socket head) have been built that
tools

wire strippers can walk, run and


helping hands even climb stairs –
Sugru mouldable glue or a lighter but despite all of
terminal crimping tool their advances, they
superglue still have a habit of
toppling over!

WALKING ROBOT 99
1

2 Plug each of the servos into


the servo tester and set them to
their ‘neutral’ position. If you don’t have a
servo tester, it is possible to find this position
by moving the servo arm to each of its
extreme positions and then moving it back
to the middle point.

Carefully remove the servo arms


from the servos and grip one in
a pair of helping hands. Cut off the end of
the arm so that the part that connects to the
servo only remains.

100 HOME ROBOTICS


Remove this piece (A) from the helping hands 3
and replace it with a second arm (B). We now
want to attach the piece that we just cut off to this servo arm
to form a joint for the legs. There are two ways to do this:
1) Mix some Sugru (a readily available mouldable putty)
and sculpt a joint. You can temporarily secure the pieces
with a small amount of superglue until the Sugru hardens.
2) Carefully use a gas lighter to melt the two pieces
together. This method is inexpensive and creates a very
strong bond. You should ask an adult to do it for you. Create
two separate leg joints using
one of the above methods.

Attach the leg joint to two of the


3 servos. the positioning of this is
critical. The bit we originally cut off will join to
a servo to form the ‘hip’ of the walker robot (A)
B and the second servo will actuate one of the
feet (B). Repeat this step for the second pair of
servos – bear in mind that the two ‘feet’ servos
should mirror each other.

4
B

4
5

Cut off the Glue the feet servos to the


connectors to dog tag blanks using some
the servos and crimp on ring superglue. You should place the servos
electrical crimp terminals. near one end of the dog tag blanks
To save on connectors, all of – the servo arms face
the red leads can connect to towards the back part
one terminal. Similarly, all of of the foot. The feet
the brown leads can connect should be able to 6
to a second terminal. The keep themselves
yellow leads of the hip servos upright, if not
can also be joined together, adjust the balance
but the remaining two yellow and weight of
wires of the feet servos must each foot. Put the
have their own individual servo motors to
crimped connections. one side.

102 HOME ROBOTICS


Attach the
bolts to each
of the terminals on the
BBC micro:bit. Loosely
tighten the nuts to keep the
bolts aligned. Put a bead of
superglue along the bottom
of the modified 4.5-volt
battery pack and attach the
end of the screw caps to the
battery pack. The micro:bit
serves as a jig to keep the
bolts correctly spaced.

WALKING ROBOT 103


8
Glue the hip
servos to the
battery box. The wires
coming from the hip servos
should face away from the
BBC micro:bit.

It’s now time


to attach the
electrical connectors. First
join all of the brown and black
wires to the ‘GND’ pad on the
9
micro:bit. The yellow wires for
the hip servos should connect
to pad ‘0’ and the remaining
two yellow wires for each of
the feet should connect to pad
‘1’ and ‘2’ respectively.
Finally tie the red cables
together and cover them with
a bit of insulation tape to
prevent them touching other
components.
Our physical robot is now
complete – now to program it.

104 HOME ROBOTICS


10 When our program
starts, we want all of
our servos to move
to their ‘neutral’ position. We do
this by using the value ‘90’ with a
‘servo write pin’ block. Because it
takes time for servos to move from
one position to another, we need
to use ‘pause’ blocks to let our
robot physically move. To begin
our program, use ‘servo write pin
P0 to 180’ blocks to set our servos
11 to their home position. Adjust the
values from 180 to 90 and make
sure that each ‘servo write’ block
is either setting ‘P0’ or ‘P1’. Add
‘pause’ blocks (from the Basics tab)
and set them to 1000ms as shown.

We now need to do the same for our other servo motor. Again,
use a ‘servo write pin P0 to 180’ block and adjust it to refer to
‘P2’. You will notice that instead of ‘90’ I have chosen ‘75’ as the value to
write to the servo. In your case, you might start with the value ‘90’, but if
on start-up you find that your walker immediately tips over, be prepared to
tinker with this value.
Follow this block with a ‘pause’ block and set its value to 5000 – this way
our robot should wait for five seconds before attempting to walk; giving us a
chance to make sure the initial setup of our walker is right.

WALKING ROBOT 105


12 As with the start of
our program, each
motor movement must be followed
by a ‘pause’ statement to provide
the servo motors adequate time
to complete their movement.
Study the pictures to see how the
‘pauses’ are built in. I have chosen
‘750’ as a good middle ground to
provide the motors time to move,
but not too long to get boring!
As the picture shows, insert a
‘servo write pin P0 to 180’ block
and set its value to ‘100’. This
block should cause the hip to
move.

13 Following this block,


we now want to move
both of our feet servos at the
same time – this way our robot
will unbalance itself and start to
move forward by shifting its feet to
take a step. Again use ‘servo write
pin P0 to 180’ blocks for this and
set them to ‘P1’ and ‘P2’. I have
chosen the values ‘110’ and ‘95’,
followed by a ‘pause’ statement.

106 HOME ROBOTICS


14 We now want our robot
to put its feet back down.
To do this we need to set the hip
position back to ‘90’.

15 Now we’ll take


another step, but this
time with the other foot. So, use a
‘servo write pin P0 to 180’ block
to move the hip; I set the value
‘80’ this time to move the hip in
the other direction.

WALKING ROBOT 107


16 Again, we will
move both
feet at the same time, so
use ‘servo write’ blocks and
set their values to ‘55’ and
‘70’ – this will move the feet
in the opposite direction.
Finally return the hip to its
neutral position by setting its
position to ‘90’.
It’s taken some time
but now our program is
complete.

brainwave
If the walker is really
struggling to maintain
its balance, even
when it’s turned off
and the servos are in
their neutral position,
a small weight on
each foot can help to
counterbalance it.

108 HOME ROBOTICS


How it Works
While the battery pack is switched off and the cable unplugged, download the
program to the micro:bit. Place the walker on a flat surface and switch on the power
to the motors. When you are ready, plug the battery pack into the micro:bit’s power
connector. The servo motors should move to their home position (with a bit of luck
this will be roughly the same as their current position). If the robot immediately
topples over, adjust the values in the start-up part of the program and repeat. If it
stays upright, within the next five seconds our walker should attempt to take its first
step into the big wide world. Just like a child, this will probably be quite unsteady,
so be ready to catch it! You will need to gradually adjust the values to the servos at
each stage to help find the right position to maintain the walker’s centre of gravity.
Don’t be discouraged if it keeps falling over, even the best walkers have to learn step
by step. Once tuned, your robot should happily (albeit somewhat haphazardly) walk
around all day long.

WALKING ROBOT 109


03
SMART MAKES
ROBO WARRIOR
CNC WRITER
MARS ROVER

These advanced projects introduce you to the world of

programming. Follow the simple instructions to create

some truly impressive home-made robots.


Robo warrior
A few years ago a new sport was born – robot combat. The idea was

that contestants would build large fighting robots and let them battle it

out in an arena. This may seem technically very difficult to do, but this

project shows you how to build a robo warrior from simple components.

1 9g servo 1 expired gift or credit card


components

2 continuous rotation servos 1 laser-cut panel or piece of thick


2 wheels for servos cardboard (see diagram page 114)
1 6-volt 210mAh ultra-miniature 1 Hobby King HK-T6A V2 transmitter
1/2AAA NiMH battery with Futaba 1 Hobby King HK-T6A V2 receiver
connector 1 Hobby King 2.4Ghz 6Ch Tx USB cable
1 R/C switch battery receiver on-off (to download firmware)
Futaba JR connector leads 8 AA batteries

drill vice
tools

rotary multi-tool with cut-off disc Snapshot


hot glue gun For this project, we will put together
marker pen a simple, cheap and lightweight
flat-head screwdriver fighting robot that can be modified
and upgraded as your skills develop.

ROBO WARRIOR 113


In recent times electronic parts have been getting cheaper
and simpler to work with, and so it has become much easier Brainwave
to construct these kinds of fighting machines. While the It is important to
battle bots that you see on TV shows like Robot Wars are note that, while
extremely advanced, you can still participate in the sport by fun, combat robots
joining one of the smaller leagues. can potentially be
In the UK one of the classes is known as ‘Antweight’ dangerous – so
for which the weight limit is 150 grams (5¼ oz). There are please use caution
still quite a few rules to observe (they can be found on the if you decide to
Internet), but this weight class is much more approachable construct your own.
for the beginner, and some of the robots that people have
built are just as devastating.

Robot base template We first need to produce the


base for our robot. If you have
65mm (2½ inches)
access to a laser cutter, cut the following
D DXF file (https://github.com/danielknox/
Robot_Warrior) out of 3mm acrylic or
wood. The file is calibrated in millimetres –
A A the red lines represent cuts and the blue lines
engravings. If you don’t have a laser cutter,
B
85mm (3¹/³ inches)

not to worry. Just transcribe the drawing


E (left) onto a piece of stiff card and cut it out.
C

Key
A Continuous rotation servo
B HK-T6A receiver
50mm (2 inches) C NiMh battery
D R/C switch
E Holes for zip ties

114 HOME ROBOTICS


2 One of the important rules for
antweight robots is that they
must have an accessible removable link (a
piece of wire that can be detached) or an
On/Off button that can disable the robot.
We will use a simple R/C switch to cut all
power to the electronics. Attach the R/C
switch to the rear of the plastic plate using
a hot glue gun (annotated D on the diagram
opposite) – the switch should face outwards.

We are now going to attach the servos that will provide our robot
with motion. To do this, attach both continuous rotation servos
to the back of the plastic plate (annotated A on the diagram opposite) using
hot glue. The servos should sit on either side of the R/C switch. Continuous
rotation servos are simple to work with, but many more experienced
roboteers use small metal gear motors with higher rpms (they make the
robot move faster).

ROBO WARRIOR 115


4

Now it’s time to build our robot’s deadly weapon. Attach a


servo horn to the 9g servo and check its rotation. We want to
place the servo facing upwards with the horn able to move between a 10
o’clock position and a 2 o’clock position. Once you have the horn in the right
spot, hot glue the servo in place near the front of the right-hand side servo.

Clamp the gift


or credit card
in a drill vice and mark the
location for a small slot
near the top centre part of
it. Using a rotary multi-tool
with a cut-off blade, create
a small slit in the card that
is just wide enough for the
servo horn to fit through.
5

116 HOME ROBOTICS


A

Slip the plastic card over the servo horn


of the combat robot. Rotate the servo B
horn with the card in place until the horn points
away from the robot; the card should point up
towards the sky.
Once you have aligned the card, hot
glue it in place; a little dab of glue on the
underside of the card helps to tack it in
place (A). You can then secure it firmly with
a nice dollop of glue on the top (B).
When you activate the servo, the credit
card part of the robot will flip up. This will allow
you to topple opponents onto their backs when you
have manoeuvred the Robo Warrior close enough to
them.

ROBO WARRIOR 117


7

The RC receiver is a bit big for our purposes


because of its plastic casing. Carefully remove
the casing using a flat-head screwdriver to expose the
small electronic board.

Continuous rotation servo

Channel 2

Channel 1 - Weapon servo

Channel 3
8

Referring to the diagram on page the continuous rotation servos into channels
114, position the NiMH battery 2 and 3 of the receiver board, the 9g servo
(annotated C) and receiver board (annotated into channel 1 and finally the output of RC/
B) on the plastic base and secure these in switch cable into row 7 – this was labelled
place with zip ties (annotated E). If you are BAT when the casing was in place. Tidy the
using a bit of plastic, you can hot glue the wires up into bundles using zip ties.
receiver and battery pack in place. Now plug

118 HOME ROBOTICS


8

Attach the wheels to your robot;


it’s up to you what diameter
wheels you use – I prefer small diameter
ones. Once the wheels are secured, our
robot is now physically ready to fight.

ROBO WARRIOR 119


Continuous rotation servo 10
Channel 2

Channel 3 - Weapon servo

Channel 4

By default, the steering on our to reprogram the transmitter, using a


robot is controlled by the left programming cable, to adjust the controls to
and the right sticks of the remote control. a different set-up; this is known as mixing.
Some people find this type of steering First we need to physically change the wiring
a bit unnatural, especially when used in on our receiver – the continuous rotation
conjunction with the flipper, as it can be servos should move from channels 2 and 3
difficult to steer and operate the weapon to channels 2 and 4. The servo for the flipper
at the same time. However, it’s possible should now move to channel 3.

10

120
11

We need to install the drivers for the Hobby


King 2.4Ghz 6Ch Tx USB cable before we plug
it into a computer. Download and install the Silicon Labs
CP210x USB to UART Bridge drivers (http://www.silabs.
com/products/development-tools/software/usb-to-uart-
bridge-vcp-drivers); you may need to restart your computer
once these drivers have installed. You can now plug the
adapter cable into your transmitter, turn on the transmitter
and plug it into your PC. To check that the device has been
detected correctly on Windows computers, open ‘Device
Manager’ and look under the ‘Ports’ dropdown. If you see
the Silicon Labs CP210x USB to UART device listed, the
driver has installed correctly. Make a note of the Com port
number. On Mac (OSX), you still need to install the driver,
but you don’t need to check ‘Device Manager’.

ROBO WARRIOR 121


12

13

122 HOME ROBOTICS


14

The next steps only apply to Windows computers. If you


are on a Mac, you can use the program ‘TurborixConfig’
(http://www.zenoshrdlu.com/turborix/) to configure your controller. On
Windows install and open T6config (https://hobbyking.com/media/
file/824762106X399553X54.zip) and click the ‘Setting’ button. The ‘Serial
Setting’ dialog opens and from the dropdown box select the Com port that
matches the number you just noted down. Click OK.

Test that the controller has It’s a good idea to make a


successfully connected to your backup of the factory settings
computer by turning some of the sticks on before we modify them or write our own.
the transmitter – you should see the green Click ‘Save’ and enter a filename; for
bars in the T6config software also move. example, type ‘factory_backup’. Click ‘Open’
to save the file.

ROBO WARRIOR 123


15

We are ready to write our


new mixing settings to the Brainwave
transmitter. First download the mix file from Remember that even a relatively
(https://github.com/danielknox/Robot_ low-powered and simple robot can
Warrior/tree/master/Software) to your do extremely well in a fight – the
computer. Now in T6Config click ‘Open’ and secret is to become really well
then navigate to the directory containing the practised at knowing how to control
file that you just downloaded. Select the file and manoeuvre your robot (A, B).
and then click ‘Open’. You should now be Like David and Goliath, a small but
able to move the sticks on the transmitter. skilful fighter can take down even the
The right-hand stick should control the biggest and scariest opponents.
direction of channels 2 and 4, and the left-
hand stick should control channel 3.
You are now ready for combat!

124 HOME ROBOTICS


A B

How it Works
We are now ready to operate our tiny antweight
robot. First charge the NiMH battery using an
appropriate battery charger. Once charged, plug the
battery into the R/C switch input. When you are
ready to do battle, switch the robot on and turn on
your transmitter. Although our robot moves about
fairly slowly, it can push something quite powerfully
(C). The onboard weapon will help you flip over E
opponents (D), but it takes some skill to self-right
yourself with it if you turn over (E). At the end of
your fight or practice session, don’t forget to switch
off the robot using its R/C switch.

ROBO WARRIOR 125


CNC writer
CNC-enabled machines allow us to perform repetitive jobs at high

speed and with great precision. CNC (computer numerical control)

can seem a bit like magic at first, but building a computer-controlled

machine, and operating it, isn’t as hard as you might imagine.

M3 square head set bolts x 6mm Arduino Uno microcontroller board


components

(pack of 250) DFRobot dual bipolar stepper motor


M3 square head set bolts x 25mm controller for Arduino
(pack of 4) 9-volt power supply
M3 stainless steel plain nuts (pack 2 second-hand CDROM/DVD drives
of 250) 4 90-degree-angle L bracket
2 MakerBeam – 40mm (1½in) long 22 AWG wire (stranded)
black anodized beam small piece of acrylic
4 MakerBeam – 150mm (6in) long roller pen
black anodized beam

soldering iron
tools

lead-free solder Snapshot


snips All it takes are two reclaimed
3mm nut driver (5.5) CDROM/DVD drives, a controller
wire strippers board and some simple extrusion,
marker pen and we’ll have a cool-looking CNC
superglue machine put together in no time.
multimeter
flat-headed screwdriver

CNC WRITER 127


Most CNC machines use steppers/servos to
control their movement allied to some form
of gantry/rail system – accurately assembling
this can be quite hard. Luckily for us, mass-
production means there’s a ready-made system
conveniently to hand: old CDROM/DVD drives. A

Brainwave
CDROM/DVD drives can be easily
picked up at bootfairs for a few pounds
each; there’s a little bit of variation
between different brands, but all are
basically very similar.

We first need to salvage


B the motion drive from
our two CDROM/DVD drives.
This can be a little fiddly and is
unique for each brand of drive.
Essentially, undo all of the screws
in the drive. Remove the front face
of the drive, which is usually held
in place by plastic tabs (A). You
should now be able to open up the
drive and see inside. Remove all
the screws holding the daughter
boards and detach the ribbon
cables, held in place by small
plastic clips (B). With most of the
boards out of the way, you should
now be able to lift out the metal
motion carriage (C).
C

128 HOME ROBOTICS


Stepper motors are an pair will connect to the second winding.
interesting breed of motor – To identify the pairs, we will use a multimeter
unlike servos they do not have a feedback on the ohm (Ω) measurement setting. Using
system to find their current position, but the multimeter probes, test two of the
they have more control than standard DC solder contacts on the stepper motor. You
motors. They operate by rapidly pulsing should get an ohm readout from each of the
the windings of the motor, in a controlled contacts. What we are looking for is a value
manner. A stepper motor controller will do less than infinite, but more than 0 – this is
this complicated step for us, but first we because the contacts that are not connected
need to identify the pairs of coil windings to each other will read infinite resistance,
in the motor. whereas the contacts that are connected to
Most drives are bipolar motors, so two each other will get a small resistance reading.
of the contacts will connect to Once you have identified the two pairs,
one winding and the other label them (this becomes very
important later!).
3

Now that we 4
have identified
the pairs of windings, solder
wires onto each of the
contacts. You can solder
onto the ribbon cable if
you like, or directly onto
the motor solder joints. It
is important that the solder
joints and wires do not We will be assembling the CNC frame using
bridge – this can be a little aluminium extrusion. The particular type used
fiddly and it helps to have here is known as Makerbeam; which gives us a tiny 10mm
pre-tinned wires. Once the x 10mm profile; we will also use special square bolts and a
wires are on, it’s a good idea nut driver to tighten the components. Each CDROM/DVD
to label each cable with the drive is a little different, so you must first look carefully at
motor and pair number. each drive to work out how best and where to mount it to
the extrusion.
First slip two 25mm (1in) square bolts into a groove of a
150mm (6in) piece of extrusion. Secure these bolts in place
with a M3 nut. Repeat this step.

130 HOME ROBOTICS


5 Now mount one
of the drives to
this frame. This will form
the X axis. You will see in
the picture that I chose to
use two holes on the right-
hand side of the drive. For
the left-hand side, grip the
two original mounting points
between a pair of nuts. Once
you have found the best way
to mount the drive to the
top of the frame, tighten
everything into place.

6 7

We are now going to construct Use another L bracket to attach


the bottom frame of the CNC a 40mm (1½in) length of
machine. First use one of the L brackets to extrusion to the top piece of the extrusion.
attach two pieces of 150mm (6in) extrusion This will form the front part of the CNC
together. Also create a mirrored copy for the machine. As before, create a mirrored copy
other side of the machine. with the other piece of frame.

CNC WRITER 131


To form the
Y axis, attach
the second CDROM/DVD
drive to this bottom frame.
Just like the last frame, I’m
using a nut to grip the drive’s
mounting points (A). The
shape of this particular drive
means that it is supported
securely by the extrusion,
so you don’t need to worry
about adding additional
support.

132 HOME ROBOTICS


We are now going to mount it is in place, secure each side with a nut
both halves of the CNC and tighten using the nut driver. The entire
machine. Put a square bolt through each assembly needs to be very rigid, so check
of the remaining L bracket holes and slide the alignment of everything and make sure
the top part of the frame onto this. Once all is tight and secure.

CNC WRITER 133


10

Using superglue, stick a small We now need to mount a pen


piece of acrylic (A) to the to the top drive. To set the ‘Z’
moving part of the Y axis. Don’t worry if height (as we have no independent control of
you don’t have any acrylic – any small thick this), put a small piece of paper on the bed
piece of some scrap material to act as a bed and remove the cap from the pen. Position
will do just as well. the pen so that it just touches the paper and
begins to make a mark. Attach the pen to the
X axis with superglue, so that the pen is held
in exactly this position.

134 HOME ROBOTICS


11

12
It’s time to install the electronics
into our CNC machine. First
A mount the dual bipolar stepper motor
controller shield onto the Arduino Uno (A).
The sprung terminals should face towards
the USB connector on the Arduino Uno.

135
Attach the motor wires to the that step matters! One pair should go to the
dual bipolar stepper motor terminals marked 1A and 1B and the other
controller; the X axis (top drive) wires pair of wires should go to 2A and 2B. If you
should go to the terminals marked for the get these wrong, the motor will not move.
X axis and the Y axis (bottom drive) wires Never unplug the stepper motors from
should go to the terminals marked for the Y the driver when it is powered, this can
axis. Remember that we marked the pairs of damage the controller board.
windings near the beginning? This is where

136 HOME ROBOTICS


I mentioned earlier that the controller
board does the fancy pulsing
required to control the stepper motors. The
firmware put together for this machine uses
something known as micro-stepping to make
the stepper motor move a tiny amount on
each pulse (step). As we increase the amount
of micro-stepping, more steps are needed for
the motor to move the axis the same physical
distance. I’ve already configured this for you
in the firmware, but this means we need to make
sure that the CNC controller has been set to the right
micro-stepping mode. To do this, push the three dip
switches to the ‘on’ position; do this for each axis.
We’ve now completed the physical assembly of
our CNC machine.

CNC WRITER 137


15

It’s now time to upload the software to our


Arduino. Download the appropriate zip file from
the online website (https://github.com/danielknox/CNC-
Machine) and follow the included instructions to extract the
required files.
Open the Arduino IDE (Integrated Development
Environment) and click the ‘File->Examples’ tab. Choose
‘grbl->grblUpload’ from the menu list.

138 HOME ROBOTICS


16

We now need to make sure we


are compiling the software for
the correct type of Arduino board. Click
on the ‘Tools->Board:’ tab and choose the
‘Arduino/Genuino Uno’ option.

CNC WRITER 139


17

18

140 HOME ROBOTICS


Now click ‘Tools->Port’ and
select the ‘com’ port for the
Arduino Uno – you will need the Arduino
plugged into your PC for this to be detected.
There are probably only going to be a few
possible devices in this list; ignore Bluetooth
devices on Macs and COM1 on Windows.

We can finally upload the


software to the device. To do
this click on the icon that looks like a right-
facing arrow (if you hover over it you should
see an ‘Upload’ label appear). The Arduino
IDE will now compile the program and
upload it to the Arduino board for us.
Our CNC machine is now ready to use.

How it works
Plug the 9-volt power supply into the terminals marked ‘VCC and
GND’ on the motor shield, VCC is for the positive cable and GND is
for the negative lead. You must make sure you get the polarity right
before plugging it into the shield. I like using a multimeter in ‘volts’
mode to confirm this. Put one probe on each wire and read the
voltage on the meter, if there’s a little negative symbol, you probably
have the wires around the wrong way.
Using CNC machines is a bit more complicated than working with
our other robots, so I’ve put together a little guide on the same page
from which you downloaded the software; follow this and before
long you will be confident in CNC control.

CNC WRITER 141


mars rover
One of the greatest benefits that robots provide is their ability to

work in places where it is too dangerous or difficult for humans

to function. This can be at the bottom of the sea, inside nuclear

reactors, or even on the surface of other planets.

8 equal right-angle MakerBeam bracket soldering iron


components

tools
6 45-degree-angle MakerBeam bracket lead-free solder
M3 square head set bolts x 6mm (pack of 250) drill vice
M3 square head set bolts x 25mm (pack of 25) snips
4 M3 hex brass standoff spaces 3mm nut driver (5.5)
M3 stainless steel plain nuts (pack of 250) wire strippers
M3 washers (pack of 10) rotary multi-tool
6 MakerBeam – 100mm (4in) long black anodized beam cordless drill with 5mm
2 MakerBeam – 150mm (6in) long black anodized beam and 3mm drill bits
project box (approx 190 x 110 x 60mm/7½ x 4½ x 2½in) marker pen
zip ties mobile phone or tablet
5mm threaded rod – 300mm (12in) length with wifi
6 M5 stainless steel plain nuts superglue
DFRobot Romeo BLE all-in-one microcontroller retractable craft knife
6 6-volt geared robot motors with wheels (only required for
22 AWG spool of stranded wire solar panel)
NiMH 9.6-volt 1800mAh 8 cell AA battery pack
NiMH battery charger with Tamiya mini battery
connector
Tamiya mini battery connector
(see page 150 for solar panel components)

MARS ROVER 143


1
Snapshot
The Mars Rover, Sojourner, is one
of my all-time favourite robots. It
was exploring Mars for 83 sols (as
days on Mars are known) while I was
still at school learning how to build
machines. I’ve always wanted to
build a spiritual replica of Sojourner
and now have finally had the chance
to do so. Our Sojourner won’t be We first need to resize one of
exploring remote planets anytime the holes in each of the right-
soon, but it has a similar rocker-bogie angled brackets to allow us to put the 5mm
suspension system to allow it to threaded rod through it. To do this, grip the
traverse tough terrain; it also has a bracket inside a vice and use a 5mm drill
controller that allows easy expansion bit and cordless drill to expand the shared
of the robot with various sensors. middle hole. Try to get the drill as straight as
possible when doing this. Repeat this for all
of the right-angled brackets.

We are now going to begin 2


assembling the rocker-bogie
using aluminium extrusion. This material
is great as it comes in various standard
sizes and can be cut to length; this allows
the easy creation of frames. The downside
of aluminium extrusion is that it requires
the use of special bolts; the bolt slides into
the extrusion and we then secure it in place
by using a nut driver to tighten a nut. The
particular extrusion we are using here is lengths, 6mm M3 square head bolts, and
known as MakerBeam, which gives us a tiny two right-angled brackets. Slot the required
10mm x 10mm profile. Begin to assemble square bolts in first and then attach both
the first bogie by using two 100mm (4in) right-angled brackets at the same time.

144 HOME ROBOTICS


3 Now take a
third piece
of 100mm (4in) extrusion
and use a 45-degree-angle
bracket to connect it to our
previous frame. We only
need one 45-degree-angle
bracket for this connection.

We are now going to assemble


the second part of the bogie;
for this, we require two right-angled brackets,
two 45-degree-angle brackets, two washers,
a longer bolt and a 150mm (6in) piece of
extrusion. Put two right-angled brackets,
one on each side of the 150mm piece of
extrusion. Connect the 45-degree-angle
brackets to the end of the part that we
assembled in step 2. Finally use a longer bolt
to attach the two parts together; include a
washer to help the part to pivot freely.

MARS ROVER 145


5

We now attach three of the 6-volt motors to the


frame. Slot 25mm (1in) square bolts onto the
frame; two bolts for each motor.

6 The middle motor will not be


powered, but left unmodified
the gears inside the motor will increase the
friction that the other motors will have to
overcome on each rocker-bogie. To fix this,
open one of the motors and remove the
internal gears that connect the drive axle to
the motor. Reassemble the motor and you
should find that the axle now spins freely.

146 HOME ROBOTICS


Slot the motors 7
onto each of
the 25mm bolts and tighten
them in place with nuts. The
free-running motor that we
made in step 6 should be
in the middle. Position the
motors so that their electrical
terminals face inwards
towards the extrusion.

Solder a length of wire onto


each of the terminals of the BRAINWAVE
powered motors (not the middle one). It Use differently coloured wires to
needs to be long enough to run up the length help identify which wire runs to
of each extrusion with roughly 15cm (6in) of which motor terminal.
wire to spare.

MARS ROVER 147


Repeat steps 2–8 to produce a second rocker-
bogie. This second rocker must mirror the one
that we have just produced. Fix the wheels in position. Once
completed, put the rocker-bogies to one side.

148 HOME ROBOTICS


10 10

A
B

We are now going to modify (about 15mm/½in away). Drill both holes
the project box to allow us to using a 5mm drill bit in a cordless drill (A).
install the controller board and the rocker- Repeat this step on the opposite side of the
bogies on it. First mark the centre of the box (B). We want the middle holes to be
project box, roughly 10mm (¼in) from the closely aligned as the axle will run through
top. Mark a second hole adjacent to this them.

11

Flip the project box over and place the controller board on top.
Mark out the location of each of the mounting holes onto the
project box. Use the cordless drill and a 3mm drill bit to drill out each of the
mounting holes.

MARS ROVER 149


12 12

Flip the project 13


box back over
and install the hex standoff
spaces – the thread of the
spacer should go through
the project box and be
tightened in place with a nut
(A). Once the spacers are in,
insert the controller board
and secure this in place with
screws (B). Insert the bare
wire ends of the Tamiya
mini battery connector into
the motor power screw Insert the 5mm threaded rod through the axle
terminals. holes that we made in the project box. Tighten
an M5 nut on each side.

150 HOME ROBOTICS


14

Install each of the rocker-


bogies onto the axle. Secure the
rocker-bogies in place with two M5 nuts on
each side. Thread the motor wires through
the spare holes in the project box and insert
two wires into each of the screw terminal
blocks for the motors (M1 and M2 will each
drive two motors). Finally, secure the wire
lengths to the extrusion using zip-ties.

15
Use a rotary multi-tool with a
cut-off blade to trim the excess
threaded rod.

MARS ROVER 151


200mm (8in)
Make a fake solar panel
This step is optional and only required
if you want to create a fake solar panel,
it is not required for the function of the
Mars Rover! It also requires access to
a special piece of machinery, a laser

300mm (12in)
cutter, but many school workshops have
one of these!

3mm translucent piece of blue acrylic


components

(600 x 400mm/24 x 16in sheet)

100mm (4in)
black vinyl (300 x 300mm/12 x 12in

25mm (1in)
sheet)

150mm (6in)

If you are a school pupil, ask your


teacher to help to cut the following
DXF file (https://github.com/danielknox/Mars_
Rover) out of 3mm (¹⁄8 inch) translucent dark blue
acrylic; the file is in millimeters. Next remove
the adhesive backing off a piece of black vinyl
and stick it to one side of the acrylic panel.
Normally we want to avoid trapping air
bubbles, but in this case, it will add to
the effect – just pop the larger ones
with a small needle/point of the
retractable knife. Cut the excess
vinyl away using the knife and then
score lines into the top of the acrylic.
Finally, glue the acrylic panel onto the lid of the
project box.

152 HOME ROBOTICS


MARS ROVER 153
17 We now need
to upload the
required software to our
Arduino based board
(the DFRobot Romeo).
I’ve already written the
code for the robot – we
just need to compile and
upload it. Download the
appropriate zip file from
the online website (https://
g i t h u b. c o m / d a n i e l k n ox /
Mars_Rover) and follow
the included instructions to
extract the required files.
Open the Arduino IDE and
click the ‘File->Open…’ tab.

18

154 HOME ROBOTICS


19

Browse to the ‘Mars_Rover.ino’ We now need to make sure we


file and click ‘Open’. are compiling the software for
the correct type of Arduino based board.
Click on the ‘Tools->Board:’ tab and choose
the ‘Arduino/Genuino Uno’ option.

MARS ROVER 155


20

21

156 HOME ROBOTICS


Now click ‘Tools->Port’ and
select the ‘Com’ port for the
Arduino based board – you will need the
DFRobot Romeo plugged into your PC for
this to be detected. There are probably only
going to be a few possible devices in this
list, ignore Bluetooth devices on Macs and
COM1 on Windows.

We can finally upload the


software to the device. To do this
click on the icon that looks like a right-facing
arrow (if you hover over it you should see an
‘Upload’ label appear). The Arduino IDE will
now compile the program and upload it to the
DFRobot Romeo board for us.

HOW IT WORKS
We are now ready to power up our Mars Rover robot. First charge the NiMH battery
using an appropriate battery charger. Once it is ready, plug the NiMH battery into
the robot. You should now be able to connect to it using a mobile phone or tablet
device. If you are on an Android device, install the app ‘Bluno Remote’, on IOS
select the ‘GoBLE’ remote controller app.
Once installed, pair your device with the Mars Rover using Bluetooth LE – the
pin is ‘000000’. You should now be able to start the appropriate app and control
your Mars Rover with it. If the wheels are spinning the wrong way (so the robot isn’t
moving), swap the wires around – you want the wheels on each side to rotate in the
same direction.
If you do this, make sure you unplug your robot before swapping around the wires.
You should be able to operate the robot for around 15 minutes; after that (or once
you are finished) unplug the NiMH battery from the robot and recharge it. Don’t
forget it and leave it plugged in or you will drain the battery.

MARS ROVER 157


RESOURCES
The electrical and hardware components used to make the projects in this
book are all easily sourced online or at electrical and DIY stores. All the
other items that you need will be available at local stores.

USEFUL RESOURCES: HK-T6A V2 receiver – Hobbyking


BBC micro:bit – http://microbit.org/, insulation tape roll – DIY store
https://makecode.microbit.org/#lang=en lead-free solder – Maplin, Pimoroni, Adafruit (US)
CNC Machine files – M3 Hex brass standoff spaces – DIY store, Metric Machine
https://github.com/danielknox/CNC_Machine Screws (US)
Robot Warrior files – M3 stainless steel bolts, plain nuts etc – DIY store, Metric
https://github.com/danielknox/Robot_Warrior Machine Screws (US)
Mars Rover files – https://github.com/danielknox/Mars_Rover M3 square head bolts – technobotsonline, Amazon (US)
electronics & engineering – https://learn.adafruit.com/ M5 stainless steel plain nuts – DIY store, Metric Machine
Screws (US)
Magician robot chassis kit – eBay
COMPONENT SUPPLIERS: MakerBeam angled brackets – technobotsonline, Amazon (US)
3-volt motor – eBay, Adafruit (US)
MakerBeam, black anodised – technobotsonline, Amazon (US)
4.8V 128mAh ultra-miniature 1/4AAA NiMH battery with
metal tin (e.g. Altoids/‘survival’ tin) – convenience store/eBay
Futaba connector – eBay
mobile phone vibrator motor – eBay, Pimoroni, Adafruit (US)
6-volt geared robot motors with wheels – eBay, Amazon (US)
nails – DIY store
9V power supply – eBay, Amazon (US)
NiMH 9.6V 1800mAh 8 cell AA battery pack – eBay
22 AWG wire (Stranded) – Maplin, Pimoroni, Adafruit (US)
NiMH battery charger with Tamiya battery connector – eBay
acrylic, all sizes– theplasticpeople, Amazon (US)
PIR sensor – eBay, Adafruit (US)
AA batteries – convenience store/supermarket
project box – Maplin, Amazon (US)
AA battery holder – eBay, Adafruit (US)
ring electrical crimp terminals (Red, 3.2mm) – DIY store
AAA batteries – convenience store/supermarket
servo – eBay, Adafruit (US)
AAA battery holder with wires – eBay, Adafruit (US)
servo tester – Hobbyking
Arduino Uno – Maplin, Pimoroni, Adafruit (US)
soil hygrometer sensor for Arduino – eBay
BBC micro:bit – Maplin, Pimoroni, Adafruit (US)
SPDT momentary switch with long lever – eBay, Adafruit (US)
BBC micro:bit AAA switched battery holder – Maplin,
Tamiya mini battery connector – eBay
Pimoroni, Adafruit (US)
terminal strip – DIY store (electrical aisle)
CDROM/DVD (old) drives – eBay, boot fair/yard sale
threaded rod – DIY store
continuous rotation servos – Amazon, eBay, Adafruit (US)
toggle switch (large) – eBay, Adafruit (US)
DFRobot dual bipolar stepper motor controller for Arduino –
vinyl sheet, Black – Amazon
Robotstore, DFRobot (US)
wood (sheet of, 6mm) – DIY store
DFRobot Romeo BLE all-in-one microcontroller – Robotstore,
zip ties – DIY store
DFRobot (US)
dog tag blanks – eBay, military surplus store
double sided adhesive foam pad, roll of – DIY/craft store LASER CUTTING SERVICES:
enamelled craft wire – craft store Razor Lab – http://www.razorlab.co.uk (UK)
‘fantasy’ film – craft store/eBay Ponoko – https://www.ponoko.com (US)
HK-T6A V2 transmitter – HobbyKing

158 HOME ROBOTICS


INDEX
A computer numerical control 9, 126–141 H
AA battery holder 37, 40, 43–47, continuous rotation servo (see motor) helping hands 11, 31–32, 37, 40, 99–101
with switch 4.5-volt 12, 67, 70–76 credit card/gift card 113–117 Hex
with wires, switchable 12, 49, 54–55 crimping tool 11, 67, 69, 73, 79, 89, keys 11
AAA battery holder 93, 99 standoff spaces 14, 143, 150, 158
for BBC micro:bit, switched 12, 67, cut-off disc 11, 33, 68, 113 Hobby King HK-T6A V2 receiver/
70, 89, 92, 94 cutting mat 25, 27 transmitter 113, 121, 123, 158
with wires 12, 19, 20–23, 25–28, 31–35
acrylic 114, 127, 134, 152, 158 D J
Allen keys 11, 67, 79, 99 DFRobot dual bipolar stepper motor JavaScript Blocks Editor 60, 61, 65, 95
Arduino 9, 13, 89, 127, 138–141, controller 14, 127, 158
154–157, 158 DFRobot Romeo BLE all-in-one K
Uno 127, 135, 141, 155 microcontroller 14, 143, 157, 158 knife, retractable 10, 19, 20, 25, 27, 37,
Avatar 58–65 diagram 39, 84, 97, 101, 114, 115, 118, 45, 143, 152
120
B dog tag blank 98–109 L
Basic Bots 6, 16–55 drawing 6, 24–29, 48–55 lighter, gas 31, 99, 101
basic techniques 15 drill lollipop stick 49, 50–52, 79–82
battery 47, 54, 71, 72, 89, 99, 113 bits 11, 49–51, 91, 143–144, 149
box, modified 79–84, 99, 103–104 cordless 11, 143–144, 149 M
NiMH, and accessories 12, 113–125, drilling vice 11, 31, 33, 49, 50, 67–68, 79, M3
143, 150, 157 89, 91, 113, 116, 143–144 Hex brass standoff spaces 11, 143,
pack for BBC micro:bit 65, 77, 87, 96, drinks cup, plastic 24–29 150, 158
103, 109 DVD drive (see CDROM) square head set bolts 127, 130, 133,
BBC micro:bit 7, 12, 13, 56–109 143–147, 157
Bluetooth LE 67, 75, 95, 141, 157 E stainless steel plain nuts 127, 130,
bolts 14, 38, 49, 52, 54, 73, 84, 89, elastic band 78–87 143
92, 103 washers 143, 145
see also M3 square head set F M5 nuts 143, 150–151, 158
breakout board/shield 96–97 ‘fantasy’ film 30–35 Magician robot chassis kit 36–47
Bristle Bot 6, 18–23 MakerBeam 14, 126–141
Butterfly Bot 6, 30–35 G MakerBeam brackets 14, 126–141
Garden Guardian 88–97 Mars Rover 9, 142–157
C glue metal tin 14, 67–68, 72–73, 89–92, 94,
cardboard 8, 19–23, 26, 37, 79, 82, 113 mouldable, Sugru 99, 101 97, 158
Catapult Bot 78–87 PVA 31, 34 motor
CDROM/DVD drive 126–141 stick 25–29 3-volt 13, 19–20, 25, 27, 158
chassis (see Magician robot) superglue 67, 72, 79, 82, 85, 89, 94, 6-volt geared robot motor with
clothes peg 49, 51–55 101–104, 127, 134, 143, 152 wheels 13, 37–38, 49, 51, 53, 113,
CNC Writer 9, 126–141 glue gun 10, 15, 19, 22, 25–26, 28–29, 143, 146, 158
combat, robot 112–125 31, 35, 37, 44, 47, 49, 51, 89, 94, 113, 9g servo 13, 113, 116, 118
components guide 12–14 115–118 continuous rotation servo 13, 67–68,
computer/laptop 11, 58–60, 77, 87, googly eyes 19, 22, 25–26, 31, 35, 67, 75, 79, 113–115, 118, 120, 158
120–125, 127, 138–141, 154–157 72, 89, 94 servo 13, 79, 83–85, 87, 99, 100–109

INDEX 159
stepper (see DFRobot) rotary multi-tool 15, 33, 50–53, 68, 83, techniques, basic 15
mobile phone, vibrator 13, 31, 35, 91–92, 116, 151 terminal strip 13, 19, 20, 158
158 rover vehicle 9, 142–157 threaded rod 14, 143, 150–151, 158
multimeter 10, 89, 93, 127, 129, 141 rubber band (see elastic band) toggle switch 89, 94, 158
multi-tool, rotary 11, 31, 49, 50, 53, tools guide 10–11
67–68, 79, 83, 89, 91, 92, 113, 116, S toothbrush 18–23
143, 151 safety glasses 11, 31, 33, 49, 50, 53, 89, transmitter 8, (see also Hobby King)
91–92
N sandpaper 25, 28, 31, 35, 94 U
nail 25, 27, 158 scissors 19, 21, 31, 34 USB cable 59, 113, 121
nail brush 19, 21, 22, 23 screwdriver
needle file 67, 89, 92, cross-head 10, 37, 49, 53 V
NiMH battery and accessories 12, flat-head 10, 19–20, 49, 52, 54, 70, vice, drilling (see drilling vice)
113–114, 118, 125, 143, 157, 158 89, 96, 113, 118, 127 vinyl, sheet 152, 158
nut driver 10, 127, 130, 133, 143, 144 screws 14, 20, 67, 79, 99, 128, 150
nuts 14, 38, 49–50, 52, 54, 67, 73, 79, Scuttle Bot 7, 66–77 W
84, 89, 92, 99, 103, 143, 150–151, 158 servo (see motor) Walking Robot 7, 98–109
servo tester 13, 79, 83, 99–100, 158 washers 14, 49, 52
P Simple Robots 7, 56–109 spring 49, 52
paper 25, 28, 49, 54, 134 Smart Makes 8–9, 110–157 WiFi 143
paperclip 19, 21, 22, 37, 45, 47, 53 snips (see precision snips) wire
pen socket head 14, 67, 79, 99 craft, enamelled 31, 33
ballpoint 89, 94, 134 software 6, 7, 9, 90, 96, 121, 123–124, stranded 20 AWG 36–47, 48–55
marker 10, 19, 21, 25, 29, 49, 50, 138–139, 141, 154–155, 157 stranded 22 AWG 126–141, 142–157
53–55, 67–68, 79, 90–92, 113, soil hygrometer sensor 88–97, 158 wire strippers 11, 31, 37, 42, 67, 69–70,
127, 143 solar panel 143, 152–153 79, 83, 89, 93, 99, 127, 143
pipe cleaners 25, 26 wheels 13, 37–38, 46, 49, 51–55, 113,
PIR sensor 14, 79, 83, 84, 87, 158 soldering iron 11, 15, 20, 27, 31–32, 37, 119, 143, 148, 157, 158
pliers, engineer 10, 19, 21, 31–33, 49, 39, 40, 42–44, 49, 55, 67, 70–71, 127, wood 49, 53–55, 114, 158
55, 89, 93 129, 130, 143, 147, 158
precision snips 10, 83, 127, 143 SPDT momentary switch with long lever
programming 7, 9, 58–65, 67, 75–76, 13, 37, 39, 40, 42–44
85–87, 105–109, 138–141, 154–157 Spiro Bot 6, 48–55
project box 14, 79, 83, 85, 99, 143, Squibble Bot 6, 24–29
150–152, 158
power supply, 9v 26–141 T
Tamiya battery and accessories 143,
R 150, 158
ring electrical crimp terminals 13, 67, tape
69, 73, 79, 83, 89, 93, 99 double-sided adhesive foam 67, 72
Robo Roach 6, 36–47 insulation 73, 79, 84, 92, 99, 104, 158
Robo Warrior 8, 112–125 masking 49, 50, 54

160 HOME ROBOTICS

You might also like