New Scientist - USA (2019-06-15)

(Antfer) #1
15 June 2019 | New Scientist | 51

New stuff you need
If you have the parts for
previous projects, you will
have everything required


For next week
Continuous rotation servo
(The 6-volt kind is fine, see
website for details)
Sound sensor
Disco ball


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
It rotates when the
music starts
9 Rubbish sweeper
10 Biscuit bot


NOW that our circuits are getting
smart, it is easy to think that just
using a micro:bit microcontroller
is as good as it gets. But while it
does have an impressive range of
components, we can augment it
with extras.
The micro:bit’s gold strip is
where the magic happens. It is
split into 25 bands, called pins,
which are connection points to
the internal electronics. Extra
components are usually linked to
one of these, along with the part
in the corner marked “GND”, or
ground, making a circuit through
the micro:bit. The device directs
the electricity flowing through
the pins to control your addition.
Take your piezo buzzer, and
use a couple of crocodile clips to
attach it to the micro:bit’s 1 pin and
ground. Go to the “Music” menu
in the online micro:bit editor and
find “ring tone (Hz) Middle C”.
Clip that into the “forever” block
in the workspace, so it plays
continuously, and upload the
program to your device. Unplug
it from the computer and attach
the 3-volt battery. This way, it will
be easier to hide the noisy gadget
in a housemate’s room.
Just kidding. We are actually
going to use the micro:bit’s light
sensor to make a theremin – a
musical instrument that you play
without touching. Sensors take an
input from the environment and
convert it into electrical impulses.
The micro:bit’s light sensor is
made of a material that changes
electrical resistance according
to the light level. This adjusts the
current flowing through it. We can

use the output of the light sensor
to pick a note for the buzzer to play.
Trouble is, the readings on
the light sensor go from 0 (total
darkness) to 255 (full brightness).
We want to shift this range to
correspond to note frequencies.
In the code editor, start a new
project and create a variable called
“note”. Grab “set note to 0” and
clip it into “forever”. Using “map...”
from the “Math” menu and “light
level” from “Input”, we can write
a line that says “set note to map
light level from low 0 high 255 to
low X high Y”, where X and Y are
the frequencies of the lowest
and highest notes you want
your theremin to play. Mine

goes from 262 hertz (around
middle C) to 523 hertz (an octave
above). Try those numbers as your
X and Y. Beneath this block, add
another “ring tone (Hz) Middle C”,
but change the default “Middle C”
to your variable, “note”.
Once you have loaded the
code onto the micro:bit, you can
play your theremin by moving
your hand to block out more or
less light, or by shining a torch
towards it. You could also reverse
the scale or add more octaves.
You could even try a different
sensor. For instance, a sonar
sensor allows you to use distance
rather than light. Let us know
what you come up with.  ❚

How to be a maker Week 7


You hum it, I’ll play it


Add programmable components to make a theremin, the musical
instrument that you don’t touch. Hannah Joshua takes it away

Puzzles
Quick crossword, a
boat puzzle and the
quick quiz p52

Feedback
Cunning kids and
patriotic power: the
week in weird p53

Almost the last word
Readers weigh in on
the best swimming
strokes p54

Me and my telescope
David Reay on the
climate and carbon
farming 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


GOLD STRIP WITH
d5.38

PIEZO BUZZER

CROC CLIPS ATTACH
94d5.3&3),3)

3-VOLT
BATTERY

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