2019-06-22_New_Scientist

(singke) #1
22 June 2019 | New Scientist | 51

New stuff you need
Continuous rotation servo
Sound sensor
micro:bit edge connector
(optional)
Mirror ball


For next week
Another continuous
rotation servo
2 x wheels to fit servos
2 x long-arm limit switches
Battery box (to hold 4 x AA
batteries)
Robot chassis or CD case


Next in
the series
1 Introduction
2 Electric candle
3 Toast notifier
4 Desktop traffic light
5 Propeller car
6 Magic 8 Ball
7 Theremin
8 Sound sensitive disco ball
9 Robot rubbish sweeper
Connect two motors for
a roaming robot
10 Biscuit bot


How to be a maker Week 8


The only thing better than a mirror ball is one that automatically
starts turning when it hears music, says Hannah Joshua

Puzzles
Quick crossword,
a prison puzzle and
a short quiz p52

Feedback
Metric madness and
climate sewage: the
week in weird p53

Almost the last word
Why eyeballs don’t
freeze and the nature
of dust p54

Me and my telescope
Anthropologist Ruth
Mace on the people
of western China p56

What does...
Liana Finck?
A cartoonist’s take
on the world p53

The back pages


DA

VID

ST

OC

K^ F

OR

NE

W^
SC

IEN

TIS

T/T

HA

NK

S^ T

O^ I

CL
AD

VA

NC

ED

HA

CK
SP

AC

E

Hannah Joshua is a science
writer and maker based in
London. You can follow her
on Twitter @ hannahmakes


SERVO

EDGE CONNECTOR

CONNECT -VE RAIL TO
MICRO:BIT GND

THIS week, it is time to get down
and boogie, because we will be
making an automated mirror ball.
It will require two power sources,
because components, like
everything from evil geniuses
to artists, crave power of different
kinds in differing amounts.
Say you have a motor that needs
at least 5 volts. The micro:bit board
we have been using as the brain
of our circuit needs only 3V. As we
saw for LEDs, supplying more can
cause damage. So if you want your
micro:bit to control a motor, you
can’t just wire them both to a
heftier power source and hope.
Take your servo. It should have
three wires: red, brown and yellow,
ending in sockets. Connect the red
wire to the positive power rail on
your breadboard, and the brown
wire to the negative or ground rail
(blue), then connect the 9V battery
to the rails to power your servo
(you might need to cut a crocodile
wire so one end can poke in the
breadboard). The micro:bit has
its usual 3V battery. Here is the
important part: connect the
ground rail to the micro:bit ground.
Linking the grounds ensures both
parts of the circuit cooperate.
Connect the yellow servo wire
to pin 0 and finally add the sound
sensor. To do this, connect “vcc”
to the micro:bit’s 3V pin, “gnd” to
ground and “out” to micro:bit pin 7.
Pin 7 is the gold sliver to the left of
pin 1. It is too skinny for croc clips
so you can attach a wire with a blob
of conductive paint or solder. Or I
am using an edge connector, which
lets your micro:bit slot into a
breadboard with each pin to a row.

Plonk the mirror ball on
the spinning part of the servo
and glue it in place.
Now you are ready to code. For
the sound detection, we need an
“if <true> then else” block from
the micro:bit editor’s “Logic” tab.
Clip it into “forever”. Grab the
“0 = 0” comparison out of the
“Logic” tab too. Next, we want the
advanced menu. Find “Pins” and
grab “digital read pin”. This is
going to check the output of the
sound sensor. Stick it all together
to make a line like “if digital read
pin p7 = 0”, which basically means
“if the sensor detects a sound”.
To move the mirror ball, you can
use “servo write pin” to control the

motor. Writing a value of 0 will
spin the motor at full speed in one
direction, and writing 180 will spin
it in the opposite direction. Nestle
this under “if ”. Under “else”, stick
another “servo write pin” and type


  1. This makes the ball stop when
    the music does.
    Now test it out. Put on some
    tunes, point a torch at the mirror
    ball and you have a high-tech
    disco. (The sound sensor should
    have a dial you can turn to change
    the sensitivity.)
    There is a lot more your motor
    can do. How about a winch for
    teabags – with a temperature
    sensor for optimal dunking? Let
    us know what you come up with.  ❚


Make online
Projects so far and a full list of kit required are at
newscientist.com/maker Email: [email protected]

Have a ball


SOUND SENSOR
Free download pdf