MagPi86 Magazine
MagPi86 Magazine
MagPi86 Magazine
CC/STORE
10 RETRO
GAMING KITS
L
The best arcade controllers,
F U
kits and consoles
POW E R
R R Y P I
R AS PBE
J E C T S
P RO g builds for
rewardin l makers
25 masterf
u
LEARN TO
SPOOKIFY YOU
R CODE WITH
H A L LO W E E N SCRATCH 3
COSTUME Easy programming with this
block-based language
£5.99
WELCOME
to The MagPi 86
W
e like to think we’re a pretty welcoming bunch to
newcomers here at Raspberry Pi Towers. After all, our
favourite computer was designed to help students (of all
ages) to learn computing skills. Everybody has to start somewhere, and
there’s nowhere better than The MagPi. This magazine, like every issue, Lucy
EDITOR
is packed with great tutorials and projects for the absolute newbie. Hattersley
If that sounds like you, stop reading now and head over to our Lucy is editor of
The MagPi. Now
Scratch 3 tutorial (page 40). In it, Sean McManus will show you how to Apple-free for
the first time in 20
code with the latest version of the ultra-friendly visual coding tool. years and feels
slightly strange
Right! Everybody else. There comes a point where every Raspberry about it. Annoys
Pi owner wants to get their teeth into something with more bite. A big people by talking
about camper vans
ol’ project that needs time, tools, and tenacity. So, this month our lead constantly. Still
wants a pet dog.
feature is Powerful Projects for Raspberry Pi (page 26). We’ve asked the magpi.cc
community to let us know what ultra-powerful projects they’ve heard
about, been testing out, and what they want to make next.
The result is 25 of the biggest, baddest, most breathtaking projects
in existence. From space ballooning and soccer robots to networked GET A
knitting machines, intelligent RASPBERRY
cucumber sorters, and classic toy- ZERO W KIT
hacks, right up to hydroponics.
PJ has interviewed the makers and
PAGE 68
got tips and advice. All you need is
the get-up-and-go to get started. So
dive into our feature, and let us know
what you’re going to make.
magpi.cc 03
CONTENTS
Contents
> Issue 86 > October 2019
Cover Feature
26 25 Advanced
Maker Projects
E R F U L
Regulars
P O W RY P I
06 World of Raspberry Pi
RA S P B E R
S
92 Your letters
97 Next month
98 Final word
P RO J E C T
Project Showcases
10 MudPi
26
14 Dride Zero
18 Stonehenge Skyscape
18
20 Magic Wand
22 Night Vision
10
DISCLAIMER: Some of the tools and techniques shown in The MagPi magazine are dangerous unless used with skill, experience, and appropriate personal protection equipment. While
we attempt to guide the reader, ultimately you are responsible for your own safety and understanding the limits of yourself and your equipment. Children should be supervised. Raspberry
Pi (Trading) Ltd does not accept responsibility for any injuries, damage to equipment, or costs incurred from projects, tutorials or suggestions in The MagPi magazine. Laws and regulations
covering many of the topics in The MagPi magazine are different between countries, and are always subject to change. You are responsible for understanding the requirements in your
jurisdiction and ensuring that you comply with them. Some manufacturers place limits on the use of their hardware which some projects or suggestions in The MagPi magazine may go
beyond. It is your responsibility to understand the manufacturer’s limits.
04 magpi.cc
CONTENTS
40 60
Tutorials
36 Interactive tabletop RPG table
40 Throttle & Tilt Scratch 3 racer
44 Build a low-cost robot, part 3
48 The Photon Lab
Throttle & Tilt Make music in PICO-8
56 Tree views with C and GTK
76 60 Add game music in PICO-8
64 VNC with Raspberry Pi
84
Reviews
76 PecanPi
78 NanoSTEM IOT Weather Kit
80 Top 10 gaming accessories
82 Learn Scratch 3
Community
84 Sean Raser interview
86 This month in Raspberry Pi
Sean Raser interview 90 Events
WIN ROCKYBORG 95
ONE OF
FIVE ROBOTS!
magpi.cc 05
THE WORLD OF RASPBERRY PI
Raspberry Pi
hosts Scratch
Conference Europe
The cute coding cat is all grown up and plays a pretty big role
in education, explains conference attendee Rosie Hattersley
T
he UK hosted the Scratch Conference
Europe for the first time this August,
welcoming 300 delegates and visitors
from all over Europe and beyond.
There were 40 talks and 30 workshops, plus
keynote speeches from MIT Media Lab’s Mitchel
Resnick and Raspberry Pi Foundation CEO Philip
Colligan, among others.
The two-day conference focused on creative
ways that educators and Code Club and CoderDoJo
Teenage volunteer volunteers can inspire others using the visual
Thomas Southwell
explains his role coding platform. In part, it was a showcase for Educators in Japan are getting primary school
helping in the students programming
the possibilities of Scratch 3 – newly released in a
Scratch Bugs and
Glitches forum dedicated Raspbian Buster version this summer.
Mitchel Resnick talked about how both Scratch
and Raspberry Pi had evolved from being “a
little fringe activity” of interest to kids with
an interest in technical careers. Embraced by
governments and schools, both are now available
to “more children from more backgrounds to
design, create, experiment, explore, and learn
through coding”.
Mitchel presented the example of high school
graduate CrazyNimbus, who credited Scratch
with introducing her “to something she’s truly
passionate about” and has hopes of making
computer science a key part of her career.
Fascinating workshops
Elsewhere at the Scratch Conference, there were
presentations and workshops about overcoming
common coding and learning barriers, but also
about how to take Scratch and coding knowledge
to the next level – becoming a Scratch Ninja and
mentor for whole schools.
app for iOS and Android that enables users of all MIT’s Mitchel Resnick
ages to develop and then share their own mobile talks about the future
of Scratch
games and animations.
One fascinating workshop showed the Snap!-
based embroidery design tool at work. Using
Turtlestitch’s Scratch-like Snap! interface,
you can create geometric patterns, write words
and phrases using a range of fonts, or make
free-form designs. The instructions are then
saved to a USB and printed out on a compatible
embroidery machine.
Keynote speeches from the Scratch Conference
Europe are online at magpi.cc/rGwxnx.
I
n a rather fantastic turn of events, of a worldwide challenge for youngsters to create
Raspberry Pi has become the Educational their own mini animation, telling the story of
Partner for the Oscar-winning animation Shaun the Sheep and his new alien-friend
studio’s latest film launch, A Shaun the Sheep Lu-La’s space adventures.
Movie: Farmageddon. The global Code Club competition is split
Both Aardman Animations and Raspberry into two age categories: 11-and-under and
Pi inspire young imaginations, so it seems 12-and-above. The Scratch-based challenge asks
appropriate that the partnership takes the form entrants to tell the story of Lu-La and Shaun the
Sheep. Entries will be judged on storytelling,
creativity and coding, and must follow the rules
of the competition.
An intergalactic challenge
Shaun the Sheep: Mission to Space is a
project‑based competition designed to be
completed over approximately two Code Club
sessions, resulting in an animation of up to
Aardman Studios and 59 seconds long.
Raspberry Pi have teamed
Instructions and resources are provided in
up to run a project-
based competition eight different languages. You’ll be competing
Shaun encounters
Lu-La, an adorable
alien with
magical powers
Character chase
Of course, as fans will know, Aardman has prior
experience of space travel: in 1999, Wallace and
Gromit jetted off to the moon in search of cheese
in A Grand Day Out. The new film, A Shaun the
Sheep Movie: Farmageddon, is due to hit cinemas
this autumn.
MudPi
Want to automate a garden that grows
delicious veg? Rob Zwetsloot gets out his
gardening gloves to see how to do it
A
couple of months ago, we looked at a
Smart Herb Garden, a smaller version of
the automated garden concept. A concept
that we love here at The MagPi, so it was a delight to
hear from Eric Davisson about his MudPi system.
“MudPi is an automated garden system, built
open-source, that helps me grow the produce I
love with less time, resources, and effort,” Eric
Eric
MAKER
10 magpi.cc MudPi
PROJECT SHOWCASE
Quick FACTS
> Eric’s Raspberry Pi
was originally used
Controlling irrigation for retro gaming
helps save water and
grow better plants > MudPi has been in
development for
nearly two years
> Proper
implementation
saves water
and time
MudPi magpi.cc 11
PROJECT SHOWCASE
12 magpi.cc MudPi
PROJECT SHOWCASE
Build MudPi
MudPi magpi.cc 13
PROJECT SHOWCASE
The adjustable-angle
dash-cam attaches to
a windscreen or mirror
Dride Zero
for Raspberry Pi
Dride Zero is a video-sharing dash-cam you can set up yourself
and run from a Raspberry Pi. Intriguing, says Rosie Hattersley
S
cary footage of vehicular near misses, Engineer and developer Yossi Neiman, and
crazily inattentive driving, and partner Shiran Tasa, sensed a place for a ‘fusion
unfortunate encounters with wildlife, dash-cam and safety system’ that has a social
stray car parts and extreme weather events… video-sharing element while also alerting others
Dash-cam footage has brought a new perspective to poor driving etiquette and road dangers. There’s
to the everyday commute. It has also highlighted a driving alert feature that kicks in when Dride
just how tenuous some people’s control of their Zero senses something crazy is happening, and it
vehicles and sense of proportion can be. duly records it. Pressing a single button shares the
Yossi
MAKER
Quick FACTS
> Yossi’s Linux
experience made
Raspberry Pi the
obvious choice for
You can make your own
the project
dash-cam powered by
a Raspberry Pi Zero W
> The original Dride
Zero product was
based on Raspberry
Pi Zero W
Dride on time
We first covered Dride back in 2017, when it was an
Alexa project (magpi.cc/yCyAuH). We’re pleased to
see how far it’s come on. he Dride Kit enables you to build your own dash-cam
T
Stonehenge
Skyscape
You can see how the skies above Stonehenge affect
the iconic stones via a web browser thanks to a
Raspberry Pi computer, as David Crookes discovers
S
tonehenge is Britain’s greatest monument
and it currently attracts more than 1.5 million
visitors each year. It’s possible to walk around
the iconic stone circle and visit the Neolithic houses
outside the visitor centre. Yet, worries about potential
damage have forced preservationists to limit access. This Raspberry Pi was also fitted with a Pimoroni
With that in mind, Eric Winbolt, Interim Head Enviro pHAT containing atmospheric, air pressure,
Mark of Digital/Innovation at English Heritage, had a and light sensors. Captured light values from the
MAKER
Griffiths brainwave. “We decided to give people an idea of sky image were then used to alter the colour values
what it’s like to see the sunrise and sunset within of the master image of the stones so that the light
Mark is the owner of the circle, and allow them to enjoy the skies over on Stonehenge, as seen via the web, reflected the
The Bespoke Pixel
Stonehenge in real-time without actually stepping ambient light of the sky.
which operates
from Fareham, inside,” he explains.
Hampshire and has This could have been achieved by permanently What can you see?
created award-
positioning a camera within the stone circle, but this “What it does is give a view of the stones as it looks
winning digital
creations for art, was ruled out for fear of being too intrusive. Instead, right now, or at least within a few minutes,” says
music, and science. Eric and developers from The Bespoke Pixel agency Eric. “It also means the effect doesn’t look like two
magpi.cc/uZGDZz snapped a single panoramic shot of the circle’s images simply Photoshopped together.”
Placed within a
protective acrylic dome,
the camera takes an
image of the sky every
four minutes; this
is blended with the
Stonehenge photo on
the website
By day, you see
Stonehenge as it would
appear to real-life visitors;
at night, a computer-
generated model of the
sky is depicted with the live
location of the stars and
the five visible planets An ADSL line allows the sky images and
the HAT data to be sent to the cloud,
to an application called Stonehenge
Skyscape which drives the website
F
ollowing a trip to Universal Studios (Japan)
by his brother, who was able to perform
some ‘magical’ tricks with a retroreflector-
tipped wand while he was there, maker Jasmeet
Singh was inspired to explore what he could do
with a replica wand. “I have been highly inspired
by tech portrayed in sci-fi movies – be it some cool
gadget owned by a superhero, or wands that can
Jasmeet
MAKER
Jasmeet’s
homemade box
opens using a servo
Night Vision
Unlike eating carrots, this ingenious infrared camera really does enable
you to see in the dark. Phil King stops munching veg to take a look
I
t’s late at night and all the lights are out in with IR LEDs for night-time ‘illumination’. The
the house, but someone is sneaking around… live camera view can be shown on a Pimoroni
Don’t worry, it’s just Dan Aldred testing out HyperPixel 4-inch TFT touchscreen, which is also
Dan his latest Raspberry Pi-powered invention, a used for a graphical user interface.
MAKER
Aldred portable infrared camera enabling him to see in For the housing, Dan upcycled a handheld
total darkness. camera flash unit. “The original plan was to use
Raspberry Pi As a child, Dan was a fan of the Splinter Cell an old-fashioned camera and make a camera that
enthusiast, NCCE
stealth shooter video game. “The iconic image took photos in the dark, but when I went to a car
facilitator, teacher,
and coder who from the game is the night-vision goggles that boot sale, all I found was the pivoting flash – it cost
enjoys creating new Sam Fisher wears,” he recalls. “I have always a pound, which was a bargain.”
projects and hacks been fascinated by the idea that you can see in the As well as being large enough to house a
to inspire others to
start learning. Still dark, and this formed the foundation of my idea Raspberry Pi Zero, IR camera, and screen, the flash
trying to get a Kinect to build a portable handheld night vision piece unit has the bonus of a tilting handle, enabling the
360, Python, and of equipment.” user to angle the camera to the desired position.
Raspberry Pi working
One of the hardest challenges was that Dan
with each other.
Success by stealth wanted Night Vision to be standalone, portable,
magpi.cc/rwepTs
Sam’s Night Vision project features a Raspberry and bootable, with minimum interaction from the
Pi Zero and a ZeroCam infrared camera equipped user to get it running. “The obvious solution was
PROJECT
I
t’s common to do a bit of head-scratching when you get
your first Raspberry Pi. Sure, it’s a cool bit of technology
at an amazing price, but what to do with it?
Here at The MagPi, we work hard to stuff your imagination
full of ideas that are hopefully accessible to all our readers.
Still, we thought it might be fun to take a look at what
happens when a maker gets ambitious and decides to go
all‑out on their new project. We present some of our favourite
advanced Raspberry Pi makes…
FEATURE
ADVANCED
PHOTO GAMING BUILDS
PROJECTS Strictly for fun, these masterful makes
Take amazing shots with put a smile on your face
Raspberry Pi
HEVERLEE SJOELEN
Maker Grant Gibson | magpi.cc/DQiGwQ
When Belgium beer brand Heverlee
approached prolific maker Grant
Gibson for promotional ideas, he was
reminded of Sjoelen, a shuffleboard
game popular in Germany and Belgium.
The result was a Raspberry Pi-powered
physical game and vending machine
mash-up that dispensed cold cans of
beer to the winners.
DROP PI
Maker David Hunt | magpi.cc/fvNmeA
THE CLAW
Take incredible shots of water droplets,
Maker Ryan Walmsley | magpi.cc/aqtCxF
using a Raspberry Pi as a controller for a Ryan’s ever-popular claw machine
solenoid valve and camera trigger. The is often seen at Raspberry Pi events
valve is hooked up to the GPIO pins and throughout the UK. An upcycled
a small piece of code opens the valve and bar-top ‘grabber’ game, this one
triggers the camera. The code is timed can be played over the internet.
for a valve 40 cm above the surface of Use your computer or mobile
the water. It’s a great example of how phone to try to grab Babbage the
Raspberry Pi can be used to control an Bear (gently) as the results are
environment and camera, plus a good live-streamed to you.
excuse to learn how to control valves.
STEREOPI
Maker Eugene Pomazov | magpi.cc/pGvBAp
Since 2014, Raspbian has offered built-in
support for stereoscopic photography.
With two cameras attached to a Raspberry
Pi, you can create 3D photographs and
record 3D video. You’ll need a Raspberry Pi
Compute Module
(which has support
for two Camera OUTRUN BAR-TOP
Modules). The
compact and light
Maker Matt Brailsford (aka Circuitbeard) | magpi.cc/TjjVMH
nature of StereoPi What separates Matt from the crowd is his exquisite attention
makes it particularly to detail. This OutRun Deluxe bar-top features fully working
useful for attaching controls, such as gear shifting and a steering wheel. Add the
to drones and robots. pedals, repurposed from an wheel controller, and custom
bodywork and this is a classy project.
CREATIVE PURSUITS
Physical computing and the arts are a very
good match, and here’s why
PI CLOCK 2
Maker Tim Richardson | magpi.cc/dbqYPu
Tim’s clock is made up of two
64×32 pixel displays and displays
information being relayed from a
Raspberry Pi-controlled weather
station. It features some clever
energy-saving extras, such as a
motion sensor to only update the
screen when someone is in the
room. It’s been to Parliament as
part of the one-millionth Raspberry
Pi celebrations.
FEATURE
T H E S E A S I N
TAKE TO N O M O U S Y A C H T
YOUR AUTO
This is a wind-powered
craft, so the sail is
moved by motor
MAKER
AI Coventry
(Coventry ‘The Rabbit’, complete
University) with Raspberry Pi Zero
Left to Right: Balazs
Bordas, Mark Tyers,
Sergiu Harjau,
Shahzad Haider.
magpi.cc/uxjfhV
The project’s Raspberry Pi Zero is
connected to a host of sensors to
determine direction and speed
A
I Coventry is making serious progress with Are you happy with the outcome?
autonomous vehicle technology. Sergiu Yes, in our latest trip we did way better than our
Harjau and team entered their aquatic past ones, but even still we weren’t perfect. We’re
vehicle, ‘The Rabbit’, in an autonomous boat very happy to call it a learning experience and go
challenge in China. We asked him all about it. from there. On the flip side, we were very organised,
more prepared than any team out there if I’m
What inspired you to build a self-sailing boat? honest, and that allowed us to quickly fix our issues
I first started having an interest in autonomous when we needed to. In the end, we managed to get
vehicles when I had to choose a project for a third prize, and we’re very happy with the result.
second-year module. I first built an autonomous
RC Car, driven by Raspberry Pi Zero[…]. That got Any improvements planned?
some traction in the university and then a lecturer We’re going to be looking at spending a little bit
offered me a spot on the autonomous boat team in extra on our compass sensor to ensure it doesn’t
Finland. We use the project as a way to broaden our get de-calibrated as often as it did in China. We
skill set, both from a software standpoint but also suspected there were power lines under the lake,
when it comes to electrical engineering, and so far and that didn’t help our autonomous sailing.
it’s been working wonderfully.
What plans do you have for your next vehicle?
What challenges did you face? Since autonomous vehicles and embedded systems
Autonomous vehicles are a bit like chess in some are two of my favourite pastime activities, my next
ways. It’s very easy to understand how it’s all big project will again bring the two together. I’ll
meant to work, but it’s really hard to go ‘deep’ be helping my lecturer Dr David Croft to deliver a
and create beautiful systems which work without hardware-software platform for a new master’s
a single flaw[…]. In China, our biggest challenge course next year: ‘Connected autonomous vehicles
which we didn’t foresee was the weather. The systems’. We’re planning on building an RC car
humidity and extreme heat rendered some of with capabilities to become autonomous on an ROS
our sensors faulty, spitting out random data at software interface. It’s not going to be easy, to say
unpredictable times. Even still, we pursued our the least, but I hope that through my other projects
goals and in the end managed to fix some of the I have managed to gain the necessary skills to
issues and came home with a pretty good result. pursue yet another interesting endeavour.
SOCCERBOTS TENSORFLOW
Maker Neil Lambeth | redrobotics.co.uk
CUCUMBER SORTER
Neil wanted to show kids that robotics
Maker Makoto Koike | magpi.cc/fDeLLK
can be more than just a single ‘bot It’s lovely to see one maker
moving around, so he developed the put AI tech into practice to
SoccerBots, a pair of remote-controlled, solve a problem. Makato’s
ball-firing robots that try to score goals father grows cucumbers
against each other. They’ve inspired and straight ones with lots
hundreds of kids around the UK. of prickles command a high
price. Makato trained an AI robot to spot and sort
them. Perhaps there are a number of production
BIOHEX lines that could benefit from a little AI.
HIGH-ALTITUDE BALLOONING
Maker Dave Akerman | daveakerman.com
The world’s best computer is no stranger to space, often
hitching a lift on the ISS. If you’d like to send a Raspberry Pi
skyward, it’s easier than you think. Dave sends Raspberry Pi
Zero computers up to 100,000 ft (30,480 m) in the air using
helium balloons, taking amazing photos. His comprehensive Warning!
blog shares an immense amount of knowledge. High Voltage
This project uses
potentially dangerous
levels of electricity
SPIN UP A N I M A T I O N
DIGIT A L A
B
rian is a regular at Raspberry Pi events idea that I could make a digital version bringing
MAKER
up and down the UK and is most often Eadweard Muybridge’s images to life.
Brian Corteil seen with his Pi Noon balloon-battling
Brian is an award- robots or FacePlant, the two-wheel balancing What challenges did you face?
winning robot
creation he entered in this year’s Pi Wars. I had to control twelve screens on a single
maker, active
member of the There is another one of his builds that caught our Raspberry Pi and design a circuit to be able to
Raspberry Pi attention, a digital zoetrope (an early animation select each screen. Then I needed to write software
community, and machine) that threw up some real technical to render images for the screens, modifying the
self-titled ‘head
meat-bag’ of challenges, in particular trying to drive twelve driver software to upload an image in four blocks.
Coretec Robotics. screens from one Raspberry Pi. The images on
magpi.cc/LjJFFO the screens can be updated in real-time when the Are you happy with the result?
zoetrope is spun. I’m pleased with the way the Digital Zoetrope turn
out after I changed the shiny black acrylic to matt
What inspired you to build a zoetrope? black and the wiring to black. It ended up being as
While I was researching the images of Eadweard I first imagined it would be.
Muybridge and the history of moving images,
I was reminded of the zoetrope. I had a crazy Any improvements planned?
To make it more interactive and be able to import
cells by taking a photo of a hand-drawn sheet of a
one-second short film.
Interactive
Rob
tabletop RPG table
MAKER
Zwetsloot
Rob is amazing.
Plunder dungeons and slay dragons in digital style with this
He’s also the
Features Editor
simple TV conversion project for all your TTRPG needs
of The MagPi, a
hobbyist maker,
T
cosplayer, comic
book writer, and abletop RPGs are back in fashion a serious might seem like a no-brainer, we’d suggest doing
extremely modest. way. Thanks to a recent tidal wave of some tests first. We’re using a spare Raspberry
magpi.cc podcasts, live streams, and YouTube series, Pi 3 and it works just fine, and a Raspberry Pi 3A+
games like Dungeons & Dragons, Vampire: The would probably do the job as well, even with the
Masquerade, Warhammer 40,000, and other reduction in RAM.
TTRPG systems have never been more popular. If you’re buying a brand new Raspberry Pi for
Aside from finding a day all your friends are the job, go for the 4GB Raspberry Pi 4 so that
available, the most difficult part of playing can be you have more room to grow with possible future
handling and juggling different maps. Struggle TV upgrades.
no longer with paper printouts and upgrade your
GM’s table with an old TV, a Raspberry Pi, and a
bit of ingenuity. Now grab your carpenter’s tools
Set up Roll20
and roll a skill check…
02 The real magic for this interactive table
comes from Roll20 (roll20.net) – it’s a free
Warning! online service that is normally used to let people
Power Tools
Choose your Raspberry Pi
In this tutorial we use
01 Not every Raspberry Pi will be quite suited
remotely connect to each other for a TTRPG game.
As well as being able to talk to your group and
various hand and power
tools that can be very
for this use. The main function of Raspberry Pi GM, you can roll dice within the app and control
dangerous. Please seek here is to launch into a web app from full-screen tokens of your characters.
adult supervision.
Chromium. It’s not the lightest webpage in the It also allows a GM to display a map that has a ‘fog
world, so while something like a Raspberry Pi Zero of war’ – areas that the players cannot see. From
their computer, they can reveal the map as the
players explore. Sign up for an account – if you’re
the GM, you might want a secondary account to act
as the ‘player’ account for the screen.
You’ll Need
> Flatscreen TV
Raspbian tweaks
04 To get Chromium to launch at startup, you
can add a quick line to the bottom of the profile
config file. Open the Terminal and use:
We did a bit of customisation of Raspbian as and bottom of the TV to the exact length of each
Top Tip well. You can swap the Raspberry Pi Desktop side, and then cut the two side bits of wood to fit
splash screen by changing the splash.png file in their size, plus twice the depth of the wood. This
Other software /usr/share/plymouth/themes/pix/ (we used the way, the side parts cover the ends of the wood used
Dungeons & Dragons ampersand logo) and we also for the top and bottom.
Don’t want to changed the wallpaper on the desktop. For the façade, we measured how long each
connect to the piece of wood would be at the top (side length plus
WiFi in every twice the wood depth) and then cut at a 45-degree
new location?
angle inwards so that the chamfered edge was the
You can use
Measure your screen
Dungeon Board,
which allows
05 If you want to build a frame, you need to
shorter edge of the wood.
you to power the make sure you know how big your TV is. Measure
map from the the length and width precisely, as well as the depth
GM’s computer: Assemble the frame
magpi.cc/pJdHtp
and the bezels. For the frame, you want to use
planed lengths of timber to create the sides of a
07 This step looks easy, but is a bit tricky. You
sort of box. need to nail the shorter (side) lengths of wood to
Make sure the width of the timber is larger than the longer (top and bottom) lengths of wood to
the depth of the TV. We used 18 mm-deep cuts of create your basic box-like frame. Use clamps where
wood to try to keep the weight down; however, you you can to keep the angle at as close to 90 degrees
may choose thicker. as possible. We recommend nailing one of the
We used moulded skirting boards for the façade short (side) parts of wood to both of the long pieces
of the frame, meaning we didn’t need to create (top and bottom), before closing it off with the
a chamfer on a piece of wood. The width of the other side part of wood.
skirting should cover the depth of the main frame,
as well as the bezel on the TV.
TV check
08 Before going further, make sure your
Cut your wood
06 We recommend using a mitre box to make
measurements were correct and fit your TV into the
box. At this point you might want to make note of
sure your cuts are straight or perfectly angled. We any extra protrusions, or drill some holes to access
created the frame by cutting the wood for the top buttons on the television if necessary.
Top Tip
Elevation
One of the
problems we
came across with
paper maps is
that they take
up valuable
table space. So
does this screen.
A possible
solution? Use
legs to elevate
it and regain
some space for
character sheets.
T
esting the fit is
essential to make
sure everything
is fine before
continuing
Final adjustments
If it doesn’t fit properly, you may need to take
apart the frame and do it again, or make sure you
11 You’ll need to run a couple of power cables
measured correctly in the first place. from beneath the frame to power the TV and
Raspberry Pi – we used a rotary tool to carve out a
little bump that would allow cables (along with a
mouse cable) to run freely from under the frame.
Assemble the façade
09 You should probably glue the edges of the
Now it’s time for the first proper test, so try to get
your friends over (if their schedules allow it) and try
façade together to make sure they’re all even and not to spill any canned drinks onto the new table.
nice before attempting to add it to the frame.
We didn’t do that, and instead clamped each Y ou’ll need to run a couple of power
piece to their specific side and added a few nails to
attach them. In our case, we had quite wide pieces, cables from beneath the frame to power
so we had to make sure they didn’t dip inwards
while we hammered them in. Gluing beforehand the TV and Raspberry Pi
should allow you to avoid that.
Further upgrades
12 The table looks nice, but there are always
ways for it to look nicer. You could carve the façade
Install the TV
10 Once the façade is added, turn over the
parts to make it look more ornate, and give it a coat
of dark varnish to give it a more woody look.
frame and lower your TV in. We screwed in some If the bezels on the TV you used aren’t
wide brackets to the sides of the frame to keep the particularly deep, you could also add a layer of clear
TV in place. This also means you can remove the acrylic as protection to the real screen. Finally,
TV if you need to at some point. Turn it over and maybe add carrying handles if you plan to move it
admire your handiwork. around a lot.
Make a Scratch 3
Sense HAT game
Discover what’s new in Scratch 3 as you build this exciting
racing game, using your Raspberry Pi as a steering wheel
S
Draw the road
cratch 3 is now on Raspberry Pi, with new
blocks for the Sense HAT. In this game,
02 Hover over the icon in the bottom right to
you tilt your Raspberry Pi to turn left and open the backdrop menu. Click the option to paint a
Sean right, and use the HAT’s up and down joystick backdrop and draw a green box that fills the Stage.
MAKER
McManus controls as an accelerator. Going off-road or Add Listing 1 to Sprite1 (the cat). You’ll need to use
colliding with the computer’s racer damages the menu in the first block to set up a new message
Author of Scratch your car. Can you complete three laps before your called ‘draw road’. Click the script to test it. You
Programming in
car is too beaten up to drive? If so, how fast is should see the road is drawn with two differently
Easy Steps, Cool
Scratch Projects your qualifying time? This project will give you a coloured checkpoints at the top and bottom.
in Easy Steps, and tour through what’s new in Scratch 3, including
Mission Python. Get
free chapters at
computer speech, new sound effects, and the
extensions. Rev up!
T ilt your Raspberry Pi to
Sean’s website.
Top Tip
Simplifying strings
Roll: X There’s a new Operators block called apple contains a?
Use it to search a piece of text more easily.
DOWNLOAD
throttleandtilt.sb3 THE FULL CODE:
> Language: Scratch magpi.cc/github86
Listing 6
Listing 5 Listing 7
Listing 8
Build a low-cost
Part 03
wheeled robot
A wheeled robot isn’t much fun when it’s stationary. Using the
motor controller and code, it’s time to get the robot moving!
T
he previous part of this series showed for this. When it is ready, eject the microSD card
how to build a robot using a lunchbox as and put it back into the computer. Then follow the
Danny a chassis (call it Lunchbot!). While that instructions at magpi.cc/RhviuV to configure WiFi
MAKER
Staple robot looks smart, and like it might work, it’s not (in the wpa_supplicant.conf file) and enable SSH.
going to do much without code to do something
Danny makes on it. In this part, we’ll get your Raspberry Pi
robots with his kids ready for robotics and write some simple code to
as Orionrobots
Connect to your Raspberry Pi
on YouTube, and
is the author of
move the robot.
You’ll set up the microSD card for running code
02 The microSD card and USB power input on
Learn Robotics over wireless LAN, add tools to connect to the the robot’s Raspberry Pi may not be accessible.
Programming.
robot’s motor board, and write code to instruct If needed, loosen the bolts to get to it. Put the
orionrobots.co.uk the motors to turn. microSD card into the robot’s Raspberry Pi.
You can power this Raspberry Pi from a USB
cable during setup. When the lights stop flashing,
You’ll Need Lunchbot’s Raspberry Pi has booted and should
Prepare the microSD card
> Lunchbot 01 When the robot is moving, Raspberry
be ready to contact.
Raspberry Pi has a guide on finding it on
> Set of 6 × AA Pi can’t be tethered to a screen or keyboard. A the network at magpi.cc/kNOAbE. It’s called
batteries (nice and
‘headless’ configuration is needed. Headless raspberrypi.local for now, but you can change this
fresh, alkaline)
means designed to be operated via the network. A by following magpi.cc/HZGBFR.
> 16GB microSD card NOOBs or Raspbian desktop image is unsuitable Since it is headless, SSH is the right way to
> microSD card for this, so use Raspbian Lite. interact with the robot. See magpi.cc/2sLqBmM
reader Download a Raspbian Lite image from and magpi.cc/ssh for instructions on getting in.
> WiFi network magpi.cc/raspbian and burn it onto the microSD
card. Etcher (balena.io/etcher) is recommended
Table 1
IN 1 IN 2 Motor
Spin
Low High Forward
Spin
High Low Backward
How a wheeled
robot moves. The
Driving forwards
08
dark arrows show
the direction of
the wheels; the In drive_forward.py, line 8 instructs the
green arrows show controller to drive both motors forward.
the movement of
the robot The delay on line 9 is needed so that the robot
drives for a little time before stopping the motors.
This controls the direction, but what about time.sleep() uses a time in seconds.
speed? By turning the motor power on and off Put in batteries to switch to battery power. If you
rapidly (in square waves), the ratio of time on vs don’t have a switch, use the last battery as one.
time off changes the speed of the motor. Figures 1 Use SCP to put this code on the robot or use
and 2 show how this works. This is known as Raspberry Pi to edit it. Put it in /home/pi. Give the
pulse-width modulation or PWM. The GPIO Zero robot space to drive and run the code:
library can set the direction and the PWM speed.
python3 drive_forward.py
Have plenty of
shoot off until they hit a wall or off a desk, and
driving space
not in the direction you expect. Emergency stop
Troubleshooting driving forwards
The robot is going
to move and
measures are essential. First, ensure that motors
are always turned off. Python’s try…finally block
09 If running drive_forward.py shows errors,
needs space to do applies in almost all cases. Even if the program check everything in Step 3, and that the code is
so. Don’t test this crashes, it runs the finally code. exactly as listed.
on a tabletop!
If one motor (or both) doesn’t move, inspect the
try: motor controller wiring. Ensure the enable jumpers
pass are fitted. If the motors whine but don’t move, try
# Code that starts motors fresh batteries. If a motor goes backwards, then
finally: swap its pin numbers on line 4.
# Code to stop motors The robot may veer to one side; check the motors
are glued in well, without friction between wheels,
The other measure is an emergency stop button. axles, and robot. Some veer is unavoidable without
Python comes with such a button built-in: pressing sensors. This is when loose screws in the robot will
the keyboard combination CTRL+C will stop the show up and need fixing.
code running and enter the finally code.
E
ver seen those glow-in-the-dark products?
Figure 2
With the Photon Lab, you can learn how
they work and test how effective they are.
Mike
MAKER
Figure 1
Testing phosphorescence
03 Our Photon Lab will use a TSL2591 light
sensor, but as these are hard to get hold of in
small quantities, and very tricky to solder, we
are going to use the Adafruit TSL2591 breakout
board. This chip has two light sensors: a visible
one and an IR (infrared) one, plus a dual slope A/D
(analogue to digital converter) for each sensor.
This sort of converter charges a capacitor with the
sensor’s voltage, and then discharges it through
a known resistor. Timing how long it takes to
h = Planck’s constant
discharge is a measure of the sensor’s output
Figure 1 Electron energy diagram showing how photoluminescence works voltage. See Figure 2.
Figure 4
efore assembly,
B
paint everything matt
black to stop any
internal reflections
integration time, along with other things like the
file name to use to store the results. The way we
made the software work is that the keyboard key
that matches the first letter of the line controls the
Figure 4 The physical
layout of the Photon Lab
parameter. If just the key is pressed, the parameter
increases; if SHIFT and the key is held down, the
parameter decreases.
Finishing off
Top Tip 06 Solder header pins onto the TSL2591 board
and build up the sensor board. Make sure you
Using the strip The software
board as a
leave the maximum length of lead on the LED, as
this will need bending towards the target. Cut a
08 The software is shown in Photon_Lab.py.
template small notch on the base plate to allow the ribbon We decided not to use any of the existing libraries
When making
cable to exit the box. Use countersunk screws and for this chip, as it is so simple to use once you find
the box, lay the 2 mm nylon spacers to mount the stripboard, with the right I2C commands in the data sheet. The
stripboard, track 25 mm hex spacers holding the sample holder and a setGain function sets both the gain and integration
side down, on the 20 mm spacer for the board rest. Before assembly, time of each measurement with a write to a single
base, and drill paint everything matt black to stop any internal register. With the readSensor function checking
through the three
reflections in the light-tight box (Figures 6a, 6b). the status register until it indicates a measurement
holes to the wood
is finished, it then reads the four bytes which
underneath. Do
this for the sample contain the IR and visible readings. Then it kicks
holder as well. off the next reading while it processes this one.
Software design
07 For testing photoluminescence, we need
to (optionally) light up an LED to charge the
Using the software
material, and then take light readings until we
decide enough have been taken. What the software
09 First off, press the F key to bring up a dialog
Figure 5 Parts for the
Photon Lab’s box needs to do is to be able to set both the gain and box enabling you to choose the file name and path
for the results file. Press the D key to choose the
data type; the Full Spectrum option is simply the
Figure 5
addition of visible and IR sensor readings. Press the
G and I keys to set the gain and integration time;
use the SHIFT key to make these go down. The L
Figure 6a
Figure 6a Paint all the parts you can matt black
Figure 7
key toggles if the excitation LED is turned on, with
the E key determining how long it is on for, and the
S key giving the length of delay after turning off
the LED and starting the readings. This is needed
because white LEDs do not turn off very quickly.
Photon_Lab.py DOWNLOAD
THE FULL CODE:
> Language: Python magpi.cc/dhaAam
Photon_Lab.py (continued)
> Language: Python
Tree views
Part 06
A
s mentioned in part five, using a list store g_signal_connect (win, "delete_event",
for a combo box can sometimes be overkill G_CALLBACK (end_program), NULL);
– although in some circumstances, it is
exactly the right thing to do! But the situation for int pos = 0;
Simon which a list store is really designed is as the data
MAKER
Long store for a widget called a GtkTreeView – a table GtkListStore *ls = gtk_list_store_new (2,
of data arranged in columns. The table can show G_TYPE_STRING, GDK_TYPE_PIXBUF);
Simon Long images as well as text, and can even contain other GdkPixbuf *icon = gtk_icon_theme_load_icon (
is a software
widgets, such as check buttons, alongside the data. gtk_icon_theme_get_default (), "dialog-ok-apply",
engineer working
for Raspberry Pi, 32, 0, NULL);
responsible for Creating a tree view gtk_list_store_insert_with_values (ls, NULL,
the Raspberry
To demonstrate this, we’re going to create a new list pos++, 0, "Option 1", 1, icon, -1);
Pi Desktop on
both Raspbian store with two entries per row, a text string, and an gtk_list_store_insert_with_values (ls, NULL,
and Debian. icon. Here’s the code to do that: pos++, 0, "Option 2", 1, icon, -1);
rpf.io gtk_list_store_insert_with_values (ls, NULL,
void main (int argc, char *argv[]) pos++, 0, "Option 3", 1, icon, -1);
{
gtk_init (&argc, &argv); GtkWidget *tv = gtk_tree_view_new_with_model (
GTK_TREE_MODEL (ls));
GtkWidget *win = gtk_window_new (
GTK_WINDOW_TOPLEVEL); GtkCellRenderer *prend =
GtkWidget *btn = gtk_button_new_with_label ( gtk_cell_renderer_pixbuf_new ();
"Close window"); GtkCellRenderer *trend =
g_signal_connect (btn, "clicked", gtk_cell_renderer_text_new ();
G_CALLBACK (end_program), NULL);
gtk_tree_view_insert_column_with_attributes (
GTK_TREE_VIEW (tv), -1, "Icon", prend, "pixbuf",
1, NULL);
An Introduction gtk_tree_view_insert_column_with_attributes (
GtkWidget *tv =
gtk_tree_view_new_with_model (
GTK_TREE_MODEL (ls));
GtkCellRenderer *prend =
gtk_cell_renderer_pixbuf_new ();
GtkCellRenderer *trend =
gtk_cell_renderer_text_new ();
Figure 2
GtkTreeModel *model;
GtkTreeIter iter;
char *option;
sel = gtk_tree_view_get_selection (
GTK_TREE_VIEW (wid));
if (gtk_tree_selection_get_selected (
sel, &model, &iter))
{
gtk_tree_model_get (model, &iter, 0,
&option, -1);
printf ("The selected row contains the
text %s\n", option);
}
}
Getting input from a tree view (This function returns FALSE if there is no valid
A tree view is useful as a display of information, selection – it’s important to check for this as
but it can also be used to read user selections. If otherwise the next line will cause a crash if no row is
you click on one of the rows in the table, it will be selected.) Finally, we can get the actual values from
highlighted – you can also move the highlight up the model and iterator.
and down through the table with the arrow keys on
the keyboard (Figure 2). gtk_tree_model_get (model, &iter, 0, &option,
Whenever the selected row is changed, the -1);
cursor-changed signal is generated by the tree view,
so this can be used to call an appropriate callback: As when setting a value in a list store, the
arguments to this function, after the model and
g_signal_connect (tv, "cursor-changed", iterator, are a list of paired values, the first of each
G_CALLBACK (row_selected), NULL); pair being the column to be read, and the second
being a pointer to which the data should be written.
The callback should be as follows: Multiple values can be read from the same row with
a single call, so -1 is used for the column value of
void row_selected (GtkWidget *wid, the final entry in the list, to show there are no more
gpointer ptr) values to read.
{ In this case, a pointer to the text in the first
GtkTreeSelection *sel; column of the selected row is returned as option.
Strato Pi CM Duo is the perfect solution for high-reliability systems - featuring two distinct SD cards with
high-speed switching matrix for separate OS/data storage, redundancy and in-field full-system upgrades.
Additional features:
- Opto-isolated RS-485 serial interface
- Real-Time Clock with a replaceable backup battery
- Secure element
www.sferalabs.cc
TUTORIAL
P
ICO-8 comes with a comprehensive and them with the top-left button. Generally, they
surprisingly versatile set of music and both show the same information, and both have
sound effect editors. Featuring eight synth the same speed, loop, and instrument selectors.
Dan
MAKER
instruments and seven built-in effects – including The number at the top left is the index of the
Lambton-Howard
slides, vibrato, and arpeggiators – it is an current SFX you are editing. Toggle to index 0 and
Dan is an accessible and easy way to make everything from let’s get started.
independent game retro bleeps and bloops, up to entire chiptune
designer based in symphonies. We’ll walk you through each of the
Newcastle upon
Tyne, where he is
editors as we make some simple sound effects
Pew pew pew!
lucky enough to
make games for
for our space shooter game. Then, we’ll put some
loops together to explore the basics of writing a
03 We think our space shooter could do with an
his PhD.
retro techno soundtrack. All together now! old-school laser sound, don’t you? To achieve this
@danhowardgames in pitch mode, draw a descending series of about
eight notes (Figure 1). You can use any instrument
you want, but we’ve alternated between square and
An anatomy of sound
01 Let’s start with understanding how PICO‑8
pulse waves to give a little retro warble. We’ve also
used noise for the last two notes, to create a sense
handles audio. A PICO-8 cartridge can hold up of impact. Hit the SPACE bar at any point to play
to 64 sound effects (SFX). These SFX are used your SFX. We’ve chosen our SFX speed as 2 (1 is the
DOWNLOAD for everything from gameplay sounds, like the quickest), but play around to see what works.
THE FULL ‘boing’ you hear when jumping in a platformer,
CODE: to backing tracks and incidental music. Each
e think our space shooter
W
SFX consists of 32 notes and each note contains
magpi.cc/fB0ksD
information about its pitch (how high or low), its
instrument (the overall timbre and aural quality),
could do with an old-school
its volume (you guessed it), and effect (how that laser sound, don’t you?
note is altered or modified). You can make a lot of
noise with eight little bits!
Impactful audio
04 To see how your laser sound works in game,
You’ll Need add SFX(0) after the call to create_laser() around
The editors
> PICO-8
02 Load up the space shooter game we’ve been
line 35. Reload your game to hear it in action. It
really is that easy. Now, repeat this process to
magpi.cc/pico8 building, and switch to the SFX editor. The first make an explosion sound. For ours, we’ve used
> Raspberry Pi thing to know is that there are two modes. Pitch around ten notes, starting with deep square wave,
mode allows you to plot notes with the mouse and a surge of noise, then finishing on higher-pitched
> Keyboard and
mouse is best for creating sound effects, whilst tracker saw wave. This creates an initial impact noise and
mode is more suited to music. Toggle between ends on a retro, dopamine-inducing chime. Visit
Figure 1
Figure 1 Here’s the same laser zap sound viewed in pitch mode (left) and tracker mode (right)
Tracker mode
05 Now we’ve got some retro zaps and booms,
let’s move onto the soundtrack. Toggle the editor to
tracker mode. This mode is better for writing music
as it is easier to see the relative spacing and timings
of notes, as well as to adjust individual properties
of each note. You will also be able to see the grey
effect selector buttons in this view. Notes might
look like a baffling array of letters and numbers, but
are actually quite simple. Each line shows the pitch
(A–G#), octave (0–5), instrument (0–7), volume
(0–9), and effect (0–7) of a note.
Figure 2
C
omposers like Chris
‘Gruber’ Donnelly
have produced entire
albums on PICO-8,
a testament to the
versatility of the tool
P
ICO-8’s music editor in full swing. Here it is playing our
composition on three of the four available audio channels
Deep cuts
12 We’ve barely scratched the surface of Top Tip
what you can do with sound effects and music
with PICO-8. But you should have a good enough Only four
grasp of the tools to start exploring the creative
channels
potential of this little virtual console. If you PICO-8 only
want to go deeper, we highly recommend Chris has four audio
‘Gruber’ Donnelly’s series of video tutorials: channels,
magpi.cc/OngdaS. To add to the possibilities, a meaning only
recent PICO-8 update introduced SFX instruments, four SFX can be
playing at any one
allowing makers to define and experiment with
time, including
their own instruments on top of the basic eight. in music.
Plenty to get your teeth stuck into.
T
here will be times when you can’t or If you haven’t changed Raspbian’s password
don’t want to switch to your Raspberry Pi. from the default ‘raspberry’, now is a good time
Perhaps you’re using another computer, or to do so. Click the Change Password button and
Lucy
MAKER
Connect to Raspberry Pi
03 Enter the IP address of your Raspberry Pi
(the four numbers displayed in VNC Server) into
Activate VNC Server the search bar of VNC Viewer (the part saying
on your Raspberry ‘Enter a VNC Server address or search’). Press
Pi with Raspberry
Pi Configuration RETURN to connect to Raspberry Pi.
tool. Choose the
The first time you do this, a window will appear
Interfaces tab and
set VNC to Enabled with a warning: ‘VNC has no record of connecting
Looking at properties
05 You can access Properties from the menu Top Tip
Remote control
04 A window appears on your Windows PC
at the top of the VNC Viewer preview window, but
we’re going to close down the preview window to Technical
displaying the Raspbian desktop interface from access it from VNC Connect. Click End Session in information
your Raspberry Pi. Move the mouse around the the drop-down menu and Yes to disconnect.
window and you’ll see the mouse moving around VNC Viewer now displays a small preview of your You can find a
wealth of detailed
on your Raspberry Pi. You can now use this window Raspberry Pi desktop in the Address Book, along
information on the
to control your Raspberry Pi over the network (just with the IP address. You can double-click this
RealVNC website.
as if you were sitting in front of it). at any time to reopen the connection – but first, Take a look at
Hover the mouse at the top of the VNC Viewer right-click and choose Properties. this Technician’s
window and a menu will drop down from the top Enter ‘Raspberry Pi’ in the Name window; Guide PDF:
of the screen. To the left of the Options is Enter this will make your screen friendlier. Now magpi.cc/JiSeZX
Full Screen; click it and the preview window click Options. The Picture Quality setting is
will take over the screen. Your Raspberry Pi set to Automatic by default. If you have a slow
display may not fit your PC display, so click connection, try setting it to Low; alternatively, if
the Scale button in the menu (so it’s set to you have a fast connection, set it to High.
Scale Automatically). Finally, take a look at the Expert tab. Here you
You will now be able to open apps and use your can find a variety of settings for all aspects of the
Raspberry Pi as if you were working directly on the system. Scroll down to find FullScreen and set
small computer. the drop-down menu below from False to True.
VNC Viewer
displays the
Raspbian desktop
interface remotely
Now when you open Raspberry Pi in VNC Viewer, ith a RealVNC account,
W
Top Tip the preview window will automatically be in full-
screen mode. Choose the options you prefer and you can access your
Speed it up click OK to set them.
Raspberry Pi across the
If your remote
Raspberry Pi feels wider internet
sluggish, hover at Get online
the top of the VNC 06 So far we’ve been working on our local password generator (rempe.us/diceware). Follow
Viewer window
network. With a RealVNC account, you can access the rest of the setup process and click on the email
and click the cog
on the menu that your Raspberry Pi across the wider internet. authentication when it arrives.
appears, then Open VNC Viewer on your PC and click the Sign
reduce the picture In button on the top left. It’s most likely that you
quality on the don’t have an account already, so click ‘Sign up
Options tab.
Sign in
online’. This will take you to the RealVNC website.
Enter your email address and click the ‘I’m
07 Now you need to sign in with the same
not a robot’ checkbox. Now create a password. account on both VNC Viewer on your PC and VNC
Please choose a long and complex password that Server on Raspberry Pi.
is not easy to guess. We suggest using a Diceware The Sign In window should still be displayed
in the Sign In window in VNC Viewer on your
PC. Open VNC Server on your Raspberry Pi and
click Sign In to enable the cloud connectivity
link (displayed just below your IP address
under Connectivity).
Return to VNC Viewer on your PC. You’ll still
see a Raspberry Pi window in the Address Book
section, but below it you’ll see an option called
Team (it will appear with your name). Click this
to see your Raspberry Pi again. However, this is
Use File Transfer to the connection using your VNC Connect account.
send and retrieve
files from your
Double-click it to launch into your Raspbian
Raspberry Pi desktop and remote control.
Top Tip
Got a Mac?
Mac users must
change the
Authentication
protocol to
VNC password
to connect
using macOS’s
native tools.
The difference? This account works remotely, Your Raspberry Pi is now set up for remote
and you can use this from other networks. access. It’s now perfectly possible to remove the
screen and keyboard from your Raspberry Pi
and leave it on the network. It’ll be there waiting
for you to connect from your PC whenever
Send files
08 You can send and receive files from your
you’re ready.
SUBSCRIBE TODAY
FROM ONLY £5
Subscriber Benefits
FREE Delivery
Get it fast and for FREE
Exclusive Offers
Great gifts, offers, and discounts
Great Savings
Save up to 35% compared to stores
FREE Raspberry Pi
Zero W Starter Kit
WITH YOUR SUBSCRIPTION
Subscribe in print
for 12 months today
and you’ll receive:
Raspberry Pi Zero W
Raspberry Pi
Zero W case with
three covers
USB and HDMI
converter cables
Camera Module
connector
Offer subject to change or
withdrawal at any time
SUBSCRIBE
on app stores
magpi.cc 69
TUTORIAL
O O K T A S T I C
L
10 SP
A
HALL
STOMACH SHOT
MAKER We interviewed Luis about this blood-curdling costume idea
a few years ago. It’s very basically a Raspberry Pi with a Camera
Luis Martin Module that displays what it sees on the screen live. The camera
Nuez
is attached to his back, with the screen on his stomach, and the
magpi.cc/KiVVnM
preview mode is used to create the illusion that he has been shot
through the stomach. Grisly.
Characters: As this is an older project, some of the parts may be unnecessary
Zombie, or easy to upgrade to better versions. We also recommend you use a
skeleton screen solution that is powered by your Raspberry Pi so that you can
use a portable battery charger instead.
O
OWW E E NP R O J E C T S
COSTUM E
Use Raspberry Pi weara
ble tech to make
amazing costumes this
Halloween
G A M E B O Y CO ST UM E
MAKER The point of a Game Boy is that it’s small and you
can fit it into your pocket. Turning yourself into a
MikeHandidate portable console as a costume sort of ruins that aspect
magpi.cc/yLdPXL
of it, but at least you are then still portable.
The costume itself is very simple, with a couple
of cardboard sheets painted to make it look like the
Characters: classic Game Boy Color. It’s got a pretty big screen
BMO, robot, any though, so it may need a bit more power than your
other retro video standard mobile battery. Having the gloves work as
game console custom controllers adds an extra level of complexity to
the build; however, GPIO-based buttons are supported
Instead of poking at Mike, you use
in RetroPie, so they shouldn’t be too hard to do. controls on his gloves
RO BO SU IT
MAKER This build combines many
things we enjoy. Robots, simple
Estefannie electronics, googly eyes, flashing
Explains It All lights, and really fun, low-budget
magpi.cc/HPmPZx
DIY construction.
Estefannie used several
Characters: technologies to power this suit,
Darth Vader, including Arduino supplies to
Power Loader, power LEDs around the suit, a
Gort, Teletubby voice changer to giver herself
a more robotic persona, and a
Raspberry Pi to power the screen
on the chest with several functions
which are powered by a series
of buttons. The jaw even moves
depending on how she speaks!
And of course, it’s built using
cardboard boxes and silver tape,
meaning just about anyone can
make the body.
HALLOWEEN
COSPLAY
& COSTUME V O IC E C H A N G E R
SUPPLIES MAKER Voice changers/amplifiers make for excellent parts in a
scary costume, especially when installed in a scary skull
Need some wigs,
Olivier Ros mask like this.
r- magpi.cc/PXEiJX
fabric, or armou While seemingly a simple build – and it generally is – there’s
making su pp lie s? a few neat parts to this project. You need to remove the
Check out our Characters: microphone part of an audio board add-on, and Olivier also
friends at Coscraft Darth Vader, teaches you how to correctly install the built device so that the
(coscraft.co.uk) Dalek, robot, microphone is isolated and to reduce feedback. There’s even a
of
for a huge range alien, Judge Doom button to change between voice types!
mi ng an d co splay
costu
about
supplies for just
.
any wearable build
Modelling clay is
used to fit the device
to the mask, and to
reduce feedback
DOC BROWN
MAKER A good Doc Brown costume can mostly be made with just
a lab coat, cool shades, and a frizzy wig. A great Doc Brown
Carl Monk
costume includes custom-made props from the Back to the
magpi.cc/giHLeF
Future series, such as the flux capacitor that makes time travel
possible, and the time circuit for setting your destination.
The circuit part of the build is fairly simple, making use of
Characters: several seven-segment displays to ape the style of the films,
Darth Vader, and they’re housed in a simple box to complete the
Clock King, Rebel look. Carl has an exhaustive build tutorial on his
pilot, robot website as well, if you wish to pick it apart.
NE OP IXE L SA NS UN DE RT AL E EY ES
MAKER This full-on cosplay has an electronic secret –
simple LED lights for eyes that can change into
Mel Nurdin flashing circles of doom. For those that know of
magpi.cc/ipwbXp
the game Undertale, the light patterns represent
how the character Sans looks when he unleashes
his true power.
Characters: This simple build makes use of a Raspberry
Credit: Beth Dooner
STEAMPUNK
TENTACLE HAT
MAKER Have you ever wanted to have tentacles
growing out of your head? Probably not, we’d
Derek
hope, but we can offer you the next best thing:
Woodroffe
a hat that makes it look like transdimensional
magpi.cc/iqDuUm
tentacles are growing out of your head.
It’s actually quite an ingenious build, using
several servos and plastic tentacle skeletons
Characters: to make the stocking-based suckers wiggle
Twi’lek, and move freely on top of the hat. Some latex,
Andorians, other sealant, and paint bits later and you have a
aliens, animal ears very weird and kinda scary hat.
Each tentacle is
controller by servos
that run on a sine
wave pattern to
make them move
more ‘naturally’
POWER
CONCERNS
Powering your costume
D IS CO B A L L
can be tricky. Not
everything can run off a MAKER For a costume that
Raspberry Pi, so you may is essentially a series
Wolfie
find yourself needing a magpi.cc/VsDiFi
of LEDs, there is a lot
battery pack to provide a going on here. It’s fully
bit more oomph. In that autonomous, playing
case, you can also use a a preprogrammed
5 V battery pack to power
Characters: light display, and can
BB-8, a star,
your Raspberry Pi via the connect to wireless LAN to ape the light show that
a planet
GPIO pins – check out our the builder’s house is playing as well.
full powering guide to find The frame is welded together specifically to fit
out how to do this safely: Wolfie’s granddaughter; however, you can make it
magpi.cc/UiAJdk fit whomever you’d like if making it yourself. It uses
some custom 3D-printed parts to keep a Raspberry Pi
and some batteries in place – at the time of making,
it would last several hours.
74 magpi.cc
TUTORIAL
IR O N M A N A R C R E A C TO R
MAKER Voice modification and LEDs are cool, but how
about voice-controlled (and reactive!) LEDs? This
Team
fantastic project from the MATRIX Labs team turns a
MATRIX Labs
cheap Iron Man costume into a party piece that is sure
magpi.cc/PbaWFp
to attract a few nerds.
The voice-controlled magic is handled by Snips.ai
Characters: (snips.ai), a customisable piece of tech that allows you
War Machine, to create voice assistants that work under your control.
robot, Optimus You can set keywords, train it to make sure it understand
Prime, Gundam your voice, and then hook it up to your MATRIX board.
TH E JA CK ET 2.0
MAKER The cyberpunk aesthetic will probably never
go away, especially now that it’s easier than
CoreDump ever to install electronics into clothes, a bit
magpi.cc/kUjSkV
like ‘The Jacket’ that CoreDump likes to wear
at Halloween.
It’s a pretty standard leather jacket, albeit
with some serious modifications. Not just style
Characters: bits like neon lights and punk spikes, but also
Buzz Lightyear, the fully functional Raspberry Pi installed into
Commander one of the sleeves for that ‘hacking-on-the-go’
Shepard, Fallout look. There’s also a hidden action camera in one
character of the spikes, perfect for first-person video fun.
SPECS
SIGNAL TO
NOISE RATIO:
130 dB
(A-weighted)
DYNAMIC
RANGE:
125 dB
TOTAL
HARMONIC
DISTORTION:
0.0003%
SAMPLING RATE:
Up to 192kHz
BIT RATES:
Up to 24-bit
DIMENSIONS:
125×125×70 mm
PecanPi
Orchard Audio magpi.cc/gedJyS £325 / $399
T
he market is crowded with audio streaming
options available well under £100, so
is there a place for another Raspberry
Pi-based DAC (digital to analogue converter)?
Presented in a brutalist black metal box, Orchard
Audio’s PecanPi is built with some of the highest-
quality components available, aiming it squarely The DAC is a HAT sitting on a Raspberry Pi 3B. WiFi is unavailable,
Verdict
at the serious music lover. Inside you’ll find a to preserve sound quality, so you’ll need Ethernet or an adapter
Raspberry Pi 3B and the DAC HAT itself. The
outputs are analogue, with the two expected phono
One for true outputs accompanied by XLR connectors, making the sound processing (an optional WiFi/Ethernet
audiophiles. If
this suitable for professional setups. bridge is available if needed).
music is your
passion or We tested on a high-end amplifier with all its
profession, and Double DACs sound processing disabled, playing FLAC-encoded
you’re OK with Great care has been taken over component choice music. The result was crisp, detailed, and rich.
the selection of and the design uniquely features two of Texas We can see how this device would appeal to the
available software, Instruments’ highest-specification DACs, one enthusiast or professional requiring best-of-class.
this might well be
for each channel, with some of the industry’s A small let-down is the software. Volumio is an
the best streaming
best-performing op-amps. The result is some open-source playback web app that supports many
8
device out there.
impressive technical specifications, including total different DACs. Although it aims to be pretty, we
harmonic distortion of 0.0003% and a dynamic found it unintuitive and buggy, lacking the polish
/10
range of 125 dB. Even on-board WiFi has been of other similar products like Plex. Luckily, other
disabled to prevent the radio interfering with playback packages are compatible with PecanPi.
76 magpi.cc PecanPi
REVIEW
NanoSTEM IOT
Weather Kit
Nanomesher magpi.cc/rpPidc £64 / $80
SPECS
DISPLAY:
1.3” High
Contrast
OLED (128×96
resolution)
PRESSURE
SENSOR:
BMP180 (range
300–1100hPa)
HUMIDITY &
TEMPERATURE
SENSOR:
SHT31
AIR QUALITY
SENSOR:
CCS811 (TVOC
and eCO2
sensing)
What do you get in the kit, then? Well, it’s a
HAT-like add-on board that covers the USB and
Ethernet ports, along with the rest of a Raspberry
H
ome weather kits are excellent for Pi. This is the ProdBoard that Nanomesher makes,
9
mobile battery.
relatively cheap as well. Featuring an at-a-glance Everything is ready to go out of the box – even the
display for basic data readouts and an online sensors are plugged into the board – so as long as
/10
dashboard with the full suite of data, it’s basically you have access to power, you can get very quickly
the full package. started with monitoring.
SUBSCRIBE AND
SAVEUP
TO
35%
on the cover price
ISSUE #23
10 Best:
Gaming
accessories
Level up your Raspberry Pi gaming
with these accessories and kits
BASIC Arcade Controller Kit
W
e’ve done several features and articles
over the years on how to set up your own Arcade on your lap
Raspberry Pi-based games console. So we This arcade stick-style kit allows you to build an arcade machine right into the
have a good idea what kind of hardware is out there stick. Monster Joysticks also makes a bigger and badder version with high-
that will improve your experience on any Raspberry Pi quality Sanwa arcade parts.
gaming setup. Let’s take a look...
£70 / $87
magpi.cc/ierNVd
Picade X HAT
Ultimate arcade board TinyPi Pro
Created for the amazing Picade,
the X HAT is the absolute perfect Pocket-sized gaming
accessory for turning a
This is a bit more of an accessory and more on the kit side – the TinyPi Pro is
Raspberry Pi into an arcade
absolutely tiny, as the name suggests, yet still allows you to play a huge variety
machine. Just build the
of games.
cabinet, add the buttons,
and you’re good to go. £92 / $115
£16 / $16 magpi.cc/EXKvig
magpi.cc/eaiQpA
USB Gamepad
A retro classic
Including the European/Japanese
gamepad colour scheme, this retro-style controller has enough
buttons to allow you to play just about any game you have prior
to 1995, and some newer homebrew stuff.
£6 / $8
magpi.cc/RRLFPM
£9 / $10
magpi.cc/LpMyCp
Joy Bonnet
Tiny controller HAT
This funky add-on for Raspberry Pi
Zero turns it into a controller that is its own console. It’s a bit fiddly,
but it’s also an excellent party piece and can even fit in your pocket.
£14 / $14
magpi.cc/biqbgi
Wireless
Gamepad
New school cool
Playing newer games
thanks to Steam Link or other
streaming tech? Then you may need
a controller that can do it all, which also
doesn’t limit you to the length of a USB cable.
£14 / $18
magpi.cc/fXqWFh
Cupcade
Mini arcade cabinet
Keybow Kit
Arcade machines can be huge and
Extra hot keys
expensive to maintain. The Cupcade
can fit on a DVD shelf and the parts Need more keys for your gaming? Look no further than the Keybow, a
are much cheaper. Plus, you don’t Raspberry Pi-powered mechanical keypad. You can program the keys
need to hire a van to move it – bonus! to do anything you want, so it’s great for MMOs.
Learn Scratch 3
with Raspberry Pi
Discover the delights of the remarkably easy-to-use
programming language. By Lucy Hattersley
Raspberry Pi Resources
Raspberry Pi Scratch is a wonderful educational tool for learners of
AUTHOR
video courses for Scratch. Most Snake Game, Scary Shark Game,
Price: are being updated for Scratch 3, Helicopter Game, Racing Car
£150 / $150
but and this gaming course is Game, Crossing the Road Game –
magpi.cc/rxAAwp one of the first out. The course all of which builds up to a version
is by Dr Chris Mall and covers all
the basics of programming using
of the arcade game Arkanoid.
There are 46 lectures in all, with Courses &
Scratch 3.
After the introduction to
eight hours of video, along with
two articles and downloadable
projects
blocks and commands, you’ll resources for each game.
As with all Udemy courses, Learn computer
it can be expensive but is
science with these
frequently available at a discount.
The RRP is £150, but at press time
Scratch courses and
it was on sale for a much more online projects
palatable £12.
Dr Mall also has another
course, Scratch 3.0 for Teachers
(magpi.cc/qnSgEA), with
similar content, but aimed at a
classroom environment.
HARVARD CREATIVE
COMPUTING CURRICULUM
Team learn Scratch straight from the computing experience using the
source? Open up Scratch 3 on Scratch programming language.
Price:
Free
your Raspberry Pi and click the magpi.cc/yhJPtR
Tutorials button.
magpi.cc/jhzDsu
Inside the Scratch 3 program, GOOGLE CS FIRST
you’ll find a Getting Started A free computer science
guide and plenty of other broader focus on animation curriculum that makes coding
tutorials for learning key and storytelling. easy to teach and fun to learn.
concepts in Scratch. As with Some tutorials, such as magpi.cc/mrppRV
the Raspberry Pi Projects, Video Sensing, can work with
these are a varied bunch of Raspberry Pi. But there isn’t CODE CLUB PROJECTS
imaginative projects. the focus on hardware such as Many Code Club projects
You’ll find such projects as the Sense HAT or GPIO pins. appear on the Raspberry Pi
Animate a Name, Make Music, For that, you’ll need to look to website, but it also has a
Create a Story, and Create Raspberry Pi itself. However, collection on the Code Club
Animations that Talk. There the built-in tutorials are a good website. There is a great
are also a few games, such as source of fun and these projects collection of additional
Make a Chase Game and Pong are directly integrated with projects here.
Game. But there’s a much Scratch 3. magpi.cc/kRHmrC
Sean Raser
Computer science teacher, Raspberry Jam organiser, and
Code Club leader. Sean Raser sure loves to teach Raspberry Pi
> Day job Teacher > Community role Raspberry Jam organiser > Twitter @sraser88
F
or a lot of the people who Valley) and through my school The Castro Valley Jam is his
do a lot with Raspberry Pi, district (San Ramon Valley big community Raspberry Jam,
they’ve been here since Unified School District),” with attendees from all walks
day one – 29 February 2012. Sean tells us. “I also teach of life trying out Raspberry Pi
Sean, on the other hand, didn’t ‘Physical Computing with projects. Sean’s school-based
even learn about Raspberry Pi Raspberry Pi’ classes through Raspberry Jam is aimed more
until early 2015, but that hasn’t our local Education Foundation, towards middle- and high-
stopped him from teaching which take place after school, as school students, though.
about it, putting on events well as during holiday breaks
about it, or running a Code and summer. I am also the Do you use Raspberry Pi in your
Club using the Raspberry Pi leader of the Castro Valley Code high-school classes?
Foundation resources. Club, which I started just around I absolutely do! I have used them
“I have held Jams in both my one year ago (right after I a few different ways. I have used
local community (Castro attended Picademy).” them as their own separate unit,
This Month in
Raspberry Pi
Scratch
Conference Europe
The Raspberry Pi Foundation 01
hosts a Scratch party
Y
ou’ve probably read all about the big Scratch
Conference that the Raspberry Pi Foundation
hosted last month on page 6. It was a great
time for all involved, and we have the pictures to
prove it!
02
03
04
05
06
07 08
09
MagPi Monday
Amazing projects direct from our Twitter
E
very Monday we ask the question: have you
made something with a Raspberry Pi over
the weekend? Every Monday, our followers 01
send us amazing photos and videos of the things
they’ve made. Here is a small fraction of them.
Follow along at the hashtag #MagPiMonday.
02
05
06
DACBerry AMP2
Pi-oT – IoT Module
With all the DACs available for Raspberry Pi, why should this be the
IoT modules for Raspberry Pi are quite common; one for you? Well, the blurb says: “The DACBerry AMP² provides a
however, this one is quite the beast. Not only is it 4×60 W amplified dual stereo output in Dual Stereo mode and up
designed with normal home automation in mind, but also to 2×100 W in Dual Mono mode. Integrates a 192kHz/32-bit DAC
with industrial automation. It certainly looks the part. chip with hardware volume mixing and mini DSP.”
CROWD
kck.st/2Q3AYTO
kck.st/2MELG0B A PI PRFUNDING
OJECT
If you
’ve la ?
irresis unche
tible P d an
projec i-relate
t, let u d
magp s know
magpi.cc/tfJwaa magpi.cc/igkFed
04
05
08
Raspberry Jam
Event Calendar 01
Find out what community-organised Raspberry
Pi-themed events are happening near you…
FIND OUT
ABOUT JAMS
Want a Raspberry Jam in
your area? Want to start
one? Email Tom Hadfield
about it:
jam@raspberrypi.org
Ticketing
“W
e make sure free tickets are always
available for those who need them.
We issue an ‘optional donation’ ticket
with a suggested donation of £3 per person, or £5 if
attending a workshop, but we make it very clear
that it is entirely optional. We then also go
round and shake a tin about half an hour
before the end.”
Your
Letters
Adults in space!
I always love hearing about
new Astro Pi projects; however,
I think I’m a bit too old to
participate in it! Is there
anyway for us grown-ups to get
involved? Would love to say I’d
helped get something in space!
PC HARDWARE
ENTHUSIASTS
WIN
ONE OF FIVE
ROCKYBORG
ROBOTS!
We reviewed the RockyBorg last issue
(magpi.cc/85) and loved it. It’s fast,
easy to program, and fun to use.
Competition magpi.cc 95
AVAILABLE NOW AT VILROS
/vilrosusa
NEXT MONTH
EDITORIAL
Editor
Lucy Hattersley
lucy@raspberrypi.org
Features Editor
Rob Zwetsloot
rob.zwetsloot@raspberrypi.org
Sub Editors
Phil King and Nicola King
BUILD A
ADVERTISING
Charlotte Milligan
charlotte.milligan@raspberrypi.org
R A S P B E R RY P I
+44 (0)7725 368887
DESIGN
criticalmedia.co.uk
Head of Design
4K M E D I A
Lee Allen
Designers
Sam Ribbits, Harriet Knight,
C E N T RE
Ty Logan
Illustrator
Sam Alder
CONTRIBUTORS
Mike Cook, David Crookes, PJ
Evans, Rosemary Hattersley,
Michael Horne, Nicola King,
Daniel Lambton-Howard, Simon
Long, Sean McManus, Tim
Richardson, Danny Staple
PUBLISHING
Publishing Director
Russell Barnes
russell@raspberrypi.org
Director of Communications
Liz Upton
CEO
Eben Upton
DISTRIBUTION
Seymour Distribution Ltd
2 East Poultry Ave,
London EC1A 9PT
+44 (0)207 429 4000
SUBSCRIPTIONS
Unit 6 The Enterprise Centre
Kelvin Lane, Manor Royal,
Crawley, West Sussex, RH10 9PE
ON SALE 31 OCTOBER
magpi@subscriptionhelpline.co.uk
O
ur volunteer experience with and clear-down, who gave talks, and without you. You are the backbone
Raspberry Pi started way who did show and tell. All of these of every event that is run, the
back in May 2013. First, Mike volunteers gave up their own time so (sometimes hidden) element of any
resurrected the Cambridge Raspberry that we could support the aim of the successful event.
Jam. Two Jams later and Tim joined in Jam – which was primarily to help kids
to run the event. learn to both code and get involved in Getting involved
Together, we turned it into one of physical computing, as well as support If there is a message behind this
the biggest Raspberry Jam meet-ups the vast array of hobbyists that were article, it is to encourage anyone
in the world. That is only part of the using Raspberry Pi. reading to support your local events;
story, though, because it sounds like to get involved. If you are a hobbyist,
we did it all ourselves, which just is Rise of the robots consider spreading your knowledge
not true. When we then started Pi Wars, the and experience around. If you are
In order to make the Jam bigger, challenge-based robotics competition, bringing your child to an event, and
we needed a larger venue, and to be we knew that it would only work with you are on your own, of course you
honest, we did not have a clue as to the help of others. We could sort out will want to keep an eye on them. If
both parents are attending, though,
one or both of you might consider
e had so many volunteers who contributed
W giving up some of your time to
only with the help of other people that the organisation of the event and the
we managed to keep it going. We had ‘other side of the coin’ when it came
Between them, Mike & Tim have run
so many volunteers who contributed to the event itself. the Cambridge and Potton Jams, Pi
so much to the Jam. We had people We are incredibly grateful to anyone Wars, and the first two Raspberry Pi Big
who ran workshops, who manned the who has volunteered at one of our Birthday Weekends.
front desk, who helped us with setup events. We simply could not do it Mike @recantha / Tim @geeky_tim