Beruflich Dokumente
Kultur Dokumente
RETRO
GAMING
BLISS
Build this handheld gaming masterpiece
with the brand new Raspberry Pi Zero W
Also inside:
PI ZERO NOW HAS
> THE TINY PI-POWERED SMARTPHONE
> UPGRADE YOUR TV WITH A PI HTPC
WIRELESS!
And its hidden
> 3D MODELLING ON RASPBERRY PI inside this months
Issue 55 Mar 2017 5.99
THE ONLY MONTHLY MAGAZINE WRITTEN BY AND FOR THE PI COMMUNITY 9 772051 998001
Welcome
WELCOME TO
PAGE 2
8
THE OFFICIAL
MAGAZINE
ts been extremely hard to keep the
I existence of the Pi Zero W secret over
the last few months. When Eben Upton
first revealed that he had something new in the
pipeline, we spent the rest of the day discussing
how much of a game-changer it could be for
hackers and makers around the world.
Now that the wireless connectivity of the
Pi Zero W has been revealed, you can find
SEE PAGE 28 FOR DETAILS
the definitive breakdown including some
background into its making starting on
page 64. And beginning on page 14, this
months big build integrates the new Pi model THIS MONTH:
with Adafruits amazing PiGRRL handheld
console, making it even better than before.
To celebrate even further, weve got a new 14 BUILD THE ULTIMATE HANDHELD
subscription offer that lets you walk away Upgrade the famous PiGRRL console in this months big build
with your own Pi Zero W and brand-new
official Pi Zero case that comes with three
42 MAKE AN ALEXA-POWERED ROBOT
This Alexabot responds to your emotions
interchangeable covers. Youll also get cables
for the Camera Module, HDMI, and USB ports.
64 THE PI ZERO W IS HERE!
Learn more on page 28. Enjoy the issue! The latest version of the Pi Zero is amazing. Heres why
This magazine is printed on paper sourced from The MagPi magazine is published by Raspberry Pi (Trading) Ltd., 30 Station Road, Cambridge, CB1 2JH. The publisher,
sustainable forests and the printer operates an editor, and contributors accept no responsibility in respect of any omissions or errors relating to goods, products or services
environmental management system which has referred to or advertised in the magazine. Except where otherwise noted, content in this magazine is licensed under a
been assessed as conforming to ISO 14001. Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported (CC BY-NC-SA 3.0). ISSN: 2051-9982.
raspberrypi.org/magpi March
April 2016
2017 3
Contents
Issue 55 March 2017 raspberrypi.org/magpi
BUILD A RETRO
HANDHELD
> MAKE A WHOOPI CUSHION 56
Create an electronic farting machine
COUNTERFEIT GOOGLE
IN THE NEWS CASES SURVEY
PI CURRICULUM
94
FOSDEM
PI ZERO W
You asked for wireless LAN. You got wireless LAN. Heres 64 The open-source development
82
everything you need to know about the improved Pi Zero community come together
COMMUNITY
> THIS MONTH IN PI 84
What else happened in the world of Pi?
ZEROPHONE
A Raspberry Pi Zero thats also a phone
> EVENTS
Find a community event near you
> LETTERS
90
92
We answer your pressing questions about the mag
PI TELESCOPE 32
View the stars with Pi-aided accuracy
REVIEWS
> KODI 17 74
HEARTBEAT 34 > PI METRE 76
MONITOR > SPEAKER PHAT 77
A fitness project that monitors your heart rate
> CLUSTER HAT 78
raspberrypi.org/magpi March 2017 5
News FEATURE
RASPBERRY PI
CREATES
CURRICULUM New curriculum aims to teach the power of digital making
he Raspberry Pi For the community Individuals who run digital
T Foundation is determined
to put the power of digital
We have a large and diverse
community of people who are
making clubs at schools,
community centres, and
making into the hands of people interested in digital making, Raspberry Jams may draw
all over the world. explains Carrie Anne Philbin, on it for extra guidance.
It has taken an exciting step director of education at the Some teachers may wish to use
in this journey, by defining its Raspberry Pi Foundation. the curriculum as inspiration for
digital making curriculum that Some of those people what to teach their students.
Below Teachers
will help people everywhere learn might use the curriculum to We want to help people to
can use the
curriculum to new skills. help guide and inform their make things so that they can
develop their skills
You can view the new curriculum learning, or perhaps their become the inventors, creators,
and as inspiration
for school lessons online (magpi.cc/2kZD18j). childrens education. and makers of tomorrow, says
Carrie Anne. Digital making, Learning for all ACCESS THE CURRICULUM
STEAM, project-based learning The Raspberry Pi Curriculum is
and tinkering are at the core of the open to everybody, regardless of A PDF version of the curriculum is available to
Foundations teaching philosophy. age or experience. We wanted download direct from the Raspberry Pi Foundation:
This principle can be summed up to avoid the age-related and magpi.cc/2kZzvuO.
simply as we learn best by doing, stage-related labels that are
Carrie Anne tells us. often associated with a learners e am specifications in a fun and
progress, reveals Carrie Anne, tangible way.
The curriculum [along with] the preconceptions, The Foundation is continuing
The curriculum has five strands these labels bring. to expand its catalogue of free
Design, Programming, Physical The Raspberry Pi Foundations educational resources. It expects the
Computing, Manufacture, and digital making curriculum is not curriculum to grow and improve,
Community and Sharing. Each of
these encapsulates key concepts
and skills in digital making. Users We want to help people to make things
so that they can become the inventors,
will progress in each strand. You
start with certain skills and
knowledge, says Carrie Anne.
Then, with guidance, practice,
and understanding, you progress
creators, and makers of tomorrow
towards broader and deeper
knowledge and competence. intended to be a replacement for but is requesting input into that
Characters are used to represent computer science-related curricula process. This is vital says Carrie
different levels of ability. around the world. Anne. So please do take a closer
Progression starts with Creator, It hopes that following the look at the program (see Access
and moves onto Builder and learning pathways will support the curriculum) and send your
Developer before becoming Maker. the study of formal curricular and feedback (see How to get involved).
HIGH SCHOOL
REPLACES
COMPUTERS
WITH RASPBERRY PI
MC2 STEM High School using Raspberry Pi to boost computer science skills
ne school in Cleveland,
O Ohio has chosen to use
Raspberry Pi rather than
buy expensive new computers.
Instead of the Raspberry Pi
being a limitation, the smaller
boards have enabled MC2 STEM
to implement a full computer
science curriculum.
MC2 STEM High School is a
unique school, says Feowyn A
MacKinnon, head of school.
There are 50,000 students in the
A mobile Fab Lab enables MC2
district, and 100% of them qualify STEM students to build projects and
demonstrate them to nearby schools
for free and reduced meals. As a
result, the technology situation
can be quite bleak. Feowyn, we have come to depend I imagine we may be one of the
The computers at MC2 were completely on Raspberry Pi. only high schools doing this,
ten years old and hopelessly out of It turns out the Raspberry Pi says Feowyn.
date. More useful as paperweights is better for teaching STEM than The Raspberry Pi then evolved
than technology, Feowyn tells us. traditional equipment. Our from just a cool, fun, learning
experience to an all-encompassing
traditional equipment
in the US to own a mobile Fab Lab.
The mobile Fab Lab comes in
handy when we want to express
Traditionally, schools in America students experience an innovative our ideas to other schools, says
would have a fund-raising drive to and fun project while building MC2 STEM student Brandon
try to secure the money required their Raspberry Pi computers, (magpi.cc/2kLla6s). I like the
for new technology. However, MC2 reveals Feowyn. idea of project-based learning and
had a better idea. MC2 is now teaching a full year being able to build stuff with your
Rather than try to fund-raise long computer science curriculum hands, instead of always doing
for new technology, explains using only Raspberry Pi computers. writing work.
WATCH OUT
FAKE CASES Fake Raspberry Pi cases doing the rounds
nscrupulous dealers are computers, cases, cameras, and
U selling fake Raspberry
Pi cases on third-party
other products goes straight
into our charitable fund to train
websites and eBay. teachers, provide free learning
Kinneir Dufort designed the resources, teach kids, help build the
official Raspberry Pi case. While foundations of digital making in
there are many third-party cases schools, and much more.
available, the fake cases are Let The Raspberry Pi Foundation
intended to mimic the official case. know if you find fake cases in the
The Raspberry Pi Foundation wild. It damages our reputation
managed to get its hands on a when something shonky comes on
WORLD
The stories we shared that
flew around the world
Hello World is a
WIRE AND LOOP GAME
new magazine from
the Raspberry Pi magpi.cc/2hNaep3
Foundation thats
free to all educators This Wire and Loop game is a great project for learning
basic circuits, electronics, and Python coding.
ROBOTS AT THE
SCIENCE MUSEUM
Above Baxter
is the worlds New exhibition brings 100 robots under one roof
r o arme
robot designed
ver 100 robots are who built, commissioned or Some of the robots are incredibly
O
to work together
i h eo le on display at a new gazed upon these mesmerising lifelike. Zeno R25 has incredible
exhibition at the Science mechanical creations over the past expression, while Nao will dance,
Museum, London. 500 years reveals so much about blow kisses, and exercise.
The exhibition is called Robots humanitys hopes, fears, dreams, iving head-first into the
and is set to last all summer. and delusions. uncanny valley is Animatronic
It explores humanitys 500-year Pepper is a humanoid companion baby. The baby breathes, sneezes,
quest to reimagine ourselves as created to communicate with and moves its arms and legs. Its
machines, explains the museum. humans through voice and touch designed to make you feel strong
Robots is open daily until and movement. This robot invites emotions towards a robot.
3 September 2017. Tickets are on visitors to touch its hands and fist- Ben Russell, the lead curator
Below
RoboThespian was sale now (magpi.cc/2kLvyeO). bump while sharing a story using of Robots, says: Coming face to
he r ull i e
Ian Blatchford, director of the the screen on its chest. face with a mechanical human
humanoid robot to
be commercially Science Museum Group, says: Baxter, REEM Service Robot, and has always been a disconcerting
produced
This stunning exhibition explores Amico are industrial robots with experience. That sense of unease,
Below right Robs the fascinating question of why, amazing precision, while robots like of something you cannot quite put
Open Source
rather than how, we build robots. ROSA, Inhka, and RoboThespien are your finger on, goes to the heart of
Android was built to
move like a human To look through the eyes of those used to interact with humans. our long relationship with robots.
GOOGLE
TOOLS
Tech giant asks makers for advice on AI tools
oogle is going to arrive in style in 2017. The tech
G titan has exciting plans for the maker community.
It intends to make a range of smart tools available
this year. Googles range of AI and machine learning
technology could enable makers to build powerful projects.
To make this happen, Google needs help from the
maker community. Raspberry Pi fans are the best
makers around, and its their ideas that will give the tech
company direction.
Heres what Google has to say: Hi, makers! Thank you
for taking the time to take our survey. We at Google are
interested in creating smart tools for makers and want
to hear from you about what would be most helpful. As a
thank-you, we will share our findings with the community
so that you can learn more about makers around
the world.
The company can produce some serious tools for the
maker community, so make sure you have your say to get
the tools you need.
Let Google know what you would like by filling out the
survey: magpi.cc/2l152MR.
RETRO
GAMING
BLISS
Build upon Adafruit's amazing Pi GRRL 2 using the brand new
Pi Zero W to create the ultimate retro handheld console
ASSEMBLE
YOUR PARTS Heres what youll need to make the Pi GRRL Zero W
Pi Zero W
> magpi.cc/2l6zurq <
The key to this project is the Pi Zero W. The wireless-
enabled version of the Pi Zero is as powerful as the
Pi Zero, yet saves a load of space thanks to the radio
chip included in it, so no WiFi dongle is needed. It
runs at 1GHz, which makes it powerful enough to run
emulators of many eighties and nineties consoles.
Adafruit
TOOLS 3D-printed PiTFT 2.8
FOR THE JOB
case > magpi.cc/2lob5Ky <
Soldering iron This is actually a touchscreen, although
> magpi.cc/2kS9K1f <
Wire we wont be making use of it in that way.
Heat shrink The PiGRRL 2 case repurposed for our needs. t fits neatly in the case and provides
Glue It has some spaces for USB and Ethernet on four extra buttons to use when playing
Blu-Tack a B+/2/3 board, but the Pi Zero will require games. You can also assign system and UI
Wire strippers extensions if you want to make use of the gaps. shortcuts to the buttons.
Hobby knife
PiGRRL 2
controller
board
> magpi.cc/2lohZzr <
PowerBoost
1000C Slide switch
> magpi.cc/2lo5aFg < > magpi.cc/2lojfTb <
This is one of the cool bits: were going This switch allows you to turn the power
to use this PowerBoost to actually on and off. Its best to do the software
charge a battery within the handheld. shutdown of RetroPie first before
With the low power draw of the Pi and switching the power off, though.
advancements in modern battery tech,
youll get a lot out of one charge.
Microswitches
GPIO hammer > magpi.cc/2lo890i <
headers
The beauty of proper retro gaming is tactile
controls. Youll need ten 6mm switches,
and a couple of 12mm buttons.
> magpi.cc/2lohN2U <
A wonderful innovation from Pimoroni,
these GPIO headers require zero
soldering and can be (carefully) 2500mAH
battery
hammered onto the empty
pins of a Pi Zero.
SCREWS
A selection of
Bluetooth audio (optional) screws to attach
the parts to the
Theres no dedicated Audio Out on the Pi Zero W, but it does case. This includes
have Bluetooth. RetroPie doesnt support Bluetooth audio yet, 14 #4-40 and
but there are workarounds: see magpi.cc/2oMboUz 6 #2-56 3/8
machine screws.
HOW TO PRINT
YOUR 3D CASE
pigrrl2-top.stl
>STEP-01
pigrrl2-bot.stl
GET THE FILES pitft-buttons.stl
he ull a e le an e dpad2.stl
downloaded from magpi.cc/2kS9K1f, action-btns.stl
althou h there are ore le here than pause-start.stl
what ou a tuall need to r nt he one shoulder-btns.stl GET THE FILES AT
youll need from the pack are: shoulder-mount.stl
magpi.cc/2kS9K1f
>STEP-02
FIND A 3D
PRINTER
t an e tr to nd a ood r nt n er e
online, so unless you have access to a 3D printer, we
highly recommend using 3DHubs.com t l t lo al
printing services, along with an estimated completion
t e and re ew he le we downloaded al o wor
USE 3DHUBS.COM
w th the er e to print your case!
>STEP-03
UPLOAD FILES
Once youve selected your printer, youll be asked to upload
the le ou le he ou e ele ted the orre t one and
a e ure the u load ro erl ou ll et an error the a l
uall tr n a a n w ll wor ou al o onl need one o ea h
and or are reat ater al to u e or the art
PREPARING YOUR PI
Get your Pi Zero W ready to be made into a retro gaming treasure
SELECT START $ cd
$ curl -O https://raw.githubusercontent.
When you come back to reconfigure your buttons, refer to this handy guide
com/adafruit/Raspberry-Pi-Installer-
Scripts/master/pitft-fbcp.sh
$ sudo bash pitft-fbcp.sh
SETTING UP WIRELESS
rele onne t t on the new ero reat ut the
on urat on ethod or w rele on the etro e er ele t and don t re oot ow we need
a ou ll need to now the na e o our w rele networ to add u ort or the u to utton a n the
(SSID) along with the password, as it wont be able to search for command line, use:
a a la le networ ou an al o ort deta l load n a t t
le onto the oot art t on
$ cd
$ curl -O https://raw.githubusercontent.
com/adafruit/Raspberry-Pi-Installer-
Scripts/master/retrogame.sh
$ sudo bash retrogame.sh
>STEP-01
PREPARE THE
GAMEPAD BOARD
ur r t o to older the header n onto the
a e ad oard ou an ee t all n la e w th a
l ttle lu a e ore older n t on a e ure ou re
older n the header onto the orre t de o the oard
>STEP-02
ADD THE
BUTTONS
Now its time to carefully solder
the ten 6mm microswitches
to the front of the board.
Some helping hands would
be good here.
>STEP-03
TURN ON
THE BACKLIGHT
de ault the doe n t ha e t a l ht
turned on ou need to ta e a ra t n e and ut the
r u t etween the lo n the o that ou
an ee r led n the ture
>STEP-04
RESIZE
THE
RIBBON
CABLE
t a ood dea to horten
the r on a le
a arentl the er e t e ut
ou an o a l ttle lon er n e
ou e ea ured t ut the a le
>STEP-05
ASSEMBLE
THE CABLE
Using something like a pen or pin, youll need to push
in the clip that holds the connector in place on the
part youre discarding. Very carefully remove the cable
and install it at the end of your newly trimmed cable.
>STEP-06
PREPARE
FOR POWER
o a e all our older n ea er we ll da o e
older onto the ot where we need t or the
o ent n the ower oo t add o e
older to the o t e and ne at e n and the
and n ut one o the le o the ower
w t h and ut o e older on the other two
>STEP-07
SOLDER ON THE SWITCH
a e ure the ower w t h w ll t n the hole or t n the a e t on
the de o the otto art ou a need to le awa the la t a t
n e that done tr two hort t o w re to a out lon and older
one to ea h le older tho e to and t doe n t atter wh h wa
around the o
>STEP-08
SHOULDER
BUTTONS
The shoulder buttons (the 12mm ones) need to
be attached to the controller board much like the
switch was connected to the power board. Clip two
legs off each and use a pair of pliers to atten the
remaining two. Solder wires to each pin (about 14cm
long) and then solder the other end to the bumper
pins on the controller board. Again, polarity doesnt
matter, but keep each one as a pair in the row.
>STEP-09
WIRE IT
ALL UP
ow we an o ne the ower
w th the ontroller oard wh h
w ll allow u to ro de ower
to the whole te older two
w re a out lon to the
under de o the and n
on the ontroller oard he
w re hould then e oldered to the
o t e o the ower oo t oard
w th the to the ne at e
>STEP-10
HAMMER
THE HEADS
Its now a good idea to add the GPIO
headers to the Pi Zero W. Gently
hammer them in until theyre secure,
and youre done. >STEP-11
>STEP-12
BACK PLATE
ou ll now need to ount the a utton and
the ower oo t he rear utton ha e a late
that ee the n la e and da ru t u e t
u n a l ttle lu a to t the w t he n
o t on ou ll atta h the ower w t h and then
nall rew on the ower oo t e are ul w th
the w re that ou e oldered on
>STEP-13 WANT
TO KNOW
CLOSE IT UP MORE?
ow ou an nall lo e t u n ert Prefer to use a
the atter and ta e t down need full-sized Pi? Check
e e ore rew n t hut a e ure out the original
all the a le are a el n de the a e PiGRRL 2 guide
e ore t hten n t thou h magpi.cc/2l0ALzQ
USING A
WIRELESS
PIGRRL
Heres some of the amazing advantages
of having the PiGRRL powered by Pi Zero W
CONNECT
VIA SSH
Physically connecting to the Pi Zero inside is a massive hassle once the
case is screwed together. With the Pi Zero W connected to your home
UPDATING
network, though, its easy to connect to it remotely from another
computer using SSH.
RETROPIE
On a Mac or Linux machine (which includes another Raspberry Pi!), You can update RetroPie from the handheld itself
you can simply open the terminal or command line and enter the or via SSH in the command line. The keyboard
following to connect: might be better suited for this, so if youre by your
computer it wouldnt hurt to use it instead.
From the handheld, you need to go to the
ssh pi@retropie RetroPie menu in EmulationStation and activate
the setup script. From the terminal (if youve
SSHed in), you can use the following command:
It will prompt you for a password, which is raspberry. The
user name in this instance is pi, with retropie being the default
name for the system on the network. sudo ~/RetroPie-Setup/retropie_setup.sh
For Windows machines, youll have to connect using an SSH
application like PuTTY
(magpi.cc/2lBHCRm). Once From here, look for the Update All Installed
its installed, you need to set Packages option. There are many options here
the host name to retropie, that you can select from, including managing the
the port to 22, and then click individual packages in case you want to remove
Open. Youll need to put or add any. To update, you can select the option
in pi as the user name and Update all installed packages (which will also
raspberry as the password. update the RetroPie-Setup script as well) or
Once inside, you can control you can go to Manage packages and update the
many aspects of the system packages individually. This could be useful if any
via the command line. If packages have some problems updating, or if you
youve used the terminal in want to do the essential updates before running
You can ignore a lot of the PuTTY interface Raspbian, youll know how it out the house.
when just connecting to the handheld works: sudo reboot, ls, cd, etc.
UPLOADING
FILES
If you want to upload ROMs to the handheld, PLAYING
ONLINE
you can do so with the Pi Zero Ws wireless
connection. Otherwise, youd have to manually
load them onto the SD card, which would
require dismantling the console to get to the Otherwise known as netplay in emulation circles, this allows you to play
Pi Zero not particularly easy or practical multiplayer games with friends, even if theyre on the other side of the
to do. Luckily, RetroPie includes Samba and world! Lets see the SNES do that! Not every emulator supports it and
SFTP, which allow you to transfer the files over if it does, you need to follow three extra rules: both parties need to be
the network. running the same version of RetroArch, both must be running the same
For Samba its nice and easy: when your emulator, and both need to be running the same ROM.
handheld is connected to your network, you You then need to configure netplay from the setup script. If youre
can go to your main computer and find it on hosting, change your Netplay Mode to host, make the host IP your IP
the network shares as \\RETROPIE. Here you address, and pick a nickname. The client (other player) needs to go to
can upload any necessary extra files to the the same menu, change Netplay Mode to client, change the host IP to
handheld with minimal hassle. the other handheld, and pick your nickname. You may need to open up
For SFTP youll have to make use of a specific TCP/UDP port on the hosts router, which you then need to
specialsoftware. For Windows, the set as the same on both systems.
RetroPieteam recommend WinSCP Now both of you need to open the same ROM using the js0 key
(magpi.cc/2lCwRhz); for Mac, you can try (which should be X on a SNES layout) and select Launch with netplay
Cyberduck (magpi.cc/2lCwjs9). enabled. If its been set up correctly, youll connect!
Once booted up, you can use the same SSH
settings as we used for PuTTY. You can then
drop the files into the corresponding folder in
the roms directory.
CAUTION!
PIRATING VIDEOGAMES IS BAD,
NOT TO MENTION ILLEGAL!
Dont use illegally downloaded
content on your PiGRRL.
MEET THE
RUIZ BROTHERS
We talk to the original creators behind the Pi GRRL and many other amazing Adafruit projects
PIGRRL HISTORY T
wo of the superstars of the maker scene are No Ruiz
and Pedro Ruiz, otherwise known as the Ruiz Brothers.
How the PiGRRL project has evolved Theyve done many amazing projects for Adafruit,
including a lot of 3D printing and wearables, which always go
down well with the community. So its surprising to hear theyve
onl een n the a er ene or a out e ear
rother and ur ha ed our r t r nter n and
quickly started using it in our work, No tells us. While looking
for a way to integrate lighting into our 3D-printed designs, we
discovered Adafruit and the Arduino platform. We built some
projects using their parts and came up with some unique ideas.
We went on Adafruits weekly live show-and-tell show, and the
rest is history.
hat tarted o a a load o ool ha that added to
existing products or enabled you to create great light-up projects
quickly evolved into doing more. Part of this was to do with the
introduction of the Raspberry Pi.
PIGRRL ur r t ro e t w th the a err wa the eara le
The original PiGRRL celebrated the 25th anniversary with Near-Eye Video Glasses, explains No. We were interested
of the Game Boy and used the original Raspberry Pi
Model B to power it. Its a lot bigger than the version
were building, although it more accurately matches
the size of the original Game Boy.
RASPBERRY PI
POKMON FINDER
> magpi.cc/2lKXpcA <
Based on the Lure Modules found in Pokmon GO, this
project caused a little bit a stir at the time, as it used
some APIs that people possibly shouldnt have had
access to. It would tell you if there were any Pokmon
in your immediate area, and even display a coloured
light for how rare the Pokmon was.
in Google Glass and thought wed make a DIY version with the
Raspberry Pi. We hacked apart a pair of video glasses, and designed
a custom 3D-printed housing for the display and driver. It was a fun
experiment and this is how we learned about the Raspberry Pi.
Things escalated even further when the brothers made the
original PiGRRL. Originally an idea from Limor Fried, founder of
Adafruit and Ladyada herself, the idea was to improve upon her
earlier Game Grrl project but this time use a custom 3D-printed
enclosure. It was their biggest project to date, so they were
extremely happy to see that it had such a positive reaction.
The PiGRRL projects have since become the Brothers favourites
to work on, according to No. NEOPIXEL YOYO
I think its become a classic Raspberry Pi project because it > magpi.cc/2lKRd4c <
loo l e an on de e that o er lot o la t e eo le lo e A simple playground toy turned awesome with the use of
to play games, and being able to build your own gaming console is some NeoPixel LEDs. The yoyo itself is also 3D-printed,
super-rewarding. Every year we create a new version with better allow n or u to art o that ou an t the
hardware and han e the or a tor to tr d erent de n o electronics inside. It even has a USB charging port. Check
many folks have built one and its really awesome to see parents out the link for some cool GIFs of the yoyo in action.
building them with their kids.
Whats in the future for the PiGRRL and the Ruiz Brothers? Well,
PiGRRL 3 is happening this year with a bigger screen and better
audio, and should be a much quicker build. Watch this space!
FREE
PI ZERO W
Subscribe in print for 12
months today and receive:
A free Pi Zero W (the latest model)
Free Pi Zero W case with 3 covers
Free Camera Module connector
Free USB and HDMI converter cables
....................................................................................................................................
$69 (USA) *If giving The MagPi as a gift, please complete both your own details (above) and the recipients (below).
Address .......................................................................................................................
80 (EU) Name and full postal address of your bank or building society:
$129 (USA)
Address ..........................................................................................................................
........................................................................................................................................
n n n n n n Account number n n n n n n n n
Branch sort code
Reference n n n n n n n n n n n n n n n n n al u e onl
Get three issues: Please pay Select Publisher Services Ltd Direct Debits from the account detailed in this instruction
subject to the safeguards assured by the Direct Debit Guarantee. I understand that this instruction
may remain with Select Publisher Services Ltd and, if so, details will be passed electronically to my
bank/building society.
$37.50 (US) (quarterly) SUBSCRIPTION PRICING WHEN PAYING BY CHEQUE OR CREDIT/DEBIT CARD
DESIGNING A PI
ZERO PHONE KIT
>STEP-02
I developed it because thats LCD and battery
what I needed to improve my mall LC creen i u e
in er ace a er i h
o i la he u er
cell i u e o o er
Raspberry Pi tinkering he Pi ero, i la , an S mo ule
TRACKING
TELESCOPE
MOUNT
For Mike Hamende, making something is far more exciting and rewarding than
logging into an online store, as his Pi-powered tracking telescope mount proves
I
f you search for Mike
Facts
8PumpkinDonuts online, parts of the mount
when he was unable to
youll soon realise that hes quite find the correct pieces
the craftsman. From a suspended
> Mike has lounger for his fianc e, to a
no previous
experience of wristwatch built completely from
coding Python scratch, Mike is a true maker. So
> The tracking its really no surprise that hed
mount is set to eventually build a Raspberry Pi
n re e project that we could sink our teeth
locations
into. Despite his lack of previous
> The mount runs
Python knowledge, and ignoring
on a battery,
making it the fact he could easily purchase
portable what hed decided to build, Mike
> It cost produced a tracking telescope
mount for his 8 rion re ector.
o uil
This is definitely the most
> See a video involved project Ive ever
of the mount
completed, Mike tells us. Im
working here:
magpi.cc/ aware there are mounts I could
2lGLgWf have bought to accomplish the
same thing, but, while astronomy
is a hobby of mine, building things
is what Im really into.
Mike used two Nema 17 stepper
motors, powered by a Raspberry
Pi 3, to angle the mount. For
the frame, he used T-slot The Raspberry The mount runs on a
aluminium, utilising his CNC Pi sits beneath a 12V/12AH SLA battery
touchscreen, housed hooked to the back of
mill, CNC router, and CNC lathe in a 3D-printed case the frame
to cut further pieces of aluminium
for the mount.
SCOPING THE
SOLAR SYSTEM
>STEP-01
Creating the parts
Mike used his own tools to design and cut the
a ro ria e ar or he moun ou o aluminium
The red tint to the screen
helps to better protect hi allo e or grea er con rol o he nal loo
Mikes night vision when
realigning to new objects
Quick
Facts
HEARTBEAT
MONITOR
> It took two days
for Daniel to
develop the
software
> Daniel is an
T watches, however long
it lasts, probably owes
create his own heartbeat monitor
w th hel ro a a err
wor w th t later urther ore
wanted o e fle l t n how the
old hand with
the Raspberry something to the activity trackers I have always liked to monitor data was plotted and how often the
Pi, using it that are synonymous with anyone my heartbeat while I run on the heartbeat was updated, and to be
to automate
tr n to ee tra o the r tne tread ll an el tell u here able to retrieve the data from the
several projects
These devices track the users is simply no cheap, commercial device in an easy-to-process format
> The case is to
heartbeat and use it to calculate solution that did everything I l e
protect the Pi
from sweat and things like periods of rest, calories wanted: to plot the results in a graph o e an an el u ld e
spilt water urnt and ore ou an tell a thats easy to monitor, so that you selected the Raspberry Pi 3 as it
lot of things from a heartbeat, so can look at them while you run, and wa a ull fled ed o uter w th
>STEP-01
You only need four items to make the monitor how many projects are this simple?
Starting up
When the Pi boots up, it loads up a Python script that
built-in luetooth that could fit o far, the Raspberry Pi has
checks the heartbeat data from the sensor, and a
on his treadmill. He coupled it always worked correctly with my
reePa cal rogram ha lo he a a
with a Polar H7 heart sensor and a heartbeat sensor, aniel says.
. screen, and -printed a little The program has always provided
case to fit it all in. smooth plots and a very responsive
ts not very difficult to build display of my real-time heartbeat.
as most of the project is based I have been able to save my run
on software, e plains aniel. data files and perform some more
f you have the sensor, screen, e tensive mathematical analysis
and software, you could have it to better understand how my heart
RASPBERRY PI
PROJECTS BOOK
Amazing hacking and making projects
from the creators of magazine
Inside:
How to get started with Raspberry Pi
able
Availw
no
magpi.cc/MagPiStore
plus all good newsagents and:
Youll B
uilding a media centre, or HTPC (home
theatre PC) is one of the most rewarding INSTALLING OSMC
Need
projects a newcomer can complete.
Its easy to turn a Raspberry Pi into an HTPC, and ON A RASPBERRY PI
you can quickly hook it up to your television.
> OSMC sing an TP , you can play video and music files, >STEP-01
> Pi Zero or and stream video and audio from online services. And Installation
Raspberry Pi 2/3 unlike proprietary systems, such as Apple TV and First, install the OSMC image to an SD card. Visit
> Keyboard Google Chromecast, you can use it to play just about magpi.cc/2jqbw8R in your web browser and
for setup any media format. download the OSMC disk image for Raspberry Pi Zero
> Smartphone for You can add streaming services to your HTPC, such or Raspberry Pi 2/3. Flash the image to an SD card
remote control as BBC iPlayer and Soma radio stations. These enable using Etcher (etcher.io).
you to play media directly from the internet.
There are several pieces of software available for 01
setting up an TP . Two options youll find on the
Raspberry Pi Foundations Downloads page are OSMC
and LibreELEC. Both are similar and run a media
player called Kodi.
In this guide, were going to opt for OSMC. Its a
free and open-source media centre built on top of
Debian, and is reliable and easy to use.
Setting up OSMC on a Raspberry Pi is
a straightforward and rewarding project.
Lets get started.
38 March 2017
xxxx 2016 raspberrypi.org/magpi
BUILD AN HTPC MEDIA CENTRE Tutorial
>STEP-02 >STEP-05
Setup Streaming services
Insert the SD card into your Raspberry Pi. Connect a Select Videos > Video Add-ons > Get More. Scroll
keyboard and use an HDMI cable to connect a display. down the er e to nd a a and ele t n tall
Power up and go through the Welcome section. Its a Press ESC to get back to the main screen and select
good idea to keep SSH enabled (the default option). deo a a hoo e e trea and to
watch the station. For keyboard controls, visit the
02 Kodi wiki (magpi.cc/2jqjK0C).
05
>STEP-03
Video files
To test video playback, weve downloaded a >STEP-06
o r ht ree deo le o a o e alled Return of Remote control
the Kung Fu Dragon (magpi.cc/2jxKryi). Download Open the app store on your phone and search for
the deo er on and then tran er the le al od e ote ore on ndro d en the
to a fla h dr e app, and click Add Host then Find Kodi. It should
nd the a err on our networ l a e
03 ow u e the a a a re ote ontrol
>STEP-04
Play video
onne t the fla h dr e to the a err n the
nter a e ele t deo le and the fla h
dr e ere ou ll ee the deo le ou o ed
across. Select it, and the video will start playing.
04
HOW TO BACK UP
YOUR RASPBERRY PI
a u the le on a a err o ou an u l re tore our le
Need o letel
ou re wor n on a ro e t and ou
e o eth n u t onl ta e nute
ower down our a
ard la e t nto an
err and re o e the
ard reader and onne t t to
to re n tall the o erat n te and tart a a n w t our o uter
> Raspberry Pi
re torat on u t one th n that a e the a err en a er nal w ndow on a a or nu
> SD card deal or e er entat on o uter and enter df a e a loo at what dr e
> Flash drive h on tant tate o e n read to re re h an ou ha e on our te ow atta h the ard to
e a dou le ed ed word thou h he a err a our o uter and enter df a a n
u e ul ro o uter ou an et u e a l and u e the ot the newl ounted dr e on a nu a h ne
nternet wr te do u ent n tall and u e od n tool t w ll e o eth n l e de d and on a a t
and wor on all anner o lon ter ro e t w ll a de d he nu er a e d erent
ou u e a a err or a lon t e ou ll want o e ure to he are ull
to th n a out a a u olut on a u ena le n nu
ou to re tore the a an and our le
ortunatel there are e eral d erent wa to o sudo dd bs=4M if=/dev/sdb of=raspbian.img
a out a n u the and our le
na a
Option 1: Copy the SD card image
he le t wa to a u our a err to sudo dd bs=4m if=/dev/rdisk2 of=raspbian.img
o the ent re ard a an a e
h te hn ue the re er e o fla h n our ou an then u e the raspbian.img le to re tore
ard when n tall n an to t n tead o o n our ent re o erat n te n t urrent tate
an a e le ro our o uter to the ard to an ard u n dd n re er e or u n an a
ou o the ent re ard to an a e le on u h a t her etcher.io to fla h the ard
40 March 2017
xxxx 2016 raspberrypi.org/magpi
BACK UP YOUR RASPBERRY PI Tutorial
n ndow ou a u the ard u n n
a er magpi.cc/2bndEsr
en the ro ra and l e to the e ur t alert
w ndow nter C:\raspberrypi.img n the a e le
te t o and l ead he ard w ll e wr tten to
the a e le hen t a ead u e ul ou an
l
Youll
Need HOW TO MAKE AN
ALEXA-POWERED
ROBOT
> Raspberry Pi 3
> Microphone
amzn.to/
2g9mm1V Build an Amazon Alexa-controlled robot using the Raspberry Pi,
> A free Amazon
Developer
allowing you to operate it with just your voice
account
inally, a Raspberry Pi robot to do your
> A free IFTTT
account F bidding, controlled only by the sound of
your voice! Amazon Alexa software can be
put on the Raspberry Pi robot, the GoPiGo. In this
project, well create an Alexa-based robot that will
respond to voice commands, as well as answer your
questions. You can ask Alexabot How hot is it in
Dubai? or Whats the weather like in London?.
What makes Alexabot really interesting is that you
can order it around with your voice, using the Alexa
Voice Service (AVS).
The first step towards robot world domination
and building our Amazon Alexa-controlled robot
is to set up AlexaPi.
Alexabot.py Language
>PYTHON
from flask import Flask
import gopigo DOWNLOAD:
import time magpi.cc/2kiFlZz
app = Flask(__name__)
@app.route('/')
def index():
return 'Hello world'
@app.route('/forward')
def forward():
print("Forward!")
gopigo.fwd() # Send the GoPiGo Forward
time.sleep(1) # for 1 second
gopigo.stop() # then stop the GoPiGo
return 'Alexabot moved forward!'
@app.route('/backward')
def backward():
print("Backward!")
gopigo.bwd() # Send the GoPiGo Backward
time.sleep(1) # for 1 second
gopigo.stop() # then stop the GoPiGo.
return 'Backward!'
@app.route('/left')
def left():
print("Left!")
gopigo.left()
time.sleep(1)
gopigo.stop()
return 'Left!'
@app.route('/right')
def right():
print("Right!")
gopigo.right()
time.sleep(1)
gopigo.stop()
return 'Right!'
@app.route('/dance')
def dance():
Fig 1 An example of how to build your own command print("Dance!")
for each in range(0,5):
There are a few tutorials on how to turn your
gopigo.right()
time.sleep(0.25)
Raspberry Pi into an Amazon Echo using Amazon
gopigo.left()
Alexa. However, AlexaPi (magpi.cc/2kiyOxO) is the
time.sleep(0.25)
easiest way to get Amazon Alexa on your Raspberry gopigo.bwd()
Pi. The project has prepared everything to set up time.sleep(0.25)
Alexa Voice Services on your Pi in a streamlined gopigo.stop()
and simple manner. The hardest part is setting up return 'Dance!'
your Amazon Developer account and gathering your
credentials (and really, thats not that hard!). @app.route('/coffee')
At this point, with your speaker and your def coffee():
microphone plugged into your Pi, you should be able
print("Coffee!")
return 'coffee!'
to run Alexa on your GoPiGo, just as you would on
an Amazon Echo. Ask it for a news update: Alexa,
if __name__ == '__main__':
whats the news? app.run(debug=True, host='0.0.0.0')
Next, well set up IFTTT. If This Then That (IFTTT) Fig 1 shows how this is done in more detail. We
TRIGGER is a service that lets us connect different parts of will need to do this for all the moves you want
WORDS the web together. In our case, IFTTT helps us couple your Amazon Alexa-controlled robot to make! In
Alexa together with the Raspberry Pi. IFTTT lets us our project, we made seven: one each for Forward,
Remember
that your bridge the AlexaPi responses back to the Raspberry ackward, Left, top, Right, ance, and offee.
trigger words, Pi. First, youll need to set up an IFTTT account. Next, well connect to the ngrok service. We will
the words (ifttt.com/join). Again, this is free. have IFTTT contact a server on the Pi, but the tricky
that get Alexa
going, start Next, youll need to add the IFTTT service to your part will be setting up a server on the Pi thats visible
with Alexa Ale aPi. You can do this by first installing the Ale a to the world outside our local wireless network. For
trigger. app on your phone or tablet (magpi.cc/2kyIJho); its this, you can use ngrok (ngrok.com), a service that
available for iOS, Android, and Fire OS. With your allows you to connect to your Raspberry Pi through
phone on the same network as your Pi, connect to
your AlexaPi and add the IFTTT service.
Next, in IFTTT, we will need an applet for each A robot that will
respond to voice
command we want to send to the GoPiGo. First,
connect Amazon Alexa to your IFTTT account
commands
(magpi.cc/2kizD9X). Then well do the following to
create an applet that will handle a single command:
01. Create an IFTTT applet (magpi.cc/2jTYYn2 any network. IFTTT needs an internet-based URL
or our r comman e ill crea e to contact, so well use ngrok to make our server
an le a a le accessible to the outside world.
First, set up an account with ngrok. You can get
02. Selec Sa a S eci c Phra e away with a free account, but it will be much easier to
set up Alexabot with a paid account. A paid account
03. Specify the command. Say Backward. will allow you to set up named servers, rather than
ngroks randomly assigned server.
04. e , elec ha Next, install ngrok on your Raspberry Pi using the
directions here: ngrok.com/download.
05. e ll u e he ac ion er ice, a er This should install all the software. You will next
need to get your token, which will authorise your
RUNNING 06. Clic a e a e re ue an eci Raspberry Pi to ngrok. If you log into your account you
THE FLASK hein orma ion will see step 2, with your token already populated. It
SERVER should start with ./ngrok authtoken. Copy the
07. The URL is either your provided ngrok URL or command, and paste it into your command line.
The Flask our cu om omain e ill n hi in our
server
runs in the next step, but for now we can enter ngrok.io. Test out ngrok
background You can type the following into the command line:
and needs
to be set up
08. ur a le ill e oing a me ho , he
in a i eren con en ill e e , an on u an hing in ./ngrok http 80
command- the body.
line window You should then see a server start up, as shown in
from the
ngrok server. 09. Clic Crea e c ion an hen ini h Fig 2. When an IP address appears, try typing that IP
address into your browser. You should see your default
python alexabot-flask-app.py
ifthisthenthat
This illustrates how the Forward command works;
each command will work this way, with its own
directory and custom code for moving the GoPiGo.
Now, with all the services set up, we should be able
to say a command like Alexa trigger forward; Alexa
will alert IFTTT, which will send an HTTP message
through ngrok back to our GoPiGo and post to the
web server running in Flask. The Flask program will
command the GoPiGo to move forward.
The quick-start method to get running with
Ale abot is to first start Ale aPi
SCANF
AN INTRODUCTION TO C PART 09
USER INPUT
Just like sscanf,
scanf returns
an integer
indicating how
many values
it successfully
read, which
you can use
to check for
errors. One
problem is
Reading and interpreting input from the user
that scanf
I
only removes n the previous instalments, weve looked at #include <stdio.h>
matched how to print program output to the terminal,
values from the
in u u er, but in order to interact with the user, this void main (void)
so if a scanf needs to be a two-way process. This instalment looks {
fails to match at how we can read and interpret input that the user char input[256];
anything,
what the user enters in the terminal. int age;
typed will be The printf is the standard way of writing formatted
read again on text output from a program, but how can we read what printf ("What is your name, user?\n");
the next call
to scanf. It the user types in? scanf ("%s", input);
really is easier In the last instalment, we looked at the sscanf
to use fgets function, which reads values from a string. Theres printf ("How old are you, %s?\n", input);
and sscanf!
an equivalent function called scanf, which reads scanf ("%d", &age);
values typed in by the user:
printf ("%s, you're %d?\n", input, age);
GET THE }
NUMBER
RIGHT
scanf works exactly like sscanf, but has one fewer
Remember argument, as it reads from the keyboard rather than
ha he r
item in the argv from a string.
array argv[0] However, its not the best way of getting input, as
is the name it relies on the user doing what you expect, and this
of the program
itself, not the doesnt always happen! (For example, in the code
r arame er above, if the user types in 257 characters when asked
The actual for their name, they will over ow the space allocated
parameters
start at argv[1]. for the input string, and bad things may happen)
A better way
Above The argc and argv arguments to the main function can
be used to access parameters typed on the command line
A better approach is to read each line the user enters
when the program is run into a buffer string, and then use sscanf to read
This works, as youve seen, but it isnt strictly argv[2] is the second parameter; this is a string,
correct. The strict definition of main looks like this: but were only interested in the first character, so we
use *argv[2] to get this.
int main (int argc, char *argv[]) Make sure you separate the arguments from the
operator with spaces so they are identified as separate
But if youd seen that in instalment 1, youd have parameters <progname> 2 + 2 rather than
run a mile, wouldnt you? <progname> 2+2.
MODEL A SQUID
WITH GLISE How to get started with 3D modelling and turn your Raspberry Pi
Youll into a personal graphic workstation
Need uring the last few years, 3D applications Set up and install
> Raspbian D have been behind many achievements
in computational and video hardware,
You must first activate the e perimental penGL
drivers find out how on the Raspberry Pi website
> Glise
magpi.cc/ addressing whole new branches of computer graphics. here: magpi.cc/2knRTvS. You might also want to
2kqaIiq Once known as 3D modelling applications, these increase the GPU memory to 128MB.
> Experimental packages are now best described as fully edged Download Glise for Raspberry Pi from
GL drivers modelling suites, with ever-higher hardware twistednormal.com, right-click on the downloaded
magpi.cc/
requirements and steeper learning curves. We want to installer, and select Package Install.
2knRTvS
take a step back and focus on pure 3D modelling using Avoid any L E Glise key binding con ict they
> Three-button
Glise, a new free modeller with minimal hardware both use Alt+mouse drag). You can either edit
mouse
requirements and a painless interface. Built from ~/.config/openbox/lxde-pi-rc.xml and comment
scratch, it turns a Raspberry Pi into a true modelling out the whole <context name="Frame"> section, or
tool. So lets get started and see what your Raspberry simply press the unction Windows key when using
Pi can do! the Alt key to move the camera in Glise.
When you model a base mesh, model a base mesh, Glise automagically takes care of
its subdivided surface in real time. You may change
Glise automagically takes care the display mode of a modelling canvas by pressing
1 to see only base meshes, 2 to see only subdivided
Fig 3 dd n ns
a) edge selected
b) after edge bevel
c) during face extrusion
SUBTRACTIVE
SYNTHESIS
&& Learn more ways to design sounds in Sonic Pi thanks to Sam Aaron
Youll
Need T
his is the second in a series of articles on how
to use Sonic Pi for sound design. Last month
the :saw. Its this buzziness and variation from a
pure sine wave that we can play with when we use
we looked at additive synthesis, which we subtractive synthesis.
> Raspberry Pi
running Raspbian discovered was the simple act of playing multiple
Low-pass filter
he low a lter u h an ortant art C
of every subtractive synthesis toolkit that its
worth taking a deeper look at how it works. This
diagram (top right) shows the same sound wave
(the :prophet synth) with varying amounts of
lter n t the to e t on how the aud o
Language
wa e w th no lter n ot e how the wa e or you to directly name and control the running FX
is very pointy and contains lots of sharp edges. It synth. Line 2 does exactly this and controls the FX to
the e hard har an le that rodu e the h h set the cutoff_slide: opt to 3 and the new target >RUBY
crispy/buzzy parts of the sound. Section B shows cutoff: to be 130. The FX will now start sliding the
the low a lter n a t on not e how t le cutoff: opts value from 50 to 130 over a period of
Above How the
pointy and more rounded than the wave form three beats. Finally, we also trigger a source signal waveform alters
above. This means that the sound will have fewer synth so we can hear the effect of the modulated when a low-pass
e s added h
h h re uen e n t a ore ellow rounded low-pass filter. o c o a es
eel e t on how the low a lter w th a
a rl low uto alue th ean that e en ore Bringing it all together
of the high frequencies have been removed from This is just a very basic taster of whats possible when
the nal re ult n n an e en o ter rounder you use filters to modify and change a source sound.
wa e or nall not e how the e o the wa e Try playing with Sonic Pis many built-in FX to see
or wh h re re ent the a l tude de rea e a what crazy sounds you can design. If your sound feels
we o e ro to u tra t e nthe wor too static, remember you can start modulating the
re o n art o the nal wh h ean that options to create some movement.
the overall amplitude is reduced as the amount Lets finish by designing a function which will play
o lter n that ta n la e n rea e a new sound created with subtractive synthesis. See
if you can figure out whats going on here and, for
the advanced Sonic Pi readers out there, see if you can
Filter modulation work out why we wrapped everything inside a call to
So far weve just produced fairly static sounds. In at (please send answers to @samaaron on Twitter).
other words, the sound doesnt change in any way for
the entirety of its duration. Often, you might want define :subt_synth do |note, sus|
some movement in the sound to give the timbre some at do
life. ne way to achieve this is via filter modulation with_fx :lpf, cutoff: 40, amp: 2 do |fx|
changing the filters options through time. Luckily, control fx, cutoff_slide: 6, cutoff: 100
Sonic Pi gives you powerful tools to manipulate an synth :prophet, note: note, sustain: sus
FXs opts through time. For example, you can set a end
slide time to each modulatable opt to specify how long with_fx :hpf, cutoff_slide: 0.01 do |fx|
it should take for the current value to linearly slide to synth :dsaw, note: note + 12, sustain: sus
the target value: (sus * 8).times do
control fx, cutoff: rrand(70, 110)
with_fx :lpf, cutoff: 50 do |fx| sleep 0.125
control fx, cutoff_slide: 3, cutoff: 130 end
synth :prophet, note: :e2, sustain: 3.5 end
end end
end
Lets take a quick look at whats going on here.
Firstly, we start a :lpf FX block as normal with an subt_synth :e1, 8
initial cutoff: of a low 50. owever, the first line sleep 8
also finishes with the strange |fx| at the end. This is subt_synth :e1 - 4, 8
an optional part of the with_fx syntax which allows
> Full-size
breadboard
> 3 LEDs
Learn how you can use source/values in GPIO Zero to easily connect
> 3 330 resistors
source_values.py
from gpiozero import LED, Button
from gpiozero.tools import all_values, any_values, negated
from signal import pause
in_1 = Button(0)
in_2 = Button(1)
out_1 = LED(2)
out_2 = LED(3)
out_3 = LED(4)
pause()
MAKE A
raspberrypi.org
Youll
Need
WHOOPI
PROJECT
> 2 crocodile clips Enter the Pioneers
> 2 male-to- challenge here:
female jumper
magpi.cc/2iHKIP5
CUSHION
leads
> A speaker
> Cra u
paper plates,
cardboard,
aluminium foil,
glue, scissors,
sponge, bulldog
or paper clips,
sticky tape A Pi-powered retro prank, perfect to get your mind thinking
about a Pioneers project!
n the bad old days before TV and computers, PARP! noise, causing him to jump into the air and
I the most popular form of family entertainment
was the whoopee cushion, a tooty balloon
making his false teeth y out. t was the best thing
ever. This project brings the whoopee cushion up to
originally made from a pigs bladder. The whoopee date: theres no bladder and no need to blow it up.
cushion would be in ated and hidden under Grandads Thanks to the Raspberry Pi, you can also add whatever
chair cushion. When he sat down, it would make a loud noises you want!
An electrically
powered trump
machine, ready
to prank
GP27 GND
GP22 GP23
3V3 GP24
GP10 GND
GP09 GP25
GP11 GP8
raspberrypi.org/magpi March 2017 57
Tutorial WALKTHROUGH
Fig 3 a n
this will be the Fig 4Its a very
same pin on any simple step but
Raspberry Pi best to get it right
3V3 5V
GP2 5V
GP3 GND
GP4 GP14
GND GP15
GP17 GP18
GP27 GND
mkdir whoopee To switch audio to the headphone jack, return to the
GP22 GP23
terminal window and type the following command:
e 3V3 GP24
t, use cd whoopee to enter the folder you
have just created. Were going to need a sample amixer cset numid=3 1
GP10 GND
sound file for this project, so well use one from
onicGP09 GP25this burp sample using the
Pi. ownload f your Raspberry Pi is connected to the internet,
following command: you could search for some suitable trumping sounds.
GP11 GP8 They need to be in WAV format to work. Alternatively,
GND
wget GP7
http://rpf.io/burp -O burp.wav download our example sounds here: rpf.io/farts.
DNC
ow, DNC
test that you can play the sound file using Write a program in Python
aplay by typing: pen Python LE from the Programming menu
GP5 GND
and click on ile ew Window. This will open a blank
aplay GP12
GP6burp.wav file. lick on ile ave As, name the file whoopee.py
and then type the following code into your file
GP13 GND
You should hear it from the speakers or headphones
GP19to GP16
connected your Pi. f you cant hear anything, make
sure that your speakers are connected correctly. f import os
GP26 GP20
this still doesnt work, youll need to change your import random
audioGND GP21
configuration. from time import sleep
from gpiozero import Button
button = Button(2)
3V3 5V
GP2 5V
GP3 GND
GP4 GP14
GND GP15
GP17 GP18
GP27 GND
GP22 GP23
3V3 GP24
GP10 GND
GP09 GP25
GP11 GP8
GND GP7
DNC DNC
GP5 GND
GP6 GP12
GP13 GND
GP19 GP16
GP26 GP20
GND GP21
Language
pressed. Begin by creating a loop using while True:.
Then, add button.wait_for_press() inside the loop
whoopee.py >PYTHON 3
by indenting by four spaces. Each time around the import os
loop, the computer waits for the button to be pressed. import random DOWNLOAD:
magpi.cc/
On the next line, use the random.choice function from time import sleep
WhoopiCushion
to select a sound at random from the list you created from gpiozero import Button
earlier. That selected sound needs to be stored inside
another variable which you can call parp! Type parp = button = Button(2)
random.choice(trumps). trumps = ['ben-fart.wav', 'ca-fart.wav', 'marc-fart.wav']
The next line will play the sound selected at random
using aplay, as used earlier when testing sounds. while True:
Type os.system("aplay {0}".format(parp)). button.wait_for_press()
Finally, add sleep(2) to pause the program before it parp = random.choice(trumps)
starts the loop again. Your code should look like this: os.system("aplay {0}".format(parp))
sleep(2)
while True:
button.wait_for_press()
parp = random.choice(trumps) Setting it up
os.system("aplay {0}".format(parp)) Carefully place your cushion in a spot where your
sleep(2) victim will sit on it (obviously!), but not under a really
heavy cushion where it will be squashed straight
ave the file by clicking on ile ave. Test that your away. The tricky bit is setting up the Pi so that it
code works by clicking on Run > Run Module. Use your cant be seen: remember, youll need a plug socket to
hand to push the top plate of your Whoopi cushion connect it to the power, unless youre using a battery
down to make a connection between the foil sheets, pack. Run the program, and wait. Heres a hint:
and you should hear a fun sound. f it doesnt work first whistle tunelessly and look around at the ceiling. This
time, dont worry. Check your code through. Have you will make you seem innocent, and will help to attract
typed your code out exactly as you see it here? potential victims.
REMOTELY MONITOR
YOUR PI PROCESSES Create a web-based dashboard of all your important processes and get
Youll a not at on when one e t
Need f youre using one or more Raspberry Pis to Monitor a process
> Initial State
account
I run a dedicated task (e.g. weather station or
monitoring your beer fridge), you need those
Whenever you run a program or script on your Pi,
you initiate a process. Each running process will
magpi.cc/ processes to run uninterrupted. A task that exits have a unique process ID number (PID). You can see
2kiYp77
unexpectedly may need your immediate attention every process owned by you by typing ps at your Pis
to avoid lost data, project delays, or a system failure. command prompt. You will see a response that looks
Its impractical, though, to manually babysit a bunch something like this:
of Raspberry Pis. A better way to ensure continuous
operation is to be alerted when a process exits, and be PID TTY: 3359 pts/0 3373 pts/0
able to pull up a single dashboard to see the status of TIME CMD: 00:00:01 bash 00:00:00 ps
every important process running on every one of your
deployed Raspberry Pis. f you want to find every running Python process,
you can use the following command:
Initial State
We want to stream the status of each of our processes $ ps -ef | grep py
to a web service and have that service turn our data
into a nice dashboard that we can access from our root 2287 1 0 Dec09 ?
laptop or mobile device. Our data needs a destination, 00:00:00 sudo python /home/pi/weather/
and well use Initial State as that destination. First, go weather.py
to magpi.cc/2kiYp77 and create a new account. Next,
install the Initial State Python module onto your Pi: In the example above, the PID of the weather
Python script is 2287. Once we know the PID of the
cd ~ process we want to monitor, we can pass this number
\curl -sSL https://get.initialstate.com/ as a parameter into a simple Python script that
python -o - | sudo bash will monitor the e istence of this defined process
and send either a Running or Exited response to
Follow the prompts, including the step of creating a our dashboard.
test script to ensure you can successfully stream data We will use the Python script located at
from your Pi. magpi.cc/2kj3BYs. Before we can use this script,
BUCKET_KEY specifies the data bucket our script Monitor a reboot DOWNLOAD:
magpi.cc/2iUSsAY
will stream into. Make sure you use the same If power drops, our process will instantly die, as will
BUCKET_KEY for each script that should send data our monitoring script and network connection. On
into the same dashboard. reboot, we need to do two things: send an update to
our process dashboard that our process exited, and
ACCESS_KEY is your unique Initial State account key. automatically start our process and process monitor
This key is used to send data into your account from after the reboot completes.
the scripts. You can find your A E EY in the First, lets create a script that will run on reboot to
Streaming Access Keys section of your Initial State send a process exited status to our dashboard. Well
account settings. use the script at magpi.cc/2kiTfIa. The user settings
at the top of this script need to be set just like the
PROCESS_NAME is the name of the specific process other scripts. Make sure you use the same BUCKET_
youre monitoring that you want to display on KEY, ACCESS_KEY, and PROCESS_NAME as in the
your dashboard. For example, PROCESS_NAME = Monitor a process step. Once this script is set up,
"Franklin Weather Station". we need to call it automatically on reboot.
nohup python monitor_process.py <pid> & At the end of the file that opens, add the
monitor_reboot script and the launch_process
anually finding the P is cumbersome. Lets script. Specify the full path. For example, youll add
make it a bit easier by creating another simple script a single line that looks something like the following
that will find the P automatically and launch our with your specific paths
monitor_process script.
@reboot python /home/pi/weather/monitor_
Launch a monitored process reboot.py && /home/pi/weather/launch_
We can use a simple Bash script to do three things: process.sh
launch our important task program process, find the
PID of the task/program/process we just launched, Notice the monitor_reboot script is followed by
and pass the PID into our monitor_process script. &&. This specifies that the monitor_reboot script
The Bash script that well modify and use is located should complete before the next command runs. If
at magpi.cc/2kiS23q. theres a power outage, it may take a few minutes
To use this script, simply modify the two user for your network connection to be restored. After the
settings at the top of the file delays specified in the monitor_reboot script expire,
status updates will be sent to your dashboard and
PROCESS2RUN is the process you want to run and your process will be launched.
monitor. Specify the full path. Once this is in place, everything will be automated.
Every time your Pi boots, your process dashboard
MONITOR_SCRIPT is the monitor_process.py script we will update, and your process will launch and INITIAL STATE
just created. Again, specify the full path. be monitored.
Initial State is
an easy-to-
Before you run this script, youll need to make it an Dashboard and notifications use platform
e ecutable file. Run the following Each process that you monitor will add a data tile to for collecting
data from
your dashboard. This can be extremely useful if you connected
chmod u+x launch_process.sh have an application where multiple Pis are deployed devices and
across multiple locations. For example, if a Pi is used turning that
data into
To run the script: to monitor temperature in every room in your office dashboards,
building, you can quickly see the status of every Pi at a waveforms,
./launch_process.sh glance. You can enable and or email notifications no i ca ion ,
and more.
for each process status by going to the Triggers section initialstate.com
We could stop here and have a pretty good solution of your data bucket settings.
RASPBIAN
HOW DO I SWITCH INTERFACE?
Default interface
INTERFACES
You can select which interface to use by default from the
Raspberry Pi onfiguration tool under Preferences in the
program menu. t is set to boot to the desktop by default,
but you can also set it to boot straight into the command
WHAT INTERFACES CAN I USE line if it suits your usage.
ON RASPBIAN?
Switch while running
PIXEL You can switch between the desktop and L while the Pi
The graphical user interface G for Raspbian is the running. rom the command line, using the command
main way to use the Raspberry Pi. rom here you can startx will boot up the desktop. rom the desktop, you
access traditional browsers, office suite apps, and the can uickly switch to a command-line interface using
programming Es. This is the interface most people CTRL+ALT+F2. You can then switch back to the desktop
will use and the one which is recommended. interface with CTRL+ALT+F1.
Password
or Raspbian, the default user name is pi and the
password is raspberry, so youll need to remember that
if you turn off auto login. f youre turning it off for
security reasons, its a good idea to change the password
as well. ind out how to do so here magpi.cc/2iqm9pO.
PI
ZERO
Petite, efficient, and well connected.
Meet the latest member of the Raspberry Pi family
he big news this month is A third of the size of a Raspberry Squeezing wireless networking
T the introduction of a new
computer model from the
Pi 3, the Pi Zero W still has enough
power to run a full operating
onto a Pi Zero board hasnt been
easy, and the way Raspberry
Raspberry Pi Foundation. system like Raspbian. Pi went about it has shown
The Pi Zero W is the same small This update to the Pi Zero considerable ingenuity. The new Pi
revolutionary board that rocked has the same small form Zero case is also a thing of wonder.
the maker community, but it factor, but crams in wireless But its what you can now do
now packs built-in wireless LAN LAN networking too. With the Pi with a Pi Zero W that is going to
networking and Bluetooth. Zero W, you can connect directly make a difference.
It also comes with an incredible to a local wireless network without The Pi Zero W can connect
new case. With switchable lids, having to attach a USB dongle. automatically to a local network.
this enables the Pi Zero W to The Pi Zero W gets the With its small size and low-energy
function as a camera, provides same wireless networking footprint, its ideal as a node for
access to its GPIO pins, or lets it act capabilities first deployed projects around the home, as well
as a secure node. on the Raspberry Pi 3. as IoT and wearable projects.
FREE
A
PI ZER
OW
AND C , CASE
ABLES
PI ZERO W
!
PAGE 2
8 Technical Specifications
Dimensions:
65mm 30mm 5mm
SoC:
Broadcom BCM2835
CPU:
ARM11 running at 1GHz
RAM:
512MB
Wireless:
2.4GHz 802.11n wireless LAN
Bluetooth:
Bluetooth 4.1 LE
Power:
5V, supplied via micro USB connector
Storage:
MicroSD card
Output:
Micro USB
GPIO:
40-pin GPIO, unpopulated
Pins:
Run mode, unpopulated; RCA composite,
unpopulated
Price:
US UK EU
$10 9.60 11
EX-TAX INC VAT INC VAT
THE
he technology found in
T the Pi Zero W is similar to
that of the original Pi Zero,
only now everything has had
to make space for an incredibly
BOARD
smart radio antenna. This
design enables the minute
Pi Zero board to pack a complete
wireless LAN and Bluetooth
connection module.
The Pi Zero W contains all of
the technology from the original
Pi Zero, but with a slightly
redesigned board.
The technical surge forward is
thanks to the presence of 2.4GHz
802.11n wireless LAN and Bluetooth
Up close with the technology packed onto a Pi Zero W board
01
06
11
07 04 02
BEHIND THE
PI ZERO W
We chat with Roger Thornton, principal hardware engineer at the Raspberry Pi Foundation
oger Thornton is the but we were getting better at 01. Ground plane
R person in charge of the
Raspberry Pi Zero W
squeezing features onto products,
so we did a little playing around
hi ree ace i u e o
in erac i h he ra io a e
project: developing the new board with the design. According to he re ona e in hi ca i a
has been a labour of love for him. Roger, there was a lot of pushing u he righ re uenc
The first Raspberry Pi product and shoving to fit all the
to gain wireless networking components into a restricted area, 02. Capacitors
was the Raspberry Pi 3 (released and onto one side of the board. At the lower part of the
shortly after the original Zero). The Raspberry Pi 3 layout was ground plane sit two
Developing this product gave based on a two-sided Broadcom ca aci or he e ca ure
Raspberry Pi the experience reference design, with a chip the radio signal.
he e e c e e ns
Its a really neat design
they needed to bring wireless antenna. In contrast, the Zero W
networking to the Zero. uses a single-sided layout
There was no easy way the with a PCB antenna; this is the
wireless layout from the larger trapezoidal shape between the
Raspberry Pi board would fit on mini HDMI and micro USB sockets
the diminutive Zero. We thought on the bottom edge of the board.
it was impossible, muses Roger, The Raspberry Pi 3 antenna is 02 01
a surface-mount component,
explains Roger, whereas the
Zero W antenna is a resonant
cavity which is formed by etching
away copper on each layer of the
PCB structure.
The technology is licensed from
a Swedish company called Proant
(you can see the credit on the
reverse of the Zero W board).
Theyre very clever boffins,
says Roger. Its a really
neat design.
SET UP A PI ZERO W
>STEP 01
The white text is added to the PCB using a silk-screen technique.
These markings are used to provide information and branding for the board
Download Raspbian
Youll need the latest version of Raspbian with PIXEL
from raspberrypi.org/downloads a e ure ou ge
he mo recen u a e, a he la e er ion a Pi
ero u or Pu our Pi ero in i e i ca e
>STEP 02
Set up the Pi Zero W
la h he microS car an in er i in o our Pi
ero ea S n he o a a or o connec
our e oar an mou e o he micro S or
mar e S chain he mou e ia a e oar S i
o i le e a mini o ca le or a a er
o connec he Pi ero o a moni or
>STEP 03
Power on
Connec a o er u l o he micro S or
marked PWR. The Pi Zero W will power up into
Ra ian i h P L Clic on he irele icon in he
o righ o he creen o loca e our local irele
ne or n er our irele a or o connec he
Pi ero o he ne or
PI ZERO W
CASE
A whole new way to hold your Raspberry Pi
aunching alongside the Pi
03
THREE COVERS
PI ZERO W
PROJECTS
Five great project ideas for you to build with your new Pi Zero W
AMAZON
ECHO A
mazon Alexa is an
intelligent assistant
making a lot of waves in
Add a speaker to your Pi Zero W
the tech community. Amazon sells using a Speaker pHAT
two Alexa products: the Amazon
Echo and Echo Dot. portable Amazon Alexa device. All USB microphone using the USB to
Amazon has also created a you need are some speakers and USB On-The-Go adapter.
homebrew version of Alexa for a USB microphone. Previously, you also had to
the Raspberry Pi. Pimoronis Speaker pHAT add a button to the Raspberry
Now that the Pi Zero W has (12, magpi.cc/2kXdZsE) is a Pi version of Alexa, but a recent
wireless LAN, its a perfect neat solution. Combine it with a update has added an always on
mode to the Raspberry Pi build.
Alexa now listens for a vocal
cue, such as the word Alexa
and then starts monitoring.
You can change the vocal signal
to any name of your choosing;
computer is a popular choice
for Star Trek fans.
A GitHub repository has all the
information you need to set up
Amazon Alexa on a Raspberry
Pi (magpi.cc/2kXrdW2).
There is a complete guide here
Use a speaker and (magpi.cc/2kXfPcO). Frederick
microphone to turn your Pi Vandenbosch has written a guide
Zero W into a hands-free
Amazon Alexa Echo to installing Alexa on a Raspberry
Pi Zero (magpi.cc/2kXkY4A).
WEARABLE MOTION-
CAMERA SENSING
he Pi ero ca e i h camera
li len i el er ec l o
CAMERA
The low power draw of the Pi Zero
ma ing a mini camera ou coul
W also makes it ideal for use as a
a a u on o he ca e u ing
ecuri camera, or a an ou oor
Sugru o uil a igicam, or u e a
il li e camera oo i u o a
lue oo h camera u on a oun
Zero LiPo (magpi.cc/2kXI8YW)
on el e ic
and youll get a steady stream of
We also like the idea of making
o er Connec he Pi ero camera
a eara le camera a rui ha a
an u e he irele L o en
grea u orial on crea ing hi ro ec
aler hen i e ec mo ion
a rui u e a uni ue rin e
a e a loo a ar e ro ec
ca e, u no ou can im l u e he Pi
(magpi.cc/2kXznhq).
ero ca e magpi.cc/2kXASMw).
FILE
SERVER
The low power draw of the
Pi Zero W and its wireless
connec i i ma e i i eal or
u e a a connec e no e
some storage and turn it into
always-on network storage.
This has always been a great
Ra err Pi ro ec , u i i
e eciall ea i h he ero
uil in irele connec i i
Maker
Says
An award-
winning
free and
open-source
software
media centre
Team Kodi
KODI 17.0
KRYPTON
The premier HTPC software gets an update with a new look
and some new tech behind the scenes
new Kodi release is Bare-bones being pretty much the same means
Free
Left Add-ons
can now also
be found in a
dedicated add-
on category,
though some
will still show up
in the relevant
media categories
We also noticed that, while still said, you cant change the order
supposedly supported, AirPlay was in which theyre listed and, for
working worse than ever. Before, a device youre probably mostly
an Apple device could at least see using to play back video, having
the Kodi box although weve never the pure video option last in the
actually seen AirPlay working list is not very useful.
between the two. Now, it simply It runs beautifully on the
doesnt show up. It would be good if Raspberry Pi, though, with smooth
the Kodi guys could get that working transitions between menus and the
consistently, but its a minor issue. same basic structure as other skins.
Raspberry Pi, with smooth most of our testing on a Raspberry before, and even
has symbols to
Pi 2, which is more than likely the signify if you have
FREE
Maker
Says
Want
to lose
the Xmas
dinner?
Join Pi Metre
Pi Metre
PI METRE
rat h owered tne a
ow doe t hel ou et t
or the a err
he Pi Metre is a simple repetitive. nce the countdown is runs on cratch, it will use up
While
thanks to the addition of lash to setup to take it with you to the
hromium. Luke astle, the creator
gym or while running
MyFitnessPal
is great, it of Pi etre, suggests also making a
doesnt run on
portable Pi setup to take it with you
the Raspberry
Pi. The app is to the gym or while running, but it Workout times are then kept in to make so you can create your
available for iOS would work just as well at home. your locker, which can be accessed own portable workout countdown
and Android.
Pi etre works by asking you to with L. nfortunately, theres and tracker.
first start a workout. You do this by no way to differentiate between
pressing E and entering the number different types of workouts, and it
of seconds you plan to work out wont calculate a calorie count for Last word
this does slow down the process cardio. You get an account for the
A very simple workout app
a bit, as you need to transfer the app as well, with the idea that you
which is much better as a
minutes you plan to work out into can save your workouts to refer
full Pi project than just the
seconds. The app will then count back to them youll need to make
software on its own. Youre
down the seconds and play an sure to log off, though, to save the po a e e o ha
appropriate workout mi for you workouts properly. smartphone app, though.
to e ercise to. t lasts just over five ts a very simplistic app
FREE
minutes before looping again, so and could do with a fair few
myfitnesspal.com
for longer workouts it may get a bit e tra components. Also, as it
12 / $15
Maker
Says
Turn
your Pi into
a Lilliputian
ghetto
blaster
Pimoroni
Maker
Says
Ideal tool
for teaching,
testing or
simulating
small-scale
clusters
pimoroni
Related
program cluster computers is one running a cluster. those looking to get into cluster
of the most highly valued skills in computing, this is a game-changer.
the world of big data. Hat on it
PICO 5 A cluster is a set of computers The Cluster HAT removes the Getting started
STARTER networked together and used as e pense and effort re uired Setting up the Cluster HAT
KIT a single system. Each computer to create a cluster. This lower hardware was an absolute
PicoCluster
has a range of (or node) is scheduled to work barrier to entry makes it a lot breeze. Screw the four pins on
cluster kits for a on the same task, controlled by a easier to get on with the more to a Raspberry Pi 3 board and
range of boards master computer. important act of learning cluster insert the supplied USB cable,
(including the
Raspberry Knowing how to manage, computing technologies. then attach the HAT (wiring the
Pi). They use and use, clustered computers The HAT sits on top of cable between the board and HAT).
Ethernet and supercomputers is a pretty a Raspberry Pi 2/3 and you slot four Attach the USB power to the HAT
networking
and Raspberry valuable skill. Its also one of the Pi Zero computers on to the HAT and then slot on the four Pi Zero
Pi 2/3 boards, areas at the absolute forefront of (via the USB connection). boards. The whole setup took less
but are more computing technology. A USB cable is run from the than five minutes.
expensive.
ut it has always been difficult Raspberry Pi to the HAT to provide Software is well handled too. A
to get started. Traditionally, cluster power to the four Pi Zero boards. dedicated site (magpi.cc/2jHMeQq)
computing has been an expensive The latter are controlled directly provides image files for the
hobby. You need lots of computers via the GPIO pins. controller (the Pi 2/3) and one
(preferably identical) and a You need a microSD card for each image file for each Pi Zero board.
network controller and the skill to Pi Zero, and one for the controlling The Cluster HAT version
network them all together. This Raspberry Pi. o thats five of Raspbian boots into the
difficulty is before you even start cards in total. command line, but offers a
189 / $239
learning how to manage several We costed up a Raspberry Pi, script for controlling the cluster.
magpi.cc/2kAcJLG
computers working in tandem. Cluster HAT, four Pi Zero boards, or e ample
28 / $35
clusterhat on all the cluster of four Pi Zero boards Python, Java, SQL (and relational Above Left The
soc e s on
ran at roughly half the speed of database techniques). Youll also the Cluster HAT
This command-line code a single Raspberry Pi 3 board. need a good understanding of p o de connec on
for four Pi
switches on all four Pi Zero The slower speed makes sense the Linux command line. e o oa ds
boards. You can also control them when you think about it. Nick ortunately, starters are
separately, using p1-4. uch as e plains This is partly down not alone. Theres a vibrant Above Right The
Raspberry Pi 3
to the faster individual cores in Cluster HAT Google Groups board board is the only
clusterhat p2 off the Pi 3, but also the node-node (magpi.cc/2jHYqk6). There are de ce s n
he ne e o
clusterhat p2 on communication is obviously lots of resources and projects o e s sed
a great deal faster within the Pi 3 being shared by the community. o hoo p he
Zero boards
It takes a few moments for SoC compared to communicating One book that is recommended
each Pi Zero to power up and load between separate Zeros with reading is Raspberry Pi Super
its software, at which point itll Ethernet-over-USB. Cluster (16.78) by Andrew K
appear in i on . So youre not building a faster Dennis (magpi.cc/2jHZyV8).
Access each node using SSH Raspberry Pi. However, we Whatever resources you choose,
enabled by default dont think this matters. The we think the Cluster HAT is a great
aim for most people will be to resource for starting distributed
ssh pi@p1.local build a low-cost and relatively computing. Its small, cheap, and
easy-to-assemble cluster for easy to set up.
Here you can use i on to educational purposes. You have to leap a lot of hurdles
find the P address luster AT Once created, you can start to to learn cluster computing.
has assigned to the Pi Zero experiment with the concepts But Cluster HAT removes
(under USB Ethernet). behind cluster computing. The the e pensive and difficult
Cluster HAT is ideal for teaching, hardware build. Its then up to
Pi computing learning or developing cluster you to learn the sophisticated
One thing this isnt, though, is a computing ideas. coding techniques.
supercomputer. Theres a good set We suspect it will also appeal to
of benchmarks by Nick Smith on developers who have access to larger Last word
Climbers.net (magpi.cc/2jKlq23). cluster computing systems, but
Nick used iperf to test the not all the time. You can test and A compact, neat and cost-
network-over-USB connection and run code on the Cluster HAT, then e ec e so on o dn
found it comparable to Ethernet. migrate it across to a larger system. a cluster computer. The end-
The slower speed of the Pi Zero p od c m h ac a po e
boards compared to Raspberry Pi 2/3 Distributed computing s pe ec o each n
and ea n n d s ed
boards is much more pronounced. Cluster computing is not a game
comp n concep s
Nick benchmarked the system for beginners. Realistically
using HPC Challenge Benchmark speaking, prospective learners
(magpi.cc/2jKpH5C). He found will need a working knowledge of
BESTSELLERS
GAME
then followed by programming
basics, all with reference to parts
of typical games. The writing style
Dr James Stones Tutorial books for DEVELOPMENT forward momentum, and were soon
at our first game.
Sebtel make technical, mathematical Author: Sloan Kelly After due recognition to design
subjects easily understandable. Publisher: Apress and testing, theres Bricks, a
Price: 14.99
classic Breakout-style game;
ISBN: 978-1484225165
MAKERSPACE
circuits, more electronics; the
Author: Dr James Stone
supply listings are localised to US
PROJECTS
Publisher: Sebtel Press
Price: 16.95 suppliers, but it shouldnt take too
ISBN: 978-0956372857 much effort to track things down
magpi.cc/2lFOwRp
wherever you are, locally
Authors: Colleen Graves, as well as through the
An outstanding introduction Aaron Graves
that can pull in the general
internet. Projects are
Publisher: McGraw Hill
reader with dry humour, but Price: 15.99 followed by challenges,
has the textbook rigour needed ISBN: 978-1259644252 suggesting you step beyond
by programmers looking for
magpi.cc/2lFLiNM following instructions and
a fuller understanding of this
essential subject. make projects your own.
Learning programming Every maker needs some
FOSDEM
FEATURE
en thousand attendees is in English, and many Americans The project featured in the
T a guesstimate, as FOSDEM
is an entirely free event
y in to attend or speak, the
corridors buzz with geeky chat
design track, as its usability
research was profiled. t was also
with no registration. Its certainly in Flemish and French, and featured in a talk on OpenScore,
very big! Now in its 18th year, Scandinavian and Slavic languages which is crowdsourcing MuseScore
FOSDEM has been referred to as a abound. This is Europes developer digitisation of out-of-copyright
week-long event happening over meetup; it exists because its sheet music to build a vast library
a weekend. Indeed, it feels very important for free and open source of semantic score data, open for
concentrated, with dozens of talks software developers to be able to analysis with tools like MITs
happening at once (610 speakers meet in real life. music21, as well as freely accessible
in total), almost all rooms full to With 55 tracks over 30 rooms of sheet music. Partners for OpenScore
capacity, and busy project stands the Universit Libre de Bruxelles, include the IMSLP public domain
spread over several buildings. youll find not just your favourite sheet music library: imslp.org.
The conference runs on projects, but many new discoveries. Good as it was to see some old-
goodwill, volunteer energy, and This years event included languages school analogue synths in the slides
a modest amount of discreet from GNU Guile to Python, of Python developer Yann Gravrand,
sponsorship plus coffee and technologies from containers to it was even better to hear a live
Belgian beer). While all talks are microkernels, and hardware projects demo of them being controlled via
covering everything from the Python by his old MIDI drum pads,
OPENING
embedded space to chip designers. and the mido and portmidi libraries.
Add in documentation, design, More exotic languages were
THE MONTH IN
RASPBERRY PI
Everything else that happened this month in the world of Raspberry Pi
HELLO,
WORLD! e launched a sister magazine
W last month called Hello World, a
free computing magazine aimed
specifically at educators. The reactions
to it have been fantastic, with attendees
of the Bett Show and other educators
around the UK (and indeed the world)
e cited to get their hands on a copy.
You can find out more info on how to
get one yourself at helloworld.cc, and
help kids and teens learn more about
computing everywhere.
HIDDEN FIGURES
More secret history from behind the scenes of the Apollo missions
You may remember a few issues ago that reader on Twitter pointed out to us.
we did a piece on using the Raspberry Pi Hidden Figures is about these people:
to run the Apollo Guidance Computer the women of colour such as Katherine
code. This was after the code for it had Johnson working behind the scenes as
been uploaded to GitHub in July 2016, a mathematicians, performing orbital
wonderful mixing of old code and new calculations among many other things
tech. One of the things we talked about for NASA. Its been nominated for
extensively was Margaret Hamilton, one three Academy Awards, including Best
of the head coders behind the project. Picture, and shows the struggles these
Its because of her that the concept of women went through, not just because
software engineering exists today, but of their gender but also the colour of
she wasnt the only person breaking their skin. Its an excellent watch and
boundaries at NASA in those days, as a we recommend it.
CROWDFUND THIS!
The best crowdfunding hits this month for you to check out
f you cast your minds back a little while, you may kck.st/2l6bwts
remember that we reviewed the excellent MeArm robot
arm its pretty popular in the Pi community, even While not boasting a very descriptive name, the
though you need to do some rejigging to get it working Pi186 AT allows you to plug in 186 rechargeable
with it. ts no surprise, then, that the team behind it Li-ion batteries to power the Raspberry Pi. The
are making a Pi-specific version, and have asked the AT fits on older 26-pin Raspberry Pis as well, and
community to help fund it, which they did in less than offers a new way of enabling portability for the Pi.
12 hours. Theyre currently at , so its a great time Its smashed its funding target, so get on board now
to jump on and get your own kit. to get one to boost your portable projects.
GBAPI
Weve seen lots of Game Boy conversions and even
RUNMYROBOT GUEST WIFI
We like Lets Robot and
apparently other people in the
community like the idea as well
A makerspace in Santa Barbara,
CA is automating guest WiFi
codes using a Raspberry Pi, a
custom builds (like our modified PiGRRL in the cover theres now an entire website thermal printer, and a big old
feature), but this is possibly the first GBA conversion dedicated to letting people give button. Press it for a 24-hour code
weve seen using RetroPie. Although its missing two random strangers on the internet you can use in the makerspace.
buttons to be able to go full-on SNES, you could access to robots in their home. Its simple and easy. We should
probably mod one a bit further and add buttons, You can add your own if you want, get one for when people come
and the backlight the original lacked. We love it! albeit at your own peril. over and want the WiFi code.
COMMUNITY
PROFILE
DAVID
PRIDE
A Raspberry Pi maker and student, who plans
to add as many letters as he can after his name
David Pride D
avids experiences in
computer education came
for, head-first. espite a lack of
knowledge in Linu and Python,
slightly later in life. He he experimented and had fun. He
Category: Maker and student
admits to not being a grade-A found a Raspberry am and, with
Day job: Currently getting paid
student: he left school with few it, Pi enthusiasts like ike orne
to study what he loves
ualifications, unable to pursue and Peter Onions. The projects on
Website: piandchips.co.uk further education at university. display at the Jam were enough
twitter.com/davejavupride There was, however, a teacher to push David further into the
who instilled in him a passion for Raspberry Pi rabbit hole and, after
Below David joined computers and coding which would working his way through several
us at the St Jamess stick with him indefinitely. Python books, he began to take
Palace Community
celebration, mingling Twenty years later, back in 2 12, steps into the world of formal
with the likes of the David heard of the Raspberry Pi a higher education.
Duke of York, plus
organisers of Jams soon-to-be released new little With a ualification
and clubs, such as marvel that he instantly fell from Rice University under his
Grace and Femi
Above Self-playing xylophones, Wiimote air drums, Lego sorters, Pi Wars robots, Above Davids determination to access and complete further
and more. David is continually hacking toys, giving them new Pi-powered life education in computing has earned him a three-year PhD
studentship. Not bad for a lousy student
belt, he continued to improve is website, the pun-tastic Pi
HIGHLIGHT
upon his self-taught knowledge and hips, is home to the majority
and was fortunate enough to be of his work; David also links to
accepted to study for a masters YouTube videos and walk-throughs
degree in Computer Science at of his projects, and relates his
the University of Hertfordshire. experiences at various events.
With a distinction for his final If youve followed any of the
dissertation, avid completed action across the Raspberry Pi
the course with an overall social media channels or indeed,
@codeclubworld
CODE CLUB
INTERNATIONAL
Code Club helps get kids coding around the world. Heres how
f you havent yet heard International, magpi.cc/2lfaGNm). most kids coding at a single event.
I about it, Code Club is
a global network of
Code Club partners with local NGOs
not-for-profit organisations .
Coding is the language of the 21st
century, says Kelly Tagalan from
volunteer-led extracurricular coding These share the mission to have a Code Club Australia. Our mission is
clubs for children. Code Club in every community in to make sure every Australian child
ode lub first started in the the world, and support the countrys has the opportunity to learn how to
UK, back in 2012, to help children local Code Club community. code, no matter where they live or
develop coding skills. Since then, Currently there are Code Club what school they go to.
this idea has spread around the partners in ten countries. Code Club
world and there are now over 9,000 Australia, the biggest community Global volunteers
Code Clubs internationally. outside the UK, has over 50,000 Anyone can start an individual
n 2 16, ode lub officially children attending Code Clubs Code Club in their local community,
launched its international (magpi.cc/2lgjyiE). In fact, in 2016 anywhere in the world (see How
programme (Code Club they set a world record for the to Start a Code Club below). There
CODE CLUB
Inspire kids to become the next
generation of digital makers
INTERNATIONAL
IN NUMBERS
are clubs all around the globe, Volunteering is also a good thing
in countries such as Mauritius, to do. I feel really happy when I am
Bermuda, Nigeria, Kazakhstan, volunteering at Code Club because
the Philippines, and Israel. I feel a sense of real achievement,
Code Clubs come in all shapes and says Mizanur Rahman, a Code
sizes and some of the most powerful Club volunteer in Bangladesh.
ode lubs make a big difference for These children do not have big
a very small number of local kids. ambitions and they think of doing
Max Dolgikh runs a Code Club similar jobs as their poor parents,
in Ukraine. Hes been teaching explains Mizanur. At Code Club,
students to use Scratch. One we provide a creative platform.
Ukrainian boy, Vova, wrote a version They can express themselves with
of the classic game Arkanoid. I was confidence and learn skills with
happy all day long, says Max. Its better career prospects.
worth teaching to just a single child Code Club is looking for
to give them a better life. volunteers around the world.
Volunteering at a Code Club is a Anyone can start an individual Code
good way for STEM graduates to pass Club in their local community.
on coding skills while developing Start a Code Club in your local
communication skills. area and youll get to inspire the
I have the opportunity to next generation of digital makers.
share my knowledge with young Visit Code Club International and
people in my community, dont forget to register your club.
says Shohel Rana, a Code Club Class projects are completely free,
volunteer in Bangladesh. At the and available in 25 languages from
same time, these experiences French and Spanish to Korean,
taught me to communicate Arabic, and Hebrew for registered
concepts to a group, skills that will Code Clubs. Visit magpi.cc/2lnuqLL
serve me in the future. to see how you can help.
RASPBERRY JAM
EVENT CALENDAR 1 3RD ANNUAL HISAR
CODING SUMMIT
Istanbul, Turkey
Find out what community-organised, Raspberry Pi-
themed events are happening near you
3 #PDATTHECOTTAGE
RASPBERRY JAM
Minden, LA, USA
FIND OUT
ABOUT JAMS
Want a Raspberry Jam in your
area? Want to start one?
Email Ben Nuttall about it:
ben@raspberrypi.org
BLAYDON
2 RASPBERRY JAM
a don
MANCHESTER
6 RASPBERRY JAM
anches e
COULD USE
MORE JAMS
5 PRESTON
RASPBERRY JAM
es on
STAFFORD
7 RASPBERRY JAM
a od
8 PI WARS
am d e
STAFFORD
RASPBERRY JAM
When: Tuesday 14 arch
MORE WAYS TO LEARN
Where: tafford Library,
tafford,
magpi.cc/2lzwyQu
CODE CLUBS
A big meet-up of Pi enthusiasts The latest figures show there
who all share ideas, help each are over 5,000 Code Club after-
other, and most of all have fun! school or extracurricular clubs
around the UK, any of which
PI WARS you can join to learn more
When: aturday 1 - unday 2 April about computing. That means
Where: omputer Laboratory theres probably one near you.
niversity of ambridge , Code Clubs offer loads of fun
ambridge, ways to learn about computing
magpi.cc/2k48U1D using Scratch, Python, or
Pi Wars is back! The spin-off of the even web-style code. Find out
am am pits Pi-robots against each where your nearest one is at
other in a series of tricky challenges. codeclub.org.uk.
YOUR LETTERS
Mature users
I am a very senior (more than 50 years Mirror, mirror
experience) computer person from the USA. I am Thank you very much for the
also a physician health surveyor for Medicare, magic mirror guide in the last
so I visit a lot of older folks, most of whom have issue it was incredibly
been bypassed by the computer revolution. My informative and Im getting
experiments with Raspberry Pi indicate that this, the components now to try
in ario orm ac or co ld become a errific and make my own. I liked the
introductory system for seniors who wish to learn way it was laid out, showing
about computing (and many of them do!). each step in detail Im
This is a HUGE potential application. I note sure not everyone reading
that someone has already cobbled together a computer magazine will
a implified er in er ace or enior o g have the necessary carpentry
personally would prefer that this be done at the skills; I sure didnt!
OS level (I know, much easier said than done). On Are you going to continue
e ole e a pberr i i a ing o in e doing these sort of builds at
. o ld be errific i e co ld ge ome ing all in the near future?
going with AARP to promote Raspberry Pi for the Tamara O
elderly, especially if we could produce a really
EXCELLENT simple but capable user interface. If youre this far into the issue, youll probably
Stuart Jones have already noticed that we do indeed have Above A lot of
you liked the big
a similar build this issue with the Pi Zero W
project from last
Thats great that its helping seniors learn retro console. Starting from this issue, were issue and were
de n e p ann n
about computing in America. The Raspberry Pi calling our projects like this MagPi Big Builds
to do more in
Foundations mission does really revolve around while we have had two in a row, were likely the future
children, teens, and other young people, which not going to be doing one every issue, so each
is probably quite apparent in the way a lot of the Big Build will be a bit of an event. Hopefully,
resources are written. However, as youve said, the we can keep making projects as popular as the
community has come together and created some magic mirror!
interfaces more suited to seniors. Theres a very
long list of stuff that the P EL team has to tweak
and add, so you may see something like that one Lost in translation
day, but who knows when? Ive noticed youre doing a few translated editions
Otherwise, it might be an idea to keep an eye on now the German version and the mini mags.
any new Picademy USA courses, so you can learn You seem to have a great range of languages;
better how to educate others about the Raspberry Pi. however, Id love to help you with translating
it into another language. Do you have any plans
for future translated editions?
Marcus
FROM THE FORUM: This was a weird one, but thanks to the folks on the
forums, we did realise what happened
WHEN ASCII
To begin with, theyre supposed to say GP and not
. You then wire up the cover to the listed GP
GOES WRONG
ports to get them to light in the right order. Simple
enough. What seems to have happened is that during
the design process, the illustration we used which said
GP was subject to some bug that changed each letter
The Raspberry Pi Forum is a hotbed of to the previous one on the alphabet.
conversations and problem-solving for the Due to the way the articles are checked, it was
community - join in via raspberrypi.org/forums nearly impossible to notice this error. Now we
know its a thing that might happen, though, we
ather late, I know (or early for 2017): Im looking at the can make sure it doesnt again. Were sorry for any
R Christmas tree project. On the image of the back of the tree
card, what do the characters mean next to the lights?
confusion caused!
What does FOHN mean next to the light number? There is also WRITE TO US
FOHN /1, and FOHN 05 appears twice.
Have you got something youd like to say?
Thanks,
Get in touch via magpi@raspberrypi.org or on The MagPi
jonesypeter section of the forum at: raspberrypi.org/forums
ONE OF TEN
KODI EDITION
RASPBERRY PI CASES
This issue weve reviewed
the brand-new version of
Kodi and weve also made a tutorial
on how to make your own HTPC with
it. This Kodi case is the ideal accessory
for your home theatre, blending in
perfectly with your other devices.
PI FOR THE
CONNECTED
HOME
Matt Richardson on how the arrival of Zero W is perfectly timed for IoT
ince the original Raspberry Pi Zero came hack with a Raspberry Pi lets you use Amazon
S out, Ive seen many makers using it for
connected home projects. Its size, low price,
Dash buttons to control almost anything you want.
(Dash buttons are usually used to order a particular
low power consumption, and software package product, such as laundry detergent, from Amazon
have made it a great option, even if makers had with just a single press.)
to use a USB peripheral to add connectivity. Now
that wireless LAN and Bluetooth connectivity are Advanced IoT
built into Raspberry Pi Zero W, it makes this mini If you want to go beyond the basics, there are cloud-
computer platform even better suited for home based platforms that let you manage many devices
Internet of Things projects. at once, and create intelligent alerts and actions.
Let me get this out of the way first nternet Many platforms are already Raspberry Pi-friendly,
of Things, or oT, has all the trappings of including the Particle Cloud, Initial State, Cayenne,
an overhyped buzzword. But even if the term and Resin.io. Each has its distinct advantages. For
Internet of Things doesnt stick around very long, example, Initial State makes it really easy for you
the concept of connected devices is here to stay to create custom web-based dashboards to show
for good. ts a clear side effect of increasingly you the state of your own sensors and internet-
affordable wireless connectivity technology. connected devices.
Its not just development boards that are becoming And if youre a beginner, there are platforms that
more connected. The consumer electronics devices make it easy to get started with connected devices.
that we buy for our homes are more likely to have ne in particular is called TTT, which stands for f
wireless capabilities. Even a product as simple as This, Then That. Its an easy-to-use service that lets
a light bulb can be equipped with connectivity, so you connect consumer and maker platforms together
that you can control its intensity and colour with a without needing to write any code. IFTTT can also go
mobile app or home automation platform. I recently beyond your devices it can interact with the news,
connected our Google Home to our WeMo Smart weather, or even local government. n the first
Plugs so that I can control the lights in our home partnership of its kind, the City of Louisville,
using my voice. Last week I was carrying a load of Kentucky recently announced that its now on IFTTT
laundry into a dark bedroom. Being able to say OK and sending real-time air quality data, which you can
Google, turn the bedroom lights on and having it log or use to trigger your own projects. I hope that
instantly do just that was a magical moment. its just the beginning for IoT partnerships like these.
As makers and technology enthusiasts, we have With all the recent developments in the Internet
even more power available to us. We benefit from of Things realm, Raspberry Pi Zero W comes at
affordable connectivity when it arrives on hardware the perfect time to offer affordable, portable, and
platforms like Zero W, and can create the connected connected computing power. The best part is that
devices that we hope to see on store shelves one day. exploring IoT doesnt mean that you need to go too
We also benefit from being able to interface with far into uncharted territory its still the same
consumer-connected devices. For example, a simple Raspberry Pi that you already know and love.
ESSENTIALS
LEARN | CODE | MAKE
Serial Pi Plus
RS232 serial communication board.
Control your Raspberry Pi over RS232
or connect to external serial
accessories.
Breakout Pi Plus
The Breakout Pi Plus is a useful
and versatile prototyping expansion
board for the Raspberry Pi
ADC Differential Pi
8 channel 18 bit analogue to digital
converter. I2C address selection
allows you to add up to 32 analogue
inputs to your Raspberry Pi.
IO Pi Plus
32 digital 5V inputs or outputs. I2C
address selection allows you to stack
up to 4 IO Pi Plus boards on your
Raspberry Pi giving you 128 digital
inputs or outputs.
RTC Pi Plus
Real-time clock with battery backup
and 5V I2C level converter for adding
external 5V I2C devices to your
Raspberry Pi. Also
available
1 Wire Pi Plus for the
1-Wire to I2C host interface with ESD
protection diode and I2C address
selection.
Pi Zero
www.abelectronics.co.uk