Mag Pi 59
Mag Pi 59
THE RASPBERRY PI
PC CHALLENGE
What cant you do with a $35 computer?
DESIGN A DOG
TREAT DISPENSER
Keep Scooby in snacks with
this clever pet project
BUILD A GPS
TRACKING DEVICE
The ultimate movement tracker
for land and sea adventures
MASTER BLUETOOTH
Take control of your Raspberry Pi remotely
12 SUMMER
Also inside:
> USE A SENSE HAT WITH MATHEMATICA
PROJECTS
Dont leave your Pi in the shade!
> REVIEWED! THE BEST WEB BROWSER FOR PI Incredible outdoor
> CREATE ELECTRONIC SENSOR WIND CHIMES digital projects for
Issue 59 July 2017 5.99
THE ONLY MONTHLY MAGAZINE WRITTEN BY AND FOR THE PI COMMUNITY 9 772051 998001
Welcome
WELCOME TO
THE OFFICIAL
MAGAZINE PAGE 3
0
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 April
July 2016
2017 3
Contents
Issue 59 July 2017 raspberrypi.org/magpi
THE PI PC
This months Pi Bakery makes wind-powered music
CHALLENGE
Use the AIY Projects Voice HAT to control servos
SUMMER
is outside
th
Lets take
HOT HOLIDAY PROJECTS 68
Go outside and get making this summer!
YOUR PROJECTS
97
REGULARS
> NEWS 06
> TECHNICAL FAQ 64
> BOOK REVIEWS 82
> FINAL WORD 98
COMMUNITY
32
> THIS MONTH IN PI 84
DISPENSER
The ultimate, Pi-powered treat dispenser
for a very good boy REVIEWS
PI0CKET TINY 38 > OCTOCAM 76
The smallest handheld games system > BROWSER GROUP TEST 78
weve ever seen
> WD PIDRIVE USB FLASH 80
raspberrypi.org/magpi July 2017 5
News FEATURE
RASPBERRY PI
JOINS FORCES WITH
CODERDOJO Teaming up to deliver more for young makers and coders
he Raspberry Pi CoderDojo spokesperson Rosa with technology. By combining
T Foundation and the
CoderDojo Foundation
Langhammer tells us that
CoderDojo is and will always
our efforts we get closer to these
shared goals.
have merged, with Raspberry Pi remain 100% content, software The merger will allow CoderDojo
Foundation CEO Philip Colligan and hardware neutral! to reach even more young,
joining the CoderDojo board. The The Raspberry Pi Foundation enthusiastic makers and coders.
Below Philip
two Foundations will share back- works to put the power of digital Well hear more about these
Colligan (left), CEO
of the Raspberry office resources and expertise making into the hands of people plans in the summer, but Rosa did
Pi Foundation,
to deliver more quickly on their all over the world, continues reveal that part of the strategy
and Giustina
Mizzoni (right), shared goals. Rosa, and the CoderDojo mission review includes mapping the
Executive Director
CoderDojo fans wont see any is to give every young person an path to 5,000 Dojos [worldwide]
of the CoderDojo
Foundation change at the Dojos, however. opportunity to learn and create by 2020.
WHAT IS CODERDOJO?
Aimed at young people between the ages of
7 and 17, CoderDojos are free, community-led
programming clubs for anyone curious about
coding. Whether thats building websites, apps,
or just figuring out how technology works, Dojos
have always offered freedom from hardware and
software restrictions any tool is fine, as long as
youre coding.
The CoderDojo mission is to give every young
person an opportunity to learn and create with
technology, as spokesperson Rosa Langhammer
puts it.
Key to the movement are the volunteer
Champions who set up the Dojos. If you or your
Any hardware and software is fine, as long as youre coding organisation would like to set up a Dojo, the
CoderDojo Foundation will help you get started:
visit magpi.cc/2r4EnVT for details. You dont need
But, the first priority, Philip to support the growth of the technical skills to start a verified Dojo, just the ability
tells us, is to make it as easy CoderDojo movement around to bring people together, and a passion for the
as possible to set up and run a the world. power of code to build a positive future.
CoderDojo. That means investing The CoderDojo Foundation To search for a Dojo near you, check the
in the tools and resources that team is really excited, says interactive map at zen.coderdojo.com.
A PI IN
EVERY
DEVICE?
Eben Upton speaks at the first ever Global Digital Signage Conference
aspberry Pi co-founder With about 14 million Pis shipped However, machine-to-machine
R Eben Upton was a key
speaker at the recent
in the last five years, he sees more
scope for industrial IoT applications
interactions offer according
to Eben almost limitless
Global Digital Signage Conference. than consumer IoT products. possibilities to use a Raspberry Pi.
One attendee had flown in from Theres a limit to how many things For example, many of the screens
Brazil just to hear him speak. you can interact with if you have in airports now are powered by Pi
Compute Modules.
UHD Pi?
Asked when we might see a
Raspberry Pi capable of Ultra High
Definition (4K) output, Eben said
it was forward in our minds but
dismissed the use of a separate
graphics chip. The only rationale
for a second chip would be
thermal you bake in a lot of cost
if you do that. Eben estimated
that its probably four or five
years before wed see a UHD Pi.
RASPBERRY PI
IS FINALIST FOR PRESTIGIOUS
MACROBERT AWARD Redefines how people use and engage with computers
Below Last
years MacRobert
he Raspberry Pi is a finalist for this years The Raspberry Pi team has achieved something that
Award winner
was Blatchfords
Linx, the worlds
T MacRobert Award, the UKs longest running
and most prestigious national prize for
mainstream multinational computer companies and
leading processing chip designers not only failed to
most intelligent
prosthetic limb engineering and innovation. do, but failed even to spot a need for, said MacRobert
Award judge Dr Frances Saunders CB FREng.
The Raspberry Pi has helped reverse the
downward trend of interest in computer science and
programming. This trend is thought to be linked to
the demise of programmable home computers like
the BBC Micro and [ZX] Spectrum, according to the
MacRobert nomination.
Speaking at a separate event, Raspberry Pi co-
creator Eben Upton corroborated this. We used to get
about 600 people applying to study computer science
at Cambridge, he expanded. We got down to about
200 our worst year, in 2008. We had 700 [applicants]
last year [2016].
The final winner of the MacRobert Award will be
announced at the Royal Academy of Engineerings
Awards Dinner on 29 June.
GOPIGO 3 RELEASED
Updated robot car kit more versatile than ever exter Industries has launched the third version
D of its popular GoPiGo robot car kit, along with
a whole new operating system, DexterOS,
designed specifically for learning how to program
robots intuitively.
The new kit has an updated sensor board, with ports
including two I2C and two AD (analogue or digital),
one serial, two servo. Everything is a lot more robust
so you can daisy-chain and add on easily.
Dexter Industries Taryn Sullivan says that the
GoPiGo3 is totally redesigned and weve added a
lot of features that will be great for educators. The
DexterOS software allows you or your students to build
code in Bloxter (based on Googles Blockly) or Python,
and is compatible with the GoPiGo2.
The GoPiGo3 should be on sale in the UK by
the time you read this, from suppliers such as
ModMyPi (www.modmypi.com). The price has
yet to be confirmed, but we expect it to be around
95-100 (Pi-less).
NOW TRENDING
The stories we shared that
flew around the world
SMART METER
magpi.cc/2s6L21v
PROGRAM MINECRAFT ON A PI
magpi.cc/2sit2RT
nline retailer Pi Supply (pi-supply.com) has Shaw says that pre-soldering the GPIO header
O released a Raspberry Pi Zero W with a GPIO
header. This is a boon for solder-averse
turns the Pi Zero into something completely plug
and play, the minute it falls through the post box.
hobbyists and lazy makers alike, especially as the pre- And we test them before they ship out.
soldered Pi costs only 14. Visit magpi.cc/2sUWhds We wondered who was doing all the laborious
for details. soldering: For the first 100 units, we did these by hand
Pi Supply owner Aaron Shaw tells us, We think the between four of us we have now outsourced it to our
Raspberry Pi Foundation absolutely did the right thing lovely contract manufacture partners based in the UK.
by not including a header as standard because its The pre-soldered Pi was first listed on 12 May
unnecessary for many projects and adds a significant and they have been selling fantastically well.
cost! However, for some projects this is an annoyance Presoldered or not, you can still only buy one Pi
and a header is needed. ZeroW per order.
PI CLUSTER POWERS
NEXT-GEN MEDICAL
RESEARCH TOOL
Semantic search meets affordable hardware
K-based SciBite recently demonstrated its
U cutting-edge biomedical semantic search tools
on a humble Raspberry Pi cluster.
The demonstration was part of SciBites setup for the
Bio-IT World show in Boston, USA, where SciBite won an
award for Best of Show in the Analysis and Data Computer
category. The show went really well, SciBite marketing
manager Monica Kulkarni tells us, with a great reception
for the Pis. People came to the stand just to see the demo.
The great thing about using the Pi cluster,
Monica continues, was that when the internet
connection went down in the exhibition hall, we could
carry on demonstrating, as the Pis ran on their own
local network.
Semantic search is a method of information gathering
far in advance of using a standard search engine, Monica
explains. Controlled scientific vocabularies allow the
TERMite semantic search tool to understand that for
any given concept, there may be multiple synonyms
for a singular term. Schilder syndrome, Alpers disease,
Christensen disorder, Encephalitis periaxialis are all
the same disease. The tens of millions of synonyms
provide the depth of knowledge required to understand
biologicaltext.
However, ambiguity is also a problem, with a single
word having many meanings, and therefore producing
either irrelevant or misleading search results. Contextual
disambiguation is critical to ensuring accurate insight,
confirms Monica.
TERMite, and the DOCstore front-end that accesses
it, is platform-agnostic (its a Java app with a browser-
based UI), but developing for the Pi wasnt just for fun.
Squeezing the TERMite vocabularies to run on the Pis 1GB
of RAM was a challenge, but some of the techniques we
used to compress and efficiently scan data are already
finding their way into next release of TERMite.
The
RASPBERRY PI
PC CHALLENGE
Can you really use a Raspberry Pi as a desktop replacement?
We set Rob Zwetsloot the challenge of using a Pi for a week
03.
03.
01.
Robs
Desktop
Setup
01. RASPBERRY PI
For one week, Ill be working
on a Raspberry Pi. Ive chosen
the Raspberry Pi 3, as its the
most powerful Pi to date, and
02. Im going to need all the power
I can get.
03. KEYBOARD
& MOUSE
The classic desktop setup isnt
complete without the standard
mouse and keyboard no
touchscreen or motion-sensing
devices in sight!
Also...
MONITOR
The Raspberry Pi 3 can display
1080p visuals over HDMI, so
Ive chosen a monitor that can
handle this.
RASPBIAN
Ive chosen Raspbian for this
experiment. Not only is it the
premier Raspberry Pi OS; it
is also well supported by the
community, so I can easily get
help if I need it.
Day One:
SETTING UP
built the basic hardware setup as described on
I the previous page. I downloaded and installed
the latest version of Raspbian (you can do
Web browser: Email:
this via NOOBS, or follow our instructional video:
magpi.cc/2sj7IeN) and let it run through its automatic Chromium Claws Mail
setup steps. With that, I was ready to start using the
Raspberry Pi as a desktop computer. Lets begin. This default browser (and the base A very lightweight email
for Googles Chrome browser) client that comes bundled
comes with all the major features with Raspbian. You can use
Know your software of Chrome itself, including the it like any other email client.
If youre using the Raspberry Pi for sysadmin or other ability to transfer over your Rob thinks: Claws is fairly
kinds of IT management, youre not going to demand settings and Chrome apps. This basic, but if all you really
much from it. The trusty Terminal will be your best version of Chromium also comes need to do is read and reply
friend, along with a quick peek at Google to check with Flash integration. to emails, you dont need
Stack Overflow. Rob thinks: Chrome is my much else.
Im treating my Raspberry Pi as an office desktop preferred browser, and we also
computer. For writing magazine articles, this means think it (as Chromium) is the
Im about 95 percent covered by a word processor best browser available for the
and an accompanying office suite, a web browser for Raspberry Pi (read our group test
general internet usage, and access to relevant chat on page 78). Most importantly for
protocols so I can coordinate with the rest of the team. this experiment, it allows for great
These requirements will be the same for a lot of office access to web versions of software
workers. Lets take a look at the tools youre getting on that may not have a Raspbian
Raspbian to help with this. equivalent, such as Skype.
Office suite:
LibreOffice
One of the most popular alternatives to Microsoft
Office, LibreOffice includes a range of equivalent
programs that are compatible with Microsoft
Office files. Writer is your Word replacement,
Sheets replaces Excel, Impress works with
PowerPoint files, etc.
Rob thinks: I really like the LibreOffice apps,
and Writer is a perfect substitute for Word
and other word processors. This version of
LibreOffice has been further optimised to look
and run better on the Raspberry Pi as well,
so you wont notice any performance issues.
CHROMIUM TIPS
Heres how I used the Chromium browser to handle multiple tasks
Gmail
While I could access my Gmail through Claws Mail,
I was interested in seeing whether I could get Gmail
running in the browser. Surprisingly, Gmail takes up
a lot of memory space while it runs. This increases as
you add different accounts.
Luckily, Google has a solution: switching to
HTML mode while loading. Google claims that
TOP TIP: this is to help with slow connections, but it also
Use SHIFT+ESC to drastically cuts down the memory footprint. It
open the Chromium looks as if youre using Gmail in 2002, but its
task manager worth it.
Skype
We use Skype for chatting at The MagPi, and while
there are other chat protocols that might be easier
to tap into (such as Hangouts), we cant change
the way we work just for one person. I decided
to try web Skype (web.skype.com), and while it
wasnt particularly kind to the memory
resources, it did run happily
in the background while I got on
with other work.
TOP TIP:
I turned off some of the chat Use a different chat
features (including the giant client. Try out Pidgin
animated emoticons), and I for a very lightweight
suggest that you do the same. way of staying
in touch
TweetDeck
You may not use Twitter enough to need TweetDeck
to manage all your accounts, but I was pleasantly
surprised at how well it worked. It does use a lot of
memory, but it runs just fine on the Pi, even when
other programs are up and running.
Day Two:
TOP TIP:
Keep an eye on the
tabs you have open,
and whether or not
they need to be open
all the time
DOS &
DONTS
Which websites should you avoid?
Day Three:
MEET THE
COMMAND LINE
I
t is perfectly possible to use Raspbian or any
other Linux distribution solely through the Command-line
graphical desktop. However, getting to grips
with the command line or Terminal is essential to
basics sudo
allows you to run
Some essential commands commands as
make sure your Raspbian experience is as smooth
you need to know the owner of the
as possible.
I found myself periodically having to enter the operating system
command line to troubleshoot issues Id discovered sudo apt-get update
during the experiment. Heres how it works.
Before installing software or updating your version
sudo reboot
TROUBLESHOOTING
IN THE TERMINAL
Got a problem? Pi running slow? Try these simple fixes
COMMAND
The column on the far right-hand side
shows which programs are running,
along with their package name
PID
The process ID, or pid, is the number
the Raspbian system assigns to each
running piece of software
%CPU
This column shows the percentage
of the processors overall power
used by each piece of software
%MEM
This column shows the percentage
of overall memory that each piece
of software is using
Day Four:
GETTING DOWN
TO BUSINESS
few days into our experiment, I found myself
A facing some admin tasks, so I was using more
Office-style programs than on previous days.
I needed access to collaborative documents from
Google Docs and Sheets, and to WordPress for writing
blog posts. Heres what I needed to achieve, along
with some of my solutions.
TOP TIP:
Google Drive
set up Dropbox on
a Raspberry Pi using
Using online collaborative spreadsheets
Dropbox
the guide here:
and documents magpi.cc/2c9NnPC
As I discovered earlier in the week, juggling Chromium
Making the most
tabs is essential to keep the Raspberry Pi running
of cloud storage
well. Google Drive and Google Docs use large amounts A lot of The MagPi files live on a shared Dropbox
of resources, so keep that in mind when working that we use to create the magazine, and we all
with them. need to upload articles as well as monitoring the
I recommend trying to use one document at a time, production process. There are two main ways
or to close as many other tabs as possible if you need to make this work: follow our previous tutorials
to juggle more than one. If you keep this in mind, and install Dropbox to Raspbian, or make use of
Docs and Sheets work well in the Chromium browser, the Dropbox web interface.
so you shouldnt need to make any further changes to There are advantages to both options. Creating
get them running. a dedicated Dropbox folder is a lot faster and
frees up all-important browser resources, while
the web interface allows you to quickly access,
download, and upload a few files at a time. While
I used the web interface method this time, I
have used Dropbox on a Pi before. If this were a
more long-term solution, Id set up Dropbox on
an external hard drive. This makes everything
easier, although it takes a while to set up.
PDF
How to read PDFs on the Raspberry Pi
Opening a PDF on the Raspberry Pi is easy theres a
dedicated PDF reader installed. Opening PDFs in the
browser can cause problems, though. Chromium has
a habit of trying to load PDFs into the browser without
downloading them first. This is fine on a normal
desktop computer, but it doesnt always work on the Pi.
Other services
Ive probably missed out something you use regularly
we dont all use our computers for the same things!
Here are a few tips on troubleshooting your desktop
Pi experience.
Things to keep in mind while using WordPress xperiment with several pieces of software until
E
you find the one that works for you
I didnt have any big problems while writing The MagPi
e wary of fancy web interfaces; these will take
B
blog posts. The main thing that caused the Pi to slow
up a lot of resources
down was adding images directly into the posts. Id
recommend uploading them to the Media library first, Above all, be patient
before embedding them in a post.
Image editing
A lightweight alternative to Photoshop
I dont expect to do any serious image editing or
touch-ups on a Raspberry Pi, but the ability to
perform simple editing tasks (crop, rotate, resize)
is important. Mirage is the software that allowed
me to do this in Raspbian. It is very lightweight
and works well. The display also includes a column
showing all the images in a selected directory.
It was quick and efficient for the simple tasks I
needed, although for anything more complex youll
have to seek out a more powerful computer.
Day Five:
MAINSTREAM
MEDIA Below Can Goku recruit Frieza for the Tournament of Power?
wanted to relax on the evening of the final
I day, by watching some TV and playing some
games. While Im performing this experiment,
Find out next time on Dragon Ball Super
WATCHING
YouTube & online video viewing into fullscreen mode, which juddered a bit
As weve discussed before, YouTube works just fine when it started but performed well over the next half
on the Raspberry Pi with Raspbian and Chromium. hour or so as I switched between a selection of videos.
I caught up with my YouTube subscriptions (handily I havent had much luck with other types of online
placed in a Watch Later playlist) while sipping video this week. However, this task only used one tab
Below Dont judge
me: Im going to Walt a tropical, rum-based concoction Id devised to in my browser, so I thought Id push the envelope a bit
Disney World soon... celebrate the end of the week. I daringly took my and see whether I could catch up on Dragon Ball Super
via Crunchyroll. Unfortunately, instead of providing the
low-quality playback I had come to expect, the video
player just refused to load, leaving me unable to find out
whether Goku had reached Super Saiyan Blue 2!
I had similar problems with Netflix while trying to
watch some of the new Unbreakable Kimmy Schmidt
episodes. There are solutions to fix this issue
(magpi.cc/2rDbtaE), but theyre not available by default.
Verdict:
Hit and miss for online video, but at least
YouTube worked well
PLAYING
Minecraft Pi
A slimmed-down
version of Minecraft,
Minecraft Pi is great
for making forts in mountains, and thats before you start hacking it with
Pi-compatible games your own mods! To run Minecraft Pi, open it from the desktop menu or type
minecraft-pi in a Terminal window.
Verdict:
A very similar experience to using a video player
on a normal desktop, thanks to Omxplayer Above Easily view your files over the network using Samba -
it can be used for more than just streaming media!
WHAT WE
LEARNED
The experiment is over: heres what I thought of the week
oing into this experiment, I wasnt sure what As Ive explained, juggling all my tasks was a little
G to expect. Ive been using the various models
of Raspberry Pi for more than five years
taxing on the Raspberry Pi, and I had to learn to
prioritise my tasks and software to guarantee the
now, in all manner of ways, but never as a full-on best performance. I also had to remove the power a
desktop replacement. I knew the Pi was capable of the few times, so I learned to save anything important to
individual tasks Id need to do, but I was wary of trying external storage in case the SD card corrupted.
to get them all running together. I learned two main lessons from the week with Pi
Patience:
The Raspberry Pi, like any computer, can only do
so much at once. The Pi is a bit more limited than
a modern laptop or desktop computer, so you cant
expect it to immediately load all the elements of
a webpage or instantly open the document youre
working on.
If it seems to hang, give it some time to sort itself
out before you start killing programs or consider
pulling the plug.
Compromise:
Like all relationships, using the Raspberry Pi as
a desktop computer involves some compromise.
Sure, Id love to have all the things I need to work on
running at once, but the Pi cant quite handle them.
Instead, I moved my music listening to my phone,
I made sure that windows and software were closed
when they werent needed, and I used the HTML
Gmail interface for my email.
All this resulted in increased efficiency during my
work day in some ways, but other tasks took longer,
so it balanced out overall.
The Result
After my week with the Raspberry Pi 3, Id say that
it is perfectly suitable for using as desktop work
computer just dont expect it to perform better
than a standard desktop machine.
Raspberry Pi
Retailers
Websites that specialise in supplying Raspberry
pi-top
pi-top.com
Pis offer some great deals on kits, along with The pi-top is one of the first major Raspberry Pi
the accessories youll need. Here are some full-computer kits, available as a pi-top laptop,
of our favourites. or a pitopCEED desktop. Theyre designed for
educational purposes rather than desktop use,
but theyre very easy to convert once youve got
Pimoroni everything up and running. The pi-topCEED is the
shop.pimoroni.com cheaper model, and all you need to provide are the
Pimoroni is a great place to find mouse, keyboard, and external hard drive.
cool Raspberry Pi kits, along with
some great project ideas and 112/$110
accessories. Theyre famous for
their funky Pi cases made from
layers of laser-cut acrylic.
The Pi Hut
thepihut.com
The Pi Hut always has great little
supplies for your Raspberry Pi
projects, as well as everything
youll need for a Pi desktop. WD PiDrive
Compute Centre
magpi.cc/2s8NbZr
Adafruit
adafruit.com We reviewed this kit in issue 56, and we think its
Looking for Raspberry Pi gear great. It is part of the WD PiDrive series, so it comes
in the USA? Adafruit is one of with a case and a hard drive setup optimised for use
the best sites, and has its own with the Raspberry Pi. You wont need an external
awesome range of components hard drive for this setup, and it even comes with a
to use with your Pi. mouse and keyboard all you need is a monitor!
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 three 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
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
SATNAV
FOR ROBOTS Guide robots with incredible accuracy using this differential GPS system
Quick
Facts W
hile building a rugged
robot, named Big Rob, for
enables the robot to correct the
inaccuracies in its own GPS signal,
can receive not just GPS signals,
but also those from the Russian
outdoor use, Ingmar Stapel mainly caused by atmospheric GLONASS system, as well as SBAS
> The differential
GPS system wanted to create a system for effects, in order to calculate its systems such as Europes EGNOS.
is accurate precise navigation. Disappointed precise position. This technique
to 20 cm with the accuracy of the standard produces an accuracy of 20cm, XBee or WiFi?
> The robot uses USB GPS modules used on his compared with 4-5 m for To minimise GPS inaccuracies,
three Python previous robots, he decided to standard GPS. Ingmar is using the RTKLIB Python
programs
build a navigation system based Both units are equipped with a library (rtklib.com) to perform
> 6 IKEA on differential GPS. RasPiGNSS Aldebaran module from the RTK calculations. The most
lunch boxes
protect the Differential GPS uses the RTK drfasching.com: It is the only complex part of this project was to
base stations (Real Time Kinematic) method for one I know which is especially built configure the RTKLIB library and
> Big Rob has carrier-based ranging between for the Raspberry Pi, explains to set up the XBee communication
a 12 V 30 Ah a base station and the robot. Ingmar. They are also fitted with between the base station and
battery
Data sent from the base station a Tallysman GNSS antenna that the robot. The main advantage
> See videos to using XBee Pro rather than
of Big Rob at
standard WiFi is its superior
magpi.cc/
2rPfEnz range of up to 1.6 km. However,
Ingmar has also tested the system
using WiFi, which offers a higher
bandwidth. Both versions of the
RTKRCV program are described on
his blog.
Robotic navigation Once it obtains a fix, the robot Ingmar has a few ideas for
So, how does it all work in moves continuously from one putting his differential GPS system
practice? Ingmar admits that waypoint to the next, checking its to practical use. I will mount the
it can take a while to obtain orientation with the Sense HAT metal detector (as used on his
a GPS fix, depending on the magnetometer: If a deviation of Discoverer robot, featured in The
surroundings and weather. five degrees is detected to the next MagPi #48) on the front of Big Rob,
If I use the setup in open country waypoint, the Python program and together with the differential
with no clouds, the calculation corrects the speed of the DC GPS setup, the robot will be able
of a fix position takes between motors to face the waypoint. Only to search very precisely for metal
10 and 15 minutes. If I use it in if the GPS signal gets lost will the in the ground. The next idea is to
the yard with high buildings robot stop and wait for the next mount, for example, a lawnmower
around the base station and calculated fix position. Waypoints on the front or to build a fertilizer
robot, it could take up to an can be entered in a Terminal spreader. The differential GPS
hour to calculate only a floating window or imported via a Google setup is a key feature for many
GPS position. Earth KML file. ideas and setups.
TELE2
alvingroen.com
How a Raspberry Pi kit helps people to live the life of a complete stranger
e have all imagined what More intriguingly, the We caught up with Alvin Groen,
Quick W it would be like to be system collected data on each the director and designer of the
> A custom iOS The Teradek VidiU enables the kit The Galvanic Skin Response An e-Health v2.0 board is mounted
app was used to stream live video to the web Sensor, Polar Bluetooth HR above a Raspberry Pi 3. The Pi
to control the via the Tele2 modem monitor, and Muse headband collects the video and audio data, as
data stream all gather data on the emotional well as the health measurements
state of the wearer
> The equipment
was in use for
more than two
months
WEARABLE
DOG TREAT
MACHINE
With motion detection and video capture, is this the ultimate dog treat dispenser?
hile pondering what to analysis of the view from a system using really good code
Quick W get Shirin, his fiance, for Raspberry Pi Camera Module. If from Adrian at PyImageSearch.
Facts
her birthday, Eric Page motion is detected, it captures a This ensures that the video always
realised how much she misses her photo and video of Pickles, which starts with Pickles entering the
dog Pickles while shes at work. are sent to Shirin in an email with area, and Shirin can see him
> Build details He decided to build a device to a randomised cute comment. If trotting up with excitement.
are on
allow her to serve treats to Pickles no motion is detected, it sends Far from being a seasoned maker,
Instructables
magpi.cc/ remotely. She uses it almost an Im not home but will enjoy Eric reveals this was my first
2sTf5qU every day! Usually once a day when the treats later message, along attempt at anything DIY in probably
> There are four she is at her office. When shes with a couple of photos of Pickles 25-plus years since junior high,
ways to trigger travelling, she probably sends playing outside. so it took some trial and error.
the device
him three or four treats every Eric says motion detection was After starting the project with an
> It can dispense day. I think it helps her feel closer an important addition. I didnt Arduino, he soon realised that it
treats of
different sizes
to home. want to send my girlfriend a video lacked the processing power and
There are four ways to trigger of a floor full of treats. Even if storage required for video and other
> Eric has added
a ball launcher
the Pi-powered device: email, Pickles was home, if he walked complexities. After I switched
MQTT, IFTTT, or Alexa. It then over to the treats more quickly or to the Pi, it took 30-45 days to get
> He intends
to extend plays a sample of Shirins voice, slowly than expected, the video to a version that would reliably
it further dispenses some dog treats, and would be blank for a period of deliver treats via email. After
checks for motion using OpenCV time. So I built a motion detection that, I periodically tinkered with
Below The
ingredients for
the perfect dog
treat dispenser
include a Pi,
Camera Module
laser-cut tubes
and stand, and
a stepper motor
>STEP-01
Cutting the parts
Eric used a laser cutter at a local makerspace to
create the plastic stand and cylinders. The inner
cylinder is divided into two compartments; one for
storage and one for dispensing.
>STEP-02
Dispensing mechanism
To make sure the desired number of treats falls into
it for four to five months, adding opening to a smaller section that the dispenser compartment, acrylic semicircles
additional delivery mechanisms holds and dispenses one serving. reduce the size of the opening. One of these is
and improving the reliability of the Following the success of the attached by Velcro and can be adjusted.
code, e.g. reconnecting everything treat dispenser, Eric has extended
if the WiFi went down. the project by building a ball
Eric says the most difficult part launcher using RFID-tagged balls,
of the project was getting the which hes trained Pickles to
he Sense HAT is one of the most important You develop code for the Sense HAT and run it in the
Youll T pieces of Raspberry Pi hardware. The emulator. A visual representation of the Sense HAT
Need
board was developed to travel aboard the hardware appears, and a range of sliders and buttons
International Space Station (ISS) as part of the Astro can be used to emulate the Sense HATs features.
Pi mission. It was also made available to buy, and The sliders are used to change the values reported
> Raspberry Pi schoolkids around the world use it to develop code by the sensors while your code is running. You can
> Raspbian - some of which runs in space as part of a series increase the pressure and humidity that the Sense
of competitions. HAT hardware would detect, and check that your
> Sense HAT
emulator The Sense HAT adds various sensors to system responds accordingly.
the Raspberry Pi: gyroscope, accelerometer, The Sense HAT emulator is a great option for
magnetometer, temperature, barometric pressure, somebody who wants to develop code for the Astro
and humidity. Pi mission, but doesnt have access to the Sense HAT
The Sense HAT emulator was developed by Dave hardware. Its also a great environment for testing
Jones (github.com/waveform80). It is intended for code, because you can manually adjust the values
people who own a Raspberry Pi, but not a Sense HAT. reported via the sensors.
01
40 July
xxxx 2017
2016 raspberrypi.org/magpi
SENSE HAT EMULATOR Tutorial
>STEP-02 humidity.py Language
Code >PYTHON
Open IDLE (Programming > Python 3) and choose File > from sense_emu import SenseHat
New. Enter the code from humidity.py. This program
adjusts the number of green and white pixels displayed sense = SenseHat()
on the LED, depending on the detected humidity.
green = (0,255,0)
02 white = (255,255,255)
while True:
humidity = sense.humidity
humidity_value = 64 * humidity / 100
pixels = [green if i < humidity_value
else white for i in range(64)]
sense.set_pixels(pixels)
>STEP-03 >STEP-05
Run and adjust Code examples Sense HAT
Run the program in IDLE (Run > Run Module) and the If youre new to the Sense HAT, you can copy and
Sense HAT image will appear and display some green paste a range of example code from the Raspberry Pi Essentials
LEDs. Adjust the humidity slider and watch the number educational resources page. Projects include a getting
If youre interested
of green LEDs change to match the new readings. started guide (magpi.cc/2rvSPSB) and a random
in learning more
number program (magpi.cc/2rvpOXq). You will also
about the Sense
03 find lots of examples under File > Open Example.
HAT, check out
These will be written to your home directory.
our Sense HAT
Essentials guide,
05 Experiment with the
Sense HAT.
magpi.cc/
Sense-HAT-book
>STEP-04
Preferences
There are some preferences that you can adjust to
change the behaviour of the emulator. Choose Edit
> Preferences. Increase the Screen updates value to
provide a more realistic experience of the behaviour of
the hardware sensors. Youll see that the values being
returned in your code drift according to the known >STEP-06
error tolerances of the physical sensors used on the Port to Sense HAT
Sense HAT. If you want to port your emulator code to a physical
Sense HAT, you just need to change:
04
sense_emu 06
to
sense_hat
raspberrypi.org/magpi xxxxx
July 2016
2017 41
Tutorial RASPBERRY PI 101: CLONE, COPY AND CONTRIBUTE TO CODE WITH GIT
it is powerful software that lets you clone, The first thing to do is to tell Git who you are.
42 July
xxxx 2017
2016 raspberrypi.org/magpi
GIT Tutorial
just get a new one and grab all the documents and
writing from the master briefcase.
Thats not all, though. The other people working
on your project also have magical briefcases, and
they also keep their documents synchronised with
the master briefcase. This means that you can all
work on a project together. If someone else has a
better answer to a project question than you do, you
can copy their answer from the master briefcase to
your document.
Start a project
So you want to start a new project? Maybe its a special
ultrasonic range finder for tracking flying objects in
the air. Youll want a directory on your computer for
Use nano to edit the
all your files to sit in, so the first thing to do is create nano README.md README.md text file
that directory.
In the Terminal, you can use the mkdir (make This command opens up the file in the Terminal.
directory) command to create a new directory. You can now give the file a title and write a short
explanation of what your project is about.
mkdir snitch-sniffer
# The Golden Snitch Sniffer
Now you want to go into that directory. You can use
the cd (change directory) command to do this. This is a project that uses multiple long-
range ultrasonic sensors to find and track
cd snitch-sniffer an object flying in three-dimensional space.
It displays the objects coordinates,
Next, you can create a file that will tell people what speed, and trajectory through a VR headset.
the project is about. You can use any text editor to
do this, but in this example, nano is used to create a Pressing CTRL+X will cause a save prompt to
file called README.md. The .md extension stands appear. You can type Y to save and then hit ENTER
for Markdown, which is a markup language. You can to close nano. Your file should have been created
learn more about Markdown on the Daring Fireball and will now be sitting in your directory. You can
website(magpi.cc/2scx1iu). type ls in the Terminal to see a list of files.
raspberrypi.org/magpi xxxxx
July 2016
2017 43
Tutorial
News RASPBERRY PI 101: CLONE, COPY AND CONTRIBUTE TO CODE WITH GIT
That .git directory is the repo skeleton. You can have a This is telling you that the README.md file has
look inside it by typing ls -a .git. not yet been committed. This means that although
This should bring up something like: Git knows about the file, it doesnt yet have any of
the files contents stored. The simplest way to do a
branches config description HEAD hooks commit is by typing:
info objects refs
git commit -am 'add README.md'
You dont need to worry about this directory
at all now. Just know that it is there and that its tracking
all the changes to the parent directory snitch-sniffer.
44 July
xxxx 2017
2016 raspberrypi.org/magpi
GIT News
Tutorial
This commits all the changes you have made in the
directory to the Git repo, and adds a message saying
what you did. The message can be anything really, but
its best to keep it fairly short yet descriptive of what
you changed.
Time travel
Now that you have set up your repo, its time to get on
with the project. Create two new files and store them in
your snitch-sniffer directory:
delete find function The file will be restored, and you can now commit
this change.
commit
5fd772a292c019a7cf3012b1156685280d4a7d2d git commit -am 'restore find function'
Author: Harry Potter <h.potter@hogwarts.prog>
Date: Fri Mar 3 20:24:52 2017 +0000 Making major changes
Imagine youre talking to someone about your
finish find function amazing project, and they have a cool idea for some
raspberrypi.org/magpi xxxxx
July 2016
2017 45
Tutorial
News RASPBERRY PI 101: CLONE, COPY AND CONTRIBUTE TO CODE WITH GIT
* lidar-version
master
46 July
xxxx 2017
2016 raspberrypi.org/magpi
GIT News
Tutorial
logged in. Find the Issues tab. You can now
create a new issue, and give a description. Once
thats completed, the maintainers of the repo will be
able to reply to you, and close the issue once its fixed.
Pull requests
Issues are great, but if you want to help out even
more, the project maintainers are usually very happy
for you to fix or improve projects yourself. To do this,
you need to make your own copy of the repo so that
you can work on it.
On the projects main page, find the Fork button
and click it. You will now have a copy of the repo. You
should see a Clone or Download button. Clicking this
Use the GitHub website to create a repository (repo) will reveal the uniform resource identifier (URI) of the
repo. Using the Terminal, you can clone the repo to
git push -u origin master your computer with git clone:
You will need to enter yes in the command line to git clone https://github.com/HelpfulUser/
accept the authentication token, then your GitHub getting-started-with-git.git
user name and password. If you look on GitHub, you
should now be able to see your repo, along with the All the files and directories will now be on your
displayed README.md file that you wrote. computer. Go ahead and make the changes you want,
Any time you make changes to your project, and you then commit them and push them back up to GitHub,
want to push them up to GitHub, you can just type: just as you would normally do. Here your commit
message is particularly important, as it will explain
git push origin master to the resources original owner the changes you
have made.
You may see an RSA fingerprint warning. Enter yes. If You can now head back over to GitHub. Find the
you are working on a different branch, you would type: button that says New Pull Request. Click the button
and then click on the Create Pull Request button. Your
git push origin <branch-name> commit message will be there, but you can change it
and even add a more detailed description if you like.
Collaborative working Once youre happy, click the Create Pull Request
The true power of services like GitHub becomes apparent button. The maintainer of the repo will then be able to The snitch-sniffer
when you start working with other people. GitHub allows see your pull request. They can then choose to merge repo, showing
branches, commits,
other people to make their own copies of your projects, it into their repo or close it. and other information
GitHub issues
The copy editors at Raspberry Pi are pretty amazing,
so the chances of you spotting a typo in this tutorial
are pretty slim. You might spot a mistake in some of
the code, though, and thats where you can help out.
Take this bit of code for example:
print('Hello World!)
Lets see how you could help fix this error. Head on
over to magpi.cc/2rM1c0w, and make sure you are
raspberrypi.org/magpi xxxxx
July 2016
2017 47
Tutorial WALKTHROUGH
BILL BALLARD
Bill is a retired physicist who went
back to his programming roots and
found fun things to do with his ten
Raspberry Pis, even while sailing.
github.com/wpballa
Youll
Need
> Raspberry Pi
Zero W with
case and
GPIO header
SAILING PI
Track and map your sailing adventure, wherever you go
y weekly sailing crew asked for a way to
M
> Ultimate GPS
breakout visualise where we had been, and for a live
magpi.cc/ display of the true speed over ground to see
2qLDUpB
whether we were fighting tides. This project delivers
> Pimoroni Scroll both, without relying on internet connections or cell
pHAT
magpi.cc/ phone data. Add a battery and it would also be useful
2qMVMks for car rallies or cyclists. All you need is a Raspberry
> 40-pin stacking Pi Zero W with some additional hardware, Python,
header for the and Mathematica!
Scroll pHAT
Software setup
Boot up your Raspberry Pi Zero without the
GPS attached. Go to Preferences > Raspberry Pi
Configuration. In the Interfaces tab, be sure to enable
SSH, Serial, and I2C. In the System tab, you will also
SPEED UP GPS ensure the Boot option is To CLI (command line
ACQUISITION interface). Next, set up the wireless and reboot.
Now load some special software for the Scroll pHAT
Installing
the optional and the GPS:
battery on the
GPS board will sudo apt-get install python-scrollphat gpsd
significantly Note the four
speed up gpsd-clients python-gps connecting wires
satellite with twists to make
sure the antenna
acquisition The GPS uses the TX/RX pins that are the console points upwards
when starting
the system defaults, so you need to make some modifications to
the system:
sudo systemctl stop gpsd.socket When you get home and have internet access again, Above The
unit installed
sudo systemctl disable gpsd.socket connect the Raspberry Pi to a monitor and keyboard. on the boats
The CSV output file is designed to be easily read with instrumentation
Program Mathematica. However, because we crashed the Pi to
console
Download the Python program gpsd-boat.py power it off on the boat, you will need to edit the file
and Mathematica notebook LatLonPlot.nb from with nano and remove the last line or two, which will
magpi.cc/2qN6BmG. The system will not have a live contain some garbage. If the application crashed and
internet connection while you are sailing, and so it restarted at any point, there will be extra headers you
will not know the date straight away. As a result, the should search for and delete. These files were written
program waits for the GPS to get a fix and uses the as root, so, where 2017-05-04 is replaced by your
UTC date information to generate file names with the activity date:
current sailing date. Automate everything so that the
program starts at boot time: sudo nano 2017-05-04-latlon.csv
sudo nano /etc/rc.local Remove the last few lines and any errant blank lines
or additional headers. Then save the file and exit.
Add the following two lines to the file just before Start Mathematica and use the LatLonPlot.nb
the exit 0 line: notebook you downloaded to visualise your sail, but
replace the date with the date identifier for your file.
gpsd /dev/ttyS0 -F /var/run/gpsd.socket The first line of the file imports the data from the
python /home/pi/gpsd-boat.py > /home/pi/ comma-delimited file and loads the header and data
gpsd-boat.log 2> /home/pi/gpsd-boat.err & separately. The output of this command should be
a partial list of all the latitude and longitude pairs.
Then save and exit. The last line will start the Thesecond line converts the latitude-longitude
Python program as a background job, redirect output data into a GeoPosition set of variables, and then
to a log file, and redirect any error messages to an a GeoPathconstruct for plotting. The output of this
error file for later debugging. should be a small graph of the path taken, but with
no map. The third line places the GeoPath on an
We are sailing automatically sized map and places the output in the MOUNTING
Now go sailing, or perhaps driving. A 12 V automotive file image.jpeg. PlotStyle controls the colour and
THE UNIT
USB plug works in a car or in the boat, in one of the thickness of the sailing path plot. The final
many 12 V outlets. Above deck these are likely to be Hit SHIFT+ENTER to force an evaluation and wait product is held
in place with
corroded, so be prepared to clean the contacts (Scotch a while (the header will show running), particularly
Velcro strips
Brite scouring pads work well), and keep the Raspberry if it was a long sail. It takes quite some time for on the back
Pi and GPS in a plastic bag to ward off water. Power Mathematica to load the map data over the internet, of the Pi and
on the boat
everything up and go for a sail. When youve finished so be patient. When the calculation is complete, open
console
sailing, unplug the system and take it home. the image.jpeg file to have a look.
BLUE DOT
BLUETOOTH
Youll
Remove the wires from your Raspberry Pi with the Blue Dot app
Need
dding Bluetooth control to your projects The first step is to install the bluedot Python library
A has never been easier, thanks to Blue Dots
app and simple-to-use Python library. The
on your Raspberry Pi, so you can interact with the
remote app. Click Menu > Accessories > Terminal
> Android phone
apps simple blue circle can be pressed and released and enter the following:
or tablet
like a button, pushed like a joystick, and swiped like
> Raspberry Pi
a touchscreen. sudo apt-get install python3-dbus
with Bluetooth
In this walkthrough we will set up Blue Dot and sudo pip3 install bluedot
> Blue Dot
use the remote app (on an Android device or a second
magpi.cc/
2qRf8EO Raspberry Pi) with the bluedot Python library to The Blue Dot app for Android can be installed from
make lights turn on, create a DJ scratch machine, the Google Play Store (magpi.cc/2q8wkTq).
and add Bluetooth control to a robot. Blue Dot makes If you are using a second Raspberry Pi as your
using Bluetooth simple, so you are only limited remote, you should install the bluedot Python library
by your imagination! on this as well.
More ideas
Youll find a full getting started guide with lots more
ideas, as well as a complete API reference, in the Blue
Dot documentation (magpi.cc/2qRf8EO).
MATHEMATICA AND
THE SENSE HAT Collect and display environmental data using the Sense HAT
Youll and Wolframs language function
Need ver since the partnership between the To access the data from these sensors, simply call
> Sense HAT
magpi.cc/
E Raspberry Pi Foundation and Wolfram
Research began, people have been excited to
DeviceRead with the name of the measurement
wanted. For instance:
1TGGUt5
discover and are often surprised by the power and
ease of using the Wolfram Language on a Raspberry Pi. temp = DeviceRead[hat, "Temperature"]
The Wolfram Language is particularly useful in hum = DeviceRead[hat, "Humidity"]
partnership with the Sense HAT, which features an LED
array and a collection of environmental and movement A total of seven measurements can be read from
sensors. These give users the ability to read in data the Sense HAT: temperature, humidity, air pressure,
from the physical world and display or manipulate acceleration, rotation, magnetic field, and orientation.
it in the Wolfram Language with simple, one-line All the readings are returned with appropriate units,
functions. With the release of Mathematica 11, Wolfram making it easy to convert the values to other formats
Research has been working hard to refine functions if necessary.
that connect to the Sense HAT, allowing Mathematica
to communicate directly with the device. accel = DeviceRead[hat, "Acceleration"]
accelSI = UnitConvert[accel,
Programming the Sense HAT "Meters"/"Seconds"^2]
The Sense HATs functionality is built on Wolframs
Device Driver Framework (magpi.cc/2sl5Q5u), so The other physical component of the
connecting to the device is incredibly simple. To Sense HAT is the 88 LED array. You can use
start, use the DeviceOpen function to establish a theDeviceWritefunction to send an image or
connection. This will return a DeviceObject, which a string to the array. For strings, the text scrolls
we will use later to tell Mathematica which device sideways across the device. You can set the speed and
we want to read from or write to. colour of the scrolling text.
What next?
This is only a taste of what is possible with Mathematica
and the Sense HAT. Visit magpi.cc/2slJu3N to discover
more ideas for using them together. Once youve tried
some of the ideas, why not share your work on the
Figure 2: Air pressure readings taken by a Sense HAT at the
Raspberry Pi Wolfram group (magpi.cc/2slgvNo) to
Wolfram Technology Conference 2016 inspire other users? Well see you there!
MIKES PI BAKERY
Veteran magazine author from the old
days and writer of the Body Build series.
Co-author of Raspberry Pi for Dummies,
Raspberry Pi Projects, and Raspberry Pi
Projects for Dummies.
magpi.cc/259aT3X
ELECTRONIC
WIND
CHIMES
Youll
Detect a magnetic vector to ring
your chimes with Raspberry Pi
Need recent visit to a local garden centre saw us
Magnet Sensor
Selected note
Magnetic vector
Language 15.00
>PROCESSING
1 Metre
DOWNLOAD: 15 x 15mm T - section aluminium
magpi.cc/1NqJjmV
PROJECT
VIDEOS M3 screws
113.00
ss
t tru T - Upright
por
Sup
Aluminum
25 x 15mm angle aluminium
M3 screws
15.00
20.00
5mm base fixing holes
235.00
>STEP-02 (page 57) shows the wiring you need. We also added a
wire for the data ready signal, but we found that it was
Build the base
not needed for this project. Full construction details
are shown in the step-by-step guide.
The frame is built from various lengths and profiles of extruded
2mm aluminium. The base starts with a 235mm section of 25
15 angle aluminium. We used M5 nuts and bolts to attach it to Software
a 250 420mm, 12mm thick, painted MDF base. Counter-drill These days it is not necessary to run as the root
the other side of the board so the screw heads are flush with user to access the hardware just make sure the
the bottom of the board. The vertical upright is made from a I2C interface is enabled in the Interfaces tab of
one-metre length of T-section aluminium, and is attached to Preferences > Raspberry Pi Configuration.
the base bracket with two M3 screws. The vertical upright is The software, chimes.py, is written in Python 3 and
stabilised by two 160mm trusses made from 15 15mm angle runs under the Pygame framework. The sampleC list
aluminium. Note that the ends of these are cut off at an angle so determines the colour of each seed note and is easily
that they sit flush with the other brackets. The base bracket also
changed if you dont like our selection. The whole
has its corners cut off to be flush with the trusses.
display size is controlled by the variables gSpace and
gSide, making it easy to customise. An odd number
Just a word of caution: if you are buying a HMC5883L of squares ensures that you have a central square
module, there are some fake modules about on eBay position. The main loop is simple enough, but you
that claim they are HMC5883L devices but are in fact a might be puzzled by the small delay when a note is
QMC5883. While the latter is a magnetic sensor, it has a triggered. We thought it worked better like that, but
very different internal structure, different capabilities, you could remove it if you prefer an instant sound.
and will not work with the software here. On a real The magnetic vector has a large amplitude
HMC5883L, that the chip is marked L883, whereas the when the magnet is over the sensor, but a smaller
fake chip is marked DA5883. If you do get a fake, you magnitude when it is further away. To make the vector
should ask for a refund on the grounds that its not measurement easier to understand, we inverted the
what was advertised. value to match the movement of the pendulum. To do
The HMC5883L chip has an I2C interface and runs this, we took the reciprocal of the vectors amplitude
from 3V3, so is easy to interface to the Pi. Figure 1 when we applied the scale factors.
160.00
85.00 20.00
Cantilever
13 x 10 U channel
t
stru Pendulum
rt
po
l
ne
p 13 x 8 U channel
Su
an
ch
U
85.00
985.0
x1
13
0
2.5
12
12.00
18.00
Magnet
T - Upright
15 x 15mm T-section aluminium
>STEP-03
Build the top
>STEP-04
Finishing off
Taking it further
You can play about with the scale factors and change Attach the pendulum to the cantilever with a strong but
the sounds by adding other samples. However, one big flexible thread, allowing the magnet to swing just clear of the
enhancement you could make is to turn on a fan when magnetometer and fixing screws. Make sure there are no sharp
edges that could cut through the thread as it swings. Screw the
you detect that there has been no note triggered for
whole structure to the base, sit it on a flat surface, and let the
ten seconds or so. This would be great for indoor use.
pendulum come to a rest. Position the sensor board so that the
However, you could add a bit more variety in the
chip is directly under the pendulum, and mark the positions of
swing by taping some reed switches to the base. This the two holes in the sensor board. Drill these out with a 2.5mm
will remove subtle amounts of kinetic energy from the drill. To mount the sensor board, slacken off the screws, push
pendulum as it passes, and produce a more chaotic them into the holes, and then tighten up the screws. This will
swing. We did not do anything with the Z axis of the provide you with a solid blind fixing.
vector, so maybe you can come up with a use for that.
ATTACH A SERVO
TO AIY PROJECTS Servo motors are used to perform fine motor functions,
Youll Need and with AIY Projects you can program them for voice activation
A servo motor has three wires.
9 g micro servo ne of the big hopes for AIY Drivers, is typically used for motors
O
Two provide power, while a
third is used to control the
4AA battery pack Projects is that Raspberry and has a 500 mA limit. You can position of the servo
Pi owners will integrate the connect wires directly to the Voice
AIY Projects
kit into their own projects. In our HAT hardware, but its easier to
Voice HAT
last tutorial for AIY Projects, we prototype your circuits by soldering
looked at hooking up the hardware the pins (supplied with the kit) to
to control an LED light (a typical the board.
first hardware project). Here, were
going to take things up a notch >STEP-01
and hook up a servo to the AIY Servo motors
Projects board. Servo motors move in a circular
On the Voice HAT hardware you motion to a set position. They are
will see two columns of pins. The often used to control robotic arms
one on the left (marked Servos) is and legs, grippers, and the position It is relatively easy to hook up
for servos, and has a 25 mA drive of surfaces (like elevators and a servo motor to a Raspberry Pi,
limit. The one on the right, marked rudders on an RC plane). but the AIY Projects Voice HAT
board makes it even easier, with a
dedicated column of pins designed
GET YOUR AIY to control servo motors. Connecting
PROJECTS KIT your servos using the Voice HAT
If you didn't manage allows them to be controlled using
to get hold of an AIY voice commands and the Cloud
Projects kit, don't Speech API
worry Google
hopes to have more >STEP-02
available soon. Sign Servo control
up for our newsletter, Servo motors are controlled using
and we'll let you pulses generated by a GPIO pin on
know when more the Raspberry Pi (were using GPIO
AIYProjects Voice 26 on the AIY Projects Voice HAT
Kitsare available: board). The servo motor expects a
magpi.cc/Email-me pulse (the GPIO pin to be turned on,
or high, and then off again) every
20 milliseconds. The length of the
pulse determines the position of
SERVO the servo arm. If its 1 ms then the
AA BATTERY The three wires from the servo
servo arm is rotated towards the
left; 1.5 ms puts it at the mid-point;
Provide a more stable power are connected to row 0 on
2 ms and its all the way to the
supply to the servo by connecting the Servos rail. Make sure you
right. The starting position from
a 4AA battery holder to the two connect the Pin, 5v, and GND
which servos rotate varies (and
power inputs on the board wires in the correct order
some move all the way around).
add_to_action.py
# =========================================
# Makers! Implement your own actions here.
# =========================================
CONTROL A
DC MOTOR
WITH YOUR VOICE HAT
Connect a motor to your AIY Projects Voice HAT board
Youll Need
n our recent AIY Projects how to connect the Voice HAT >STEP-01
DC motor I tutorials, weve looked
at how to move beyond
hardware to simple circuits. So far
weve looked at how to control LED
Cut the power
The first thing you need to do is
4AA battery pack
using the Voice Assistant, and lights and servo motors, but in this isolate the Raspberry Pis power
Breadboard and towards using your Voice HAT tutorial well look at something supply from the power on the
jumper wires with basic electronics. a little more complex: using the Voice HAT board. This will prevent
Utility / If youve been following our AIY Projects Voice HAT to control the DC motor from draining too
Stanley knife tutorials, you will have discovered a motor. much power and shorting out your
DC MOTOR
The DC motor connects to the
positive and negative voltages
via two wires. The direction in
which the motor moves depends
on which way around the two
wires are placed.
EXTERNAL POWER
SOLDER JUMPER
You need to cut the
external power solder
jumper, located just to
AA BATTERY PACK
the left of Servos 5 on the
board. This isolates the The DC motor draws more power
than the Raspberry Pi can safely
Voice HAT power from the
provide, so a 4AA battery pack
Raspberry Pi. provides power for the DC motor.
Language
add_to_action.py >PYTHON
# =========================================
# Makers! Implement your own actions here.
# =========================================
motor.py
class MotorMove(object):
def __init__(self):
self.pwm = PWMOutputDevice(4)
from gpiozero import PWMOutputDevice
def run(self, voice_command): from time import sleep
if 'on' in voice_command:
self.pwm.on() pwm = PWMOutputDevice(4)
elif 'off' in voice_command: while True:
self.pwm.off() pwm.on()
sleep(1)
# ========================================= pwm.off()
# Makers! Add your own voice commands here. sleep(1)
# ========================================= pwm.value = 0.5
actor.add_keyword('motor', MotorMove()) sleep(1)
pwm.value = 0.0
return actor sleep(1)
Raspberry Pi. Locate the external this doesn't matter as it also manage the speed of the motor
power solder jumper marked JP1 controls the negative - pin (magpi.cc/2tnAGrz). We can use
(just to the left of Servos 5 on the that we have just connected to. the .on() and .off() methods
Voice HAT board). Use a utility This allows us to turn the motor to start and stop our motor.
knife to cut the connection in the on and off. Alternatively, we can set the
jumper (you can always re-solder value instance variable to a value
this joint if you wish to share the >STEP-04 between 0.0 and 1.0 to control the
power between the board and the Power up speed. Both techniques are shown
motor again). Finally, connect the 4AA battery in the motor.py code. You can
pack to the +Volts and GND pins also use pwm.pulse() to pulse
>STEP-02 at the lower left-hand corner the motor on and off.
Power off of the Voice HAT. This pack will
Make sure your Raspberry Pi ensure that the motor has enough >STEP-06
and Voice HAT board are powered power when you are using the Hook it up to
off. Now connect the positive leg Voice HAT, which will prevent the Voice Assistant
of the DC motor to the middle your Raspberry Pi from crashing. Now that weve seen how to
pin on Drivers 0. Notice that at Connect the power and turn on the control the motor using GPIO
the bottom of the Driver pins battery pack. Zero, it is time to integrate it
is a + symbol. with the Voice Assistant. Enter
>STEP-05 the code from add_to_action.py
>STEP-03 Turn on the Pi tothe relevant sections of
Wire for power Now turn on the Raspberry Pi /home/pi/voice-recognizer-
Next, connect the negative wire and boot into the AIY Projects raspi/src/action.py and run
of the motor to the - pin on software. Enter the code from src/main.py. Push the button
Drivers 0 (the pin on the right). motor.py to test the circuit. on your Voice HAT board and say
You may have noticed that We are using PWMOutputDevice motor on to start the motor
were not connected to the GPIO from GPIO Zero to control running; push the button again
Pin on the left (which is GPIO4); the motor. This enables us to and say motor off to stop it.
THE BASICS
can probably ignore it, but if add-ons arent working
or programs are running very slowly, youll need to
upgrade to a 2.5 A micro USB power supply.
SUMMER
outsi d e
th is
Lets take
BUILD A
raspberryweather.com
WEATHER
STATION or i s it h ot today?
Is it me,
THREE WEATHER
STATION PROJECTS
LAUNCH A
embedded solutions.
daveakerman.com
RASPBERRY PI
BALLOON Up, up and away : send your Pi sky high!
GET PERMISSION
s Neil Armstrong took a and the thin blue line of the
A giant leap for mankind,
he inspired one boy,
atmosphere separating the
ground below from the blackness
Before flying your balloon in the watching at home, to send a bear of space above, says Dave. On a
UK, you need to request permission into space. clear day, with a wide-angle lens,
from the Civil Aviation Authority As an adult, Dave Akerman Ive had the whole of southern
at least 28 days in advance. launched Babbage on a high- England from Cornwall to Kent in
Avoid areas near airports and altitude balloon with a camera, the same shot.
air shows, and send an email to sending the teddy bear 39 km A high-altitude balloon (HAB)
confirm (or cancel) your plans a above the Earth. In a stunt that flight works like this: the balloon
few days before launch. Outside replicated Felix Baumgartners is filled with hydrogen so it rises
the UK, try asking for advice on record-breaking skydive, at a speed of about 5 m/s. On
the #highaltitude IRC channel Babbage was released for the line between the payload
on Freenode. a free fall. and the balloon is a parachute,
Dont launch without permission: At that height, theres the which is pulled closed during the
you might endanger aircraft. slight curvature of the Earth, ascent. After a typical flight of
CAMERA
THREE THINGS YOU NEED TO Using a Raspberry
BUILD A HIGH-ALTITUDE BALLOON Pi with the Camera
Module, you can
program the
PI IN THE SKY KIT camera to shoot at
You can build your own tracking certain altitudes
system, but the simplest option only. Dont use a
is to use the Pi in the Sky kit, case: it will trap
which includes the GPS antenna moisture and ruin
and a radio transmitter. your images.
magpi.cc/2rablQk magpi.cc/28IjIsz
Insulated case
Dave recommends plenty of insulation
to protect your components from the
cold, and from the impact when they
come down to earth. It also protects
anyone or anything your kit lands on!
GPS tracker
The GPS tracker has been positioned away from the Pi to
provide a clear signal. Put your GPS aerial near the top of
your container, and make sure it has an unobstructed view. two to three hours, the balloon With a well-tested radio tracker,
bursts at high altitude, and the the chance of not knowing where
payload drops. The parachute the payload has landed is pretty
opens, and the payload returns close to zero.
to the ground. The payload Dave started out building his
includes a GPS tracker and a radio own tracking and transmission
transmitter so you can follow its systems, but the Pi in the Sky
journey from the ground, and be (PITS) kit can now do this for you.
ready to recover it. You can also Among other things, it enables
receive images during the flight. data from the Sense HAT to be
There are several options for sent back during the flight.
the radio transmissions. Most Some of my flights have had a
people in the UK use RTTY (Radio 3G link at low altitudes (useful for
Teletype) transmissions, but streaming video to YouTube), or
some also use LoRa, a proprietary have predicted their own landing
long-range radio system that position during descent, Dave
g
erry Pi flyin
titude ph oto from a Raspb nw all
enables images to be downloaded says. My current project is to use
High-al and C or
ing over Devon
more quickly. In some countries a gliding parachute or parafoil to
win don , look
over S (but not the UK), APRS can be land at a particular target location,
used, if you have an amateur using wind data measured during
BALLOON radio licence. ascent to feed the guidance
The balloon (shown In the UK we have a algorithm during descent.
here bursting) widespread network of other Dave advises new launchers
carries your payload. hobbyists who will help during to read as much as they can
Use the online the flight, meaning that even if to avoid mistakes others have
calculator to work the chase car loses signal (e.g. already made. Read the UK
out which size you its in a tunnel or on the wrong HighAltitude Society website
need: typically 800 g side of a hill) then the rest of (ukhas.org.uk), read various HAB
or 1000 g, depending the receiver network will fill in blogs, and join the #highaltitude
on the weight of the gaps, says Dave. Data from IRC channel on Freenode and
your payload. flights is fed into a distributed introduce yourself, he says.
magpi.cc/2rRPZKr mapping system called Habhub. Doall three!
GREAT
OUTDOOR
id
PROJECTS
e, and see the
our r
, pim py
Get close to nature
e b rilliant projects
ith thes
world differently w
Photo: David Schneider/IEEE Spectrum
40 / $50
OCTOCAM
A complete camera kit with a fun design
he latest in Pimoronis Inside the box youll find a with a 50cm USB to micro USB
T growing range of Pi
Zero W project kits,
Raspberry Pi Zero W, a 5 MP mini
camera (more on this later), and
cable, a male 220-pin header (to
solder on), and a sticker sheet.
OctoCam provides everything an octopus-shaped acrylic mount Assembly of the main camera
you need to build your own with four suction cups and a desk kit takes around 30 minutes
cute camera. As with the other stand. The only things you need using a step-by-step guide
Pimoroni kits, the packaging is to add are a microSD card and a (magpi.cc/2srIv2q) and is fairly
excellent and the hinged plastic power supply. Bonus components straightforward, if a little fiddly
case can be reused to store other in the box include USB and HDMI at times. This is mainly due to the
components afterwards. adapters for the Pi Zero W, along tiny nylon nuts, bolts and spacers,
Related
ZEROVIEW
A neat custom
mount for the
Raspberry
Pi Zero and
official Camera
Module, which
can be stuck
to a window
using its two
suction cups.
7 / $9
magpi.cc/2e89hWt
WEB BROWSER
GROUP TEST
What is the best way to surf the World Wide Web in Raspbian?
MIDORI
t is hard to overstate the importance of web browsers and how
I much we take them for granted. They are our access point to
a universe of information, and they do a lot of work to bring us all
this information in a readable format.
Raspbian has featured several default web browsers over the last The original Raspbian web browser, well known
five years, changing as internet access and power requirements have as a lightweight browser for the Linux community,
developed. Is the latest choice, Chromium, the best of the lot? We test is suitable for use on a (relatively) low-powered
some of the best browsers available to find out. system. It hasnt been included in standard
Raspbian releases since around the time of the
Raspberry Pi 2 launch, so we went into testing
Midori on our Pi 3 expecting it to outperform
everything else.
Unfortunately, we were surprised to find it
lagging as we used it. YouTube videos stuttered, and
scrolling was only smooth on low-resource websites
such as Wikipedia. Loading wasnt particularly fast
either. The lack of features, which should have made
it fast and lightweight, did not seem to help, and
this gave it a severe handicap.
midori-browser.org
EPIPHANY/WEB
As with Midori, we had high expectations looking back at Epiphany.
Known as Web in the GNOME desktop environment, its an often-
overlooked browser that is usually singled out for being far too
simplistic and basic.
Like Midori, it was once a default Raspbian browser, with a modified
version used until recently when it was superseded by Chromium.
Unlike Midori, it is optimised for use with the Raspberry Pi.
We expected our revisit to Epiphany would reaffirm our dislike for
it, but honestly it still works well on the Raspberry Pi. Scrolling is
relatively smooth, YouTube playback is fine, and juggling tabs is easy.
Its still heavily limited in what it can do, but it did a lot better than
we expected. magpi.cc/2rUHrmX
CHROMIUM
The current default browser for Raspbian,
Chromium is the open-source base of Googles
Chrome browser. Theres not a lot of difference
between the two, especially as Raspbians
version has Flash installed.
On a normal PC, Chromium is relatively
lightweight (especially if youre using only a
few tabs at a time), but even this slimmed-
down version of Chromium for Raspbian offers
good performance. The Raspberry Pi 3 has the
power to handle it, and with enough oomph
spare to run other software.
One of the benefits of running Chromium is
KWEB
that it also connects to your Google account. If
you use Chrome or Chromium on your main PC, it
lets you instantly copy over settings and apps, so
it is easier to set up the browser to your liking.
This is the only browser in this selection that has been made
chromium.org specifically for Raspbian, and in fact goes beyond the definition of a
web browser: kweb is designed to be part of a Raspberry Pi-powered
web kiosk.
Dont let that deter you though, as its still well suited to standard
web browsing. For people who are a bit more web savvy, kweb offers
a range of options to customise your web browsing experience for
maximum efficiency. This includes a button on the main interface
that lets you turn certain features on and off, such as JavaScript,
cookies, and more.
While it can be lightning fast, you do sacrifice many of the amenities
of modern browsers to produce this great performance.
FIREFOX ESR
Theres a bit of weird history behind Firefox
on Debian (the base of Raspbian), but the
important thing is that its here now, and its in
the form of an ESR.
ESRs are Extended Support Releases, slightly
different to the main version of Firefox. Firefox
usually updates every six weeks or so, but this
version is sent security updates only until the
next set of major updates arrives.
We were pleasantly surprised by the way Firefox magpi.cc/2rUZGbM
worked on the Raspberry Pi 3. It loaded quickly,
rendered pages well, allowed for smooth scrolling,
and even played YouTube videos well; but what
made it shine was one of its lesser-known features:
AWARDS
book reader mode.
Book reader mode takes a blog-style post and
strips the formatting down to a page with plain text
and pictures. It reduces resource use considerably
WINNER CHROMIUM
and works well with a Raspberry Pi, especially
MOST
when youre looking up tutorials or instructions.
19 / $19
Maker
Says
The ideal
storage
solution for
Raspberry Pi
WDLabs
WD PIDRIVE FOUNDATION
EDITION - USB FLASH
Tag-team a microSD card with a USB flash dongle for extra storage.
Lucy Hattersley looks at WDs latest offering
W
DLabs has produced some would be possible with microSD from a trusted brand, like SanDisk).
quirky and interesting card technology. However, what Even so, we expected the USB
storage solutions for the we have here is a microSD card thumb drive to be faster, and
Raspberry Pi recently. bundled with a SanDisk Cruzer benchmarks didnt let us down.
The idea is simple: WDLabs has 64GB USB drive, so things are
built a custom version of Raspbian a little muddier. Benchmarks
that boots to an external storage For example, you can pick up We benchmarked the WD PiDrive
drive. This external storage space a SanDisk 64GB microSD card for Foundation Edition, USB Flash (sda)
then acts as the primary drive, so around the same 20 price. You against an official 8GB Raspberry Pi
you only have to manage one single could keep a USB port free on microSD card (mmblk0).
storage space. your Raspberry Pi and get a more As you can see below, the USB
Related
There are other bonuses to straightforward installation. Flash read was marginally slower
WDLabs software: you can install What you do get, however, is with cached reads, but almost a
multiple instances of Raspbian OS a high-quality microSD card and third faster in buffered disk reads.
SAMSUNG alongside other OSes. a high-quality USB drive. And USB On balance, you are getting more
64GB EVO When WD bundles a 4GB drives are typically faster than speed for the same money.
PLUS microSD card with one of its large microSD cards (which vary in read
You can pick up
a high-quality
(250GB or 375GB) hard drives, and write speed tremendously Last word
microSD card the advantage is clear. You get a this is why you should choose a
with about the much bigger storage space than Class 6 or Class 10 microSD card The WD PiDrive Foundation
same amount of Edition, USB Flash is a good
storage space setup for a media centre or
for roughly the TIMING CACHED TIMING BUFFERED
same price. READS: DISK READS: retro games console. It offers
fast read times and more
1118 MB in 2.00 seconds = 100 MB in 3.01 seconds = storage than a stock card. While
/dev/sda
558.75 MB/sec 33.21 MB/sec it's not quite as impressive as
the other WD PiDrive offerings,
it's still a useful piece of kit.
1140 MB in 2.00 seconds = 64 MB in 3.02 seconds =
22 / $29 /dev/mmcblk0
570.02 MB/sec 21.19 MB/sec
magpi.cc/2rDv5v3
Subscribe from
Magazine
2.29 26.99
rolling subscription
or
full year subscription
raspberrypi.org/magpi March
July 2016
2017 81
Review BOOKS
THE INTERNET OF
RASPBERRY PI RISKY THINGS
every possible device to the internet
medical devices, cars, the power
BESTSELLERS
grid and our Panglossian disregard
for the downsides.
Author: Sean Smith
Blunders (anti-patterns),
BERRETT-KOEHLER
Publisher: OReilly
Price: 23.99 including those from traditional
ISBN: 978-1491963623 internet-connected computer
Hit a roadblock in your maker project magpi.cc/2rSCfPE devices, are outlined, with truly
or business? BK have the answers. scary examples of connected
You can bury your devices vulnerabilities from recent
head in the sand years, and the case made for a more
EAT THAT FROG! or you can read
this book. IoT devices are
robust and systematic approach
by manufacturers. Identity and
Author: Brian Tracy
already permeating every aspect of trust, devices that outlive their
Publisher: Berrett-Koehler
Price: 11.99 our lives, yet the usual IT business cryptography, privacy cautions,
ISBN: 978-1626569416 excuses have left a vast installed business cases pulling in different
magpi.cc/2s38ZE8 base of unpatched and unpatchable directions from security cases:
software in devices we can barely every angle is carefully considered
Working hard without results? even access, or have forgotten including law, the digital divide,
Fighting creative blockage, and about entirely. and future human-machine
suffering from procrastination?
Tracy cuts through the clutter Forever-day exploits are zero-day relationships but Smith gives no
and gives you simple tools to exploits that remain permanent glib answers to the many questions
complete your projects. Take for several years (or indefinitely). and reflections. The beginning of
back control!
Patches are released, but who a very necessary conversation.
patches their ADSL router? Or
THE IMPATIENT
Price: 16.99 on afterthought. Scala has obvious
ISBN: 978-1576752784 appeal for modern enterprise
magpi.cc/2s2W992
projects with large codebases,
Author: Cay S Horstmann
and Horstmanns tutorial will
Publisher: Addison-Wesley
From bug fixing and testing quickly bring Java or C++ (and
through to crowdfunding, Price: 27.99
makers need others. From ISBN: 978-0134540566 C#) coders to appreciate its
intrapreneurs, through side magpi.cc/22tPmUY possibilities. Scala has many
projects, to startup maker other applications, from web
businesses, Axelrod et al.
will help you to get the right
Another month, programming to newer paradigms
people involved. another new edition such as probabilistic programming.
of a Horstmann classic: this time Since the first edition, there have
AND GAMES
Publisher: Manning
MCTS for huge improvements in Price: 36.99
playing strength. Winning the Best ISBN: 978-1617292330
Paper Award at the conference, magpi.cc/2rSPHD8
Editors: Aske Plaat,
Walter Kosters, Lorentz and Isaacs research
No abstract concept, but a practical,
Jaap van den Herik concludes with promising strategies predictive paradigm with strong ML
Publisher: Springer
for further refinements. applications, from spam filtering to
Price: 37.99 data and image recovery.
We also find novel strategies
ISBN: 978-3319509341
magpi.cc/2rbgRlG and games modelling in Werewolf,
temporal difference learning in
Reactive Design Patterns
Author: Roland Kuhn
AI research and the game 2048, and Nash Equilibrium for
Publisher: Manning
of Go came to the publics attention better code-making choices in
Price: 27.99
recently when Googles AlphaGo Mastermind. A few papers require ISBN: 978-1617291807
program beat the worlds number some undergraduate maths (yours magpi.cc/2sUFV1C
one human player. Its combination via various MOOCs), and things
Reactive Manifesto co-author and
of move finding by Monte Carlo Tree get a little more theoretical in the
Akka lead Kuhn brings message-
Search (MCTS) and Neural Networks penultimate section. The final driven enlightenment in logical steps.
is the pinnacle of a huge amount of section contains a single paper
AI research, particularly in the field which asks Do People Think Like Visualizing Graph Data
of game playing. This collection of Computers?, and combines AI and Author: Corey L Lanum
20 academic papers from last years behavioural science work for a better Publisher: Manning
international Computers and Games understanding of human behaviour Price: 24.99
ISBN: 978-1617293078
conference, useful reading for any and approaches in adversarial
magpi.cc/2rjcdX8
curious reader, covers these topics combinatorial games like Go.
and more. Organise and present data in graph
MCTS dominates, including the format, highlighting relationships in
opening Using Partial Tablebases in Score data, and change the questions you
ask of the data.
Breakthrough, which applies Deep
THE MONTH IN
RASPBERRY PI
Everything else that happened this month in the world of Raspberry Pi
MORE AIY
ts been a couple of
I months since we released
issue 57 with the Google
PROJECTS!
AIY Projects voice kit, and
were still seeing people make
awesome stuff with it. One of our
favourite websites during that
time has been the Ktinkerer page
(magpi.cc/2sJlZ52), which lists
a lot of the cool mods theyve
People love the AIY Projects voice kit -
come across. Here are some
heres some of the excellent stuff theyve been making of our faves
MUSIC
magpi.cc/2rJygkY
magpi.cc/2sfegdF
magpi.cc/2rJu0lM
ADD A TIMER AMAZON DASH TRIGGERS
One of the great things about a smartwatch is being Adding triggers to the AIY kit is a good way to expand
able to set a timer without having to dig your phone what it does. This allows you to activate the voice
out. This feature isnt in the AIY code, so this mod lets assistant by saying OK Google, rather than using
you add it. Smart! the button. This mod goes one step further and adds
additional buttons to the kit.
magpi.cc/2rJBOE7
SHUT DOWN magpi.cc/2sfb9m1
WITH SELF-DESTRUCT
Shut down with a twist. You can ask the AIY Pi to turn
itself off, or you can have it count down to turning it
off by asking it to initiate self-destruct. It obviously
doesnt actually destroy itself, but you know its fun.
VOICE CHESS
Play chess against the computer using only
your voice. You may need to lay out a real chess
board if you cant visualise the game in your
head. At least youll be prepared to answer
a chess move riddle so you can be beamed
aboard the USS Enterprise.
successful in their missions and AstroShot (Greece, right). Image credit ESA
KICKSTART THIS!
Raspberry Pi projects you can crowdfund this month
RASPBERRY PI
LOOPER/SYNTH/
DRUM MACHINE
This is super-awesome. A fully
custom synth machine using a
Raspberry Pi, full of all the switches
and knobs youd need to synthesize
music? Musical instruments have
never been our strong point, but we
want to play with this.
magpi.cc/2sfl3nB
COMMUNITY
PROFILE
ESTEFANNIE
EXPLAINS IT ALL
From automated gingerbread houses to
French press coffee at the touch of a button,
Estefannie is taking the YouTube maker
community by storm
Estefannie H
ey, world! Estefannie
exclaims, a wide grin across
explaining it. If she could teach a
topic successfully, she knew shed
her face as the camera retained the information. And so
Category: YouTuber
begins to roll for another YouTube her YouTube channel, Estefannie
Day job: Software engineer
tutorial video. With a growing Explains It All, came into being.
Web: magpi.cc/2sm6D5Z number of followers, and wonderful But YouTube isnt her only
estefannie.com support from her fans, Estefannie outlet. With nearly 30,000
twitter.com/estefanniegg is building a solid reputation as an followers, Estefannies Instagram
online maker, creating unique, fun (magpi.cc/2smasrZ) game is
content accessible to all. Its as if strong, adding to an increasing
she was born into performing and number of female coders taking to
making for an audience, but this the platform. Across her Instagram
fun, enjoyable journey to social grid youll find insights into her
media stardom came not from a daily routine, from programming
desire to be in front of the camera, on location for work, to behind-
but rather as a unique approach to the-scenes troubleshooting as she
Below Her first videos featured
pages of notes with voice-over her own learning. While studying, begins to create another tutorial
explanations of data structure and Estefannie decided the best way to video. Its hard work, with content
algorithm analysis; then she moved
in front of the camera, and expanded confirm her knowledge of a subject creation for both Instagram and
her skills in the process was to create an educational video YouTube forever on her mind as
essentially a documentary
And thats just the beginning of her for YouTube
adventures with Pi but we wont
spoil her future plans by telling you
HIGHLIGHT
magpi.cc/2smk0mL
GINGERBREAD
HOME AUTOMATION
Estefannies automated gingerbread house project
was a labour of love, with electronics, wires and
candy strewn across both her living room and kitchen
for weeks before completion. While she is a skilled
programmer, the world of physical digital making was
still a fairly new concept for Estefannie. Having ditched
her hot glue gun in favour of a soldering iron in a
previous video, she continued to experiment and try out
new, interesting techniques that are now second nature
to so many members of the maker community. With the
gingerbread house, Estefannie was able to research and
apply techniques such as light controls, servos and app
making, although the latter was already firmly within her
skill set. The result? A fun video of ups and downs that
resulted in a wonderful, festive treat. She even gave her
holiday home its own solar panel!
EVENT REPORT
Whats being going on at Jams, Clubs, and Dojos around the world?
CODERDOJO
COOLEST PROJECTS
nce a year in Dublin, a horde of coding ninjas
O gather to show off their finest making skills
at CoderDojos Coolest Projects event. This
year, the event was held on Saturday 17 June at the
Royal Dublin Society (RDS).
Raspberry Pi and CoderDojo have merged, so
this years event saw an increase in the Raspberry
Pi Foundation attendance. Pi people scoured the
show floor looking for the best and most awesome This teddy bear recognises
faces. Were worried that it
projects. Heres what they saw might be a Terminator, though
The Northern Ireland Raspberry Jam This LEGO robot makes the
team ran a conductive paint Minecraft cut because, unlike most
Pi activity using the DOTS board robots, it has a driver!
Its weird that this isnt the first beekeeping project This LEGO DUPLO house is fully automated like the
weve seen, but it is definitely the cutest house party scene in Home Alone
CODE CLUB
STARS
Introducing a Code Club star from Brazil
WANT TO FIND
OUT MORE ABOUT
CODE CLUBS?
Head to
codeclub.org.uk
Bezerra
that they are able to develop
those games, and even to create
other ones based on their own
imagination. In some cases, the
Club: Code Club Casablanca, students can even discover an
So Paulo interest in pursuing IT as a job.
Web: magpi.cc/2rR9Ypz
Why is Code Club important
to you?
hat inspired you to Sharing my knowledge and
W volunteer for Code Club? knowing that it can change
EVENT HIGHLIGHTS
I was inspired to share the future for some students is
my knowledge of computers and something priceless to me. Also,
programming. In Brazil, students I have plenty of fun with it!
in poor neighbourhoods usually Heres what went on at Jams and
dont have access to computer What has been your best Code other Raspberry Pi events around
or game design courses. It is Club moment?
inspiring giving them access One day, the mother of one
the world this month
to these kinds of activities. of the students went to Code
Club and she was amazed to see FAMILY JAM
Tell us as a bit about your her teenage son developing a Building robodogs is
Code Club complete game over the course all well and good, until
On the first day of class, I of two hours. She raised the they chase after the
usually show one of the games kid by herself and she doesnt robo-postman! The
that the students will make have enough money to pay for Family Jam sounded
during the course. Most of them computer/game courses for him. great, though.
do not believe they will be able to She was very grateful because
program something like that. It a team of volunteers was there SCIENCE WORLD
is extremely rewarding to me to teaching and support her son. Canadian Raspberry
Pi enthusiasts had a
good time at Science
World in Vancouver,
showing off their truly
excellent projects.
RASPBERRY
JAM GUIDE
The Raspberry Jam
starter kits are now out
in the world, seen here
with Giustina, Executive
Director of the
CoderDojo Foundation.
RASPBERRY JAM
EVENT CALENDAR
Find out what community-organised, Raspberry Pi-
themed events are happening near you
HOUSTON RASPBERRY
2 PI USERS GROUP
Houston, TX, USA
FIND OUT
ABOUT JAMS
Want a Raspberry Jam in your
area? Want to start one?
Email Ben Nuttall about it:
ben@raspberrypi.org
MELBOURNE PI
8 USER GROUP
Warranwood,
VIC, Australia
7 YORK WEST
RASPBERRY JAM
York, UK
3 BECKFOOT THORNTON
RASPBERRY JAM
Thornton, UK
COULD USE
MORE JAMS
5 BLACKPOOL
RASPBERRY JAM
Blackpool, UK
6 STAFFORD
RASPBERRY JAM
Stafford, UK
4 RASPBERRY JAM
MILTON KEYNES
Bletchley Park, UK
YORK WEST
RASPBERRY JAM
When: Monday 17 July
MORE WAYS TO LEARN
Where: Acomb Library Learning
Centre, York, UK RASPBERRY JAM
magpi.cc/2sl6UVU
STARTER KITS
NOW SHIPPING
Everyone interested in Raspberry Pi
computers should book a place to
learn more about the Pi!
Every Raspberry Jam can apply for a Jam
MELBOURNE PI USER GROUP starter kit, which includes magazine back issues,
When: Tuesday 18 July printed worksheets, stickers, flyers, and more. It
Where: Melbourne Rudolf Steiner also includes access to our new Raspberry Jam
School, Warranwood, branding, including logo and poster templates
VIC, Australia for you to use to promote your events. Kits have
magpi.cc/2mx2y7Y started to arrive with Jams and theyre going
The groups aim is to bring like- down a storm! As soon as youve published your
minded people together to talk about event, you can apply for your kit. You can also
how theyre using the Raspberry Pi. download the guidebook here: magpi.cc/2q9DHfQ.
YOUR LETTERS
Live from Raspberry Pi
Could a Raspberry Pi be configured to be
used with Facebook Live instead of a phone?
It would make a great little project if we
could create a camera that streams straight
Left You will to Facebook Live, as phones arent always
hopefully be able
the best way to do it. Is this doable, do
to buy the AIY
Projects voice kits you think?
soon. Sign up to
our mailing list to
Joe Linderman
find out when!
Getting AIY Technically, yes, you can probably do this. At
I have been away for a while and Unfortunately we wont be the very least, you can bring up Facebook in
missed out on buying issue 57 of reprinting issue 57, and even if we the browser and run live video from there.
The MagPi with the AIY Projects did, it wouldnt have the kit with All you would need is a USB webcam, or a USB
voice kit. The store where I usually it. However, the AIY Projects Voice microphone and a Raspberry Pi Camera Module.
buy it was all sold out and onto HAT kit will hopefully be for sale Im guessing youre looking for a more
issue 58 of the magazine, but Id at some point, although we dont portable project, though like a video camera
still like to get it is there any know when that will be. you can point at something, hit record, and
chance of a reprint of issue 57 with The best thing you can do stream the output to Facebook. The API for
the kit attached? is sign up for our mailing list. Facebook Live is out there, but youd need to do
At the very least, Id be When Google confirms that its some serious hacking to get it all working with
interested if you end up selling the going to be on sale, we can let the Pi. It wouldnt be easy or intuitive. Let us
kit on its own in the future. Are you know. You can sign up here: know if you succeed! In the meantime, youre
there any plans for that at all? magpi.cc/Email-me. probably better off using a spare phone.
Stephen
The Voice HATs with the power ports were the test
HATs we used. The power ports werent needed in
the final version of the AIY Projects voice kit, as the
Pi powers the Voice HAT, so they were taken off. You
can easily solder one onto the board - it is useful if
you need to supply power to accessories attached to
the board that use more than the Pi can supply, such
as servos and motors (see Page 62).
This power socket was removed Look out for a future video on The MagPi YouTube
from the final version as it wasnt
needed for the projects in the mag channel on how to program servos and motors with
your AIY kit: magpi.cc/MagPiYT.
FROM THE FORUM: As some people have pointed out in the forums, theres
a reason why people were saying it wasnt going to
X86EMULATION
work - but dont lose hope! You shouldnt expect to
play Crysis on your Raspberry Pi, but with a bit more
tweaking you should be able to get something working
using ExaGear.
The Raspberry Pi Forum is a hotbed of Otherwise, DOSBox is a good alternative
conversations and problem-solving for the (dosbox.com). You can use it on a Raspberry Pi to
community. Join in via raspberrypi.org/forums emulate Windows 3.1 and DOS, along with some other
older OSes and x86 games. Theres a great tutorial online
m trying to find a free way to emulate x86 on my Pi to see here to show you how to use it: magpi.cc/2rMmnea.
I what it can do game-wise. All Ive got is ExaGear and a lot
WRITE TO US
of people say nothings gonna work - so if youre gonna
tell me its not gonna work, please dont tell me that as its
annoying. Anyways, if you know of any free methods that work,
Have you got something youd like to say?
please tell me as I cant seem to find anything. Thanks! Get in touch via magpi@raspberrypi.org or on The MagPi
Bunchie section of the forum at: raspberrypi.org/forums
www.helloworld.cc
@HelloWorld_Edu
fb.com/HelloWorldEduMag
96 July
xxxx 2017
2016 raspberrypi.org/magpi
Review
A RASPBERRY PI 3
WITH AN OFFICIAL CASE
SIGNED BY EBEN UPTON
This is your chance to win an
incredibly rare prize! We have ten
Raspberry Pi 3 boards to give away,
with official cases signed by none
other than Raspberry Pi co-creator,
Eben Upton.
DEFINING
DIGITAL
MAKING
What exactly is digital making? Matt Richardson explains
he Raspberry Pi Foundations mission is so affordable that it can be dedicated to a single project,
T to put the power of digital making into the
hands of people all over the world. But what
no matter how simple that project is. Imagine creating
a computer-based project just 15 years ago; it would
does the term digital making mean? What kinds of have been very expensive!
skills and activities are included? Its an important The beauty of digital making is that when you
concept to understand in order to get a sense of practise it, not only are you learning through the
what we set out to achieve through our affordable process of making, as Papert theorised, but youre also
computers, our outreach programs, and our support gaining valuable STEM skills that are almost certain to
for educators and learners. come in handy in the job market. Developing a better
In Oliver Quinlans Young Digital Makers, a report understanding of code and electronics is a valuable
for NESTA which surveyed attitudes and opportunities skill in and of itself, and a skill that is likely to be
for digital creativity across the United Kingdom, digital increasingly in demand in the future.
making is defined as learning about technology While we tend to put a focus on learning among
through making with it. Therefore, its not just about schoolchildren, I should also note that learning
making something you want or need. At the core of through digital making doesnt only happen
digital making is the idea that an individual is learning with students in a classroom. Learning happens
when they create something with technology. in libraries, museums, scout meetings, and
The link between making and learning is well known makerspaces. It also happens in home garages and
and its implementation in education is widespread workshops. Learning through digital making doesnt
worldwide. MIT Media Labs Seymour Papert pioneered only happen with young people, but people of all ages.
the learning theory of constructionism in the 1980s When I try to define digital making in my own
in his book, Mindstorms. Constructionism is the words, I often tell people that its a blend of a lot of
concept that people learn about a subject by creating different subject matters: computational thinking,
something physical. In Paperts own words, learning coding, electronics, physical computing, design
is most effective when part of an activity the learner thinking, fabrication, project-based learning, and
experiences as constructing a meaningful product. sharing. I know thats a lot of big stuff packed into one
term, but digital making is a big thing and I suspect it
The first step is only getting bigger.
With technology like the Raspberry Pi becoming more When we say that we want to put the power of
accessible and affordable, it can become a material digital making into the hands of people all over the
for digital making. Computers are typically thought of world, were taking on an ambitious task, and we have
as tools for creating, but Papert had also envisioned a lot of work ahead of us. Thankfully, digital making
computers being used as a material in projects. is also a fun and fulfilling activity. We only have to
Products like the Raspberry Pi Zero are perfect as a provide the affordable computers and free resources:
material. The Zero is a powerful computer, and yet its the rest is up to you, digital makers!
ESSENTIALS
LEARN | CODE | MAKE