Professional Documents
Culture Documents
Pi User Issue 1 - Winter 2016
Pi User Issue 1 - Winter 2016
E
URC FOR R
SO
AS
YOUR NEW
PB
ERRY PI
HE PI
JOIN T
UTION
Issue 01 // Winter 2016
REVOL
RASPBERRY PI!
AMAZING
11 Pi PROJECTS
Build a
Pi drone
Step-by-step guide to
making your own drone!
Make a
retro arcade
classic
Games are better
played on the Pi
20
Learn to program
in Minecraft
How to code and hack
with your favourite game
Awesome
Pi add-ons
Make your Pi into
something special
PIU01 2016
The home of technology
techradar.com
CE FOR R
UR A
SO
SP
YOUR NEW
BER PI
RY
If you’ve got a Raspberry Pi, or you’re thinking of
getting one, then you’ve come to the right place!
I grew up learning to we’ve come full circle. The low-cost,
code in Basic at home revolutionary single board computer
on my Acorn Electron. has brought back the programming bug
I typed in the code for among school children the world over, not
games from magazines to mention quite a few adults too!
like Electron User and At Pi User we’re here to do more than
saved them on a get you started programming with the Pi,
cassette recorder. although we’ll show you how to do that as
Eventually I got good enough to write well. We’ll inspire you with the latest Pi
my own games, and got one published projects, reviews and Pi news. Drop me a
in Electron User myself, and another line and let me know what you think of our
one sold by a software company. This first issue. You can email me at piuser@
inspired me to pursue computer science futurenet.com and find us on Facebook
all the way to University. Sadly, by then at www.facebook.com/PiUser/
the home computers of my day had
been replaced by Windows PCs, and
programming by kids just for the fun of it
was starting to become a forgotten art.
My love for computer magazines didn’t
go away, though, and ultimately that’s
why I’m here writing to you now. And
thanks to the Raspberry Pi I feel like Graham Barlow Editor-in-Chief
35
10 06
20 48 69
WORLD OF Pi Pi PROJECTS
Get your Pi connected and use the Pixels desktop Have an adventure with your Raspberry Pi
06 Eben Upton
interview 22 How to install
Raspbian 48 Get started with
the SenseHAT 69 Build your
first robot
10 Our favourite
home Pi projects 26 Using networks
on the Pi 54 Recreate the
Enigma machine 72 Master the Pi
Camera Module
14 Buying the
right Pi for you 28 Master the
Pixels Desktop 59 Build your
own drone 75 Make speakers
Wi-Fi-enabled
4 // // Winter 2016
92 95 102
104 112
108
Pi CODE
Learn how to code in your language of choice
Pi REVIEWS
Tested and rated: the latest add-ons for your Pi
92 Get to know
Python coding 102 PiBorg
ZeroBorg 110 CamJam
EduKit 3
95 Begin coding in
Minecraft 104 Drum HAT
112 Picade by
Pimoroni
106 Explorer
HAT Pro
Winter 2016 // // 5
6 // // Winter 2016
Eben Upton INTERVIEW
Eben
Upton
Pi User pays tribute to the inventor of the world’s
best-selling credit-card-sized computer, and finds
out why the future of computing should still be
firmly rooted in the 1980s…
Winter 2016 // // 7
INTERVIEW Eben Upton
E
ben Upton, the Chief Executive Pi User: What’s the genesis behind the Raspberry
of Raspberry Pi and a CBE Pi, beyond your obvious love for fruit-based tech-
(Commander of the Most Excellent firm nomenclature?
Order of the British Empire), is the EU: I didn’t really get into the hardware side of
genius behind the Raspberry Pi and things until I finished my PhD in 2006. I was really
its success. He began tinkering with computers burnt out and took a consulting gig with a guy
at an early age. When he wasn’t sending off who made motor controllers – he did a lot of
to BBC shows like Think of a Number for Robot Wars hardware work before it became a
pamphlets about maths problems, he was popular TV show. This got me into AVR hacking,
copying reams of Basic code from computer which is a really interesting halfway house between
books and magazines onto his trusty BBC software and hardware. You write software that
Micro. Today, he’s sold ten million Raspberry has this really low-level, deterministic interaction
Pis and is CEO of a non-profit organisation with the hardware, and that’s what really got me
that is dedicated to democratising computing. interested in building computers, even considering
To celebrate the first issue of Pi User we my limited hardware skills at the time.
decided we needed to sit down with Eben I built my very first computer back in 2006,
Upton CBE to find out where it all started and and that was the very first thing you could call a
what the future has in store for the Raspberry Raspberry Pi. I then started working for Broadcom,
Pi Foundation, and to discuss the enormous but that idea of building a computer never went
contribution he’s made to technology. away. It wasn’t until a bit later, when I was thinking
about the computer-science recruitment crisis we
Pi User: Were you always destined to work in had at Cambridge University, that the idea of
technology? What do you think hooked you as making a small computer for the students to use
a boy growing up in the 1980s? came about. The notion of fixing this recruitment
Eben Upton: I always had lots of type-in-code problem by making a piece of computer hardware
books, but I also had some higher-level, “So, what’s seemed like a good idea at the time.
a computer?” books. They were all telling me that
in the future there would be a computer in every Pi User: How has the reception of the Raspberry
home – as common as having a telephone or Pi differed from your original vision?
cooker. It seemed incredible at the time. EU: The success has been a real surprise. It’s
My youth made it really easy for me to be easily three or four orders of magnitude larger
suckered into being a computer programmer. than we were ever expecting. We thought we’d
2016 has
I think it helped that I’m one of those minority sell between one and ten thousand units. Today, been a fruitful
kinds of people who actually find computer we’re at ten million units. (sorry) year for
programming itself interesting, rather than just Our big worry when we first started the Eben and the
the end goal. Raspberry Pi project was that the kids wouldn’t Raspberry Pi.
8 // // Winter 2016
Eben Upton INTERVIEW
care about it; that we’d make this thing and it just
wouldn’t work out. As far as we could see, there
were two possible explanations as to why kids
weren’t programming any more: one was that they
didn’t have access to the hardware they needed
to program, and the other was that they simply
didn’t care about it, that they just wanted to go on
Facebook. It turns out that our first hypothesis was
correct: the lack of a programmable platform was
the only thing standing between a bunch of kids
doing a bunch of programming.
Raspberry Eye
We love this head-mounted project that Pi enthusiast
Roman Rolinsky has created in his spare time
S
ome projects are created to solve a ordered an OLO 3D printer via its Kickstarter page.
RECIPE problem. Others are created out of Was the Eye his first bright Pi idea, or his last?
pure curiosity, a bit of ambition and “Both, actually,” Roman smiles. “The Pi used for
z ITDBo
202.4E LCD a big sense of fun. Roman Rolinsky’s the Eye project soon died, because the board is
screen Raspberry Eye head-mounted display not really designed to be worn on a headstrap
falls into the second category: while it’s an without any protection. I’ve got the second
z 1 x Eye
of Horus impressive bit of engineering, Roman admits “it generation after that, but I haven’t used it for
beamsplitter was simply too bulky for something practical. I’ve anything DIY yet.”
z 1 x Fresnel
started to work on a smaller version using a 1-inch Like many builders, Roman has shared the
magnifying display paired to a Wi-Fi transmitter, but optics full details of his project online. How important
lens need to be much more advanced to create a is the community aspect of Pi building to him?
see-through image at a comfortable distance,” “It was really important to have notro’s FBTFT
he says. “Maybe printing custom optical elements kernel driver as an open-source project with
is possible with high-end 3D printers – this is a good documentation,” he says. “I just had to
direction I will try to explore.” Roman is excited adapt some code for the display I was using and
about the possibilities of 3D printing, and has pre- to produce a mirror image. From the comments
I’ve received on Hackaday I saw there are people
interested in collaborating on the project, so I will
probably contact some of them if the next iteration
finally becomes active. And of course, it is very
nice to see the stuff you are doing noticed by the
maker community.”
So what other projects does CREATOR
Roman have his, ahem, Eye on?
“I’ve bought my first house ROMAN
The Pi isn’t ROLINSKY
really designed
recently,” he says. “It’s pretty
for head old and requires a lot of Roman is a self-
employed software
mounting, so the attention, so it’s probable that developer, 3D printing
Eye is a little on my next project will be using Pi enthusiast and open
the large side. for home automation.” source advocate.
10 // // Winter 2016
Our favourite HOME PI PROJECTS
Magic Mirror
Mirror, mirror on the wall, what is the smartest Pi project of all?
Pi fans say this is number one
M
ichael Teeuw’s Magic Mirror is published the entire project details at http://
the kind of thing you wish you’d michaelteeuw.nl/tagged/magicmirror. So has RECIPE
thought of: a mirror that projects he had any other retail-related revelations? Sadly
information for you while you make not – but “walking through a big city, in this case z 1 x Iiyama
yourself presentable. It was voted New York, can be a major source of inspiration.” 24in monitor
best Pi project of all time by the Pi Foundation’s For Michael, Pi building is “a great way to z 1 x sheet of
official magazine, and deservedly so: not only is it improve your own programming skills and help one way mirror
really clever, but it has inspired countless builders others to improve theirs… If it’s out in the open, glass, alias
observation
to make their own. “I’ve seen many, many cool you want to deliver a quality product. I also find it mirror glass
use cases for the Magic Mirror, but my absolute fascinating that others have built so many different
z 1 x HDMI
favourite is one of the community members that modules for the Magic Mirror platform, modules I cable
uses the Magic Mirror project to teach kids the would never have thought of. That shows how we
possibilities of programming by letting them can all benefit from the enthusiastic and rapidly
modify and create their own modules,” he says. growing building community.”
“If the Magic Mirror project could inspire one kid
to become a programmer, I would be absolutely
thrilled!” It’s likely to inspire more: Michael has
shared his code and built an entire platform for
mirror makers at https://magicmirror.builders,
and there are several possible commercial spin-
offs on the horizon.
Michael had the idea during a shopping trip,
when he stared at an illuminated mirror and
The mirror’s
imagined it providing him with useful data as well
possibilities are
as reflecting his own bored expression. “Wandering endless: if it can
around behind your shopping girlfriend is a great be displayed on
moment to think of new possibilities,” he laughs. the screen, it’ll
The mirror shows the time, weather forecast, news appear through
and a nice compliment to cheer you up, and he’s the glass.
Wooden frame:
this is probably
the trickiest bit;
the tech is really
straightforward,
but putting the
glass in the
frame is a bit
fiddly.
TFT monitor:
the Iiyama
monitor is
nice and thin,
CREATOR leaving
enough room
MICHAEL to mount the
TEEUW PI and wiring
without
Michael likes to make making the
things, both physical frame too big.
and virtual, and blogs
about them at http://
michaelteeuw.nl
Winter 2016 // // 11
Dummy
camera:
Jack Miller IR illuminator:
took a dummy to see in the
camera and dark you need
put an a source of
unfiltered infra-red light
Raspberry Pi to bounce
camera inside back to the
it. Dummy camera.
no more!
W
hen Jack Miller moved out of housings trying to solder the IR LEDs onto them,
RECIPE his house and into a cabin in his which I eventually gave up on, and of course I
garden – “weird, I know,” he says – burnt myself numerous times,” he says. “Then I
z1x
Raspberry Pi he wanted to be able to monitor dropped the ball joint down a space in my decking
camera his house in case of break-ins. So, outside, so I had to buy another one. These
without he created a Raspberry Pi CCTV camera with night incidents are better left out of the video.”
IR filter
vision. He also found that in the daytime the Jack is a big fan of the sharing ethos around
z 1 x dummy camera had another benefit: Jack makes popular the Pi. “Sharing and teaching is what I do best,
CCTV camera video tutorials (look up Jackktutorials on YouTube), and I’ve been doing it for a long time,” he says.
z 1 x IR and the camera would let him see whether “I got this particular idea for the camera from
illuminator anybody was about to interrupt him while a guy on YouTube called Clayton Lambert, who
recording. As for the night vision, that “was mainly demonstrated a motion detection script. I then
a feature that I thought was cool, and the no-IR found ccrisan, who developed motioneyeOS, and
filter camera was cheaper when I actually came to thus the night vision camera was born.”
buying the parts. It just seemed cool, I guess.” What’s next for Jack? “I’ve just finished a
The video Jack made of the project makes the Pentesting Dropbox using the Raspberry Pi,”
entire process look effortless, but we got Jack to he told us. “It’s a small device with Kali Linux
admit that some moments did end up on the installed. You can drop it into a network and be
cutting room floor. “I did break three CCTV dummy able to access it and conduct pentesting. That
was pretty fun and complicated, but I’m definitely
going to be using it in more videos. I also have an
idea for the Pi becoming an
SSH server, and I think I’m CREATOR
going to rebuild my home
The camera
automation system.” Jack also JACK
can deliver a MILLER
real-time video
plans to resurrect a broken
feed as well as Nintendo Entertainment Jack’s a busy man. The
Jackktutorials.com
capturing still System with a Pi inside. Watch site features reviews,
images at preset this space! forums and a popular
intervals. YouTube channel.
12 // // Winter 2016
Our favourite HOME PI PROJECTS
W
arner Skoch says “The original the most headache-inducing, given how finicky
Game Boy has been one of my SD cards can be.” RECIPE
favourite consoles since I was a For Warner, the builder community is “the best
kid. I’ve also been really interested part” of Pi projects. “I recently did a second guide z 1 x broken
in electronics and tinkering in using all-custom and aftermarket parts like custom Nintendo
Game Boy
general, so when I saw the Raspberry Pi Zero’s button PCBs, many of which the community – and
capabilities, this was one of the first things I in particular the folks on the Sudomod forums – z 1 x Adafruit
wanted to try.” came up with specifically for this project. It has 3.5in composite
display
The resulting project “blew up” – but not in just been so much fun to be part of.”
a Samsung Galaxy Note sense. When Warner We love Warner’s quirky ideas – his most recent z 1 x Adafruit
2500mAh
posted details of his Game Boy Zero on Reddit, project was a Duck Hunt gun modified to be a battery
the story made the pages of The Verge and lamp zapper, with the IR receiver hidden behind a
Popular Mechanics, among many others. “I’ve duck. What’ll he come up with next? “I’ve got a few
had hundreds of people asking to buy one from things on my to-make list,” he says. “Stay tuned!”
me, hundreds more asking for a how-to guide, and
one marriage proposal.” Making more isn’t really
practical for Warner, so he decided to post full
guidance on Sudomod.com and hang around to
help others with their own Game Boy projects.
You can understand the excitement, because
Warner, alias Wermy, has done some really cool
things. He’s adapted a Game Boy cartridge to
work as a microSD card reader, and that means
the Game Boy Zero can play games from it. He’s
also added extra buttons to play other Nintendo The Game
games including NES and SNES. And he’s a big Boy Zero
fan of video editing to hide the fact that “there was supercharges
plenty of swearing and even some bleeding.” For mobile gaming
him, the SD card reader was the worst bit. “It was with Pi power.
Extra buttons:
Wermy added
two more
buttons so that
the Game Boy
Zero could play SD card reader:
NES and SNES the card reader
games too. is cunningly
housed in a
Game Boy
cartridge to
CREATOR keep things
retro while
offering stacks
WARNER
SKOCH of storage.
Winter 2016 // // 13
BUYING The right Pi for you
What Pi to buy
Familiarise yourself with the types of Raspberry Pi and accessories on offer
T
he Raspberry Pi Raspberry Pi 3 Starter Kit. These (General Purpose Input/Output)
is what is known are available from vendors such pins, but the Model B+ had four
as a “single board” as the Pi Hut (thepihut.com/ USB ports and 40 GPIO pins.
computer. In plain products/raspberry-pi-3- In February 2015, the
English, this is a starter-kit). Although you should Raspberry Pi 1 Model B+ was
complete computer built into check carefully to see what’s superseded by the Pi 2 Model
a single circuit board. Single bundled with the Pi from various B. This was in turn replaced in
board computers like the Pi offer vendors, starter kits usually February 2016 by the Raspberry
many advantages over ordinary include the Raspberry Pi 3 Pi 3, the third generation
computers. First, they are a good Model B itself, an SD card with Raspberry Pi. Apart from
deal smaller – the Raspberry Pi NOOBS pre-installed (more on being more powerful, the main
is only about the size of a credit NOOBS later), a power supply, difference is that the Pi 3 has
Pi bites card. Second, the Pi draws very a case and usually an HDMI or built-in Wi-Fi and Bluetooth.
little power (around 5V), so can network cable. In 2013, a low-cost variant
If you have an run indefinitely without any risk Not only will the Raspberry of the Raspberry Pi, the Model
older version of
the Raspberry Pi of overheating and does not Pi 3 be suitable for any of the A, was introduced. This was
and want to use require a noisy, bulky fan. It’s projects in these pages but it is replaced by the Model A+ in
wireless, there also very inexpensive to mass fully backwards compatible, so November 2014. The main
is an official
Raspberry Pi produce Raspberry Pis, hence
wireless adapter,
available from
sites such as
the low cost of purchasing one.
One of the down sides to THE RASPBERRY PI 3 IS FULLY
the Pi Hut
(http://bit.ly/
having an entire computer on
a single circuit board is that it’s
BACKWARDS COMPATIBLE, SO IT
PiWiFi).
difficult to upgrade individual WILL WORK FOR ANY PROJECTS
components such as the RAM
(memory). At the same time, the YOU FIND FOR EARLIER MODELS
Raspberry Pi is not as simple to
use out-of-the-box as a new
smartphone or tablet computer will work for any projects you difference between the Model A+
might be – you need to know may find for earlier Pi models. and the Pi 3 is that the Model A+
how to set it up, where to plug in The Raspberry Pi 3 is most does not have Ethernet, Wi-Fi or
the video, the storage, and so on. useful for resource-heavy multiple USB ports. It is really
The low cost is also sometimes projects like playing games or intended for embedded projects
a little misleading because you streaming video. If you don’t – that is, building into devices
need to add extras such as need to do this, then there are that don’t require connectivity.
cables for power and a monitor, less costly Pi models available. It’s not necessary to know
not to mention the monitor and every model of Raspberry Pi, but
keyboard themselves, in order to A brief history of Pi if you read older magazines or
do anything with your Pi. The very first generation of browse websites for Pi projects,
If you’ve just bought your first Raspberry Pi (known, a little they might refer to these models
Raspberry Pi, congratulations! In counter-intuitively, as the model being required for projects. As
the pages that follow, you’ll find B) was released in 2012. This we’ve noted, the Pi 3 is fully
out all about how to set it up and was replaced in July 2014 by backwards compatible, meaning
what it can do. If you don’t yet the Model B+, which introduced it will work for any such projects.
have a Pi and simply want to various technical improvements Some websites do still sell
know what to buy to get started and several changes: among older models, and you might be
with Raspberry Pi, then we’d other things, the original Pi had tempted by these because they
recommend purchasing a two USB ports and 26 GPIO are a little cheaper than the Pi 3.
14 // // Winter 2016
The right Pi for you BUYING
This is your decision to make, Raspbian and NOOBS. Raspbian there’s rarely any compelling
but bear in mind that the older is a free operating system (OS) reason to try to install a different
models are not as fast, consume designed to work specifically OS unless it’s specifically
slightly more power, and lack with the Raspberry Pi. It’s based recommended for the project
built-in Bluetooth or Wi-Fi. If a on Debian Linux, which is an you’re following.
project requires very low power OS for desktop computers. It If you buy a Raspberry Pi
draw, consider the Model A+ or contains a number of handy pre- Starter Kit, it’s very likely that
Pi Zero (more on this shortly). installed programs and utilities, Raspbian will have been installed
enabling the Pi to function out- already onto your microSD card
Raspbian & NOOBS of-the-box. through NOOBS (New Out Of the
While looking at the various Raspbian is in fact only one of Box Software).
Raspberry Pi models, you’re a number of operating systems NOOBS is simply an operating
likely to see references to both that will work with your Pi, but system installer which allows
Winter 2016 // // 15
BUYING The right Pi for you
MicroSD Card Micro USB DSI Display Full-size HDMI CSI Camera 3.5mm 4-pole
Slot (edge Power Input. Port Video Output Port Composite
connector on Switched Video and
underside) power source Audio Output
can handle jack
up to 2.5A
The Raspberry Pi 3
dimensions are a compact
85.6mm x 56mm x 21mm.
you to select the OS you want to make sure you have the most Pi. Unlike its predecessor, the
install from a friendly menu. This up-to-date version of Raspbian Raspberry Pi 2, it supports both
is not only convenient if you installed before starting any Wi-Fi and Bluetooth connection
want to try a different OS; it is project. You can do this by out of the box without the need
extremely useful if you decide to opening the Terminal app and for separate adaptors.
start a new project on your Pi as typing the following commands: If you’re familiar with
it enables you to reset the Pi to $ sudo apt-get update computer hardware, it has a
how it was when you first took it $ sudo apt-get upgrade 1.2GHZ 64-bit Quad-Core
out of the box. Simply restart the Press Return after entering processor and 1GB of RAM.
Pi, then hold down Shift on your each command. The Pi 3 also has four USB
keyboard and you can opt to ports. While most USB devices
install Raspbian afresh. The Raspberry Pi 3 will work, some will require more
If you’ve got a brand new As we’ve noted, the Raspberry Pi power than the Pi can supply. If
Raspberry Pi, you should also 3 is the third generation of the you want to use the Pi with a
16 // // Winter 2016
The right Pi for you BUYING
Winter 2016 // // 17
BUYING The right Pi for you
Raspberry Pi
Zero as sold by
the Pi Hut. Above
are a power
adapter and the
“Essentials Kit”.
To the left is a
micro SD, USB
wireless adapter
and shim.
If you need internet access performance. It has a 1GHZ memory. The Compute Module
on the Pi Zero, then the Official single-core processor and just is designed for specialised
Raspberry Pi Wireless Adapter 512MB of RAM. However, this industrial applications, so it’s
will work in conjunction with is actually ample for many Pi unlikely that you’ll need to use
the Zero’s mini USB connector. related projects. this, but we’ve mentioned it here
Alternatively, Pi Hut sells a in case you see it for sale.
MicroUSB converter “shim” Raspberry Pi The small size of the Compute
which slots over the end of any Compute Module (67.6x30mm) makes it
USB device, saving trailing Finally, the Raspberry Pi ideal for a number of ambitious
cables. Visit thepihut.com/ Compute Module contains the projects such as the CubeSat
products/usb-to-microusb-otg- bare bones of the Raspberry Pi project, which hopes to build
converter-shim to find out more. (a processor and 1GB of RAM) shoe-box-sized satellites that
The smaller size and price of but instead of using an SD card can be launched into space, all
the Zero comes at the cost of it contains 4GB of internal flash powered by the Pi.
18 // // Winter 2016
U O
P SA 58
T
V %
FR US
E
J
O T
M
5 £
A GREAT GIFT
FOR EVERYONE
Choose from a huge range of titles Subscribe from just £5 every 3 months
Save up to 58% off the cover price Free personalised gift card when buying for someone else
Savings calculated against the full RRP (single issue price x frequency). This offer is for new subscribers only. Full details of the Direct Debit guarantee
are available upon request. You can write to us or call us to cancel your subscription within 14 days of purchase. Your subscription is for the minimum
UFSNTQFDJmFEBOEXJMMFYQJSFBUUIFFOEPGUIFDVSSFOUUFSN1BZNFOUJTOPOSFGVOEBCMFBGUFSUIFEBZDBODFMMBUJPOQFSJPEVOMFTTFYDFQUJPOBM
circumstances apply. Your statutory rights are not affected. Prices correct at point of print and subject to change. For full terms and conditions please
visit: myfavm.ag/magterms. Offer ends: 31st January 2017.
CONNECTED Get started
E
ven though it might use and compatible wireless unpowered hub is an option,
not look like it, the adaptors, for example – before while powered hubs can handle
Raspberry Pi is in we can move on to creating a any devices, no matter whether
a fundamental way boot disc to start it up. power is required or not.
just like any other To use the Pi as a computer,
desktop computer you might you’ll need to connect at least a Display me
have owned or used in the past. keyboard, a mouse, a display and Technically, the Raspberry Pi
That is to say, it has a processor, a compatible SD card. In today’s works with most types of
memory and storage and, in environment, it’s going to be displays using the correct cable
order for you to use it, it requires useful to at least have a wired or adaptor. It’s envisioned to be
being connected to all the usual internet connection around, or used with an HDMI monitor but
peripherals – a display, inputs a suitable USB wireless adaptor works with older monitors with
and more. For most people, this for wireless networking. The a DVI adaptor or an HD TV.
should be straightforward, but final touch would be desktop With the HDMI connector, both
there are some finer points that speakers. On a technical level, the Pi and the display should
you should know about – details peripheral support is provided automatically configure
about the correct SD card to by the Linux kernel that powers themselves correctly; we’ve
the Raspbian OS, but more on successfully used the Raspberry
that later… Pi on a 4K display without issue,
beyond manually setting the
Need input! higher 4K screen resolution.
Ever since the Model B+, the It’s possible to connect the
Raspberry Pi has been well Pi to an old TV or monitor
furnished with four USB ports. using an analogue composite
This ensures that it’s easy to connector – this is usually a
connect all the peripherals you round yellow RCA connector.
need. The base minimum of With the Pi, the 3.5mm jack
these is a USB mouse and that’s usually used for stereo
keyboard for standard input – audio output carries an extra
especially considering you’re line for the video. To access this,
able to get keyboards that you need a 3.5mm jack to stereo
provide additional USB ports, and composite RCA.
helping to save one or more on
ON THE CASE the Raspberry Pi itself.
Pretty much any keyboard
Sounds good
The Raspberry Pi is perfectly
We admit, it can be unnerving having a naked and mouse should work, but capable of producing plenty
Raspberry Pi sitting on your desktop, and it’s don’t expect support for any of audio, and later we’ll see
certainly the case that it could short on random unusual buttons (you’d be projects that enable the use of
wires, screws or metal surfaces. So, a common extra surprised at how many do the Pi as an audio streamer and
that people get for their Pi is a suitable case. At this work, though...). media centre. You can get audio
point, there’s quite a range available, and many leave
The important thing to out of standard Pis in two ways.
the GPIO pins and other ports open for easy access.
remember is that even with just The first is over the HDMI line.
There are more exotic options that can mount the Pi
within a display, a desktop-style case that expands four USB ports – or the single When you plug the Raspberry
its capabilities, and even a laptop chassis, so you port on the Pi Zero – it’s easy to Pi into a display that also has
can take your Pi with you. Just be aware that this expand your USB connectivity speakers, audio generated by
means you can spend anything from £5 up to £100 with a hub. For devices that don’t the Pi is automatically sent over
for your Pi case! require additional power, an the HDMI line, too.
20 // // Winter 2016
Get started CONNECTED
The alternative option is to All Raspberry Pis use a normal desktop PC. The fact is, Connect it up
use the standard 3.5mm audio micro USB port to supply their the Pi was envisioned to be that and a Raspberry
jack, which can easily be plugged power. This has the advantage and so much more. A big part of Pi will form the
into most speakers. that, on the whole, you can its extra abilities comes through heart of a
power a Pi from almost any the bank of GPIO (General powerful but
Network and power phone power adaptor. The power Purpose Input Output) pins. We’ll very compact
computer setup.
We’re going to look into Pi requirements vary, depending on explore these later through fun
networking in more detail over which Pi you have and what and exciting projects, but for
the page, largely because we you’re doing with it. Old power now, it’s enough to know that
want to look at wireless supplies that provide only 5W these enable the Pi to control,
networking adaptors and the should cope with a basic Pi monitor and power external
newer Raspberry Pi 3 wireless Model B setup, which draws devices and projects. You don’t
capabilities in full, alongside the 3.5W, but the more peripherals have to use them, but they’re
new Bluetooth features and how you add, the more power it always there if you want them.
they work. Beside this, all Model requires. The Pi 2 and 3 use 4W, Additionally, the Pi comes with
B Pis come with the wired so the draw is more critical. a camera interface – although
Ethernet network port. This can Ideally, you want a 10W (2A, 5V) you can also use standard USB
be plugged into any router, and supply, which is more common cameras – plus there’s a
boom – instant network access, these days because modern dedicated digital touch display
including internet access if that tablets and phones also have interface, too.
router is connected. For the higher power requirements. All you have to do now is
Model A Pis and Pi Zero, a USB At this point, you would have follow our installation guide over
wireless adaptor is required. your Raspberry Pi all set to be a the page and boot it up!
SD CARDS
The main storage for a Raspberry Pi is an out at 25MB/s. It’s also not capable of
SD card, typically a micro SD card, though utilising the technology of the latest UHS
the original Model B and Model A Pis used high-speed SD cards.
a full-sized SD card. On the whole, you With all that in mind, the key thing to
can just run out and buy any micro SD look for in an SD card is to get one with
card and it should work, but it certainly fast read/write access, rather than pure
makes sense to ensure that the card you throughout. It’s also worth keeping an eye
buy will not only work, but will also be on the list of compatible tested SD cards
large enough and as fast as possible. at http://elinux.org/RPi_SD_cards.
Not all SD cards are made the same. You should also aim to get a card at
There are various speed categories, such least 8GB in capacity. The latest build of
as Class 6 (which denotes a minimum Raspbian – the main Pi OS – is now larger
6MB/s write speed) and Class 10 than 4GB. That said, given the price of SD
(denoting 10MB/s write speeds), along cards, it makes sense to go for a 16GB or
with the newer and faster UHS-1/2 (Ultra 32GB card. You need to balance the slight
High Speed). One thing to keep in mind increase in price against the fact that a
here is that the Pi’s SD controller maxes larger card is likely to be of use far longer.
Winter 2016 // // 21
INSTALL Get started
How to install
Raspbian
Before you can do anything on your Raspberry Pi, you need some software
for it to run. With a micro SD card in hand, we guide you through the process
B
efore the Raspberry Unlike traditional computers, needs to be at least 4GB in
Pi can do anything the Pi has no internal storage, capacity. If all this seems too
(apart from sitting so the OS needs to be loaded technical, you may wish to look
there looking cute) it from an SD card. The original Pi at NOOBS (over the page).
needs an operating models (models A and B) use Note that on MacOS computers,
system (OS). The most popular full-size SD cards, whereas it’s also possible to write the
OS for the Pi is Raspbian, which newer models (B+, 2, 3 and Raspbian image using the dd
is based on Debian Linux. A Zero) use the smaller (and tool from the command line. If
number of other operating much easier to lose!) microSD you’re comfortable working
systems are also available for variety. SD cards pre-loaded this way, the procedure is very
the Pi. Some of these can be with an OS can be purchased similar to the Linux instructions
downloaded from the Raspberry from pretty much wherever the on page 25. Alternatively, check
Pi Foundation website (https:// Pi is available, and are commonly out the instructions on the
raspberrypi.org/downloads) included in bundles, but it is also Raspberry Pi Foundation website
and some can be installed using straightforward (and cheap) to at www.raspberrypi.org/
NOOBS (over the page). There’s make your own. This can be documentation/installation/
Ubuntu MATE (Pi 2 and 3 only), done using freely available tools installing-images/mac.md.
an ARM port of Arch Linux, the on Linux, MacOS or Windows.
classic RISC OS, the OSMC If you already have a pre- Enjoy Raspbian
media centre, not to mention loaded SD card, you can skip this Once your SD card is ready
the RetroPie vintage gaming section entirely. If not, the most (whichever road you choose),
platform. There’s also Snappy straightforward way to get going you’re all ready to boot up your
Ubuntu Core and even Windows with the Pi is to download the Raspberry Pi. Remove the SD
10 IoT Core. If you’re a beginner, latest Raspbian image and write card from your computer, plug it
Raspbian is good to start with. it directly to an SD card, which into your Pi (along with all the
other gubbins – display, power,
Raspbian keyboard and mouse), and it
should be your should boot up to the raspi-
first choice, but config program. From here, you
the other OSes should expand the filesystem (if
can be fetched
your card is greater than 4GB),
and installed with
minimum fuss.
change the default password and
enable Boot to Desktop. Select
Finish and you’ll be able to
reboot to the Raspbian desktop.
There’s all manner of interesting
things you can play with right
away, including Minecraft,
Wolfram Alpha and Sonic Pi.
If you have a wired network
connection, then that will work
out of the box. Some wireless
ones will as well, but for many,
this will be their first encounter
with the recalcitrance of Linux.
Just be patient, and remember,
Google search is your friend...
22 // // Winter 2016
Get started INSTALL
Winter 2016 // // 23
INSTALL Get started
Install NOOBS
with any OS
Possibly the easiest way to get a new OS up and running on your Pi can be
achieved using any operating system – as long as you know how!
N
OOBS (New Out Of so it will load the next time the – just plug in and turn on.
the Box Software) Pi is rebooted. Or you can hold Once your card is ready,
makes it easy to down Shift as the Pi boots to use reboot the Pi with power,
install Raspbian (or the NOOBS installer once again. mouse, keyboard and monitor
other OSes) on your Preparing a NOOBS SD card all connected. You should see
Raspberry Pi. You can buy an with Raspbian on it requires at a list of OSes (tailored for your
SD card with NOOBS on it from least a 4GB SD card – other Pi model). The Raspbian entry
many vendors, or we’ll show you OSes (in particular, Windows 10 should have a picture of an SD
how to do it yourself below. IoT Core) will require 8GB. The card on the right, indicating that
With a correctly-prepared simple process of installing it can be installed even if the Pi
NOOBS SD card, the Pi can boot NOOBS to an SD card is outlined is not connected to the internet.
to a menu offering you a choice below. Note that if you’ve bought Tick the box to its left, hit Install
of OSes. Pick one and NOOBS an SD card with NOOBS already and, before long, you’ll be able to
installs the OS on the SD card, on it, you don’t need this section reboot straight into Raspbian.
24 // // Winter 2016
Get started INSTALL
Install Raspbian
with Linux
If you’re running any flavour of Linux on your computer, then you have an
even easier life when it comes to getting Raspbian on to your Pi
L
inux users can get The Etcher
Raspbian set up image writing
from the comfort program is
probably the
of their operating
slickest way to
system, too. Much
make SD cards
the same as on Windows and under Linux,
Mac, the first steps are to and saves you
download the Raspbian image from getting
(either from a web browser or your hands
using Wget) and unzip it. There dirty at the
are a few different options for command line.
writing the image. You can use a
graphical tool such as Etcher
(see www.etcher.io) or Ubuntu’s We’ll refer to the SD card as network to side-step filesystem
Startup Disc Creator. These work /dev/sdX (replace the X with the incompatibilities amongst OSes.
very much like the image-writing actual drive letter) and assume Still, it can sometimes be handy
tools for MacOS and Windows. you’ve unzipped the Raspbian (for example, if the Pi is shut
As with most tasks on Linux, IMG file to the Downloads down) to just be able to grab the
the usual approach is to use directory. In a terminal type: SD card, slip it in a slot, and grab
the command line. $ sudo dd if=~/Downloads/26- photos or edit configuration files.
Insert the target SD card into 05-16-raspbian.img of=/dev/sdX If you’re not (yet) a Linux
the machine. We’ll use the dd bs=1M user, it’s also possible to use the
tool, which is part of all standard This process can take a long live disc mode of a distribution
Linux installations, to transfer time, particularly on older or (Ubuntu, Fedora, openSUSE,
the image. You definitely don’t cheaper SD cards. Sometimes, Mint, for example) and create
want to accidentally wipe your even when the command the SD card from there. There’s
hard drive this way (and it’s completes (when you are able a slight problem downloading
possible to do just that if you to enter another command), the the image to the root filesystem,
get this wrong), so first use the job is not done. If your SD card however, because this is all in
lsblk command to see which or adaptor has an activity light, RAM for live discs (their modus
device node it is attached to. then you can see if anything’s operandi is to not touch your
You should be able to identify still being transferred, but if not, hard drive), and there typically
the SD card by its capacity. It try the sync command. If it isn’t enough space for several
could be /dev/sdb or it could be doesn’t complete right away, gigabytes of OS image. This
/dev/sdc. Newer PCs that have data is still in-flight. Once can be worked around, though,
a native MMC controller will give everything is ready, you can because the image can be
it a slightly different name, such remove the SD card, boot your downloaded to a USB stick
as /dev/mmcblk0p1. Note that Pi and tweak the raspi-config beforehand and copied from
it is the device, not partitions on program as per the Windows there. On Ubuntu, USB sticks
that device (such as /dev/sdb1 and MacOS instructions. are mounted in a directory inside
or /dev/mmcblk0p1n2), that /run/media/ubuntu, so change
we are interested in. Any existing Linux luck the if parameter of the dd
partition information will be lost On Linux, there is a slight command accordingly.
when we transfer the image to advantage in that the SD card Alternatively, you can use the
the device. Writing the image to can be browsed natively. It’s Startup Disk Creator on an
a partition won’t work at all well, only a slight advantage because Ubuntu live DVD if you don’t
so don’t do that. things can be sent over the feel like typing things.
Winter 2016 // // 25
NETWORKS Get started
Using networks
on the Pi
Getting hooked up to a local network and the wider internet is easier
than you might think, as long as you have all the right bits...
E
veryone (and, it of the nitty gritty of networking Linux kernel they ship with.
seems, everything) from you, combined with the You can confirm whether a
is online these days, need to add wireless dongles to USB device is working correctly
and that means that all Raspberry Pi models except – other than the Raspbian
if you want your the latest Pi 3, which comes with wireless being enabled – by
Raspberry Pi to do anything built-in wireless and Bluetooth. opening a terminal and typing
“interesting” – even if that’s just Let’s talk wireless adaptors. lsusb , then pressing Return.
browsing Facebook – you need The first thing you need to do This provides a list of all your
to get it networked. As with before buying a wireless adaptor USB devices, and one should
everything Raspberry Pi, it’s is to check whether the one you be something that sounds like
Raspbian
now supports
made as hard as possible, to already have or plan to get will your USB Wi-Fi device.
easy GUI- ensure you learn as much as work with your Raspberry Pi. A second command, iwconfig
based wireless possible along the way! No, That’s where http://elinux.org/ provides a list of working
connections – actually, the only complication is RPi_USB_Wi-Fi_Adapters wireless adaptors connected to
so modern! that Raspbian doesn’t hide any comes in – this is a huge list of your Pi. This offers a slightly
both verified adaptors and those more direct confirmation that
that cause issues. the USB dongle is connected
The good news is that a huge and working.
range works with Raspbian, An easy way to avoid any
thanks to its Linux kernel. It worry is to buy an official
comes with built-in support for Raspberry Pi Foundation Wi-Fi
a large number of adaptors. dongle. Designed to work with
Because of the way Raspbian is all Raspberry Pis and Raspbian,
built, an adaptor that doesn’t this eliminates any worries.
work with Raspbian might work There’s also the added point
with another Linux OS, such as that it helps fund the Foundation,
Arch or OpenELEC, because of too. You can get more details
the particular version of the from www.raspberrypi.org/
products/usb-wifi-dongle/.
Back in the day, you had to
TCP AND YOUR SORE IP edit text files to configure your
wireless dongle, but these days,
If you’re new to PCs and networking, then the address would be something like 192.168.0.1 Raspbian has been fully updated
sudden talk of IP numbers and the like might or 192.168.100.23. Generally, your home and to provide a GUI for connecting
be very confusing. Let’s just say that local business network has its own IP range – the to any wireless network. How
networks and the internet all use a very clever broadband router you use to connect to the civilised! Wi-Fi connections can
system called TCP/IP. On a pedantic level, that’s internet creates this automatically using be made via the familiar network
two – yep, two – communications protocols: something called a DHCP server, and uses icon at the right-hand end of
TCP, alias Transmission Control Protocol; and Network Address Translation, or NAT, to route the menu bar. If a working Wi-Fi
the IP part, alias Internet Protocol. You don’t messages to and from your local network and dongle is plugged in, left-clicking
really need to know anything about it, other the wider internet. See, it does get awfully
this icon brings up a list of
than this: it assigns a unique number to each complicated very quickly!
available Wi-Fi networks, as
and every device on the internet. This enables Usually, when we talk about IP addresses,
messages to get to and from your devices, it’s when you want to know the address of a shown in the picture on this
finding their way to the right place. device or server on your network or on the page. If no networks are found,
Each device gets an address made up of four internet, or you want to give a device a specific it shows the message “No APs
numbers, separated by full stops. Each number address. You won’t have to know much more found – scanning...” Wait a few
can be between 0 and 255. So, typically, an than this. seconds more without closing
26 // // Winter 2016
Get started NETWORKS
BLUETOOTH DEVICES
With the addition of the embedded dual connecting to a wireless network. This
wireless/Bluetooth abilities in the Pi 3, goes for all Bluetooth devices, but you first
Raspbian was updated to support need to make them “discoverable” – this
Bluetooth out of the box. Prior to this, you enables other Bluetooth devices to then
had to “hack” in the Bluetooth support, attempt to connect with them, at which
with the command sudo apt-get install point you have to allow those connections
--no-install- recommends bluetooth and, or not, as the case may be. Left-click the
once it was installed, use sudo service Bluetooth icon in the top-right of the
bluetooth status to enable it. Raspbian desktop, select Make
While this was a simple case of installing Discoverable, then choose Add Device to
a manager tool, it’s far neater having it pull up a list of nearby Bluetooth devices.
around by default. If you use a smartphone Select the correct one and click Pair. With
you’re likely to have used Bluetooth, with keyboards and devices, you often have to
all the Bluetooth speakers, keyboards and enter a code on the device to finalise the
headsets available these days, but if not, connection. You’ll want to ensure that you The Raspberry Pi should pair with most
the good news it that’s it’s far simpler than choose Stop Discoverable afterwards. Bluetooth devices without an issue.
Winter 2016 // // 27
PIXEL DESKTOP Get started
C
hristmas has come The real treat comes when fairly easy to resize the window
early to the Pi this the desktop loads. Thanks to Pi (see “NitPixels,” p31).
year with Pixel (Pi Foundation Developer and skilled If the windows alone are
Improved Xwindows photographer Greg Annandale, not enough of a visual feast,
Environment, there are now over a dozen epic two of the Pi Foundation’s web
Lightweight). If you think of the desktop backgrounds bundled developers have spent a great
former desktop environment with Raspbian. Our current deal of time on making funky
LXDE as a generic store-bought favourite is “Mountain”, but yet functional icons for the
plastic tree, by contrast Pixel is they’re all stunning. Pixel desktop. You can open the
a towering Norwegian Pine laden The Pixel cheer continues applications menu to see most
with tinsel and toys. upon opening a window, as you of these but they excited us so
Pixel’s perfection is evident will notice that the wide frames greatly we actually headed over
from the moment you switch around the borders are now to the Add/Remove Software
on any Raspberry Pi with the gone, giving it a much more section in order to see the full
latest install of Raspbian as the contemporary look and feel set for various categories.
Quick tip scrolling line of (largely obscure) reminiscent of an actual desktop Some of the changes to the
text has now been replaced computer. Mercifully it is still desktop environment are much
All system icons
are stored in / with an elegant splash screen,
displaying only a few helpful
SWITCH ON, AND THE SCROLLING
usr/share/icons/
PiX. Feel free to messages and the version
By default
Raspbian still
doesn’t require
a password. You
can, however,
enable the login
screen, which will
appear on your
chosen desktop
background.
28 // // Winter 2016
Get started PIXEL DESKTOP
more subtle. The Roboto font, Raspbian+Pixel also now The Pixel Desktop will now be
which is still the default font for includes an “initial release” of bundled with all future installs of Quick tip
Raspbian, has been augmented Chromium for the Pi. If you’re Raspbian and we encourage you
If you want to
with a rendering package to not familiar with it, Chromium to try it out. The simplest way if port any of the
map pixels to the screen. The is the open source project you use Raspbian with NOOBS, sample code from
effect is admittedly not very behind the Google Chrome web the easy operating system the emulator to
noticeable in many places browser. For more information, installer, is to restart your Pi a real SenseHAT,
simply change
but makes for a much more visit www.chromium.org. while holding Shift and select
sense_emu to
professional feel in others. Raspbian again. Be warned, sense_hat at
If you are unswayed by Pixel’s Playing with Pixel however, that this will erase the top of your
glittery showing then there are Hardware geeks may also be your existing installation. program.
also several titanic applications delighted at the inclusion of a Alternatively, you can choose
bundled with the latest version SenseHAT emulator which allows to download the latest Raspbian
of Raspbian. Chief among these for easy testing of interfacing image from the Raspberry Pi
is integrated support for VNC projects without having to buy website (www.raspberrypi.org/
out of the box (see As Easy as an actual SenseHAT board or downloads/raspbian/) and
RealVNC, p31, for details). reconfigure one each time. then follow the installation
Winter 2016 // // 29
PIXEL DESKTOP Get started
guide to move it onto a suitable by running the command best switched off if not actively
Quick tip MicroSD card from which you epiphany-browser in use) or you’re storing sensitive
Consider installing
can boot your Pi (http://bit.ly/ You may want to do this if, data and don’t want to be visible
the plugin Pi-install-guide). for example, you want to export on networks.
Disconnect from Thankfully it’s also possible to your old bookmarks into If you do choose to leave the
the Chrome Web upgrade your existing Raspbian Chromium (see “NitPixels” on Wi-Fi enabled, you can now also
Store. This blocks
Jessie to the latest version the opposite page for more). disconnect from your currently
websites from
tracking you and including Pixel (Raspbian+Pixel). The official Raspberry Pi connected wireless network with
can significantly See our step-by-step guide on website cautions that although two clicks of your mouse. Simply
increase your p32 for more information. Chromium runs well on the Pi 2 open the network menu and
browsing speed. and 3, it might struggle on older click on your current network
Chromium models and the Pi Zero. If this name to disconnect.
comes along applies to you, you might
Not only does Chromium provide consider using Epiphany or Sensational
a much more modern look and investing in a faster Pi. SenseHAT
feel to everyday web browsing For the benefit of those people
on the Pi, it’s also optimised to A word on who haven’t (yet) visited the
stream HD video with your Pi’s interfaces International Space Station,
hardware. This is achieved in By popular demand, the latest the SenseHAT is an add-on
part by the h264ify browser iteration of Raspbian gives you board for the Raspberry Pi. In
extension, which as the name much more control over your November last year it was used
suggests forces YouTube to interfaces. It’s finally possible to as part of the Astro-Pi project
stream hardware accelerated disable either Bluetooth or Wi-Fi (see https://astro-pi.org for
H.264 videos. altogether from inside the Pixel more information) and is now
The Ublock Origin extension desktop environment. Simply available on sale from sites like
is also installed to prevent the click the Bluetooth/Wi-Fi icon the Pi Hut for around £30.
browser being slowed down by and choose to disable either or The SenseHAT is suitable for
The SenseHAT annoying ads. Ublock Origin is both. This is particularly useful much more than space satellites
Emulator uses based on the more well-known if you’re running your Pi from a because it’s bristling with useful
click and slide AdBlock Plus but unlike its big battery pack (because both of sensors including a gyroscope,
buttons to brother filters all advertising these are power-hungry and are accelerometer, magnetometer,
emulate content as well as trackers
movement of
rather than let a few supposedly
the joystick and
changes in the
harmless adverts through. THE EMULATOR ENABLES YOU TO
environment. This
example program
Once it’s installed the web
browser button will launch TEST ALL YOUR PROJECTS BEFORE
changes the LED
colour based
Chromium by default. However,
you can launch the former
BUYING A SENSEHAT BOARD
on humidity. browser Epiphany at any time
30 // // Winter 2016
Get started PIXEL DESKTOP
Move the
mouse pointer
either to the edge
of a window or
just outside it and
you can resize
the window.
thermometer and barometer. emulator for the SenseHAT, this projects suitable for beginners,
It also comes complete with one has been developed by the as well as intermediate and
an 8x8 LED interface and a five awesome Dave Jones to run advanced examples.
button joystick. natively on the Pi. Environmental
The latest version of variables like temperature and NitPixels
Raspbian+Pixel now comes with pressure can be altered using The upgrade process is
a SenseHAT Emulator, allowing slider switches. reasonably pain free but if you
budding coders and interfacers For those who are interested choose to install Raspbian+Pixel
to test all of their projects before in getting started, the emulator from scratch, the ZIP file will
taking the plunge and buying an contains a number of example decompress from 1.8GB to just
actual SenseHAT board. projects. Launch the emulator, over 4GB in size. This shouldn’t
Although the Raspberry Pi then click the File menu at the pose a problem for more recent
Foundation previously top left, then hover over Open versions of Linux but if you are
announced a web based Example. You will see there are using a different OS, older
AS EASY AS REALVNC
RealVNC have brought both their viewer browser does indeed support Java. If
and server software to the Pi, which not, you’ll be given the opportunity to
makes life much easier for those who install it immediately.
want to connect remotely to the rich GUI. Linux users may prefer to use the
Once RealVNC is installed, go to IcedTea-Web plugin for your browser. The
Menu > Preferences > Raspberry Pi software is open source and is capable
Configuration > Interfaces and click of running Java applets. Visit http://
“Enabled” under VNC. The VNC icon icedtea.classpath.org/wiki/IcedTea-Web
will appear at the top right of the desktop. for information on how to download and
Click this to open the VNC window install the latest version.
complete with a unique IP address Whichever method you use, you’ll be
for VNC clients – for example asked to click “Run” to confirm that you
http://192.168.1.10. wish to use the RealVNC software. The
Alternatively if you’re using a Java desktop will open in a new window. Be
enabled web browser, you can choose careful not to close this window (we
to use the relevant link to open a separate recommend moving it to a separate
Java window inside which you can access desktop if your system supports this)
the Pi’s desktop from another computer because if you do, you’ll lose access. Note down the IP address for
without installing additional programs. If you plan to use VNC regularly, you your VNC client/web browser. Use
If you choose to do this, first visit might wish to consider bookmarking the security catchphrase to stop your
https://java.com/en/download/ the Java link so that you can open your connection from being intercepted by
installed8.jsp to make sure that your desktop at any time. “Man in the Middle” attacks.
Winter 2016 // // 31
PIXEL DESKTOP Get started
archiving utilities may struggle never resist references to Mad blue link offering to Import
with this. To avoid this issue, Max) you may wish to import Bookmarks. Click this and locate
the Raspberry Pi Foundation your old bookmarks from the the file to bring your favourites
recommends using 7Zip for previous Epiphany browser. You across to the new browser. Bear
Windows and The Unarchiver can launch Epiphany at any time in mind that this version of
for Mac to extract the files. by opening Terminal on the Pi Chromium is experimental and
For the sake of compatibility and running the command therefore not all websites may
Raspbian may overwrite some epiphany-browser perform as you’d like.
of your configuration files. If you Click the settings gear icon on
find that this interferes with the top right and then choose Getting used to it
anything and need to revert to Edit Bookmarks. A new window Resizing windows now that the
the previous state, your old will open, giving you the chance oversized frames are gone can
configuration files can be found to export your bookmarks in take a little getting used to. The
in /home/pi/oldconffiles. HTML format. resize area actually exists just
As shiny as Chromium is, The first time you run the outside the window as well as
before riding it eternal (we can Chromium browser you’ll see a on the very edge, so you don’t
32 // // Winter 2016
Get started PIXEL DESKTOP
need to practise extremely downloading a fresh image from login screen to make sure
precise motor control. Simply the internet or you worked your anyone else accessing it will
move the mouse pointer to the way through the tutorial before need a password. Simply run the
corner of a window and wait a reading this warning, you can following command to open up
moment for the cursor to run the following command to your desktop configuration:
change to a resize icon. remove RealVNC server and all sudo nano /etc/lightdm/lightdm.
The Raspberry Pi website related files: conf
cautions that those using xrdp sudo apt-get purge realvnc-vnc- Now comment out the line
to access their Pi remotely server “autologin-user=pi” by placing a
might find that it conflicts with Finally, a lot of time and # at the start. Press Ctrl + X,Y,
RealVNC. If you’re updating your effort has gone into making then Return to save and exit
existing installation of Raspbian, Raspbian into a much better and restart the Pi. If you do this,
skip step two in the step-by-step approximation of a desktop you’ll notice another neat
guide on the opposite page to computer. If you decide to start feature of Pixel is that your login
avoid installing VNC. If you’ve using a Pi as a home or office screen now appears over your
installed Raspbian+Pixel by computer, consider enabling the existing desktop background.
The Pi Foundation
claim that the
splash screen
doesn’t slow down
the boot process
but if you prefer the
old boot screen, it
can be disabled.
Winter 2016 // // 33
GET THE MOST FROM
YOUR RASPBERRY Pi
OUT
NOW!
WITH
FREE
DIGITAL
EDITION
The top 20
Raspberry Pi add-ons
Add multiple dimensions to the way you use your Raspberry Pi with
this collection of essential add-ons compiled by Nick Peers
he Raspberry Pi was major manufacturers to provide We’ll reveal how to add Wi-Fi and
T
designed to inject much- people with all manner of add-ons to extra USB ports to your Pi Zero if
needed enthusiasm back extend their Pi’s capabilities, without you need them, and you’ll also find
into computing and having to design something from out how best to enjoy games on your
electronics, and scratch. In this roundup we’ve Pi, whether it’s through a simple
thousands of Pi users focussed on 20 of our favourite Pi Pi-compatible gamepad or by housing
have showcased amazing and add-ons, all of which enable you to your Pi in a full-blown arcade cabinet.
innovative projects that show just how use your Pi in different ways. And the beauty of this roundup is,
versatile it can be. Part of this success You’ll find out how to put your Pi at we’ve barely had time to scratch the
is down to the Pi’s fundamental the heart of an all-in-one desktop or surface – so if you find an add-on
design, with its USB ports and GPIO tablet, give it the tools to interact with here doesn’t quite do what you want,
pins encouraging people to interact its surroundings through the addition you’ll almost certainly be able to find
directly with the Pi to achieve... well, of sensors and robotic controls, plus something that does elsewhere. And if
just about anything. power it via batteries or even your you can’t find it? Perhaps now is the
Many Pi projects have morphed network. You’ll discover some novel time to build it yourself – and then
into something more permanent as ways of using the camera module, share it with others. Isn’t that what
crowd-funding campaigns jostle with including spying on your fish tank! the Pi is all about?
Winter 2016 // // 35
TOP 20 Raspberry Pi add-ons
pi-top CEED
Turn your Pi into an all-in-one desktop PC
£119, http://uk.rs-online.com connectors are easily accessible;
This beautifully designed the adjustable kick stand allows
desktop case with integrated you to position it for comfort.
display will house any Raspberry There are two optional extras
Pi Model B form factor. The you can buy: the pi-topPROTO is
14-inch display offers a decent a HAT-compatible add-on board
1366x768 resolution – equivalent for prototyping electronics; the
to an HD-ready 720p screen – pi-topSPEAKER is a tiny speaker
and the Pi itself hides behind the you can also fit to the mag rail.
removable black acrylic panel You can attach up to three for
beneath. All you need to supply stereo sound, but each is £20.
is the Pi (or you can buy a CEED The CEED comes loaded with
with Pi 3 included for £142), plus the pi-topOS and CEEDuniverse,
a mouse and keyboard. a multi-player online game that
Assembly is simple: remove teaches you coding and circuit-
the panel, attach your Pi to the building skills so you can make
mag rail and slide it in. Internal hardware to use with the game.
connections are neatly hidden Also consider: The Pi-Top case
away; all the cables you need are converts your Pi into a fully
supplied, plus a power supply, functional laptop, with 13.3-inch
and there’s space for your HATs screen and 10-hour battery.
too. Your Pi’s USB and Ethernet Around £225, www.pi-top.com
Pi-DAC Zero
Turn a Pi Zero into an audiophile-friendly
music player with this powerful DAC
£13 (fitted), www.iqaudio.co.uk fully functional audio player you
Give your old stereo system a can control remotely from any
new lease of life by pairing it with web browser.
a Pi Zero. Just solder GPIO pins Rip your music in FLAC
on to the Zero, then plug in the format for maximum quality and
Pi-DAC Zero. This superb DAC then sit back and prepare to be
supports full HD audio through gob-smacked. Don’t believe us?
its twin phono connectors – use We’ve been using it together
a standard set of phono plugs to with PiMusicBox as our primary
pair it with the AUX IN input on music player for a year, leaving
your stereo and you’re away. the CD player to gather dust.
Drivers are built into Raspbian Also consider: You can add a
and comprehensive instructions headphone socket via the £12
for enabling and using the DAC Pi-DAC ZeroHP board, which
can be found at www.iqaudio. plugs into the top of the Pi-DAC
com/downloads/IQaudIO.pdf. Zero. There’s a full-size version
Or you can follow the tutorial at of the Pi-DAC Zero (Pi-DAC+,
www.techradar.com/1318771 to £31) for Pi Models B+, 2 and 3,
pair your Pi Zero with the superb and a Pi-DigiAMP+ to turn a Pi
PiMusicBox distro to create a into a full-blown stereo receiver.
36 // // Winter 2016
Raspberry Pi add-ons TOP 20
ZeroView
Take pictures with this superb Pi Zero case
£7, www.thepihut.com to make them easier to remove
You’ve bought a Pi camera, but in turn should you want to shift
what’s the best way to mount it? your vantage point. Program
Our favourite camera-themed your Pi Zero to record your fish
case is the ZeroView, a cleverly swimming around its aquarium,
designed window/glass mount or perhaps use the simple time-
for your Pi Zero (or Pi Model A+) lapse command to shoot some
and the camera module (don’t stunning footage.
forget the £4 Pi Zero Camera Pair it with MotionEyeOS
Adapter cable when you buy). (https://github.com/ccrisan/
Powerful suction cups secure motioneyeos) to turn your Pi
it to any glass surface, and the Zero into an IP camera so you
camera module is close enough can keep an eye on your home
to practically eliminate glare and in real time from anywhere.
reflections. The way the Pi Zero Also consider: For home
is mounted means you can add security the SPI-BOX (£13, www.
additional pHATs, while all the sbcomponents.co.uk) has a
connectors point downward for built-in motion detector. The Pi
easy access (and tidier cables). Camera Box Bundle (£22, www.
It’s easy to assemble – no modmypi.com) fits the module
soldering involved – and the PCB and Pi Zero in a wall-mounted
board slides off the suction cups case with wide-angle lens.
Sense HAT
Multi-purpose add-on board used in space
£29, https://cpc.farnell.com long you can get a feel for the
The Sense HAT was designed to Sense HAT before you buy it by
take the Pi to the International running an emulator in your web
Space Station with astronaut browser (https://trinket.io/
Tim Peake – see https://astro- sense-hat – note it doesn’t
pi.org. It’s also packed full of currently work in Firefox). This is
useful tools. The “Sense” refers also a great way to try out your
to its six sensors, for measuring coding projects before you apply
temperature, barometric them to your Sense HAT; there’s
pressure and humidity, plus a desktop version available for
gyroscope, accelerometer and offline use through Raspbian too.
magnetometer functions. You Also consider: Sense HAT will
also get input controls via a five- work with a Pi Zero, but Enviro
button joystick and can output pHAT (£16, www.pimoroni.com)
to the 8x8 RGB LED matrix. is a better fit if your interest is
Its versatility makes the the sensors. Its four sensors
Sense HAT ideal for everything measure temperature, pressure,
from conducting experiments to light level, colour, three-axis
playing games, and you can get motion, compass heading and
started with its huge Python analogue inputs. There’s a large
library at pythonhosted.org/ Python library you can import to
sense-hat. If you can’t wait that interrogate it with.
Winter 2016 // // 37
TOP 20 Raspberry Pi add-ons
MoPi
Power your Pi from any portable source
£25, www.pimoroni.com away. Two default profiles are
The Pi’s small size suggests it’s built in, one for non-rechargeable
perfect for portable use, but it batteries and another for eight
needs a power supply. Any NiMH AA rechargeables. (You’ll
portable battery designed to need to supply your own battery
charge a smartphone over USB holder – expect to pay £3-4 for
can be used with the Pi, or you one that holds eight batteries,
could look at Pi Supply’s PiJuice and make sure it has a PP3 clip
Standard (£25, www.pi-supply. to plug into the connector
com). Or, for maximum flexibility, supplied with the MoPi.)
consider the MoPi. It plugs into How much charge you get
the GPIO header, but requires from your batteries depends on
only four pins and can be used their load and capacity: aim for
together with other GPIO- at least 2,000mAh per battery,
connected add-ons if you choose which should give you up to ten
the Stackable version. Wire it up hours use between charges even
to any suitable power source – with several connected add-ons.
one capable of at least 6.2V The MoPi also provides an on-off
under load – and after a bit of switch and can cleanly shut
configuration with the aid of the down your Pi when the battery
excellent https://pi.gate.ac.uk/ level drops to critical, ensuring
pages/mopi.html website you’re you don’t mess anything up.
7-inch touch
screen display
Turn your Pi into a tablet
£60, cpc.farnell.com it with the SmartPi Touch Case
The Pi’s official touchscreen has (£18, pimoroni.com), which
an 800x480 display and 10-point tucks your Pi away behind the
capacitive touchscreen; install a screen and provides access to all
third-party on-screen keyboard key connections, including the
app such as Florence and you camera and display cable. The
can ditch the keyboard too. case also comes with a LEGO-
Power is supplied from your Pi compatible camera case that
through the connector, which can be attached to the main
plugs into the Pi’s DSI display case – perfect for using the
port – we recommend using the camera as a webcam.
newer 5.1V/2.5A power adapter Also consider: Want a higher-
to ensure the Pi and screen get res display? ModMyPi offers the
all the juice they need. Pair it Wareshare 10.1-inch 1024x600
with the MoPi (above) to provide touchscreen with case for £90,
power on the move. but it requires cables to connect
You could turn your Pi into a to a Pi’s HDMI port (display) and
compact desktop unit if you pair one USB port (touch support).
38 // // Winter 2016
Raspberry Pi add-ons TOP 20
LCD Control
Case Bundle
A case with a 3.2-inch touchscreen
From £26, http://shop. in a remote control project and
sb-components.co.uk want an attractive but accessible
Want an embedded display but screen for interacting with. The
not a full 7-inch touchscreen? case also ensures that the micro
This case (available in black, switches are accessible through
blue or transparent) for Pi Model a series of tiny holes, which you
B+, 2 or 3 has a 3.2-inch TFT can get at using something like
touchscreen, which connects a paperclip.
to your Pi via the GPIO port to The Bundle also handily
provide touch and a 320x240 includes a power adapter and
pixel display. There are also USB Wi-Fi adapter if you need
three microswitches at the them, plus an 8GB microSD card
bottom, which you can program containing a modified version of
as you see fit. Raspbian. This works “out of the
Your Pi fits snugly into the box” with the touchscreen,
bottom of the case, which can meaning you simply pop it in,
even be wall mounted, making it boot up and can immediately
a good choice if you’re using a Pi start using the screen.
Adafruit 16x2
LCD & Keypad
Send simple messages from your Pi
£26, www.pimoroni.com your Pi has four USB ports, you’ll
Adafruit’s two-line LCD, available need to place electrical tape
in positive and negative versions over these and any resistors to
with RGB backlight, can display prevent direct contact with the
either a single message or one LCD and Keypad.
that scrolls to show longer ones. Also consider: the Micro Dot
The plate also has a four-way pHAT (£22, thepihut.com) offers
keypad and select button, so you six LED matrices (red or green)
can interact with the Pi using the plus a decimal point. It’s meant
standard I2C protocol (Adafruit for the Pi Zero but will work with
includes several Python libraries any Pi. Even more basic, the
you can tap into). The board Blinkt! (£5, thepihut.com) offers
plugs into the GPIO port to sit on eight multi-colour RGB LED
top of your Pi for easy access – indicators that are individually
it uses just two pins, both of controllable and dimmable,
which can be shared with other allowing them to flash on and off,
I2C devices, leaving the other pulse, etc. Useful to talk with
pins free for other uses. Note: if your Pi in Morse code, maybe?
Winter 2016 // // 39
TOP 20 Raspberry Pi add-ons
Pi Camera
Module v2.1
The official high-res camera add-on
£21, http://cpc.farnell.com and get the special cable that
The official Pi Camera Module plugs into the Pi Zero’s smaller
packs an 8-megapixel Sony connector (around £4).
sensor that’s also capable of The camera is supported by
shooting HD video, making it an extensive Python library for
suitable for anything from time- programmers, and all you need
lapse photography to webcam or to do is enable it via the Raspi-
home security use. Just add the config utility.
right case and software. Also consider: Pimoroni stocks
There’s one choice to make: a lens set (£8) with fish-eye,
the standard daytime version, or wide angle and macro lenses,
the NoIR model for use at night complete with clip for attaching
with suitable infra-red lighting? them to the Pi camera module.
The camera connects to a ModMyPi offers a mini camera
special connector on the Pi via a stand with magnetic lens plate
ribbon cable – for Pi Zero, make and a choice of lens (including
sure it’s the newer Pi Zero v1.3 telephoto and super fisheye) to
with camera connector built-in, securely clip on it for £9.
10
Skywriter HAT
This clever add-on enables you to control
your Pi using a series of gestures and taps
£16 www.pimoroni.com and double-tap, giving you a
Imagine holding your audience’s wide range of control options.
attention with a wave of your So controlling your Pi using a
hand or a flick of the wrist as you wand while yelling “Expelliamus!”
take control of your Pi. That’s the sounds cool, but what practical
magic behind the Skywriter HAT, projects could you use the
which enables you to control Skywriter HAT for? How about
your Pi by performing a series gesturing your way through a
of hand gestures over the top of LibreOffice presentation? Or
the HAT from up to 5cm away. making sweet music using the
It works using an electrical synth.py script that’s included
near-field that circulates around as part of the HAT’s Python API?
the surface of the Skywriter in You could even experiment with
3D. When you move your hand using it as a touchpad, although
through this field, the HAT’s its lack of precision may leave
Python API is able to measure you frustrated.
the disruption and respond as Also consider: Skywriter (£20,
programmed. It’s capable of pimoroni.com). This is the big
reading positional data in three brother to the Skywriter HAT,
dimensions along with common and allows you to gesture up to
gestures such as flick left, tap 15cm away from its surface.
40 // // Winter 2016
Raspberry Pi add-ons TOP 20
11
Pi PoE Switch
HAT
Power your Pi from a network port
£30, www.pi-supply.com The switch needs to support the
Need power plus network access 802.3af PoE protocol, and most
for controlling a project remotely don’t. In this case you’ll need to
or retrieving the data it collects? add a PoE injector, which needs
A PoE Switch HAT provides both to sit next to your switch and a
power and a network connection power socket. One is TP-Link’s
from up to 100 metres away TL-POE150S (£20, PC World),
using a standard Ethernet cable. which can provide up to 13W.
If you need to protect the unit, Also consider: The Pi PoE
search for “Pi weatherproof Switch Hat works with the Pi
case” to find some designs you Model B+, 2 or 3 – if you have a
can make using a 3D printer, or Model B, then visit www.xtronix.
if the unit’s staying in the dry, co.uk/raspberry-pi-poe.htm for
check out the PoE Switch HAT details of a compatible model. Pi
Case (£8, www.modmypi.com). Zero users will have to fashion
One more thing: you can’t just their own solution – see https://
plug into your router or switch hackaday.io/project/9455 for
and expect it to provide power. one example.
12
Picade
Create your own arcade machine
powered by your Raspberry Pi!
£180, www.pimoroni.com enough for retro gaming), stereo
The Raspberry Pi – in particular speakers, joystick and 12 micro-
the Pi 2 or Pi 3 – is more than switched arcade buttons. It’s a
capable of running the most DIY job – allow up to three hours
demanding games from decades to put it all together, but there’s
gone by. Fire up the RetroPie no soldering involved and the
gaming emulator and you can result has an authentic feel
relive past gaming glories from thanks to the black powder-
various computers and consoles coated MDF and Perspex.
from the ’80s, ’90s and even the You also get the Picade PCB,
noughties. There’s also support which connects to the Pi via USB
for MAME, which emulates and converts the joystick and
thousands of old arcade games. buttons (which are wired via the
All you need to do is supply your terminal contacts) into keyboard
own game controller (see the presses. It also provides a 3W
final entry in this roundup). amplifier for your speakers.
But why not go the whole hog Also consider: Too pricey? £135
and emulate an arcade machine buys you the full cabinet without
in miniature? Enter the Picade, a screen, £90 just the console part
tabletop case with 8-inch screen (including joystick and buttons),
(800x600 resolution, more than and £22 the Picade PCB.
Winter 2016 // // 41
TOP 20 Raspberry Pi add-ons
13
Wi-Fi Adapter
and USB hub
Add more USB ports and Wi-Fi to Pi Zero
£10, www.pimoroni.com CPU load means little impact
The one shortcoming of the Pi on your Pi Zero’s performance.
Zero is its single microUSB port. There’s even a socket for an
What if you want to use a mouse, external power adapter – one
keyboard and Wi-Fi? One answer with a 2.5mm jack providing
is the Broadcom Wi-Fi Adapter 5V/2A power with a positive
and 2-port USB hub. centre contact will do the trick.
It plugs into your Pi’s USB Also consider: Want a discreet
port – for Pi Zero you’ll need a Wi-Fi adapter that plugs directly
microUSB to USB cable or the into the Pi Zero’s lone microUSB
£2 Shim you’ll find at most Pi port? The Pi Zero WiFi adapter
stockists. This makes it perfect (£8, www.modmypi.com) is a
for general use or just to get micro-sized USB dongle – no
your Pi Zero up and running need for any messy adapters or
before you switch to headless shims. It’s just 23mm long and
use. The Y-shaped hub has a fast requires no drivers but offers the
150Mbps Wi-Fi adapter plus two same fast 150Mbps (802.11n)
full-size USB ports, and its low speeds as the Broadcom.
14
Cluster HAT
Discover how to combine the power of four
Pi Zeroes with this clever little add-on
£28, www.clusterhat.com What you’ll discover is that
Cluster computing harnesses the four Pi Zeroes will work in
the power of multiple computers tandem with each other on the
to boost performance. The same task, effectively combining
Cluster HAT enables you to plug their individual capabilities
in up to four Pi Zeroes to use (including processor and RAM)
them as an array. It requires the to produce a faster computing
use of another Pi, which acts as experience. Climbers.net
the controller – the HAT plugs recorded a performance
into this, and then you mount increase of over 400% when the
your Pi Zeroes on the top using four Pi Zeroes were combined
USB. Power is supplied from the using the Cluster HAT, although
controller’s GPIO, and you can this is still less than half the
control its output to each of the performance of the Raspberry
Pi Zeroes independently. You Pi 3 acting alone. Still, this is a
will, however, need microSD cheap and effective way to start
cards for each individual Pi Zero, exploring the world of cluster
on to which specialised Raspbian computing, from teaching how
Jessie images will need to be it works to developing software
installed from the Cluster HAT that could then be ported to
website (click the Software link). more powerful clusters.
42 // // Winter 2016
Raspberry Pi add-ons TOP 20
15
ProtoZero
Give your latest project a more permanent
home by losing the breadboard
£5, www.pimoroni.com stage by giving you a board on
The Pi’s educational, hobbyist which you can solder your
and practical side is never better components permanently. It’s
expressed than in designing and designed to match the Pi Zero’s
building your own electronics form factor, and sits neatly on
projects. When it comes to top of the Pi Zero’s GPIO pins (a
testing your projects, you can’t female GPIO header is included,
beat a good breadboard, which but not fitted). Here you’ll also
enables you to connect wires find two rows of corresponding –
without soldering them, ensuring and clearly labelled – connector
you don’t make a costly or at holes for the GPIO pins. There’s
least time-consuming mistake also another 154 holes, split into
during prototyping. But at some logical lanes of three, into which
point you’ll want to move on you can solder your components
from your breadboard – you’ll on either side of the board, so
either want it for another project, you can hide wires. For more,
or its lack of portability will visit www.protoboards.co.uk.
become annoying as your wires Also consider: The ProtoPal
fall out for the umpteenth time. (£5, www.pimoroni.com) is the
The ProtoZero enables you to ProtoZero’s big brother, and the
take your prototype to the next shape and size of a regular HAT.
16
Zero4U
Add four full-size USB ports to your Pi Zero
£6.40, www.uugear.com and the four full-size USB 2.0
We’ve already looked at one way ports each sport a handy white
around the Pi Zero’s chronic lack LED activity indicator.
of ports: the Broadcom Wi-Fi It’s configured to provide up
Adapter and USB Hub. If you to 2,000mA of current across
want something that better the four USB ports, which is
integrates with the Pi Zero, or drawn from your power supply
you need even more USB ports, – if you want to connect the
then the Zero4U is your lifeline. Zero4U to a regular Pi model,
It matches the Pi Zero’s form then you’ll need a USB-mini USB
factor exactly, but is cleverly cable to interface the two.
designed to sit underneath it, so Note, there are two versions
the GPIO pins and other ports of the hub available: one for the
are left accessible (and usable) original (v1.2) Pi Zero, and the
at the top. Connecting the other for the newer v1.3 Pi Zero
Zero4U to the Pi Zero requires (with camera connector). Make
no soldering – instead, there are sure you get the right one!
four pogo pins on the back that UUGear also provides a Zero4U
line up with the +5V, GND, USB and Pi Zero case for just £3.20.
D+ and USB D- testing pad on Also consider: For larger Pi
the back of your Pi. Plastic models, try the seven-port USB
screws are supplied to secure it, hub (£15.40, www.uugear.com).
Winter 2016 // // 43
TOP 20 Raspberry Pi add-ons
17
DrumHAT &
PianoHAT
Turn your Pi into a music machine
Piano HAT £15, Drum HAT £12, The Drum HAT has eight
www.pimoroni.com capacitive sensor pads, each
The Piano HAT has 16 capacitive labelled with a specific drum and
touch buttons, 13 arranged as containing an LED that lights up
a single-octave keyboard, plus when the pad is tapped. You can
controls for moving up and down assign a sample to each pad
the octave range and switching (musical instruments, drums,
synthesised instrument. All 16 voices, whatever) or program
have LEDs you can program to them to call any functions you
light up when the key is pressed. like when tapped or released.
A beginner’s guide is on the Also consider: The Adafruit
Pimoroni website, plus a MIDI Capacitive Touch HAT (£15.50,
control option and a Python www.pimoroni.com) has 12
library, useful for running synths capacitive touch sensors you
like Yoshimi, SunVox, playing can connect to any conductive
music with Python or inputting object using alligator clips (not
sheet music via MuseScore. supplied) to respond to a touch.
18
4tronix Picon
Zero
A controller for your next robotics project
£13.30, www.4tronix.co.uk three-pin GVS connectors, which
This is an intelligent robotics plug into most devices. Power
controller, which means there’s a can come either from your Pi
built-in process to handle all the or via separate adapters, and
direct communication between a a dedicated socket supports the
robot’s input and output devices. optional HC-SR04 ultrasonic
It uses the I2C interface, leaving sensor, for avoiding obstacles.
all the GPIO pins free, and comes There’s an extensive Python
with two H-Bridge motor drivers, library, with ScratchGPIO
giving you forward and reverse, support also promised. It plugs
plus variable speed controls. into any Pi that has the now-
The four general purpose inputs standard 40-pin GPIO header.
support digital, analogue or a Also consider: MotoZero (£10,
DS18B20 temperature sensor. www.thepihut.com) is great for
Up to six outputs are provided, motor control – you can connect
supporting digital, PWM, servo up to four, and it’s Pi Zero size.
and WS2812 (Neopixels). Both Unlike the Picon Zero, it requires
input and outputs use standard some soldering during assembly.
44 // // Winter 2016
Raspberry Pi add-ons TOP 20
19
OSMC PiDrive
Create a media centre with its own storage
$80, www.modmypi.com less power than other WD drives.
Like to turn your Pi into a media It’s based on the WD Blue slim
centre, capable of streaming and drive, a 7mm high 2.5-inch drive.
playing both local and remotely The case comes with a 3A power
stored video, music and photos? supply to power both your Pi and
The perfect operating system to the drive from a single plug
use is OSMC (www.osmc.tv), a socket, OSMC preloaded on an
specially designed version of 8GB microSD card, mounting
renowned media centre Kodi media and a single power/data
(www.kodi.tv) optimised for the cable that connects the Pi and
Pi, and this PiDrive Kit should drive, as well as linking them to
appeal to anyone looking for a the 3A power supply.
single place to both store and Also consider: The 314GB drive
stream their media. is available separately for under
The OSMC PiDrive Kit is a £30 (http://wdlabs.wd.com), or
case designed to house both £70 buys you the newer 1TB WD
your Pi and the supplied 314GB PiDrive Kit if you need additional
Western Digital PiDrive, on which storage. Note, this is 9.5mm high
you’ll store all your media files. and comes with the WD PiDrive
The PiDrive has been designed Enclosure and stand for housing
to work more efficiently with the your Pi and the drive, plus all
Pi than standard drives, drawing required cables.
20
Pi compatible
USB Gamepad
Add a new dimension to your gaming
£7, www.modmypi.com cable means you don’t have to
Not sold on the idea of building a hunch up next to the screen in
full-blown arcade cabinet? Then order to immerse yourself in a
how about this KXD-branded gaming experience guaranteed
gamepad? It follows the classic to take you on a nostalgia trip.
design with two analogue mini One final point: if you already
joysticks and a traditional D-pad, have a Windows analogue
which offers eight-way direction. controller, you might find it’s
It has the full gamut of trigger already compatible with RetroPie
buttons, from the X, Y, A and B – plug it in and give a whirl first.
buttons on the top to the dual Also consider: Want to go even
left and right shoulder buttons, more old-school? Check out the
plus Start and Select buttons, SNES style USB gamepad (£4,
giving you plenty of options www.modmypi.com). It has a
during your gaming. traditional four-way D-pad, four
The gamepad should work trigger buttons and Start and
with any emulator – it’s plug and Select, so will suit most games
play with RetroPie – and a 1.4m from the mid-’90s and before.
Winter 2016 // // 45
Helping you live better & work smarter
www.lifehacker.co.uk
twitter.com/lifehackeruk facebook.com/lifehackeruk
Pi PROJECTS
Put your Pi to use – we show you how, step-by-step!
54
48 59
69
54 Recreate the
Enigma machine
59 Build your
own drone
64 Set up a cloud
data server
69 Build your
first robot
72 75 78 72 Master the Pi
Camera Module
75 Make speakers
Wi-Fi-enabled
78 Enjoy internet
radio on the Pi
September 2016 // // 47
Winter 2016 // // 47
The SenseHAT
was used in the
Astro Pi project
on the ISS.
A
lthough the Raspberry Pi is a powerful Top) are hardware devices which, as the name
miniature computer, it’s only as suggests, can be connected easily onto the top
effective as the data feeding it. Many of a Raspberry Pi via its GPIO (General Purpose
of the projects available for the Pi are Input/Output) connector. The HATs are made
only software-based, meaning they to an exacting standard and so most will work
process inputs from the keyboard or mouse or straight out of the box.
data downloaded from the internet. The SenseHAT was originally designed for the
Using additional hardware, the Pi is capable of AstroPi Mission (more about this in a moment).
sensing a number of factors in your environment It comes bristling with a veritable Swiss Army knife
including the external temperature, the orientation of gadgets and sensors, including a gyroscope,
of the Pi, light levels and much more. accelerometer, magnetometer, thermometer,
There is virtually no limit to the applications barometer and humidity sensor. This makes it
for these. In this project, we will explore how to ideal for both budding astronauts and those
use the SenseHAT add-on for the Pi to sense the interested in more mundane projects.
ambient temperature and alert you via email if it The SenseHAT also contains a 8x8 LED matrix
is too cold or too hot. This can be extremely display and a five-button joystick for interfacing
useful for budding gardeners and we hope that projects. There are in fact two thermometers,
once you become familiar with the SenseHAT and one built into the humidity sensor and one built
programming in Python (which we’ll talk about into the barometer. For the purposes of this
shortly), you will take your coding further and project we will be using the default one built
create more exciting interfacing projects. into the humidity sensor.
In order to proceed, you’ll need a Raspberry Pi The SenseHAT is currently available from
Model 2 or 3 with the latest version of Raspbian the Pi Hut website for £30 including shipping
installed. You might also wish to invest in a to mainland UK. See https://thepihut.com/
SenseHAT, although as we’ll see it is possible products/raspberry-pi-sense-hat-astro-pi for
to get going without one... more details. If you simply want to learn more
about interfacing hardware and coding, the Pi also
Enter the SenseHAT has a SenseHAT Emulator (more on this shortly).
The SenseHAT is quite simply an add on board for Two AstroPi computers, which are quite simply
the Raspberry Pi. HATs (Hardware Attached On Raspberry Pis with SenseHATs attached in a
48 // // Winter 2016
SenseHAT PROJECT
The SenseHAT
clips neatly into
your Pi’s GPIO
port to extend its
functionality.
special 3D-printed case, were flown to the SenseHAT isn’t useful just for investigating the
International Space Station in December 2015. question of life on Mars. Indeed, when taking your
Pi bites
They formed part of British astronaut Tim Peake’s first steps with projects like these, you don’t even For a full list of
mission, codenamed “Principia”. They took need to buy any hardware beyond the Pi itself. the experiments
advantage of the huge range of data the AstroPi run by Tim Peake
can gather, and combined with the radiation and The amazing Emulator and his colleagues
on the ISS,
weightlessness of space allowed for experiments The latest version of Raspbian comes with a see https://
that cannot be performed on Earth. SenseHAT emulator, which can be launched from principia.org.uk/
Students from all across the UK took part in a Menu > Programming > SenseHAT Emulator. The the-mission/
competition and suggested various experiments to emulator will provide input in exactly the same way experiments-in-
space/
Tim, which he then performed inside the European as the real thing, except that you control elements
Columbus module, making the results available for like temperature, humidity and the joystick using
earth dwellers. See page 114 for more details. on-screen slider bars and buttons.
To date only a small number of experiments Given the low cost of the SenseHAT, you may
have been run but fortunately the AstroPi’s wonder what use the emulator is, considering
Winter 2016 // // 49
PROJECT SenseHAT
If you use email make sure to choose a distinctive name for your email alert account, like “Greenhouse A”. This will avoid confusion later on.
that you can just plug in the real thing and execute Environment). This enables you to quickly
your code. In the first instance, if you have very generate and execute your own Python scripts.
specific requirements and are not sure whether When using the Python IDLE program on the Pi,
the SenseHAT is right for you, the emulator gives whenever you create a new project it will
you a chance to “test drive” any code you’ve made. automatically be saved in your home folder.
The emulator is also particularly useful when you Make sure to save it with a meaningful name.
test a number of different projects. It also allows While Python is by no means the only
easy sharing of any Python scripts you create programming language out there, it is arguably
through social media or over the web. one of the easiest for beginners to master. There’s
Pi bites Any code you write for the emulator can be also a huge amount of information available on the
The Emulator adapted for an actual SenseHAT by editing the Raspberry Pi website and elsewhere to help get
program has first line of code (see “Sensory overload” on the you started in Python.
some helpful opposite page for more information this). For the There is no real limit to what Python can do, and
examples of code purposes of this project, use the Temperature you’ll find that many Raspberry Pi projects have
for Beginner,
Intermediate and
slider to increase or decrease the temperature to been built using this language. If you have specific
Advanced users. test that your script works. requirements for your projects such as your Pi
Simply go to File > sending a tweet when your greenhouse becomes
Open Example to Pithy Python too warm, you can visit the main website’s oddly
get started.
The language used in the sample scripts is Python named “Cheese Shop” (http://pypi.python.org/
– specifically Python v 3.4.2. This distinction is pypi?%3Aaction=index) to check that what you
important as different versions of Python can use want is possible.
different syntaxes and commands. Even though it’s very easy to learn Python
Python is the language of choice to interact terms, you should pay very careful attention to
with the SenseHAT and is one of many supported capitalisation of words and spacing as some
programming languages on the Pi through Python Python scripts may not recognise commands
IDLE (Integrated Development and Learning without the proper lettering and/or indent.
50 // // Winter 2016
SenseHAT PROJECT
The AstroPi’s
heavenly body. 3D
blueprints for the
casing are available
on the Astro Pi
Mission’s website,
https://astro-pi.org
Temperate timing
By default the supplied scripts are designed to
run only once. This can be a problem if you want
the Pi to continuously measure a value such as
the ambient temperature.
The solution is the handy tool Cron, which is
built into your Pi. It’s used to schedule tasks and
can be told to execute a script at certain times. command, you may be asked to choose an Editor. The emulator
For a full rundown of what Cron can do, we suggest Choose Option 2 to use the simplest version. enables you
reading the Raspberry Pi documentation at Press Ctrl + X, then Y, then Return to save and to adjust the
https://www.raspberrypi.org/documentation/ exit. You can double-check scheduled jobs by environment
linux/usage/cron.md. In brief, however, Cron is running the command crontab -l using buttons and
slider switches.
one way to have a script continuously check a If you want your “sensor” script to run
The sample
value. The basic format of Cron is: continuously, for example because you wish to code pictured
minute hour day of month month day of the use the LED display to show the temperature, then is to change the
week command instead of using Cron you can simply modify the SenseHAT’s LED
An asterisk must be used in place of any of Python code. Simply add the following: colours in line
these values that you are not using in a particular while True: with temperature.
case. If for instance you wished to execute the to the line directly above the first if to make the
script “myscript.py” in your Pi’s home folder at script run constantly.
midnight every night, the format would be: You can find examples of code which will light
0 0 * * * python3 /home/pi/myscript.py LEDs in response to temperature in both the Pi bites
This is particularly handy if you’re using email Emulator examples and in the SenseHAT
The Python
to send out alerts to avoid your mailbox being documentation on the Raspberry Pi website – website has
flooded with messages every few seconds. https://www.raspberrypi.org/learning/getting- some excellent
In order to set up a Cron job, open Terminal on started-with-the-sense-hat/worksheet/. tutorials for first-
your Pi or connect via SSH and run the command: timers at http://
crontab -e Sensory overload wiki.python.
org/moin/
Scroll to the very bottom of the text and paste The code you have seen in this tutorial is a very BeginnersGuide/
your job (say the midnight script example we’ve tiny slice of the Pi’s potential to use Python and Programmers
just looked at). The first time you run the crontab the SenseHAT, and should be seen as inspiration
Winter 2016 // // 51
PROJECT SenseHAT
52 // // Winter 2016
The home of technology
techradar.com
Make an amazing
Enigma machine
Nate Drake explores how to crack the code and set up an authentic version
of the Enigma cipher machine used by the German military during WW2
S
ome people thought we were at war the Raspberry Pi as well as how to configure the
with the Germans. Incorrect. We were Enigma machine in a way similar to the operators
at war with the clock. These words in World War II. We will also explore the workings of
were attributed to Alan Turing, as Enigma devices in order to understand how the Pi
played by Benedict Cumberbatch in will encode your messages.
the 2014 film The Imitation Game. Turing was
referring to the Enigma machine, which was being Enigmatic myths
used by the Germans to encode military radio The Enigma machine was invented sometime
messages during World War 2 and to date had after World War I, although its inventor, German
proved near impossible for the Allies to crack. engineer Arthur Scherbius, initially saw only
In technical terms Enigma machines were lacklustre interest from private companies.
what’s known as “electro-mechanical rotor cipher With the outbreak of World War II the military
machines”. They resembled large typewriters. An of several countries started taking an interest in
operator would configure the machine according the machine and began adapting it by beefing up
to pre-agreed settings and encode a message its security. So it’s misleading to talk about “the
using the keyboard. For each letter that was Enigma machine” – there are several. Indeed, just
pressed, the mechanical parts would complete as different countries adapted Enigma to their
A four-rotor
an electric circuit. The corresponding encoded needs, different military departments within
Enigma machine.
Different letter would then light up on the machine. Each Germany used variations of the machine too.
machines were key press shuffles at least one rotor one place The py-enigma library is capable of emulating
used by different forward, meaning that the same letter is never the German Heer (Army) and Luftwaffe (Air Force)
encoded the same way twice. Enigma machines by default. It’s also capable of
Image credit: Greg Goebel, Public Domain
branches of the
German military. Thanks to programmer Brian Neal’s py-enigma emulating the Kriegsmarine (Naval) Enigma, which
library, it is now possible to reproduce the machine had a more sophisticated design. For the purposes
exactly using the programming language Python. of this project we are going to concentrate on the
The Raspberry Pi is perfect for running as an simplest implementation of Enigma used by the
Enigma machine, thanks to the fact that it Army and Air Force.
supports Python and has an excellent hardware Another common misconception about Enigma
random number generator. In this project we will is that it was singlehandedly cracked by the code-
explore how to download the py-enigma library to breakers of Bletchley Park. It was in fact initially
54 // // Winter 2016
Enigma coding machine PROJECT
ENIGMA ENCRYPTION
To encode messages you’ll first need to $ sudo python pyenigma.py --key-file /home/pi/
navigate to where the handy enigma keyfile.key --start='APJ' --day=29
command line program is stored. Connect --text='UVXUVX'.
broken by a Polish Cryptographer Marian Rejewski. when pressed completed an electrical circuit
Rejewski designed the first clockwork “bombe” which would light up the encoded letter. For
Pi bites
machines which were used to test various Enigma example, when encrypting a message starting A working replica
settings and crack the code. This represented a WET..., the operator would first press the W key, of the Turing-
huge leap forward as the Polish previously had had and the Z lamp might light up, so Z would be the Welchman Bombe
to resort to perforated cardboard sheets known as first letter of the “ciphertext”. The operator would is at the Bletchley
Park Museum.
“Zygalski sheets” to try various permutations. then press E and note down the ciphertext letter, For a video of
Alan Turing designed a number of more and so on. it in action, see
sophisticated versions of the Polish Cipher http://bit.ly/
Bureau’s bombe, which, as depicted in The Anatomy of Enigma Turing-bombe.
Imitation Game, worked in combination with a Each key press would turn at least one of the
“crib” – some known text in a message, such as rotors once. The rotors formed the core of the
the word “Wetter” (weather), which could be used powerful code behind Enigma. Operators would
to decode German messages. place three rotors out of a possible five on a
The Enigma Machine used by the Army and Air spindle inside the machine. Each rotor had 26
Force consisted of several parts. The keyboard electrical contact pins on one side to represent
Monument to
Marian Rejewski
in Bydgoszcz,
Poland. Note
the ornamental
Enigma machine
next to him.
Image credit: Wojsyl, CC BY-SA 3.0
Winter 2016 // // 55
Image credit: RadioFan, CC BY-SA 3.0
Enigma rotor each of the letters of the alphabet, and the rotors, which would hugely increase the encryption
detail on display rotors were labelled using Roman numerals from strength of the message.
at the National I to V so they were easy to tell apart. When placed One final feature of the Enigma was the
Cryptology “Umkehrwalze” (reflector). The reflector could not
in an Enigma, each rotor can be set to one of 26
Museum. The
possible positions. This was known as the be easily changed but as the name suggested
internal wiring
for each separate
“Ringstellung” (literally the “ring setting”) and made sure that the encryption and decryption
rotor, for example allowed one letter to be encoded as another. process were the same. This meant that two
Rotor V, was By itself a single rotor would offer little operators who had set up their Enigmas with the
the same from protection for your message. It would be set up in same settings could easily encode and decode
machine to such a way that for example when you press the each other’s messages. One drawback of the
machine. letter A, it would complete a circuit so that the reflector is that a letter could never be encoded as
letter T would light up on the Enigma. The letter B itself, which is a weakness the Allies exploited.
might be Q, and so on. This is a simple substitution
alphabet and it could be broken very easily simply Enigma operators
by examining the most common letters to work Enigma operators were handed a “key sheet” by
out, which are E, T, A and so on, until the rest of the an officer containing the Enigma settings for that
message could be deciphered. day. First the choice and positioning of the rotors
The cunning of Enigma was achieved through would be listed – for example, IV, V and I. Next
using multiple rotors. Each of the rotors had would be the initial position of the rotors either
notches at different points along the alphabet as letters or as numbers – say “A F P” or “1 6 16”.
ring. This resulted in a different substitution The plugboard settings would follow. The Enigma
alphabet being used as the rotors turned. The machine allowed for up to 13 pairings, but the
Pi bites rotor on the extreme right would move one letter Army standard was 10.
forward each time a key was pressed and the Finally the “Kenngruppen” would be listed.
Image credit : Tony Sale, http://www.codesandciphers.org.uk
Programmer
Louise Dade’s others less frequently, depending on the rotor These were a series of letters that allowed
website has an settings. Provided that a message was short operators to identify on which particular day the
excellent key book enough, the word “Deutschland” for instance message was sent. This is one area where the
generator which
will create a PDF
could be encoded any number of ways in the same py-enigma library on the Pi diverges from the
of random key message, making it near impossible to crack. original Enigma machine as its key sheets simply
settings for up Allied attempts at breaking the code were place the numbered day of the month at the start.
to 40 days. See frustrated even further by the “Steckerbrett” See The Key to Enigma opposite for more.
http://enigma.
(plugboard), which was positioned at the front of
louisedade.co.uk/
dailykeys.html the machine below the keys. Letters were wired
together in pairs through cables before the text
was encoded. For instance the letter F could be
paired with the letter J. Having “steckered” pairs
of letters such as these would mean that each Example of a daily key sheet. For security reasons, officers
time the letter F was pressed, the signal would be would often tear a strip off the sheet to give operators the
diverted to the letter J before going through the settings for that day only.
56 // // Winter 2016
Enigma coding machine PROJECT
Winter 2016 // // 57
PROJECT Enigma coding machine
58 // // Winter 2016
Build your own drone
Linux is at the heart of commercial drones, which means that with the right
kit and know-how you can build your own. Alastair Jennings explains how
Q
What you need uadcopters (drones) used to take The big turning point in drone design was the
hours of practice to master because addition of small processors on-board that were
z Raspberry Pi even the simplest manoeuvres, such able to stabilise flight and implement advance
Zero as takeoff and landing, could prove features, such as auto-braking, takeoff and
difficult. Learning to fly one took time landing. These enabled the pilot to get on with
z Erle Robotics
PXF Mini
and ultimately determination, and before you even having fun rather than worrying about the
took to the skies there was the small matter of mechanics and programming.
z Erle Robotics constructing one. As commercial drones have increased in
PXF Mini Power Now that there’s a good selection of pre-built popularity and become more widespread, so have
Module
and programmed drones on the market, you can the open hardware and software communities. The
z HobbyKing go into major High Street retailers and buy one off latest open source drones are challenging their
Spec FPV250 the shelf. Drones such as the 3DR SOLO, Parrot more expensive rivals with advanced features,
Bebop and DJI Phantom have revolutionised the such as object avoidance and GPS navigation.
z 100mm male market, and slowly there are drones appearing This challenge to the commercial models is no
to male servo
cable
with advanced flight features that make flying real surprise and you don’t have to look too far into
and controlling a drone much easier. the DIY drone community to find out that many of
z FlySky-i6 the main manufacturers are extremely active in
controller the open source world and regularly contribute
advice and support to those wishing to build their
z Edimax AC
EW-7811UAC
z RC XT-60
connectors
WARNING!
This project is suitable only for those aged 18 or over.
Piloting any drone is a dangerous and skilled task. Please
seek suitable guidance and training before attempting to
do so. Be aware there are serious legal consequences for
failing to follow UK Civil Aviation Authority guidelines (see
these at www.caa.co.uk).
Winter 2016 // // 59
PROJECT Build your own drone
OF THE SMALL SIZE OF THE BOARD can connect a keyboard, mouse and Wi-Fi dongle.
You’ll actually end up with two 40-pin
connectors if you buy this kit because, as it
The motors
might seem
small but they’re
powerful. It’s
best to leave
the propellers
off until the
last moment.
60 // // Winter 2016
happens, there’s one included with the PXFMini, the drone itself. There are many basic kits Each motor
but it’s worth paying £8 for the other connectors available, and they’re straightforward to use. is controlled
along with the Pi Zero. We ordered our Pi Zero from We’ve gone for a HobbyKing Spec FPV250. by a separate
https://shop.pimoroni.com. Most of the small kits include all the basics, electronic speed
Soldering in the pins can be a bit of a challenge with a simple bolted-together frame, four small controller (ESC).
due to the small size of the board, and you must electronic speed controllers (ESC), and brushless
also make sure that the pins have enough length motors along with a battery.
above the board to interface with the PXFMini. The main components and electronics all need
The easiest way to do this is to use some Blu- to be taped and zip-tied to the frame, with only
Tack (or a similar removable adhesive product). the motors requiring screws. At this point, it’s well
We also found that sanding the pins with a bit of worth leaving the propellers off until the drone is
Wet and Dry or fine emery cloth, as you prefer, just correctly configured.
helps the solder to stick. As you put the drone together there are a
To prepare the board, place the GPIO pins into couple of key points. The PXFMini should be
the Pi Zero and turn the board over so that you can mounted with its connectors facing towards the
see the pins coming through the board. Put it on front of the craft; these pins are used to connect
the table so that it’s at about a 45 degree angle the ESC and the receiver if you’re using an RC unit.
and use a bit of Blu-Tack to secure. Between the Pi Zero and frame, it’s essential
Now push the pins so that there’s only a small that you add a section of foam to provide a bit of
portion – a maximum of 1mm – appearing through insulation from the vibration of the motors and to
the board, and use Blu-Tack to secure the position ensure that the PXFMini is level. A few additional
of the pins at one end of the board. The Blu-Tack extras that you’ll need during this part of the build
needs to be positioned on pins that we’re not are one male-to-male servo extension and four
soldering at first; then
once one end of the pins is
soldered and secured we can
remove the Blu-Tack and
finish the job. If the Blu-Tack
gets hot then it will burn and
become difficult to remove.
You’ll need to solder all the
pins and make sure that you
avoid any dry solders. A fine-
tipped soldering iron with a
new tip will make your life
Check that all
easier if you’re not used
wires are secure
to soldering.
and that all
Drone building
motors react to
commands from
Once you have the two boards the transmitter
connected, you can make a before attaching
start on the construction of the propellers.
Winter 2016 // // 61
PROJECT Build your own drone
Four speed
The Pi Zero can only read the
controllers
FAT32 file system, so before you
adjust the lift
and direction of
continue make sure you have
the drone. formatted your card correctly and
not used exFAT. With the OS
downloaded and the microSD card
ready, open a Terminal and type
df -h to check the disks attached
to your computer.
In order to flash the MicroSD
card with the latest OS Image,
you’ll need to unmount the card.
If your card is 32GB or more in
capacity, you’ll see that the disk
has two partitions, so make sure
you eject both. Type in:
umount /dev/disk2s1
Now to flash the OS to the card,
make sure that the file you have
downloaded has not yet been
uncompressed and type in the
following command (the initial
zcat command first decompresses
the disk image; change /Path/to/
male and female RC XT60 LiPo connectors. At the image/ to your desired destination directory):
moment the two boards are empty of commands sudo zcat /Path/to/image/PXFmini.img.gz | sudo dd
and before they can be used to control the of=/dev/disk bs=8M
drone they need to be flashed with an OS. This OS, The flashing process can take some time as the
as with all Raspberry Pi boards, is held on an SD uncompressed file is well over 7GB.
card – a MicroSD card in this case – which can Once the process is complete, eject the card
be quickly installed into the back of the Pi Zero. from your computer and install it into the Pi Zero.
The Pi must now be connected to a monitor,
Flashing the Pi Zero keyboard and mouse to finish the installation
The OS needed for the drone and for use with process. After the Pi boots, you’ll see the basic
the Pi Zero and PXFMini autopilot system has been Erle Robotics splash screen and a bar of Icons
pre-compiled by Erle Robotics and is based on showing the different Vehicle projects that the
Debian. As long as you purchased the board board can be used with.
directly from them, the company will email Click the Erle Copter picture and the screen
through a link to the latest version of the OS. If not, will disappear and the board will reboot. Leave
it’s possible to compile it yourself, although this the Pi Zero to run through the boot sequence
will be a more advanced task and might prove and this time rather than loading a graphical user
challenging if you’re new to such things. interface, the board will boot to a command line
62 // // Winter 2016
showing that the installation has completed and Robotics at 55 euros. You’ll need to make sure If there’s
the board can be unplugged. that your machine has a 5GHz compatible Wi-Fi one thing more
At this point the drone should be ready for device in order to get things to work properly. satisfying than
its first flight test. To get it to fly you’ll need to Once connected you can download and install AMP flying a drone, it’s
flying a drone you
connect it to some type of control device such as Planner from http://ardupilot.org and run through
built yourself.
a radio control, Bluetooth or Wi-Fi with ROS the calibration and setup process in order to get
(Robot Operating System). You do need to take your drone to work correctly.
into consideration that this is an open hardware
project and the components that we’ll be using will
be different from those used by Erle Robotics. For
ONCE YOU CONNECT EVERYTHING
complete ease, we’ve opted for the traditional IT SHOULD ALL WORK, WITH SOME
radio-controlled option and used a FLYSKY FS-i6
with the new FS-iA6B receiver, which we located at FINE-TUNING OF THE CONTROLS
Maplin for £50. The important factor here is that
the receiver is of the PPM type mentioned earlier.
PPM enables several servos – or in this case
several ESC – to be connected to one port and
controlled individually. This works in just the same
way as traditional servos would, with an individual
port in the receiver for each. This cuts down on the
amount of wires needed but more importantly it’s
the hardware required by the PXFMini in order to
interface with the controller. Once you’ve
connected everything it should work as described
here, although you may find that some fine-tuning
of the transmitter controls is needed.
The Pi Zero doesn’t feature the ability to
network over the USB ports, so a Wi-Fi dongle
is required in order to connect to your machine.
We’ve used a dongle bought directly from Erle
Winter 2016 // // 63
Set up a Raspberry
Pi as a private server
Nate Drake shows you how to set up your own free Dropbox-style cloud
service on the Raspberry Pi to securely store and share your data
D
ropbox, Google Drive and iCloud are like its predecessor ownCloud, strongly matches
just a few of the myriad of online the functions of services like Dropbox and Google
data storage and file transfer services Drive in allowing you to sync data, collaborate on
available. The days are long gone when documents and share files.
you stored your data on one computer However, Nextcloud’s software can be installed
and hoped for the best. Even backing up your on a private server, leaving you in control of your
precious files to an external hard drive, which at data, without having to pay monthly or annually
least protects to some extent against the risk of for storage space. Apps can be used to expand
data corruption or hardware failure affecting your Nextcloud’s functions to include calendars, editing
computer’s hard disk, doesn’t cut it any more. documents and much more.
Now you can back up your data and share files The Raspberry Pi is a perfect candidate for
with others via “the cloud”. Nextcloud’s software because it uses very little
The terminology is romantic but imprecise. All it power when run around the clock like a web server.
means is that the servers on which you store your For this project we will go through the preparations
stuff are accessed over an internet connection. you’ll need to ready the Pi for Nextcloud, then the
The dozens of “cloud storage” services out there steps to install the software itself.
each promise a certain amount of free space on
their servers in which to store your personal data. Nextcloud preparations
One of the most recent offerings is from Although installing the Nextcloud software itself is
Nextcloud, an open source fork of the ownCloud quite easy, you will need to prepare your Pi.
project which was started in April 2016. Nextcloud, In the first instance, it’s best to have a dedicated
Raspberry Pi to use with Nextcloud and for no
Anyone familiar other purpose. Considering that you’re relying on
with the layout it to keep your data safe, it’s unwise to risk any
of services like
other app interfering with the process.
Dropbox or
Google Drive
You’ll next need to set up a static IP address for
will be able to your Pi so that other devices can find it. The steps
use Nextcloud outlined in the tutorial are for a Pi that’s connected
right away. to your router via Ethernet cable. This is optional
but will result in a faster and more secure
64 // //Winter 2016
Nextcloud PROJECT
connection. If you want to use wireless, simply Once Nextcloud is up and running and you
substitute “wlan0” in place of “eth0” when navigate to your Admin page, you may see several
modifying your network configuration in Step 1 messages. None of them will stop you from using
of our guide on p68. Nextcloud right away to upload files and enable
Next you’ll need to decide on your database Apps (see over the page for more about these) but
type. If you plan to be the only person using it’s important to understand them. Some of them
Pi bites
Nextcloud, have only a few files and want a quick alert you to important security considerations, Be aware that
and easy setup, simply follow the steps outlined which you should give some serious thought to encryption is not
in our guide to use Nextcloud’s built in database and if necessary act upon before you begin using retrospective
software, which employs SQLite. If you want to Nextcloud and expose your personal data to risks – that is, it will
encrypt only new
make sure Nextcloud can handle larger files and/ that are entirely avoidable. files you place in
or multiple users, consider using a MySQL Nextcloud after
database by following the steps in Using MySQL Post-install tweaks it’s enabled. Log in
with Nextcloud over the page. The first message in red reads “Your data directory and log out again
after enabling
The next steps involve installing software on and your files are probably accessible from the
encryption to
your Pi to turn into a web server. In this case we Internet.” You can test whether or not this is true get started.
are using Apache, which is the most popular web by visiting http://192.168.1.118/nextcloud/data/
server software on the internet. yourusername/files/ to see a list of your files.
Once Nextcloud has been installed via the Naturally if you want to be able to access your
command line, you’ll be able to navigate to it in Nextcloud from outside your home network, this
your web browser to complete the setup process may be the way you want things. One way to make
using the handy Installation Wizard. sure that your data is safe, though, is to enable
server-side encryption, which will scramble data
Nextcloud clients inside your files, making them useless to anyone
The first message you’ll see after creating your who downloads them without your password.
account on Nextcloud is a link to download a Click on Files at the top left of the screen,
Nextcloud client for your mobile device or then Apps, then Not Enabled. Scroll down to the
computer. This is simply so that you can sync Encryption app and click Enable. Next click your
your files between your devices and the Pi. username at the top right of the screen and select
At the time of writing clients are available free Admin. Click the Encryption tab which has now
of charge for Windows, Mac and Linux. There’s also appeared in the left-hand menu. Tick the box
a free Android client in the Google Play Store. The marked Enable Server Side Encryption and read
iTunes App Store also has a Nextcloud client for the wordy disclaimer in red. Once you feel you’ve
iPhones, iPods and iPads priced around 85 pence. been duly warned, click on Enable Encryption.
Winter 2016 // // 65
PROJECT Nextcloud
66 // //Winter 2016
Nextcloud PROJECT
Winter 2016 // // 67
PROJECT Nextcloud
68 // //Winter 2016
Build your first
Pi-powered robot
Les Pounder runs through how to build a simple but elegant,
budget-busting custom robot for scaring the cat. Just because
R
obotics is an exciting way to introduce Building a robot chassis is a great activity and
people to programming but it can also the kit (mentioned above) comes with everything
be a little difficult sometimes for you need to get started. You will need to solder the
newcomers to get to grips with, as well red and black wires to the motor terminals – if you
as being expensive. Enabling someone can’t solder then now is a great time to learn from
to create an easy-to-build and cost-effective robot a friend or a local hackspace.
is a significant step in their learning. So in this With the chassis built, we now focus on the
project we’ll build our own robot and create a motor controller, which is an L298N H bridge
Python 3 library that enables anyone to control it. controller. An H bridge enables a motor to go
For this project you will need: any model of forwards and backwards. Our L298N has two
Raspberry Pi; Raspbian (www.raspberrypi.org/ outputs for our motors: the left side is served by
downloads), a Wi-Fi dongle and Pi connected to OUT1 and 2, the right by OUT3 and 4. Connect
your home router; a USB battery pack, a robot the wires from your motors to these terminals
chassis kit (http://bit.ly/LXF203_Robot_kit), an and ensure they are secure. Our AA battery pack
L298N motor controller (http://bit.ly/LXF203_ connects to +12V and GND terminal. We also
L298N); four AA batteries and some Blu-tack. need to connect one of the GND from our
REMOTE CONNECTION
We set up an SSH server on our Raspberry Pi at raspberry, and once logged in, any command
the start of this project, so now let’s use it to you enter will output on your Pi. Navigate to the
remotely control our robot. In Linux we can run directory where you saved the robot.py and test.
the ssh command from the terminal. To SSH into py files. To run the test code in the terminal type
our robot we need to know its IP address, which sudo python3 test.py . Press Return and the robot
we wrote down earlier, and the name of the user will come to life and perform the test sequence.
– typically pi for a Raspberry Pi. We then type the It works! But let’s open an interactive Python 3
following into a terminal to proceed: session and live code the robot with $ sudo
$ ssh pi@IP ADDRESS . python3 -i . We can now import the robot library
Replace IP ADDRESS with your Pi’s IP. You’ll be and run the same functions as per the test.py
prompted for the Pi password, which is typically file. To return to the terminal just press Ctrl+d.
Winter 2016 // // 69
PROJECT Build your own robot
SOLDERING
For this project we bought a robot chassis kit Cheap soldering iron sets can be bought
from eBay that included two DC motors. These for around £10, but it’s worth investing in
motors come assembled but require soldering something better than a very basic, bargain-
two wires to the terminals for power. Soldering basement model. The Antex XS25, available for
is an essential maker skill and it is really easy around £25, is a great starter to intermediate
to learn, though adult supervision is essential soldering iron. Soldering should be undertaken
for our younger would-be solders out there. in a spacious, well-ventilated room with a clear
There are many helpful YouTube tutorial videos, workspace. Soldering is great fun and your
but the best we’ve found is from Carrie Anne local hackspace/LUG can help you to learn in
Philbin (http://bit.ly/LXF203_Solder). a safe manner.
Raspberry Pi to the L298N GND terminal. On the another LXTerminal and type the following to get
Pi bites L298N we can see four pins marked IN1 to IN4. your IP address and write the address down:
Securing your These are inputs that we use to connect the $ hostname -I .
components L298N to our Raspberry Pi’s GPIO (General In the same terminal type the following to
to the chassis Purpose Input/Output) pins. launch the Python 3 editor with superuser powers:
is important, By turning a GPIO pin on or off we can trigger $ sudo idle3 &
otherwise your Pi
will be dragged
the input pins accordingly and control the motor We’ll start our code by importing two libraries. The
along by the robot. direction. We connected our inputs to the following first enables our code to talk to the GPIO pins on
We used Blu-tack GPIO pins: IN1 to 17, IN2 to 22, IN3 to 18 and IN4 our Pi while the second provides the time library:
but for a long- to 23. We used the Broadcom pin mapping, a import RPi.GPIO as GPIO
term project cable
standard set by the Raspberry Pi Foundation. import time
ties are better.
A great reference for the GPIO is http://pi. When using the GPIO pins we will refer to them
gadgetoid.com/pinout, which explains all you’ll using their Broadcom pin numbering and we must,
need to know about Broadcom pin mapping. in turn, configure our code to use those numbers
with GPIO.setmode(GPIO.BCM). Rather than refer
Software setup to each pin throughout our code we’ll create four
Boot your Raspberry Pi to the desktop and open a variables to store the GPIO pin connected to each
terminal – you can find the icon in the menu bar at of the inputs on the L298N:
the top left corner of the screen. In the LXTerminal fwdleft = 17
type the following and press Return to run: fwdright = 18
$ sudo raspi-config revleft = 22
Using the arrow keys, navigate to Advanced revright = 23
Options and press Return. In the Advanced menu In order to use each GPIO pin we need to
navigate to the SSH Server option, press Return instruct the code what each pin will be: an input
and in the new screen choose to Enable the SSH or output. As we will be sending current from the
server. Exit from the menus and reboot your GPIO pins they will be an output. So using a list,
Raspberry Pi. Reboot back to the desktop, open known in other languages as an array, and a for
The screw
terminals enable
connections
between the
batteries,
Raspberry Pi
and motors.
70 // // Winter 2016
loop, we shall iterate over each item in the list, provided as the argument (i). To turn right we set Our finished
which are our variables, and configure each GPIO the right motor to reverse and the left motor to robot is fun on
pin as follows. forwards, wait for the user-defined number of two wheels!
motors = [fwdleft,fwdright,revleft,revright] seconds and then turn off the motors.
for item in motors: For our left and reverse functions you can refer
GPIO.setup(item, GPIO.OUT) to the full code at http://bit.ly/LXF203_Robot.
The last section of code is a try and except test:
Driving our robot try:
We now create four functions that will handle print("R E A D Y")
driving our motors in a particular direction. Each of except KeyboardInterrupt:
the functions will take an argument, a duration of print("E X I T")
time that’s expressed as an integer or a float: GPIO.cleanup()
def forward(i): This will print R E A D Y when the code is
GPIO.output(fwdright, True) executed, but if we press Ctrl+c it will print E X I T
GPIO.output(fwdleft, True) and then clean up the GPIO pins ready for use by
time.sleep(i) another project.
GPIO.output(fwdright, False) Save your code as robot.py but we won’t be
GPIO.output(fwdleft, False) running the code, rather we will now create a
Our first function, forward(i) , will turn on new file and save it as test.py in the same
fwdright and fwdleft pins and then wait for the directory as robot.py.
value of i , our argument before turning the Next, we’ll import our robot.py code and use the
motors off. On to our second function: functions inside of it to control our robot.
def right(i): import robot
GPIO.output(revright, True) robot.forward(1)
GPIO.output(fwdleft, True) robot.right(2)
time.sleep(i) robot.left(2)
GPIO.output(revright, False) robot.reverse(1)
GPIO.output(fwdleft, False) Save the code and click Run > Run Module to
Our second function, right(i), spins our robot on test. Remember to pick up the robot before
the spot in a clockwise direction for the duration pressing Return or you’ll have to chase after it!
Winter 2016 // // 71
Get started with the
Pi Camera module
Mayank Sharma introduces you to the Pi Camera module
and explains how you can use it to shoot away to your heart’s content
T
he official Raspberry Pi camera Once Raspbian is up to date, launch the
module is fun little gadget, much Raspberry Pi’s configuration script with the
like the board it complements. The following command to tweak its settings:
camera module is a Full HD camera sudo raspi-config
that plugs into the Raspberry Pi via Scroll down the list to the Enable Camera option
the Camera Serial Interface (next to the Ethernet to make the Pi aware of the newly connected
port) on the device. The camera has a fixed focus peripheral. Then exit the utility and restart the Pi.
lens and 5 megapixel sensor. It can shoot still
images with a maximum resolution of 2592×1944 Trigger happy
as well as Full HD 1080p video at 30 frames per When it boots up, fire up a Terminal inside the
second, 720p video at 60fps and 640x480 at up graphical desktop to test the camera using the
to 90fps. And you get all this in a module that two command-line utilities raspistill and raspivid
measures just 25x20x9mm in size and weighs to capture still images and videos respectively.
a minuscule 3 grams! The command raspistill -o image.jpg displays a
To attach the camera, locate the Camera preview from the camera for 5 seconds and then
Serial Interface on the Raspberry Pi and pull the takes a picture, which is saved as “image.jpg” in
tab gently up. Now push the camera module’s the current folder. You can use the -t switch to
ribbon cable into the slot, with the silver contacts specify a different wait period in milliseconds.
on the cable facing away from the Ethernet port. For example, -t 20000 will display the preview
Remember not to push the cable in very deep. for 20 seconds.
Now hold it in place with one hand and push the Similarly, raspivid -d will display a five-second
CSI tab back down with the other hand to lock video demo. You can define the size and location
the camera’s ribbon. for the preview window using the --preview option
With the hardware in place, it’s now time to – for example raspivid --preview 0,0,1024,768 will
set up the software. Boot into Raspbian and log display the preview in a 1024x768 window at the
in. Before enabling the camera, make sure you top-left corner of the screen. Use --fullscreen or -f
refresh its repositories with the following: to force the preview window to use the whole
sudo apt-get update screen. The following command will capture 10
Then install any available updates with: seconds of video:
sudo apt-get upgrade raspivid -t 10000 -o video.mp4
72 // // Winter 2016
Pi Camera module PROJECT
Both raspistill and raspivid have quite a few You can take advantage of the portable nature
options to help you take more interesting image of the Raspberry Pi and its camera module to
and video captures. The --sharpness, --contrast capture time-lapse video of things that are too
and --brightness options can influence the output subtle for the human eye to perceive, such as the
of the image. The camera also supports several movement of stars or the blossoming of flowers.
exposure modes such as auto, night and sports A time-lapse video is composed of several images
that can be specified with the --exposure option. captured over several hours but played back at a
Similarly, the various white balance options much faster pace. For example, you can capture
including sun, cloud and shade can be specified an image every 10 seconds for 6 hours and then
with the --awb option. string the set of images together in a time-lapse Pi bites
Use the --width and --height option with video at 24 frames per second. This reduces the
raspistill to set the dimensions of the captured 6-hour capture to a 30-second clip. The camera
module’s tiny size
image. You can also tweak the compression level
of the jpeg image by specifying a quality level Jump through time makes it ideal
for projects that
between 0 and 100 with the --quality option. It doesn’t take much work to set up the Pi for require a small,
The --width and --height options can also be time-lapse photography. The following block of high-resolution
camera such as
used with the raspivid tool. It also uses the code will capture a shot every 30 second for the
surveillance.
--bitrate option to control the quality of the video. next 6 hours (21600000 milliseconds):
To capture a Full HD video at 15 Mbits per second $ mkdir ~/images
use --bitrate 15000000. Another related option is $ cd ~/images
--framerate, which can accept a value between 2 $ raspistill -o image-%04d.jpg -t 21600000 -tl 30000 &
and 30. To pause video during a capture, start it You can change the duration (-t option) or the
with the --keypress option. You can then press gap between the shots (-tl option) by specifying
the Enter key to pause capturing and resume by different durations in milliseconds. The %04
pressing the Enter key once again. Press the X instructs raspistill to save each image in a file
key followed by the Enter key to stop recording. called “image- nnnn.jpg’ where nnnn is a four-digit
Head to Menu > Programming to use the IDLE editor to write your Python scripts.
Python’s PiCamera library display a preview for 10 Similarly, you can record continuous() method of the
helps you control the camera seconds before capturing 5 seconds of video with the picamera library.
module from within Python. You an image: following: The picamera library includes
can install it on any distro with import picamera import picamera a number of useful modules
the following command: from time import sleep from time import sleep such as picamera.encoders,
sudo apt-get install python- picamera.streams, picamera.
picamera camera = picamera.PiCamera() camera = picamera.PiCamera() color and picamera.exec,
Or if you plan to use Python 3: camera.start_recording('video. among others. Refer to the
sudo apt-get install python3- camera.start_preview() h264') official documentation at
picamera sleep(10) sleep(5) http://picamera.readthedocs.
Once it’s installed you can use camera.capture('/home/pi/image. camera.stop_recording() io/en/release-1.12/ for more
the library to capture images. jpg') You can also capture time details and examples on the
Here’s a basic script that will camera.stop_preview() lapse video using the capture_ various modules.
Winter 2016 // // 73
PROJECT Pi Camera module
Run sudo
modprobe
bcm2835-
v4l2 to access
the camera
board on /dev/
video0. Then
get the kernel
to insert the
module on boot
automatically
with echo
"bcm2835-v4l2"
| tee -a /etc/
modules
number incremented with each successive image. In this rather long command we’ve instructed
The & sign at the end of the command instructs mencoder to create a video using the mpeg4
the Bash shell to run the command in the codec from the open source libavcodec library
background. After six hours you’ll have 720 and without any sound since we haven’t captured
images in the folder named image-0001.jpg, any. The scale specifies the Full HD (1920x1080)
image-0002.jpg, and so on, up to image-0721.jpg. resolution of the video, and the aspect specifies
You can also You can now compile these individual images the widescreen aspect ratio of the video.
enable the into a video. First, save them all in a text file: There’s also a fair bit of maths involved. The
camera from $ cd ~/images bit rate is calculated using the formula (40 * 25
within Raspbian’s $ ls *.jpg > allimages.txt * width * height / 256), which comes out to
desktop. Head
Then install the mencoder transcoding tool with: 8100000. Then we set the frame rate of the
to Menu >
sudo apt-get install mencoder resulting video to 24fps. Given that an individual
Preferences >
Raspberry Pi
Once it’s installed, compile the video with: frame (or one image) represents 30 seconds of
Configuration > $ mencoder -ovc lavc -lavcopts vcodec=mpeg4: real time, the real time represented by one second
Interfaces and aspect=16/9:vbitrate=8100000 -vf scale=1920:1080 of our time-lapsed video comes to (24s * 30s) =
toggle the Enable -nosound -o timelapse.avi -mf type=jpeg:fps=24 720s, which is equal to 12 minutes or one-fifth of
radio button. mf://@allimages.txt an hour. In other words, five seconds of the time-
lapsed video represents one hour of real time.
Once you’ve got your head around the maths,
tweak the options for the raspistill capture and
the mencoder encoding until you get to a desired
ratio between the real time and the video time.
Depending on the images it has to process,
the mencoder command can take some time to
complete. When it’s done, you’ll have a file named
timelapse.avi inside the current directory. You
can copy it to another computer using the scp
command. Assuming the IP address of the
Raspberry Pi is 192.168.1.2, head to another
Linux computer on the network and enter:
$ scp pi@192.168.1.2:/home/pi/images/timelapse.
avi ~/Videos
This command will pull the video from the Pi
to the Videos directory on your regular distro.
74 // // Winter 2016
Turn any speakers
into Wi-Fi speakers
Mayank Sharma explains how you can stream media from iOS and Android
devices to your Raspberry Pi, to play it on speakers plugged into the Pi
T
hese days, if you’re like us, you’ve amplifiers and other equipment to enhance your
probably got your music all over the listening experience.
place – on cloud sharing services like The best thing about Volumio is that it includes
Dropbox and Google Music as well as support for AirPlay devices out of the box. This
on local NAS drives. You can stream means you can use the speakers connected to the
music from all these to Wi-Fi-enabled speakers Pi as remote speakers for your AirPlay-compatible
that cost a bomb. Or, you can use a Raspberry Pi Apple devices as well as Android devices with
and transform any plain ol’ speakers into AirPlay- apps such as AirAudio that are available for free
compatible wireless speakers. from the Google Play Store. Moreover, you can
For this project, you’ll need a pair of hi-fi control Volumio from any other remote computer
speakers that you can connect to the Raspberry Pi or device attached to your local network. This
via an Auxiliary (AUX) audio cable. If you are a true enables you to then select and queue music that’ll
audiophile, you might scoff at the idea of using the play on the locally attached speakers.
Raspberry Pi to listen to music. But that’s because
you haven’t yet tried the Volumio distro, which is Pump up the amps
designed especially for music lovers and is fully To get started, download the latest version of the
equipped to work with your hi-fi gear. Volumio distribution for the Raspberry Pi from its
Using Volumio you can set up a headless media website at https://volumio.org. The image for
server on the Pi that can play music in all the the Pi is distributed in a Zip file, so you’ll have to
popular formats from a connected USB device or extract it before transferring it to the SD card you
NAS devices just as easily as it can stream Internet use with your Pi. Note that since the extracted
radio. What’s more, the distro supports a large image weighs almost 3GB in size, you’ll need an
number of USB DACs, so you can plug in your SD card that’s at least 4GB or more. It’s also a
good idea to use a Class 6 or higher card. The
PLAY MUSIC FROM A CONNECTED class number represents the speed of the card –
USB DEVICE, NAS, OR AN APPLE the higher the value, the faster the card.
To write the Volumio image file in Windows, grab
OR ANDROID DEVICE VIA WI-FI the USB Image Tool from http://www.alexpage.
de/usb-image-tool/download/. You don’t have
to install the tool, just download the Zip file and
Winter 2016 // // 75
PROJECT AirPlay
Pi bites
Although the
Raspberry Pi does
have USB ports,
it’s advisable to
connect any USB
devices using a
powered USB hub
to ensure that
the devices get
enough power.
To improve
your playback
experience, tweak
the settings
available under
Settings >
Playback Options
in Volumio’s
browser-based
interface.
extract its contents. Now right-click on the USB card is connected using the mount command,
Image Tool.exe file and select Run as Administrator which will list all mounted devices. Assuming your
from the contextual menu. The app will list your card is mounted at /dev/mmcblk0p1, write the
card in the left-hand pane. Make sure the tool is in image to the card (rather than a partition inside it)
Device Mode by selecting this from the pull-down with the following:
menu in the top-left corner. To write the image to $ sudo umount /dev/mmcblk0p1
It’s easy to the card, click the Restore button and navigate to $ sudo dd bs=4M if=volumio-0.979-2016-08-20-pi.
stream from an Volumio’s extracted .img file. That’s it. The image img of=/dev/mmcblk0
iOS device, but
will now be transferred to the card – although the It’ll take some time to write the image to
the secret sauce
process may take some time, depending on the the card. Once it’s done, insert the card into the
that powers
Volumio is the
speed of the card. Raspberry Pi. Now power up the Pi and wait for
venerable Music If you’re using Linux, you can use the venerable about a minute to allow Volumio to boot up
Player Daemon dd command to write Volumio’s image to your SD completely. That’s all there’s to it. Your AirPlay-
(MPD) music card. Most distros will automatically mount the compatible speakers are now ready. Grab any iOS
player server. card when you connect it. You can find where the device and make sure it’s connected to the same
Wi-Fi network as the Raspberry Pi. Then swipe up
from the foot of the screen to open Control Centre.
Tap AirPlay, which will bring up a list of AirPlay
devices. Tap the entry labelled Volumio to stream
audio from this iOS device to the speakers
connected to the Raspberry Pi.
AirPlay isn’t the only wireless audio streaming
protocol out there, so don’t feel left out if you don’t
have any iOS devices to stream music. The other
popular protocol for streaming audio that’s also
supported by Volumio out-of-the-box is DLNA,
and you can stream music from your Android
devices to the Raspberry Pi over DLNA with the
BubbleUPnP app (see Stream Music with
BubbleUPnP on the opposite page).
76 // // Winter 2016
AirPlay PROJECT
the same network as the Raspberry Pi. Before you Browse button in the bottom left of the screen.
can bring up Volumio’s interface, you’ll first have to This will bring up a list of the available music
find out the IP address assigned to the Raspberry sources, which includes a bunch of Internet radio
Pi by visiting your router’s administration page. stations as well as any connected USB disks and
Equipped with this address, head over to another network drives. Browse through the devices, pick
computer on the same network and enter the IP a track and the song you select will pipe through
address assigned to the Raspberry Pi. the speakers connected to the Pi. You can access
Volumio’s web interface looks very appealing the Volumio interface from any computer on the
and the controls are very intuitive. But before you network to queue and control playback on the
can use it to play music, you’ll need to point it to remote speakers.
your library. If you’ve got music files on a USB What’s more, you can also ask Volumio to fetch
drive, Volumio will automatically import them all as music from the Internet. As we’ve mentioned, the
soon as you plug in the drive. On the other hand, if Browse button automatically gives you access to
you want to point Volumio to a network share that a handful of online radio stations. (Want more?
houses your music, click the gears icon in the top- Turn the page for more about internet radio.) You
right corner of the main screen to open Volumio’s can also point Volumio to your Spotify Premium
configuration menu and click My Music. Click the account to play music from the popular service.
Add New Drive button and fill in the IP address of For this, head to Settings > Plugins and install the
the network share, along with the path to the Spotify plugin to use the service. Also, in addition
folder that contains the music files. to the browser-based interface, you can control
Once you’ve added your music, head back playback with one of the several Volumio apps
to the main Volumio interface and click on the available on the Android Play Store.
Winter 2016 // // 77
Build an internet
radio from a Pi
Nate Drake shows you how to set up your Pi so that you can enjoy
internet radio wirelessly anywhere in the house... or even beyond
O
ne of the most fun and customisable clearer audio than most household radio sets.
projects available for the Pi owner is to Because radio stations are transmitting over an
turn it into a wireless device capable of internet connection, range is no longer an issue
tuning in to internet radio stations. either, and you can tune into stations around the
Internet radio is a thing apart from world wherever you have a network connection.
regular radio stations. As the name suggests, This is especially important for people living
internet radio stations stream over the internet away from their home country. British expats living
rather than broadcasting over the airwaves. in continental Europe, for instance, have difficulty
Of course there’s no reason why radio lovers receiving the BBC World Service on a shortwave
can’t simply crank up their AM/FM handset radio, but an internet radio can stream it without
and listen to radio in the old-fashioned way. But any issue. Certain countries also jam certain
internet radio offers many advantages. The chief shortwave radio frequencies, but it is more difficult
among these must be audio quality: the signal to jam internet broadcasts.
strength and error checks put in place by internet A quick search online will show that a number
communication protocols offers much crisper and of people have turned a Pi into an internet radio
receiver in many different and inventive ways. For
this reason, we’ve included the basic information
here to get you started but leave it to you to decide
how you wish to customise it.
Radio preparations
As you’ll see from the next few pages, the actual
code required to set up an internet radio on your
Raspberry Pi is only a few lines long. Before you
Feel free to
get stuck in, however, it’s worth taking some time
be creative with
this project. This
to consider your particular setup.
vintage radio has Your first consideration should be your choice
had a Pi installed of Raspberry Pi. The Raspberry Pi 3 is the most
as well as a small expensive model but it does have a 3.5mm
RGB display. audio jack, which will be compatible with most
78 // //Winter 2016
Stream internet radio PROJECT
Ympd can be accessed on any web browser. Simply click on a radio station to begin playing. If
you’ve added new stations – we show you how over the page – click “Update DB” to load them.
Winter 2016 // // 79
PROJECT Stream internet radio
80 // //Winter 2016
Stream internet radio PROJECT
power cable with one with a switch, such as those command sudo service mpd restart . If you find
sold by Pi Hut. such problems are happening regularly, it may be
best to stop the mpd background daemon and just
Crossed wires run it manually with these two commands:
Just as there are a number of ways to set up your sudo service mpd stop
project, there are equally a myriad of ways that sudo mpd --no-daemon --stdout --verbose
things can go wrong. It’s important before you Keep an eye on the Terminal window – the
set up your radio to test that the sound is working “--verbose” flag will force mpd to show any error
properly with your speakers of choice before messages. If you’re still having troubles, try visiting
trying to listen to any streams. the helpful mpd troubleshooting page at http:// Pi bites
If you have more than one audio output – say mpd.wikia.com/wiki/Music_Player_Daemon_
you’ve connected earphones to the Pi’s earphone HOWTO_Troubleshoot. If you do choose
to use USB
jack but are also connected to a television by If you have any other software running on the speakers, they
HDMI – then you may need to right-click the Pi that connects to the internet, you may find that may require more
volume button at the top right of the screen to you aren’t able to connect to ympd on Port 80 as power than your
select the output you want. outlined in Playing radio with ympd on the Pi’s USB ports can
supply. If so, use a
If you’re connecting over SSH and can’t use the previous page. If you are unable to load the ympd
powered USB hub
Pi’s desktop to change your audio settings, then window, first stop the program with the command which connects to
simply type mpc outputs to see a list of available sudo killall ympd and then launch it again using a mains electricity.
audio devices. The list will be numbered in a form different port – for example sudo ympd –webport
such as “Output 1 (My Alsa Device)”. Use the 94 . You should then be able to access ympd by
command mpc enable # – for example mpc opening a web browser on your network and going
enable 2 – to enable the speakers of your choice. to http://yourpiIPaddress:94.
If mpd becomes unresponsive when you’re using If you decide to use the small TFT touchscreen
it, in the first instance try simply connecting via from Adafruit, you may find it tricky to navigate the
SSH or opening Terminal and running the Pi’s smaller screen. You can get around this by
ADDING
STATIONS
The Pi is capable of playing any
internet radio station. The basic
format for adding new stations
using the mpc command line
utility for the Music Player
Daemon is mpc add LINK –for
example mpc add http://bbcmedia.
ic.llnwd.net/stream/bbcmedia_radio
1_f_p?s=1473771325&e=147378572
5&h=01fae51e24dd4d26dc181f593a9
4defb.
This is quick and easy (if long-
winded) but you may struggle Websites like ShoutCast have downloadable playlists for radio stations. However, you’ll need
at first to find valid links for an actual link for the stations you want in order to be able to listen to them using mpc.
stations, particularly as the URLs
will change from time to time. 93&h=b8c1c754cb6cc971fed2 mediaselector/5/redir/ playlist files to an actual web
Stephen Phillips has also ca5b19e97d67 version/2.0/mediaset/http- stream. See https://www.
written an excellent script on his icy-mp3-a-stream/proto/http/ gebbl.net/2013/10/playing-
website (http://blog.scphillips. BBC Radio 3 : http:// vpid/bbc_radio_five_live internet-radio-streams-
com/posts/2014/05/bbc- bbcmedia.ic.llnwd.net/ mpdmpc-little-bash-python/
radio-on-the-raspberry-pi-v2/) stream/bbcmedia_radio3_mf_ BBC World Service: for more information.
which can automatically fetch p?s=1473771321&e=147378572 http://bbcwssc.ic.llnwd.net/ If you want to categorise your
the current links for BBC Radio. 1&h=c7d8a753d2663d9f4630 stream/bbcwssc_mp1_ radio stations rather than have
At press time these are: cfcbb7e1d1ae ws-eieuk_backup them all in one big list, just add
BBC Radio 1 : http:// the streams you want and then
bbcmedia.ic.llnwd.net/ BBC Radio 4 : http:// ShoutCast (www.shoutcast. save as a playlist –for example
stream/bbcmedia_radio1_mf_ bbcmedia.ic.llnwd.net/ com) has links to hundreds of mpc save bbc . A playlist file will
p?s=1473771325&e=14737857 stream/bbcmedia_ radio stations which can either appear in the location /var/lib/
25&h=01fae51e24dd4d26dc18 radio4extra_ be played directly on the website mpd/playlists. You can load the
1f593a94defb mf_q?s=1473771502&e=14737 or downloaded as a playlist. This playlist again by using mpc load
85902&h=6c94d3cedf0a32e2 can cause issues for mpd, which – for example mpc load bbc . You
BBC Radio 2 : http:// 8dd4e8bd33e5fe44 needs a link to work with. can then either play it using the
bbcmedia.ic.llnwd.net/ Fortunately the website gebbl. command mpc play or using
stream/bbcmedia_radio2_mf_ BBC Radio 5 Live : http:// net has an excellent script you your graphical program of
p?s=1473771493&e=14737858 open.live.bbc.co.uk/ can download to convert the choice such as ympd.
Winter 2016 // // 81
PROJECT Stream internet radio
82 // //Winter 2016
ON SALE NOW!
AVAILABLE AT WHSMITH, MYFAVOURITEMAGAZINES.CO.UK
OR SIMPLY SEARCH FOR T3 IN YOUR DEVICE’S APP STORE
OUT
NOW!
WITH
FULLY
FREE
REVISED &
UPDATED
DIGITAL
EDITION EDITION
95
86
92
Winter 2016 // // 85
Start programming
using Scratch
Ben Everard shows you how to build a cat and mouse game using this
straightforward beginner’s programming language on the Raspberry Pi
T
here’s a wide range of programming At the top-left are eight colour-coded categories
EXPERT languages that can be used with the or functions. To begin, click on Control, and blocks
Raspberry Pi, but Scratch is great for of code will appear below. From these, drag When
beginners, because it introduces many Space Key Pressed into the scripts panel in the
of the concepts of programming while middle. What do you want to happen when the
being easy to use. It’s especially good for creating space key is pressed? Click on Looks at top-left,
graphical programs such as games. and drag Say Hello For 2 Secs directly beneath
You’ll find Scratch on the desktop in Raspbian, the first piece. The two lock together into a script.
so there’s no need to install anything – just click You’ll notice that “Hello” and “2” have a different
on the icon to get started. (Many other operating background, indicating they can be edited. Click on
systems for the Pi don’t support Scratch, although Hello and change this to Hello World!, then click
you can download Scratch for Windows, Mac or on 2 and change this to 4. Press Return to exit
Linux at https://scratch.mit.edu. Our tutorials the text box. To run the script, press the space key.
will be equally applicable whatever your platform.) Congratulations, you’ve made a Scratch program!
The main window in Scratch is split into three Want to do more? Click on Control again, drag
sections: the bits you can use to make programs When Space Key Pressed into the scripts area,
are on the left; you piece them together in the then click on “Space Key” and change this to Right
middle; and the programs run in the area on the Arrow. Click on Motion at top-left and drag Move
right. Each program is made up of a number of 10 Steps beneath the Right Arrow block. Now the
sprites (pictures) controlled by scripts which you cat will take a walk if you hit the arrow key. Get the
assemble in the middle panel like building blocks. idea? Let’s try something a bit more complex...
86 // // Winter 2016
Starting Scratch CODING
EXPLORING SCRATCH
Categories Choose Options Menus and Costumes/Sounds Canvas This is where
what type of code buttons along the top Click a tab to show sprites are displayed
you want to use next. offer further options. the costumes (that is, and their behaviour
They’re colour-coded Under Share you can images) and sounds is previewed.
to help you identify upload your project to for the current sprite.
which type each piece scratch.mit.edu to let
of code is. the world see it.
Winter 2016 // // 87
CODING Starting Scratch
88 // // Winter 2016
Starting Scratch CODING
Winter 2016 // // 89
CODING Starting Scratch
90 // // Winter 2016
Starting Scratch CODING
Winter 2016 // // 91
Take your first steps
coding with Python
Robert Jones helps you begin learning the basics of the world’s
most popular programming language on your Raspberry Pi.
T
here’s a multitude of programming Because the Raspberry Pi is all about learning
languages, but if you’re going to learn to code, it’s no surprise to find Python already in
just one, then Python is the one. the system. Click on Menu > Programming, and
Python is used by students around you’ll find two versions of Python available:
the world to learn coding skills and Python 2 (IDLE) and Python 3 (IDLE).
by big companies such as banks to run mission There are differences in the way Python 2 and
critical software. Python 3 code works. Even the humble “print”
There are many reasons why Python is such a statement works differently.
favourite. It’s easy to learn but at the same time
incredibly powerful – it’s like getting a learner Starting Python
bike, complete with training wheels, that’s good Most tutorials and resources are created with
enough to enter the Tour De France. It is easy to Python 2 in mind, and most university courses
read Python code, and it goes light on syntax. teach Python 2. So it’s best to start with Python 2
Semi-colons and curly brackets – { and } – litter and move to Python 3 when you have a few lines
languages like C and Java, while Python just uses of code under your belt. So choose Python 2
indentation and line spacing to organise code. (IDLE) from the menu bar.
A window opens displaying “Python 2.7.9 Shell”
and three chevrons: “>>>”. This window is known
GPIO in Python as interactive mode, and you can enter Python
commands straight into it. It’s good luck to
The great thing about the Raspberry version of Python, so you don’t need
christen all new programming languages by
Pi is the GPIO pins you can access to set anything up.
on the device. These enable you to There is also a more friendly printing the traditional message “Hello, World!”
hook up hardware, connect circuits interface to GPIO called GPIO Zero. to the screen. Input the following command:
and build all kinds of projects. It’s This provides a lot of component print "Hello, World!"
the interface between your software interface for devices such as LEDs The phrase “Hello, World” is outputted as a
and hardware. You can control the and sensors. You can learn more string and appears below your command. You
GPIO Pins using Python (along with about GPIO Zero at its main website, then get another command prompt.
many other languages). Support for https://gpiozero.readthedocs.io/ And so you can start programming, entering
GPIO is built into the Raspberry Pi en/v1.3.1/. commands as input and getting direct output.
This is known as “interactive mode”. We’ll come
92 // // Winter 2016
Python CODING
Python Math
Python works well as a calculator. To demonstrate
this, type in the following:
10 + 20 - 5
You’ll get 25 as output. Notice that you didn’t
need to enter “print” at the start. It outputs the
answer as an integer. You can put “print” before
it if you like; you’ll get the same answer.
Now try the following. But before you enter it,
try to guess the answer...
10 + 10 * 2
You’ll be forgiven for thinking 40. But the answer
comes back as 30. Why? The reason is called There are
“operator precedence”. Python, like all computer print "Open the pod bay doors, " + computer two versions of
programs, doesn’t work from left to right. Instead, print "I'm sorry, " + person + ". I’m afraid I can’t Python installed
it considers the “*” and “/” operators to be more do that." in Raspbian.
important than the “+” and “-”. So our 10 + 10 * 2 Press F5 and you’ll see the script appear in Python 2 is the
program goes like this: Python Shell. Now change the strings in the one you should
10 * 2 variables person and computer, so the person is start learning.
10 + 20 called “Bob” and the computer is called “Pi”. Press
30 F5 again and you’ll see the new script.
The power symbol, which is “**” in Python, as
in 2 ** 4 (two to the power of four) is even more Variable types
important still. If you want to get around all this, Remember how we said that variables could be
you place calculations you want to be performed strings or integers (and other types)? Python gets
first in parentheses, like this: a bit confused if you try to mix the two together.
(10 + 10) * 2 This is particularly challenging when combining
Now you’ll get the answer you want: 40. numbers with strings. First enter this text:
answer = 42
Script mode print "The answer to the meaning of life, the
You can use interactive mode as a calculator, and universe, and everything is " + answer
experiment with basic commands. But to string Press F5 and you’ll get an error message:
commands together (to create that thing we call “TypeError: cannot concatenate ‘str’ and ‘int’
a “program”), you’ll need to create a new file and objects”. This error arises because answer is an
use Script mode. integer, and the print statement needs a string.
Go to File > New File and a new window will Python cannot work with them.
open called “Untitled”. Now go to File > Save and You could change answer to a string by putting
name the new file hello.py. the 42 in quotes: answer = "42" . But then you Python can be
Now we’re going to add a one-line program that won’t be able to do any maths with it. It’s no run in Interactive
says hello to you by name. Add these lines: longer an integer, and you can’t perform maths Mode and in
Script Mode. In
name = "Robert" with strings. A lot of the time you’ll want to do
Interactive Mode
print "Hello " + name some maths and then print out the result with
you can enter
Don’t forget to include to space after “Hello” or a message. To do that you need to convert the commands and
it’ll say “HelloRobert”. Go to File > Save and press integer into a string, using a function called str() . change program
F5 to run the program. The Shell window returns, You can spot functions because they have two variables from the
and displays “Hello Robert”. brackets (parentheses) after them. command line.
The element “name” is called a “variable”. This
is because the thing it contains can vary. In this
instance, it includes the name “Robert”. Variables
that contain text are known as “strings” as
opposed to numbers (which are often referred
to as “integers”).
The joy of variables is that you can use them
again and again, and quickly change them. Create
a new file and name it movie_script.py. Enter this
code to recreate a famous movie script:
person = "Dave"
computer = "HAL"
Winter 2016 // // 93
CODING Python
94 // // Winter 2016
Get started with
Minecraft coding
Robert Jones explains how to hack into Minecraft and build
your own world with this easy introduction to the Minecraft API
M
inecraft is one of the most popular going to Menu > Games > Minecraft Pi. Click Start
games ever made. In it you control Game > Create new to start playing the game
a character, officially called “the normally. You look around with the mouse, and
player” but often called Steve or Alex. move with the W,A,S,D keys.
The world of Minecraft is made of Playing Minecraft normally isn’t what we’re
blocks. In it, you dig up the blocks and craft them here for, though. So let’s get to know the Minecraft
into various things – houses, cars, statues, boats API. Press the Esc key on your keyboard to stop
and so on. It’s like virtual Lego. the game (but don’t close it down).
Minecraft for Raspberry Pi is a smaller version
of the pocket edition. It may have fewer features The Minecraft API
than the full version, but it has an ace up its sleeve. The term API stands for Application Programming
You can hack Minecraft on the Raspberry Pi using Interface. APIs are big blocks of code made by
programming languages such as Python and Java. other people that you can use. With an API you
This means that using just a few lines of code, you just need to learn a few commands, and the API
can change the Minecraft world around you, will do all the heavy lifting.
adding and removing blocks, changing blocks In Minecraft, the API works by changing the
and moving the player around. “server”. In this context, this is not a remote
Other players have created countless programs computer on which data is stored. Rather, this is
for Minecraft on the Raspberry Pi. These are a program which runs underneath the game. With
shared online, and you can import them, and the API you can interact with blocks and the player.
examine them. People have built giant randomly Here are some of the things you can do:
generated mazes, working clocks and even video Get the player’s position.
games you can play inside Minecraft. This makes Change (or set) the player’s position.
Minecraft an ideal environment for learning the Get the type of block.
basics of programming. It’s a highly visual world, Change a block.
and you can see the results of your code in a Change the camera angle.
virtual world. And there’s plenty of code for you Post messages to the player.
to play with. Above all that, it’s fun! We’re going to use the Python API for Minecraft.
Minecraft is installed by default in the Raspbian As is tradition, the first program we’ll create will
Jessie with Pixel operating system. Start it up by send the player the message “Hello World.”
Winter 2016 // // 95
CODING Minecraft
96 // // Winter 2016
Minecraft CODING
Winter 2016 // // 97
raspberry-pi-minecraft-cannon.html. To
Minecraft commands download Minecraft Cannon, open a Terminal
window and enter the following, then hit Return:
We use several Minecraft API commands in this project. There are fewer cd ~
commands than you imagine, but once you learn them, you can create clone https://github.com/martinohanlon/minecraft-
some incredibly powerful programs. Here is the Minecraft API: cannon.git
postToChat(message) Communicate in the game.
Enter ls and you’ll see the minecraft-cannon
getBlock(x, y, z) Get a block type for a specific position.
setBlock(x, y, z, blockType, blockData) Change a block to a certain blockType.
directory. Navigate to it and run the Python code
setBlocks(x1 , y1 , z1, blockType) Create a block. contained inside to run the program (make sure
setBlocks(x1 , y1 , z1 , x2, y2, z2, blockType) Set lots of blocks all at the same you’re running Minecraft first).
time by providing two sets of co-ordinates. cd minecraft-cannon
player.getPos() Get the current position of the player. python minecraft-cannon.py
player.setPos(x, y, z) Set the player’s position. Terminal will display Stuffaboutcode.com
player.getTilePos() Get the position of the tile the player is currently on. Cannon >>. You can use this mode to enter
For more, see www.stuffaboutcode.com/p/minecraft-api-reference. commands to control the cannon. To create a new
html. With these commands, you can alter Minecraft in any way you want! cannon and fire it, for example, you simply use:
start
fire
Pi bites right, but you can also examine the code and Here are all the commands you can use in
learn how it works. Minecraft Canon.
You can find the We’re going to use Git to install the software. Git start – create (start-up) the cannon
Minecraft API in is installed by default in Raspbian Jessie with Pixel, rotate [0-360 degrees] – rotate the cannon
Terminal using
cd /opt/ but if you don’t have it, you can install it using: tilt [0-90 degrees] – tilt the cannon upwards
minecraft-pi/ sudo apt-get install git-core fire – what it says!
api. Type the
command cat /
A good place to start is minecraft-clock. This exit – exit the program and clear the cannon.
opt/minecraft- code draws a large circle, then uses trigonometry You can investigate the code in Python. Open
pi/api/spec/ to to find where the hands should be drawn. IDLE from within Minecraft by going to Menu >
view the official
specifications Make sure that Minecraft is running a game. Programming > Python 3 (IDLE). Now choose File
for the project. Open a Terminal window and enter this code: > Open and open the minecraft-cannon directory.
cd ~ Highlight minecraft-cannon.py and choose Open
git clone https://github.com/martinohanlon/ to view the code in IDLE.
minecraft-clock.git Here you can see how all the functions have
cd minecraft-clock been programmed. It uses the block module as
python minecraft-clock.py well as time (to create delays), math (to calculate
You will see STARTED in the Terminal and a the trajectory) and cmd (to interact with the
message displays inside Minecraft welcoming you command line).
to the clock. Then, a giant clock appears in the sky. Minecraft is a tremendously creative game, and
Switch back to Terminal using Alt + Tab and press with Minecraft API it’s possible to create amazing
Ctrl + C to quit the program. The clock will stop programs to take it even further. This fun gaming
running inside Minecraft. connection makes Minecraft API a great way to
learn to code, and a good start to learning complex
Building a cannon programming languages such as Python (and even
One of the most complex programs you can run is Java). As you become more advanced, it’s even
called Minecraft Cannon by Martin O’Hanlon. You possible to hook up Minecraft to the Raspberry Pi
can learn more about the code on the “Stuff About hardware and blend the real world with Minecraft’s
Code” website (stuffaboutcode.com/2013/04/ imaginary block world. Have fun!
Create multiple
blocks at once
to create shapes
and structures.
98 // // Winter 2016
Pi REVIEWS
Tested and rated: the latest add-ons for your Pi 100
102
104
108
112 Picade by
Pimoroni
Winter 2016 // // 99
REVIEW FUZE Workstation
FUZE
Turn your Raspberry Pi into an electronics workstation with the
FUZE Computer. Robert Jones reviews a great kit for classrooms
T
In brief
he Raspberry Pi
is ideal for learning THE IO BOARD, LIKE A BREAKOUT
The FUZE is
an electronics
computing and
hardware projects.
CABLE, ALLOWS YOU TO CONNECT
workstation
kit for the
The only problem COMPONENTS SAFELY
Raspberry Pi is that the Raspberry Pi doesn’t
(which sits come complete with a keyboard,
inside it). It
looks more
mouse or any electronics The real advantage is the with the RC robotic arm from
like a regular components. So if you want FUZE IO Board that attaches to Maplin’s. This comes in kit form
computer but to use a Raspberry Pi to teach the GPIO pins of the Raspberry but is easy to build. It attaches
has an IO board
for connecting young students electronics Pi. Like a breakout cable, this to the FUZE Workstation via
electronics projects, you need to add quite allows you to safely connect USB and software is used to
components. a few things to get started. electrical components to the control it.
The FUZE Workstation is FUZE without worrying about The only hiccup is that FUZE
built around a Raspberry Pi but blowing the Raspberry Pi board. has put all of its eggs in a Basic
looks reminiscent of a home It also offers additional programming language basket.
computer from the 1980s. In features, such as analogue The FUZE Workstation runs a
fact, there’s a model with a retro input and output. The FUZE stock version of Raspbian and
colour scheme designed to look Workstation comes with a box can be programmed in any
just like the classic BBC Micro of components, including LED language. But most of the
(which originally inspired it). lights (red, green and blue), worksheets and projects use
In many ways, it’s the complete jumper leads, buttons, light a version of Basic (based on
computer setup that many sensors, seven segment LEDs RTB: Return To Basic).
people want. and mixed resistors. Basic may have retro appeal
There’s a keyboard on the FUZE also supplies Project to teachers remembering days
front and a mouse attached to Workbook and Worksheet spent entering code line by line
one of the four USB ports on the guides for users to work with on a BBC Micro. But it’s been
rear, where there’s also an HDMI these components. far superseded by entry-level
connection to connect the FUZE Teachers who want to take languages like Scratch and
to a television or monitor. things further can use the FUZE Python. We can’t see any good
Features at a glance
reason to teach young students Reference, Project Workbook, In all, FUZE is a nicely
Basic when you can get them 840-pin breadboard, component self-contained case for the
straight into Scratch. kit, cables and robot arm kit. Raspberry Pi that turns it into
FUZE says its Basic is Even if you opt for DIY, putting a reliable computer with a built-
a stepping stone between the kit together is easy. Slot the in IO Board for using to learn
introductory tools like Scratch Raspberry Pi inside the FUZE kit electronics. Teachers find FUZE
and real-world programming and wire up the external ports to incredibly useful for teaching IT
languages such as Python. If the USB, power and HDMI ports in the classroom.
you want to investigate the Basic on the Raspberry Pi board.
supplied with FUZE, you can The Micro SD slot of the
download it for free from the Raspberry Pi sits flush against Verdict
FUZE website. the outer case of the FUZE box.
FUZE
The FUZE can be purchased This approach worked fine with
Developer: FUZE
with a Pi inside (starting at £100 the Raspberry Pi 2 and its push- Web: www.fuze.co.uk
for the basic bundle), or you can to-eject mechanism, but the Price: From £100 including Raspberry
buy the kit without a Pi and Raspberry Pi 3 requires you Pi 3, or £70 without
assemble it yourself. The top- to pull out the Micro SD card
spec kit for £230 comes with
Raspberry Pi 3, Programmer’s
manually. We found that a pair
of tweezers helped.
Rating 8/10
Winter 2016 // // 101
REVIEW PiBorg ZeroBorg
In brief
A robot control
board for the
serious robot
maker. It’s able
to control four
DC motors or
two stepper
motors and
react to input
from an infrared
remote. Using
I2C, this board
can be stacked
with others
to provide
multiple motor
controllers for
larger projects.
It’s controlled
via a simple
Python interface
that can be used
with existing
projects.
Features at a glance
PiBorg
ZeroBorg
Les Pounder prepares to be assimilated by
the latest board from the PiBorg roboteers
T
he PiBorg team is well of controlling four DC motors to control your robot. At the time
known for its robotic simultaneously, thanks to two of writing, a Python 3 library is
creations, which full H-bridge controllers. (Each being worked on, and this should
include DoodleBorg, a one is a DRV8833, which is also be released soon if it’s not
Raspberry Pi powered used on the 4tronix Picon Zero already available.
tank large enough to transport a and the CamJam Robotics kits.) The PiBorg ZeroBorg is a
person. For its latest project the The board can also control two serious robot platform providing
team turned to crowdfunding for stepper motors, which can be rock-solid control of motors,
a smaller, Pi Zero focused robot used for slow, precise motion- both DC and stepper. The ability
control board called ZeroBorg, control applications. to add more of these boards to
and it is rather impressive. ZeroBorg also comes with augment a creation is fantastic,
Measuring 64x40mm, this board analogue inputs for sensors, and as it enables you to combine
is designed for both models of the most useful is the infrared different motors for varying
the Raspberry Pi Zero but is receiver, which will work with functionality. The board is easy
compatible with all models most remote controls. We tested to use and it took us little time
of Raspberry Pi as it uses the the receiver with a cheap generic to get going with our infrared-
Inter-Integrated Circuit (I2C) remote, captured the data controlled motor project.
interface, which Because it
requires only
the first six THE ZEROBORG IS A SERIOUS uses only six
GPIO pins,
GPIO pins.
The board
ROBOT PLATFORM PROVIDING you still have
access to the
cradles the Pi ROCK-SOLID MOTOR CONTROL remaining
Zero from pins, requiring
below, with only that you
support posts at each corner of received by the receiver and solder a header pin to each GPIO
the board. Also present on the used it to control a series of pin you wish to use.
underside of ZeroBorg is a 9V motors attached to the board. For those just starting out
battery connector, which can The PiBorg ZeroBorg is a with robotics, something like the
power the Pi and the board little different from other motor Picon Zero or CamJam Robotics
thanks to a 5V regulator built in control boards. Given that it uses kit will be more appropriate
to ZeroBorg. The connection I2C, a data connection protocol, because it provides more inputs
between the ZeroBorg and the Pi there can be multiple ZeroBorg for sensors. For the serious
is made via six General Purpose controllers in a project, with roboteer, though, this could be
Input Output (GPIO) pins, and each giving you control of four the perfect kit to build your next
these can be soldered in place motors, so with three units you multi-motor monster.
or pins can be bent as required. could drive 12 individual motors.
Both of these connections to the Controlling the ZeroBorg is
GPIO require a Pi Zero with no handled via a robust Python Verdict
GPIO header pins soldered. For library, which is installed via an
PiBorg ZeroBorg
connection to other Raspberry automated script on the PiBorg
Developer: PiBorg
Pi models, or for a temporary website. The Python library Web: www.piborg.org/zeroborg
connection, you can use female comes with a series of examples Price: From £18 (as tested £32.50)
to female header cables.
Primarily, the ZeroBorg is
on how to use the ZeroBorg,
including how to capture infrared Rating 8/10
a motor control board capable remote signals and use joypads
Drum HAT
Tap your fingers to the beat and turn a Raspberry Pi into a drum machine
with this clever HAT. Robert Jones channels his inner Fatboy Slim
T
he Drum HAT is a Setup is so simple that you claims the blurb. We’re not
In brief... crafty piece of kit can get it up and running in a even sure who he is. The built-in
Turn a from Pimoroni. With matter of minutes – it just samples are limited, but there
Raspberry Pi it, you can transform slots on top of the Raspberry are hundreds of thousands of
into a drum a Raspberry Pi into Pi. Pimoroni has an installation beats available online.
machine with
this cunning a drum machine, tapping out script on its GitHub page Behind the scenes, PyGame
piece of HAT beats on the touch-sensitive (https://github.com/pimoroni/ is used to connect the audio
hardware. The
Drum HAT is
surface pads. As this is a HAT drum-hat/blob/master/ samples to the touch pads.
an 8-pad drum- (Hardware Attached on Top) README.md). Open Terminal Inside the Python code is where
kit that fits on kit, setup is simple. All you and cut-and-past the curl the real fun is found. You set up
top of your
Raspberry Pi. It need to do is attach the Drum script and you’re ready to go. the pads using Python event
comes packed HAT to the GPIO pins and load
with samples,
and you can
the software from Pimoroni’s
GitHub (https://github.com/
USE PYTHON TO ASSIGN AUDIO
quickly turn it
into a drum
machine. Or you
pimoroni/drum-hat). SAMPLES TO EACH OF THE EIGHT
can program it
using Python.
You use Python to assign
audio samples to each of the PADS, THEN WHEN YOU TAP A
eight pads. Then when you tap
the pad with your finger, the
PAD THE SAMPLE IS PLAYED
audio sample is played. There
are two sets of drum samples Alternatively you can use git to objects. These are an index for
available in the documentation, clone the software from GitHub each pad (from 1 to 8). You
each with eight samples (such (clone https://github.com/ create hits and releases
as clap.wav and ting.wav). pimoroni/drum-hat) and run (determining how the pad
Each pad area comes with the Python setup installer. Once responds to taps and presses).
a corresponding LED. These it’s working, you can quickly If you’re really into music on
LEDs automatically light up scan over the demo scripts your Raspberry Pi, it’s possible
when you tap the drum pads, and figure out how it works. to use the Drum HAT alongside
or you can also take control of “An 8-pad Raspberry Pi Pimoroni’s other musical
them manually in code and get drum-kit that lets your fingers offering, Piano HAT. To do this
them to do what you want. think they’re Stubblefield,” you’ll need an extra piece of kit,
the HAT Hack3r, which enables
you to connect two pieces of
Features at a glance HAT hardware to a single
Raspberry Pi.
Serious musicians can also
configure the Drum HAT to
output MIDI commands via
a USB-to-MIDI adaptor. This
enables you to connect the
Drum HAT and Raspberry Pi kit
to a synth setup. Potentially,
HAT connection Touch pads LED lights therefore, you could use it in
The Drum HAT fits neatly Eight touch pads can be Each pad has an LED light a professional environment,
on top of your Raspberry Pi, individually programmed that flashes when you tap although we’re not sure how
turning it into a single box. to respond to finger taps to or can be programmed reliable it would be in a studio
make a novel controller. independently if you prefer. setting. The pads on the Drum
HAT are not pressure-sensitive, Drum HAT doesn’t interact figuring out the audio aspects
either, so it’s unlikely to impress directly with Sonic Pi (which is of the PyGame library. Despite
a professional drummer or DJ. a shame), it could form a good the hype, it’s not likely to hit the
However, at just £12, it is a fun part of a wider course in music mark for expert musicians, but
piece of kit for the Raspberry and coding. We can envision it it will be good fun for budding
Pi and does enable budding working along with MIDI musicians looking to learn to
drummers to have fun with training, Piano HAT and Sonic code, and useful in education.
sound and learn PyGame and Pi coding.
Python scripting. It’s a great project for
We had fun playing around the Raspberry Pi on its own, Verdict
with the Drum HAT. While the although it is a little simple.
Drum HAT
projects won’t keep you That’s part of the problem.
Developer: Pimoroni
occupied for long, it does have Other projects have us soldering Web: https://shop.pimoroni.com/
a lively bash and play quality. parts and assembling hardware. products/drum-hat
Music is a great way to get By comparison, the Drum HAT’s Price: £12
young students interested in entertainment value is relatively
hardware and coding in a world
that they understand. While
short-lived. But it is good for
working through Python and
Rating 8/10
Winter 2016 // // 105
REVIEW Explorer HAT Pro
Pimoroni
Explorer HAT Pro
Is this the easiest, most convenient way to use your Raspberry Pi for circuit
prototyping? Robert Jones tips his hat to a cleverly thought out HAT
P
rototyping circuits is slot the breadboard on or off programs and used to control
In brief one of the real joys as you need it. the various components.
A HAT of using a Raspberry Once you’ve got the Explorer Once you have both hardware
(Hardware Pi. Most of the time HAT Pro attached, you can start and software set up, you’re ready
Attached on this activity involves using it (thanks to the EEPROM to party. The setup is ideal for
Top) board for
prototyping, the attaching components to the that automatically connects the working with 5V powered
Explorer HAT Raspberry Pi GPIO pins using a hardware to your Pi). To get the systems thanks to four buffered
provides four
of everything:
breadboard. The Explorer HAT most from it, however, you’ll also 5V tolerant inputs and four
buffered 5V Pro places a breadboard right want to use the software that powered 5V outputs. These
tolerant inputs, on top of your Pi and also adds a Pimoroni has developed. There’s enable you to interface with
powered 5V
outputs, whole bunch of input and output an extensive Python library, systems safely, much the same
capacitive touch options that enable you to create
pads, capacitive
crocodile clip
prototype circuits right on top
of your Pi. It’s a bit like having
IT’S LIKE HAVING A BREADBOARD
pads, LEDs and
analogue inputs.
It also has two
a breadboard and advanced AND AN ADVANCED BREAKOUT
H-bridge motor
drivers and a
breakout cable all in one place
(with a few extra goodies thrown CABLE ALL IN ONE PLACE, RIGHT
convenient
mini breadboard
in for good measure).
Since this is HAT hardware,
ON TOP OF YOUR RASPBERRY PI
on top.
setup is relatively easy. We
slotted the Explorer HAT Pro into which you can learn all about as a breakout cable. There are
the GPIO pins. You can also use on the Pimoroni GitHub page also two H-bridge motor drivers.
the included mounts and screws (https://github.com/ These are used to work safely
to provide a firmer connection. pimoroni/explorer-hat). Setting with the high voltages used to
The mini breadboard is supplied up the software side of things drive motor systems and enable
as a separate piece of plastic is easy, although you’ll need you to drive the servo motors
with an adhesive strip on the to turn on i2c (which can be used in robotics projects.
rear. You can remove the accessed through the new There are a heap of extra
protective sheet and mount the Raspberry Pi Configuration tool). features on top of the ability to
mini breadboard on top of the The Explorer HAT Python library control voltages and motors.
HAT hardware, or you can just can be imported into your Four capacitive touch pads act
as buttons. These sit on the side
of the Explorer HAT Pro and
Features at a glance respond to finger presses. It’s
easy enough to add buttons to
a breadboard, but having the
feature built-in makes it that
much simpler to prototype
circuits that respond to button
pushes. You can even use them
to turn the Explorer HAT Pro into
a drum machine (like a stripped-
Capacitive touch pads H-Bridge motor drivers Mini breadboard down version of the Drum HAT).
Four touch pads act as Two H-Bridge drivers enable A mini breadboard enables Alongside the capacitive
buttons. Responding to finger voltage to be applied across a you to prototype circuits and touch pads are four coloured
presses, they can be used to load in either direction. These attach components right on LED lights: yellow, blue, red and
interact with your programs. are used to control motors. top of your Raspberry Pi. green. These can be controlled
independently for any purpose There are also four crocodile The Explorer HAT Pro is a
relating to your circuit. clip pads, of the kind found on great little prototyping add-on
The board also provides four the BBC Micro: BIT. While we for the Raspberry Pi. It extends
analogue inputs. The lack of find these clunkier than the the functionality of the GPIO
analogue input is limiting on the GPIO pins, they are an attractive pins in ways that are fun and
regular Raspberry Pi board, and alternative for many makers. functional. More importantly, it’s
the analogue inputs widen your Along with the other features, a neat, integrated little system
choice of devices. You can use they add an extra area for you that conveniently bundles
them with potentiometers, to experiment with. prototyping into the same
photocells, force sensitive Pimoroni sells an Explorer space as the Pi board itself.
resistors, temperature sensors HAT Pro Parts Kit (£10)
and two-axis joysticks. alongside the HAT itself. This kit
On a more regular note, includes LEDs and resistors plus Verdict
there are four buffered, 5V more interesting components
Explorer HAT Pro
tolerant inputs. These act just like a Piezo transducer, rotary
Developer: Pimoroni
like the GPIO pins on your potentiometers and analogue Web: shop.pimoroni.com/products/
Raspberry Pi, and you can use temperature sensors. All of these explorer-hat
them to respond to voltage parts are readily available, but Price: £18
changes in your circuit (so as to having the kit will help you work
detect motion from a PIR sensor
or button pushes and so on).
through the features on offer
from the Explorer HAT Pro.
Rating 9/10
Winter 2016 // // 107
REVIEW Picon Zero
In brief
The Picon Zero
is a physical
computing
and robotics
platform
designed for the
Raspberry Pi
Zero, but it will
work with other
Pi models. It
has dedicated
connections for
sensors, motors
and servos along
with external
power options
for high-current
projects. It can
control Neopixel
LEDs and works
with analogue
inputs. All
components are
controlled via a
simple Python
interface using
a series of
modules and
functions.
Picon Zero
Les Pounder might just have found the
ultimate platform for his robot army
C
hoosing the right Edukit 3. This dual-H-bridge
components for a controller controls two 5V
robotics project can motors, via two screw terminals
involve a lot of trial or two male pins, at around 2A
and error, but with of current, enabling a powerful
the Picon Zero we might just see robot to be built. Power for your
one board to rule them all. motors can come from the
The Picon Zero has been Raspberry Pi 5V pins, but if this
designed to match the shape of proves too much for your power
the Raspberry Pi Zero, but will supply then you can swap the
also fit on top of any 40-pin power supply, via a jumper, to an
GPIO Pi model. It has a set of external USB battery pack via a
inputs and outputs broken out handy micro USB connector on
as a series of male and female the underside of the board, or
header pins. The bank of six you can wire a battery box to
outputs, labelled 0 to 5, have the VIN terminals on the right of
three pins for each device – 5V the board. The board can also
power, Ground and Signal – and control servos, small motors
can connect to servos, LEDs and with a high degree of accuracy
even WS2812 LEDs (commonly which are commonly used for
referred to as Neopixels). precise control projects such
Each of these outputs can be as pan and tilt camera setups.
used digitally, either on or off, or All of the functionality is
with Pulse Width Modulation controlled via a Python 2/3
(PWM), which, for example, can library and it’s really simple to
be used to control the brightness use, thanks to a series of
of an LED or control the timings modules and functions that
of a signal. The bank of inputs provide a human readable
follows the same physical interface for the components
standards as the outputs but and enable this board to be
can be used with digital inputs, dropped in as a replacement for
such as buttons and switches, multiple boards. Think of it as a
as well as analogue sensors and Swiss Army knife for projects.
specialist sensors such as the Picon Zero provides a simple,
DS18B20 temperature sensor. robust and compact platform
Along the top edge of the for many different project types.
board is a series of female Other boards provide a stable
connectors, the first bank of platform for robotics but this
Features at a glance which break out a few of the really does provide everything
spare GPIO pins from your Pi – you need to get hacking with the
handy if you wish to connect any minimal amount of fuss. It will
other components. Just next to soon become your go-to board
this bank is a special row of four to get a project done.
pins, designed to accommodate
the HC-SR04 ultrasonic sensor,
commonly used to measure Verdict
distance via an ultrasonic pulse
External power Ultrasonic sensor pins Picon Zero
much like a parking sensor.
Powering motors can The HC-SR04 sensor uses Developer: 4tronix
These sensors often find their Web: www.4tronix.co.uk
get a little too much for 5V logic in its signals so
the Raspberry Pi, so it’s requires a voltage divider,
way into robotics projects. Price: £13.30
handy that an external
USB battery connector
which the Picon Zero has,
to safely connect to the 3V
The motor controller used on
the Picon Zero is a DRV8833, the Rating 10/10
is included. logic of the GPIO pins. same chip used for the Cam Jam
CamJam EduKit 3
Inspired by the latest Star Wars movie, Les Pounder tries to build his own
robot companion but can’t figure out how to fit everything into a beachball
R
In brief
obotics can become
quite personal, as THE KIT INCLUDES EVERYTHING
A robotics kit
that offers an
Robot Wars often
proves. But the first
YOU NEED FOR A MOTORISED
introduction
to the robot
barrier to entry is PROJECT – JUST ADD YOUR OWN
knowing what kit to purchase to
creation
process. The
kit comes with
get started. How much should CHASSIS FOR A UNIQUE ROBOT
all the parts
you pay? What components will
required to you need? For some budding
build a robot makers, the issue is a lack of in the box include resistors for can power motors that require
but leaves the
choice of knowledge of skills such as the HC-SR04 sensor, wires, a up to 2A of current. The motor
chassis entirely soldering. Now the team behind breadboard for prototyping your control board fits over the first
up to the maker. the CamJam kits has released its robot’s circuits, and a ball castor. 26 pins of the 40-pin GPIO. This
Includes lessons
to encourage own robotics kit for under £20. What enables a robot project leaves a selection of pins free for
creativity. The box includes everything is a motor controller, and the use on newer Pi models but also
you’d need to motorise a project. CamJam kit comes with its means the board is compatible
There are two large DC motors own controller with an H bridge with the older 26-pin GPIO
that come pre-soldered ready for – a circuit that can change its Raspberry Pi, enabling older
use with a Pi. These fit directly polarity, enabling a motor to Pis to be reused for robotics
into the large wheels and provide change direction. The DRV8833 projects – an ideal reuse of
for a decently paced robot. chip that powers the controller is them. The motor control board
There’s also a battery box to fully capable of controlling both also provides direct access to
power the motors, and a couple of our motors. This includes full a selection of GPIO pins to
of sensors, notably an HC-SR04 speed control thanks to PWM connect sensors and outputs,
ultrasonic sensor, which uses (Pulse Width Modulation). The should the user wish to do that.
ultrasound to detect objects in motor control board can work One key part of the CamJam
its path, giving our robot a basic with input power up to 10V and kits is their supporting tutorials
ability to “see”. The other sensor
is a line follower, which enables
our robot to follow a bold line
drawn on a surface. Other items
Features at a glance
The CamJam
EduKit 3 comes
with everything
you need to
get started in
robotics. It has
been well thought
out and priced
accordingly.
and this kit offers the same level the EduKit is still good value. Computing class and go on to
of quality. They come as a series It’s not just about what is in the build the chassis in Resistive
of 10 projects that gradually box, but rather the supporting Technologies, which has
introduce the components and documentation that raises this replaced shop or DT class, so
process of building a robot using kit above others. The lessons this kit can provide a true cross-
the kit. At present the tutorials that are built around the kit are curricular learning experience.
are written using Python 3 and a perfect fit for learning at a It’s a powerful and supportive
the RPi.GPIO library, which are steady pace at home, and can platform for experimentation
easy enough to use but require also be used in the classroom for and offers a gentle entry for
a learning investment for those educators wishing to introduce those new to robotics.
new to Python. Work is currently robotics into the curriculum.
under way to port these tutorials The beauty of this kit is in
over to the new GPIO Zero the customisation options. No Verdict
library, which offers an even chassis is provided, which helps
CamJam Edukit 3 Robotics
easier method of working with keep the cost low but also
Developer: CamJam / The Pi Hut
the GPIO. enables you to experiment using Web: http://bit.ly/CamJam-EduKit
The CamJam kits are always Lego, model kits or recycled old Price: £17
good value, and although the
CamJam Robotics kit is more
toys to build a unique robot. In
schools for example children Rating 9/10
expensive than its predecessors, could code the robot in
Picade by
Pimoroni
Warren Brown plugs his Pi into a
A fine addition to any desk,
maker bench or coffee table
T
In brief... he Picade offers flat-head screwdriver and Even though the Picade is
those with fond some elbow grease – amazingly styled like a cabinet and great
The Picade kit memories of the enough, there’s no need to for playing arcade ROMs,
from Pimoroni ’80s arcade scene break out the soldering kit. This Retropie – the go-to OS for retro
offers the
chance to a chance to relive being the case, the project is emulation – can emulate a host
experience those misspent days of youth. very family friendly, and the of classic consoles such as the
retro gaming
emulation at its
Starting it as Kickstarter project, video instructions mean there NES, Mega Drive or SNES. Even
most authentic. the team at Pimoroni envisioned shouldn’t be any of those classic computer games for the
It’s a great the Picade as an affordable all- awkward IKEA half-built back- likes of the Atari ST, Amiga and
option for
those who in-one solution, one that would to-front fails. Admit it, we’ve all DOS can be played. Importantly,
prefer tinkering enable Pi users to get up and been there. controls can be mapped via
rather than gaming with a minimum of fuss. The cabinet sports a slick Retropie, and more specifically
undertaking
a full-sized The kit includes a case, LCD black powder coated finish that customised for individual titles.
cab build. screen, arcade PCB, speakers, when coupled with the laser But what happens when it’s
buttons and control stick. It all cut perspex bestows upon the game over and you need your Pi
comes in a surprisingly compact project a level of polish few back? Luckily the Picade has a
box, with the fiddly stuff
compartmentalised in easy-to-
reference tool boxes. Although
RETROPIE CAN EMULATE A HOST
any model Raspberry Pi can be OF CONSOLES; CONTROLS CAN BE
used, we’d recommend going
with the latest model, the Pi 3 MAPPED AND CUSTOMISED
model B, for best performance,
and it’s worth pointing out that custom builds can match. handy back door and the
it’s not included in the box. Once everything’s assembled, Raspberry Pi can be easily
Build time will take just a few the micro-switched controls feel retrieved. All-in-all the kit
hours, and you’ll require only a responsive, with the joystick provides a great nostalgic fix
offering satisfying clicks of for those who enjoy gaming’s
arcade authenticity. Sound wise golden era.
Features at a glance the speakers bring all those The Picade really is an all-in-
iconic in-game effects to life, one solution at an affordable
but quality wasn’t brilliant. A price, and an excellent way to
substantial hum could be heard experience those classic arcade
when ramping the volume up gems of your youth.
high, but at this price point you
can’t expect top audio quality.
The eight-inch LCD screen Verdict
may sound a tad small but it
Colour coded Plug & play didn’t feel so during gaming
Picade by Pimoroni
There’s a fair bit of wiring The Pi talks to everything Developer: Pimoroni
involved, but everything is sessions. A separate 12-inch Web: pimoroni.com
via a custom PCB, making
colour coded and hooked connecting components a
screen is available but requires Price: £180
together via ready fitted
crimp connectors.
doddle. The Pi supplies all
the power; making this a
the BYO Screen Arcade Kit as
opposed to the all-in-one kit Rating 8/10
one cable cab. Very slick. featured here.
Editor-in-Chief Graham Barlow
graham.barlow@futurenet.com
Production editor Alex Summersby
Art editors Sethnam Singh, Jamie Schildhauer,
Fraser McDermott
Editorial contributors Jonni Bidwell, Les Pounder,
Mayank Sharma, Robert Jones, Nate Drake, Nick
Peers, Ali Jennings, Ben Everard
Commercial sales director Clare Dove
clare.dove@futurenet.com
Senior advertising manager Lara Jaggon
lara.jaggon@futurenet.com
Advertising manager Michael Pyatt
michael.pyatt@futurenet.com
Director of agency sales Matt Downs
matt.downs@futurenet.com
Ad director – Technology John Burke
john.burke@futurenet.com
Head of strategic partnerships Clare Jonik
clare.jonik@futurenet.com
Marketing director Sascha Kimmel
sascha.kimmel@futurenet.com
*#.1,"-+" %(
Senior Licensing & Syndication Manager Matt Ellis
matt.ellis@futurenet.com Tel + 44 (0)1225 442244
Trade marketing manager Juliette Winyard
Tel 07551 150 984
you can get for your Pi, and why you need them.
Editorial director Paul Newman
Group art director Graham Dalzell
,*&" .-
throughout for brevity. All other trademarks are the property of their respective
owners. Where applicable code printed in this magazine is licensed under the GNU
GPL v2 or later. See www.gnu.org/copyleft/gpl.html.
Entire contents copyright © 2016 Future Publishing Ltd or published under
licence. No part of this publication may be reproduced without written permission
*!%)$
for any loss of data or damage to your computer, peripherals or software through
the use of any tips or advice.
Printed in the UK by William Gibbons on behalf of Future.
More of the latest and greatest gadgets and add-ons /+(10&+*/#+.,//&+*0" +*/1)"./+*(&*"+*0("0
/).0,%+*"*!&*,.&*0
for your Pi. We’ll turn your Pi into something special! 101.",( &/,1(&
+),*5-1+0"!
+*0%"+*!+*
&((%5*$%+.*"
Non-executive chairman "0".(("*
"**5!'&*.*!
0+ '4 %*$" Managing director, Magazines +" 2+5
/5)+(
www.futureplc.com "(
**'*/.#*,%-",%--/"
derived from well-managed, certified forestry and chlorine-
free manufacture. Future Publishing and its paper suppliers
have been independently certified in accordance with the rules
of the FSC (Forest Stewardship Council).
*)-(",%!2",/,2
*Contents of future issues subject to change
LIFE OF Pi
The Astro Pi
Celebrating the big moments when the
Raspberry Pi changed the world
I
t’s pretty mind-blowing to know that the from a single block of aluminium by a company
Raspberry Pi has been into space. It’s even based in Derby called Pentaxia.
more amazing when you consider that The competition ran from January to July 2015
there were two of them up there on the and the seven winners all had their experiments
International Space Station (ISS), running launched into space. Between February and April
programs written by UK school children. 2016 these experiments were run on the ISS under
Back in 2015 the Raspberry Pi foundation, in the supervision of Tim himself. The experiments
conjunction with the UK Space Agency, ESA and did all sorts of cool things, using the sensors of a
the UK Space Trade Association, ran a competition SenseHAT attached to the Pi. Among other things,
for school students to design science experiments they took pictures of the astronauts using the
that would run on a specially-cased Raspberry Pi humidity sensor to detect them, they logged a
called the Astro Pi, which would be taken to the variety of sensor measurements of the ISS
ISS by British interior to be
astronaut IT TURNS OUT THAT CIRCUIT used in a copy
Tim Peake. of Minecraft
To become BOARDS WITH SPIKY EDGES back on earth
compatible with
space travel the AREN’T EXACTLY IDEAL IN A ZERO as a data
visualisation
Astro Pi needed
to be housed in a
GRAVITY ENVIRONMENT tool, and they
displayed the
specially designed flag of
case. You see, it turns out that circuit boards with whichever country the ISS was currently orbiting
spiky edges aren’t exactly ideal in a zero gravity above on the LED. You can check out the results of
environment where there’s no kind of atmosphere the experiments at the Astro Pi website https://
on the outside. There’s also the question of heat astro-pi.org/competition/science-results/
dissipation. In space the processes of convection Most importantly, of course, the Astro Pis
don’t happen, and with no dissipation, the warm worked flawlessly. The experiments proved that a
air just stays around the CPU and bakes it, so the Raspberry Pi can run in space, and in the process
case needed to be really effective for thermal a number of UK school children had the pleasure
dissipation. (There’s actually a minimal level of of knowing that their projects ran on the ISS. How
airflow on the ISS, which makes this possible.) cool is that? Maybe one day they’ll be taking an
There’s also a rule that any surface the crew of Astro Pi up to the International Space Station
the ISS touch must not exceed a temperature of themselves, because with the Raspberry Pi it
45 degrees. The resultant flight case was made seems that anything is possible.
OUT
NOW!
AS
YOUR NEW
PBE Y PI
RR
HE PI
JOIN T
UTION
REVOL
Discover
the world of
Raspberry Pi
The latest Pi projects,
news and reviews
9001