Mag Pi 135

Download as pdf or txt
Download as pdf or txt
You are on page 1of 100

YOUR OFFICIAL RASPBERRY PI MAGAZINE

Issue 135 November 2023 magpi.cc The official Raspberry Pi magazine

LAUNCH SPECIAL!
Quickstart setup • Build ideas • Accessories guide

50 Raspberry Pi Projects
XGO robot dog
PicoTouch Synth
£5.99

11›

9 772051 998001

WIN! OFFICIAL RASPBERRY PI 5 CASE


Industrial Raspberry Pi

ComfilePi
WELCOME

WELCOME
to The MagPi 135

R
aspberry Pi 5 is out now! This is a landmark event
for Raspberry Pi as it brings speed parity with
traditional desktop computers.
That you get all that speed and power in a tiny single-
board computer is nothing short of miraculous. And we Lucy

EDITOR
can’t wait to see what you make with it. Our Launch Hattersley
Special starts on page 36. Lucy is editor of
The MagPi and has
We’ve also got 50 Raspberry Pi project ideas starting on been making retro
synthpop in the
page 70. If you’re thinking of something to make with your Welsh countryside
for the last few
shiny new Raspberry Pi 5, this feature is sure to fire some weeks. Ideas for
brain cells. her synthpop
band name on a
We can’t wait to see what you make with Raspberry Pi 5. postcard, please!

magpi.cc
So please remember to share your creations (big or small)
with us using #MagPiMonday on social media. Or, email us
directly: [email protected]. We always love to hear
from you! GET
RASPBERRY
PI 5 FIRST!
Lucy Hattersley Editor Priority Boarding
PAGE 30

magpi.cc 03
GET YOUR
RASPBERRY PI 5
FIRST!
We’ve reserved Raspberry Pi 5 boards
for The MagPi subscribers

New subscribers to The MagPi will get a Priority Boarding


code when they sign up. So don’t delay. Take out a
subscription today! You’ll be able to buy your Raspberry Pi 5
first and get incredible Raspberry Pi tutorials, projects, and
community events every month.

magpi.cc/priorityboarding
TERMS & CONDITIONS A Priority Boarding code will be emailed to everybody who takes out a print subscription to The
MagPi or HackSpace magazine. People who subscribe to both magazines will get two codes. Print subs only! Priority
Boarding does not apply to people with App Store, Google Play, Zinio, PDF contributions, or other paid-for subscriptions. Each
code will entitle you to purchase 1x (one) Raspberry Pi 5 model (either 4 GB or 8 GB) for the standard retail price and delivery.
Multiple codes need to be used individually. This is a limited offer and is subject to change or withdrawal at any time.
CONTENTS

Contents
> Issue 135 > November 2023

Cover Feature

36 Raspberry Pi 36
Launch Special
Regulars
32 Case Study: Arribada
92 Your Letters
94 Events calendar
97 Next Month
98 The Final Word

Project Showcases
10 Blackberry Pi
14 Drill Press Camera
16 TouchCam 20
20 ScreenDress
22 Instant Framed Camera
26 Gutter Probe
28 PicoSynth

16

TouchCam ScreenDress

The MagPi is published monthly by Raspberry Pi Ltd, Maurice Wilkes Building, St. John’s Innovation Park, Cowley Road,
Cambridge, CB4 0DS, United Kingdom. Publishers Service Associates, 2406 Reach Road, Williamsport, PA, 17701, is the mailing
agent for copies distributed in the US and Canada. Application to mail at Periodicals prices is pending at Williamsport, PA.
POSTMASTER: Send address changes to The MagPi, c/o Publishers Service Associates, 2406 Reach Road, Williamsport, PA, 17701.

magpi.cc 05
CONTENTS

Tutorials 58 64
50 Using Ubuntu - part 1
54 Introduction to MQTT
58 Make a mecanum robot
64 Build a Bluetooth torch remote
Make a mecanum robot Build a Bluetooth torch remote
The Big Feature
70 83

CM4 XGO-Lite robot dog kit

86
50 Raspberry Pi Projects

Reviews
82 ClipZin
83 CM4 XGO-Lite robot dog kit
84 Learn circuits and electronics
Community
86 Nai-Wen Hsu interview
88 This Month in Raspberry Pi Nai-Wen Hsu interview

WIN OFFICIAL RASPBERRY PI 96

1 OF 10 CASES
DISCLAIMER: Some of the tools and techniques shown in The MagPi magazine are dangerous unless used with skill, experience, and appropriate personal protection equipment. While
we attempt to guide the reader, ultimately you are responsible for your own safety and understanding the limits of yourself and your equipment. Children should be supervised. Raspberry
Pi Ltd does not accept responsibility for any injuries, damage to equipment, or costs incurred from projects, tutorials or suggestions in The MagPi magazine. Laws and regulations covering
many of the topics in The MagPi magazine are different between countries, and are always subject to change. You are responsible for understanding the requirements in your jurisdiction
and ensuring that you comply with them. Some manufacturers place limits on the use of their hardware which some projects or suggestions in The MagPi magazine may go beyond. It is
your responsibility to understand the manufacturer’s limits.

06 magpi.cc
THE WORLD OF RASPBERRY PI

Final components are put


into the boards using robot
arms that have entirely pre-
programmed movements

Where Raspberry Pis


are made
The Sony factory in Wales is where Raspberry Pi
and its accessories come to life. By Rob Zwetsloot

P
encoed is not a big town, having a
population of under 10,000. However, big
things come out of there. It’s where you’ll
find the Sony UK Technology Centre, one part
factory where the vast majority of Raspberry Pis
are made, alongside other products such as Sony
broadcast cameras, and also where Sony supports
tech startups, prototyping, and code clubs.
We were lucky to be given a tour of the facilities
where machines, robot arms, and real people make
250,000 Raspberry Pi computers a week – from
board to box. Have you ever seen a machine put
a little computer in a box? It’s very cute, and
the mechanism to fold the lid is a very simple
Sheets of naked Raspberry Pi 4, ready to be assembled angled piece of metal that runs along the line,

08 magpi.cc Where Raspberry Pis are made


THE WORLD OF RASPBERRY PI

Each board is tested


before being packed
using this fantastic
Sony machine

maintaining the key engineering philosophy of


KISS (keep it super-simple, as our friends at the
 e were lucky to be given a tour of the
W
Raspberry Pi Foundation like to say it). facilities where machines, robot arms, and
Eco friendly real people make 250,000 Raspberry Pi
A (rightful) concern of many people is the
environmental impact of manufacturing products, computers a week
and a key part of the operation of the Pencoed
site is meeting sustainability targets which are set station you’ll have someone building a broadcast
every five years. From using more green energy to camera from scratch, with two a week going out
reducing waste of all kinds, Sony is taking active the doors, and in another section you’ll have
steps towards reducing its environmental impact. people snapping boards off runners to be fed into
You can see this along the lines, with (human- the boxing machine. The complexity is impressive
supervised) automated checks to make sure all to behold, with a lot of custom machines built
chips are installed correctly. Misaligned chips can and maintained by Sony to make the humble
usually be reset which cuts down on waste and Raspberry Pi.
overall improve yield, and the reflow soldering
methods (described in our engineering interview in
The MagPi 134: magpi.cc/134) in the new Raspberry
Pi 5 manufacturing process (referred to by a
codename of Hydrogen in the factory) that also
improve the number of working boards.
The factory floor itself is divided up into areas
with clear signs on what section is which. On one

Factory tour video


People are trained
Want to see the factory for yourself? Jeff Geerling on how to make
has a great video of his tour of the factory with even Raspberry Pi
thoroughly before
more excellent visuals: magpi.cc/tour.
heading to the
factory floor

Where Raspberry Pis are made magpi.cc 09


PROJECT SHOWCASE

Blackberry Pi
The BlackBerry is back – or at least that’s what David Crookes
thought until he looked more closely at Zhou Xu’s amazing creation

T
here was a time, before Apple and Google Even so, there’s still something rather
entered the fray, when BlackBerry charming about BlackBerry handsets and, for
smartphones were all the rage. They were anyone wanting to do some serious computing
introduced in 1999 and, at their peak in 2011, on-the-go, tapping away on physical keys
attracted more than 85 million users. From remains more comfortable. For those reasons, it’s
that point on, however, it was all downhill as hard not to be enthused about Zhou Xu’s amazing
BlackBerry’s big selling points – the physical project. It allows Linux software to run via a
keyboard and email service – gave way to Raspberry Pi Zero W computer on a 320×240 LCD
Zhou
MAKER

touchscreens and rival alternatives. screen and it’s controllable using a BlackBerry-
Xu style keyboard.
Zhou is an electron
“The idea started from my Game Boy Zero Plus
microscope build that was based on a stripped Raspberry
scientist working at Pi 3A computer,” Zhou explains, referring to a
Monash University
project in which a new Game Boy handheld was
in Australia. He also
describes himself built by inserting a thinned-down Raspberry Pi
as a maker, 3D 3A into an original case. “After completing it,
printing nerd, and I decided that I would then love to make use of
LEGO MOCer.
Raspberry Pi in a handheld format for testing
magpi.cc/bbpi and debugging in the field. But I did not have a
clear plan for the keyboard design until I recently
found the BBQ20KBD from Solder Party.”

Key components
The BBQ20KBD is a QWERTY keyboard and
optical track pad device powered by an RP2040
microcontroller. Identical to the BB Q20 used
in the BlackBerry Classic released in 2014, the
tiny set of keys is placed onto a custom-printed
circuit board and, because it has a USB Type-C
 hou gathered all
Z
of the components socket, it’s easy to hook up to Raspberry Pi.
together before
The keyboard gave Zhou’s Blackberry Pi a
considering the
design of the case strong direction. “The design was heavily inspired

10 magpi.cc Blackberry Pi
PROJECT SHOWCASE

The overall design is a


Look above the screen mash-up of a BlackBerry
and you can see that all phone, a Game Boy
of the GPIOs are available handheld console and, as
for easy connection a nod to the more distant
past, a ZX Spectrum!

Running Raspberry Pi Quick FACTS


OS, the device boots
in the command-line >  The project uses
interface by default an upcycled
BlackBerry
keyboard

>  The NNQ20KBD


keyboards cost just
£30/$30

>  BlackBerry Pi
is designed for
by many other Raspberry Pi handheld projects, potential future
such as Beepy and ClockworkPi,” he adds. There expansion
were some other requirements. “One of the aims
>  External devices
for this design was to test an SDR radio antenna
may need an add-
in my backyard. A battery-powered handheld is
on battery pack
so much easier for this job,” he says.
Zhou chose a 2500 mAh LiPo battery, as well as >  The STL and STEP
an Adafruit PowerBoost 1000C power supply. He files are at:
also took a GearBest 3.5 composite LCD display magpi.cc/bbpi3D
out of his Game Boy Zero Plus build, and added
a Raspberry Pi Camera Module 2 NoIR. Of all the
components, though, selecting to use a Raspberry
Pi Zero W was the easiest decision.
“I started playing with Raspberry Pi with the
original version so I’m very comfortable tinkering
with the config files and soldering the pins,”
 he case was designed in SolidWorks, a 3D CAD
T
package for Windows that dates back to 1995! Zhou says. “Even though many Raspberry Pi

Blackberry Pi magpi.cc 11
PROJECT SHOWCASE

“Besides, if I’d have used an existing


BlackBerry case, squeezing the components
in there would be very challenging. That said,
recently I’ve started to teach myself to use KiCad
for designing customised PCBs. Perhaps it would
be possible to make one that fits in a BlackBerry
case using a [Raspberry] Pi Compute Module 4.”
Not that the project is any worse for having
a freshly designed case. In fact, it looks
amazing, made all the prettier by having the
classic rainbow stripes as seen on the Sinclair
ZX Spectrum from 1982. “That was a bit of a
random decision,” Zhou says. “ZX matches
my initials and I’ve always liked retro-
style designs.”

Clever case
A lot of thought went into the case. “I’m pretty
proud to point out that all the GPIO pins are
accessible from the top of the screen and I

E ver since my Game Boy


project, I find it so much
easier to build things from
the ground up

have added a few peripheral mounting points


around the enclosure for future add-ons such
as [Raspberry] Pi HATs,” Zhou adds. “I’m also
very excited about the outcome of the enclosure
 he main components
T models were still out of stock at the time when I printing. This was the first time I have ever
sit behind the screen.
started this project, I still wanted to use one (and played with the six-colour manual change on my
There is a 5 V fan for
cooling too I’ll be upgrading to Raspberry Pi Zero 2 W). I find Klipperised Ender-3 printer.”
the comprehensive documentation provided by It nevertheless proved very challenging.
Raspberry Pi is so much more useful than starting “I spent quite some time trying to optimise
from scratch on the other counterparts.” the arrangement of different components,
especially the position of the GPIO pins and
Mod man other connection ports so that they can be
Rather than use an existing case to fit the easily accessible,” he continues. “It was also
components, Zhou felt he would have much very tricky to squeeze all the components into
more control if he designed his own. As such, such a tight space. But I guess one thing that
he drafted a case using the 3D CAD package differentiates this project from the others is
SolidWorks, with the aim of outputting the design that all of the components can be purchased
to his Creality Ender-3 3D printer. off-the-shelf, and it does not require any PCB
“Ever since my Game Boy project, I find it so design experience.”
much easier to build things from the ground up,” The end result is a stunning, expandable
he explains. “Modding an existing enclosure can machine that boots, by default, into the
take quite some extra effort and I’m now getting command-line interface. The frame buffer is
more confident in CADing. enabled in the /boot/config.txt file to display

12 magpi.cc Blackberry Pi
PROJECT SHOWCASE

A bit of BlackBerry magic

Zhou Xu dropped the USB port because


01 Raspberry Pi and the LCD screen were pretty
much drawing the power supply’s capacity. But he
used an I2C connection for the keyboard so added
it again!

Frustrated that the BBQ20KBD keyboard does


02 not have ESC and CTRL keys, Zhou sought
help. He said he was able to get the BBQ20KBD I2C
driver (magpi.cc/bbq20kbd) working, which allowed
the function keys to be mapped.

320×240 resolution and, as well as being great  he back of the


T
Blackberry Pi makes
for entering code, the Blackberry Pi is able to use of a Raspberry Pi
capture photos. It’s proving to be quite a useful Camera Module 2 – the
night-vision-enabled
Linux handheld. NoIR version
But Zhou is not yet finished. “As I mentioned
earlier, I’ll be adding a Sense HAT and an SDR
dongle. I also recently added a light guide to the
USB charging port using translucent 3D-printing
filament, so that the Adafruit PowerBoost status
LED lights can be visible from outside the
enclosure (green being fully charged, orange
charging, and red showing low battery).
“Unfortunately, the progress has been slow
lately because there are a few other projects Using translucent 3D printing filament has
03 allowed Zhou to add a great-looking power-
which have been keeping me busy, including
status light to the USB charging port. When it is
using a Raspberry Pi to remote-control an
orange, as shown, here it is charging. It’ll turn green
electron microscope and optical filters, but
when full, and red when it needs charging.
everything seems to be working very well.”

Blackberry Pi magpi.cc 13
PROJECT SHOWCASE

Drill Press Camera


A desire for absolute precision was this maker’s driving force.
Nicola King admires the microscopic details

E
xperienced at etching PCBs in his garage, crosshairs on its screen are lined up with the
John McNelly found that one of the most centre of the drill bit,” he says. “Once a PCB is
frustrating and time-consuming parts of placed on top of the drilling platform, the user can
fabricating two-sided boards was drilling the see a magnified view of the traces and intended
through-holes. Keen to speed up the process, he drilling location.” Since the position where the
created the Drill Press Camera, a clever piece of drill bit will make a hole is indicated by the
kit that makes his life so much easier. crosshairs on the camera screen, “lining up holes
“I got tired of squinting at a teeny-tiny drill bit with the centre of the drill bit is about as easy as
John
MAKER

attached to a benchtop drill press,” John explains, point and shoot.”


McNelly “so I built this project so that I can squint at a A Raspberry Pi Pico is used to control the LED
teeny-tiny screen attached to a benchtop drill strips that illuminate the underside of the PCB,
A tinkerer who is
fond of making and press instead. The microscope camera has an and John has written a simple MicroPython script
breaking new things HDMI output that I’ve been meaning to hook up that “reads brightness and hue values from
with electronics,
to a larger display, but even with the small built- two potentiometers on the control board, and
software, and
mechanical in screen, the magnified image has made drilling sends the corresponding NeoPixel commands
engineering. John much faster and more accurate.” to the high-density LED strips embedded in the
lives in Campbell, periscope.” John wanted the ability to dim the
CA, and works as an
electrical engineer.
Practicalities LEDs and also added colour control: “With some
John’s project works by using an angled, mirrored experimentation, I found out that controlling the
johnmcnelly.com
periscope to point a microscope camera at the colour of the LEDs was a cool way to improve
underside of a drilling platform. “The position contrast on some material types.”
of the Drill Press Camera is adjusted until the
Reviving concepts
John estimates that he is now twice as fast at
drilling holes than when he was aligning by eye,
and “my holes are also much more accurate.”
Unsurprisingly, the project has garnered a good
deal of enthusiastic reaction, especially regarding
the periscope configuration. “One [Hackaday] user
pointed out that I had pretty much reinvented
something from the 1970s called a ‘Target Drill’,
which is pretty cool.”
John is more than happy to have reintroduced a
drilling concept to a new generation: “There’s a lot
of really neat fabrication equipment from the good
old days, when people made PCBs by hand, that
has since faded away.” After taking this project to
Open Sauce in San Francisco earlier this year, he
found that “lots of maker types were curious about
it, and then quite enthusiastic about the concept
once they saw how it worked! Drilling precise
Housed in a protective case with the other electronics,
holes in flat things is apparently not a problem
Raspberry Pi Pico controls the LED strip lighting for the project that is unique to PCB fabrication.”

14 magpi.cc Drill Press Camera


PROJECT SHOWCASE

The drill press platform includes


Pico-controlled LED lighting,
adjustable with two rotary
potentiometers at the rear

A periscope-style section
features an angled mirror to
enable the camera to see the
underside of the platform

Quick FACTS
>  John spent around
The LCD camera view
50 hours on
features crosshairs to
the project…
aid precision alignment
of the drill with the hole
>  …including
20–30 hours on the
CAD model

>  The total cost of


the build came in at
under $300

>  See John’s GitHub


for full details:
magpi.cc/
drillpressgh

>  Have any


questions? He’s
happy to help:
johnmcnelly.com/
contact

If you’d like to build your own, John is more


than encouraging, claiming this design is easy to
build if you have access to a 3D printer and some
soldering supplies. “Most of the stuff is pretty easy
to get, but I’ve only been able to find one supplier
for 2-inch glass circles of the right thickness.
Since the microscope camera’s field of view passes
almost entirely through the hole drilled in the
glass disc, I think that a 3D-printed disc with a
hole in it could substitute for the custom glass part
just fine.” Go forth and create, as John would love Connected to Pico, a custom PCB features two potentiometers
to see what you come up with. to adjust the colour and brightness of the LEDs

Drill Press Camera magpi.cc 15


PROJECT SHOWCASE

TouchCam camera
A love of making shines through in this Raspberry Pi
4-based TouchCam project, finds Rosie Hattersley

M
ukesh Sankhla’s enthusiasm for tech as well as offering on-demand photography and
jumps off the page. His responses to The remote printing. He used Fusion 360 to come up
MagPi’s questions about his TouchCam with his own camera case design, and NextPCB for
camera project are packed with words such as the bespoke printed circuit board. Both the Linux-
‘inspire’, ‘love’ and the absolute joy he’s found based PiCam and the TouchCam have Raspberry Pi
in sharing his roster of makes over the past three 4 at their core and Remote.It and SSH, so the HQ
years. Having completed his studies only a year camera can be triggered from anywhere.
ago, the computer science graduate was quickly
Mukesh
 y goal was to
M
MAKER

snapped up by Siemens India, where Mukesh


Sankhla works as a software engineer with an Internet of
Siemens India Things focus, and spends his spare time creating blend my love for creating
software and IoT and sharing technology-based designs. The
developer Mukesh
loves making and
TouchCam has gone through several iterations, things with my technical
which Mukesh has shared as an Instructable:
documenting
electronic, magpi.cc/touchcamins. Its design is loosely based knowledge
mechanical, and on Adafruit’s 3D printer camera case for Raspberry
software projects.
Pi HQ Camera (magpi.cc/hqcam3d). Mukesh’s Iterate and improve
magpi.cc/ initial version, the PiCam, added remote access Designing the TouchCam gave Mukesh a chance
touchcamins
options and was pitched as a means of monitoring, to combine his skills as a maker and a computer
science enthusiast. “My goal was to blend my love
for creating things with my technical knowledge,”
he enthuses of the versatile device “that can
even work as a server for my test applications
and database.”
Perhaps it’s no surprise that, as a computer
engineer and developer, Mukesh works in a
process of continuously improving successive
designs. Mukesh says many of the design updates
and improvements he made when moving on from
the PiCam and developing TouchCam were directly
The TouchCam’s influenced by the feedback he got from the design
screen provides
of the PiCam. It is also an apposite demonstration
instant video and
time-lapse playback of how far his Fusion 360 computer-aided design

16 magpi.cc TouchCam camera


PROJECT SHOWCASE

A DFRobot touchscreen on the


rear allows for on-body camera
controls, while Remote.It software
means it can also be used remotely

Raspberry Pi HQ camera and 8GB


Raspberry Pi 4 power the TouchCam
and provide time-lapse photos and
HD video footage

Mukesh is justifiably proud


of his Fusion 360 CAD skills,
resulting in this gorgeous
3D-printed camera case Quick FACTS
> The TouchCam
took about a week
to print and build

> It cost around $170,


but has no
running costs

> Mukesh has used it


as the ‘eyes’ of
his robot

> A strength of being


able to control
it remotely

TouchCam camera magpi.cc 17


PROJECT SHOWCASE

A sample photo
taken using the skills have developed and was used to showcase
TouchCam triggered his design prowess for his BSc.
remotely
With the TouchCam, Mukesh was keen to design
Raspberry Pi HQ
Camera offers high- a system that is compact and easy to carry and that
quality photography would appeal to multitaskers who enjoy activities
using its 12.3
megapixel Sony such as 3D printing, time-lapse photography,
IMX477 sensor electronics, robotics, programming, and machine
learning. He also thinks the TouchCam could be
used for software development, low-cost personal
servers, and similar uses.

I chose the Raspberry Pi


because it’s affordable,
powerful, and has an
internet full of resources
Fine new features
The TouchCam builds on the PiCam by integrating
a high-definition touchscreen display and has
a touch sensor that is used for live view, to
access the photo gallery, and to switch between
still, time-lapse, and video capture modes. The

18 magpi.cc TouchCam camera


PROJECT SHOWCASE

TouchCam tips

You’ll need a Raspberry Pi 3B+, 4, or 5, a


01 Raspberry Pi HQ Camera, and a touchscreen
display. Design or reuse an existing case or use
Mukesh’s STL files at: magpi.cc/touchcam360.

TouchCam is an
HQ Camera remote server also gained more evolution of the
prominence. “I chose the Raspberry Pi because PiCam Mukesh
designed and built
it’s affordable, powerful, and has an internet full Assemble the camera case, adding a heatsink
of resources. I am using the Raspberry Pi 4 8GB
02 for Raspberry Pi 4. Follow the instructions at:
variant.” The components were sourced online, magpi.cc/touchcamins.

with standard items such as the HQ Camera paired


with a DFRobot Raspberry Pi Touchscreen, cooling
from a 5 V fan, and open-source software libraries
such as Imager, and Silvan Melchior’s Raspberry Pi
Camera Web Interface (magpi.cc/rpicamwebint).
Having already got the basics down pat with
the PiCam, the case design and touchscreen
integration were the real challenges for this build.
Only three 3D-printed versions were needed, and
even these were simply to fix minor fit issues to
accommodate the screws. Overall, Mukesh was
pleased with the way the TouchCam turned out:
“Everything from the outer shell that feels good to
hold, to the special mounts that hold the camera
Use Remote.It to run the camera remotely. All
perfectly. Each piece came from my careful design 03 the code you need to program the TouchCam is
work, making sure they look good and work at: magpi.cc/touchcamgit.
just right.”

TouchCam camera magpi.cc 19


PROJECT SHOWCASE

ScreenDress
We’d definitely say yes to this dress – a stunning creation by Anouk Wipprecht
that is proving to be an eye-opener, as David Crookes discovers

I
t’s fair to say that clothing fashion and quality functional production parts,” Anouk
computing don’t always go hand-in-hand. continues, pointing to the components being light
But bring amazing talent such as Anouk – an important factor when being worn.
Wipprecht on board and all eyes are definitely Behind each of the HyperPixel 2.1 round hi-res
going to be on the wearer – as this striking screens that display the eyes are Raspberry Pi Zero
ScreenDress shows to great effect. 2 W computers. “There are six of them,” Anouk
As well as fitting snugly around the body, says. They take information from the sensor that
the 3D-printed dress includes a set of circular has been analysed in real-time and determine
Anouk
MAKER

LCD screens, each of which looks like an eye. how the animated eyes appear on the screen.
Wipprecht Connected to an EEG sensor – a four-channel BCI

Anouk Wipprecht is
headset developed by neurotechnology company Got the look
a Dutch FashionTech g.tec – they change according to how the wearer To ensure the ScreenDress is in-tune with the
designer and feels by reading brainwaves and working out a wearer’s brain, anyone wearing the clothing,
innovator who works person’s cognitive load. which has the eyes flaring out from a sculpted
and travels between
San Francisco, Los To that end, the screens can show signs of neck-piece, has to undergo a two-minute
Angeles, Miami, stress, fatigue, and frustration. The more a person training session. Machine learning then begins
and Amsterdam. subconsciously feels to understand the
anoukwipprecht.nl their mental load is
increasing, the wider
The 3D-printed dress wearer’s mental
workload so that the
the iris and pupils includes a set of circular eyes work as accurately
dilate. By making as possible.
changes in real- LCD screens “Our fortunes turned
time, Anouk, a Dutch when Raspberry Pi
FashionTech designer, says the dress is able show Zero 2 W, equipped with a quad-core Cortex A53
a direct correlation between a person’s actions processor, was released,” Anouk says. “This
and their brain’s reaction. One thing’s for sure, upgrade significantly enhanced the processing
it’s certainly eye-catching. capabilities [over Raspberry Pi Zero W], allowing
us to manage data seamlessly and achieve the
Dress to impress desired performance.”
ScreenDress was created from scratch. As ScreenDress is certainly cool and it turned a lot
well as the headset – called the Unicorn of heads when it was first put on show at the ARS
Headband – the dress was designed in Onshape Electronica Festival in Linz, Austria in September
(magpi.cc/onshape), a free, cloud-based CAD app. before being presented in Budapest, Hungary and
Anouk said it helped her to understand the look Eindhoven, Netherlands. It has also posed a lot
and feel of the possible embedded LEDs and how of questions.
light reflected back on the body and space around “What does it mean when we can connect
it. “I used various Onshape design capabilities technological-expressive garments to our bodies,
including mixed modelling, generative design, body signals, and even emotions? What dialogues
render studio, and in-context design to reference can we trigger? This is what I am exploring with
hardware elements,” she adds. designs like these,” Anouk explains. It also means
The dress was outputted to an HP Jet Fusion that Raspberry Pi computers can be seen as a
5420W 3D printer using a form of nylon. “This fashion accessory, potentially inspiring many
material is ideal for engineering-grade, white, other makers.

20 magpi.cc ScreenDress
PROJECT SHOWCASE

The wearer needs to don


an EEG sensor as part of a
Each eye is a 2.1-inch
3D-printed headset called the
HyperPixel 2.1 Round
Unicorn Headband, designed
480×480 touchscreen
by Anouk and tech firm g.tec
capable of displaying
18‑bit colour images at
60 frames per second

The lightweight neck-piece


is designed to hold the eyes.
Raspberry Pi Zero W computers are
hidden from view behind each eye

Quick FACTS
>  The dress has been
featured around
the world

>  Each eye is


powered by
Raspberry Pi

>  It uses a type of


nylon called PA12 W

>  The prints


remain white and
don’t discolour

>  A prototype is
displayed at the
Museum voor Beeld
& Geluid

ScreenDress magpi.cc 21
PROJECT SHOWCASE

Instant Framed
Camera
A little tinkering has given this classic camera a
second shot. Nicola King focuses on the facts

A
broken Polaroid Land Camera may, for
some people, not prove particularly
inspiring. However, Max van Leeuwen’s
grandfather had given him the antiquated object,
and Max was determined to give it a new impetus.
“I really wanted to hide a Raspberry Pi in there
and bring this vintage object back to life in some
way,” he tells us. “I loved the idea of adding some
Max van
MAKER

mysticism to it. At first, I wasn’t sure what to


Leeuwen make with it, though…”
Max studied at the When Max came up with the idea of adding an
Netherlands Film e-paper display module to the mix, he knew he
A Raspberry Pi 3A+
Academy. After working was on the right track. “I wanted to make a live
in visual effects for with a Li-ion Battery
film, he now develops
picture frame right away… This idea felt right HAT is secreted in
augmented reality and because, now, I could give the picture frame to the body of the old
interactive installations. my grandma and keep her posted (it lives in her Polaroid camera
maxvanleeuwen.com bookcase now).”

A flash of inspiration
Using a Raspberry Pi Camera Module 3, a couple
of Raspberry Pi 3 Model A+ boards, and some
Python code, along with the other required
bits of hardware, Max has essentially created a
camera within a camera here, as a digital camera
is hidden within the body of the original shell.
“When the camera’s button is pressed, it makes a
hidden digital camera take a picture,” he explains.
“This picture is sent to a server, for the display
frame to show.”
Interestingly, Max decided that he wanted the
picture to then be deleted from the camera itself
and, once the frame has downloaded this picture
to display it, it is deleted from its storage as well.
 aspberry Pi is
R “I really like the idea of having only one copy of
equipped with a
Waveshare Li-ion the picture baked into the e-ink display. It makes
Battery HAT, enabling
the picture feel important, and it fits with the
a 14500 battery to be
recharged via USB-C essence of Polaroid photos,” declares Max. When

22 magpi.cc Instant Framed Camera


PROJECT SHOWCASE

The original lens


was replaced with
a Raspberry Pi
Camera Module to
take digital images

With the image


uploaded to a server,
the e-paper photo
frame can download
and display it

Quick FACTS
>  The hardware cost
a new picture is taken, the old one disappears Max around €200
from the frame.
>  The parts list
The e-paper display module was a key
is in the GitHub
inspiration to Max to make the photo frame: “I
repo: magpi.cc/
really like the look of a display that doesn’t emit instantcamgh
any light, so it’s more like an e-book instead of a
screen. It’s really fun to see the individual dots on >  This was one of
it; it looks just like a real print.” When he found Max’s very first
a type of e-paper that could do colours, there was Raspberry Pi
no stopping him. “The slow drawing speed of the projects
e-paper module (~1 minute) fits with the idea of
mimicking developing film, which was a happy >  Although time-
consuming,
accident,” he enthuses.
he thinks it’s
Max was determined that the camera should
straightforward…
send pictures to a server, instead of directly to the
other device, so that it works “even if both devices >  “Anyone with an
are on opposite sides of the planet.” Deciding affinity for coding
against using a SIM card in the camera and frame, can pick this up and
 ax considered using a Pico in the camera, but eventually opted
M
he instead opted for Wi-Fi, and the camera simply for a Raspberry Pi 3A+ for its extra RAM improve it!”

Instant Framed Camera magpi.cc 23


PROJECT SHOWCASE

 omprising another
C connects to Wi-Fi networks by taking a picture of real camera’s button trigger a signal necessitated
Raspberry Pi 3A+ and
e-paper display, the
a QR code. some good old-fashioned trial and error. “I ended
digital photo frame up using a metal spring with aluminium foil on it,
downloads each
image from the server Shooting the snags and the ends touch when the button is pressed to
Max found that the physical build was the hardest make a closed circuit.”
element of the project, and many hours of work
went into the venture. “At first, I only made little
steps at a time for a couple hours a week but, once
I really like the idea of
it started taking shape, I dedicated a few days to having only one copy of
it to make some real progress,” he reveals. Most
of his time went into the physical photo frame the picture baked into the
and the camera body. “Breaking the camera
open on the inside without breaking it on the e-ink display
outside was a bit of a tedious task. And the photo
frame needed a wooden shape on the back to fit Finally, deciding on power options for the
the computer and wires, so that became a little camera demanded some further head-scratching
arts‑and-crafts-session.” – “I ended up using a battery HAT that works for
Max’s father was on hand to help him with the about an hour on this setup and can be recharged
woodwork for the frame, but “I was scared I’d with USB-C.” The end-product was well worth
break the camera when drilling a hole through the the labour and troubleshooting required en route,
top for an LED light,” he shares. Also, making the however. As long as there is Wi-Fi available, “the

24 magpi.cc Instant Framed Camera


PROJECT SHOWCASE

photos you take with the camera appear instantly


on the display frame, no matter where in the world From camera to frame
each of them is.”

No negatives here
Understandably, many people have enjoyed
reading about Max’s camerawork.“There were
a lot of positive reactions online! I really loved
reading them. All the individual steps to making
this project are nothing new, but bringing them
together into this simple idea is what people
seemed to appreciate the most.”
Significantly, he has had messages from a
number of people who are keen to replicate
his endeavours using similar vintage cameras.
Protected by a Perspex cover, the Camera
Describing this as “super-cool”, Max is very keen 01 Module is connected to a Raspberry Pi 3A+
that people make their own variations and, indeed,
inside the Polaroid camera body, powered by a
improvements to the project. “One possible Li‑ion Battery HAT.
variation someone told me about was to make
multiple photo frames and connect them to the  ax handcrafted a
M
wooden back for the photo
same camera, so you can update a whole group at
frame to fit in Raspberry Pi
once! That could be fun.” and the wiring

When the camera’s button is pressed, a circuit


02 is completed, sending a signal to Raspberry
Pi’s Python program to light the flash LED and take
a picture.

The image is then uploaded via Wi-Fi to a


03 server. From there, it can be downloaded to the
e-paper display frame, no matter where it is located.

Instant Framed Camera magpi.cc 25


PROJECT SHOWCASE

Gutter Probe
Trying to discover the cause of a blockage, Peter Anderton invented an ingenious
solution that resulted in a twist ending. Rob Zwetsloot listens to the tale

R
aspberry Pi is used for a lot of things – rainwater would just overflow. He didn’t want
some more surprising than others. When to hire expensive equipment to confirm this
Peter Anderton emailed us about a very theory, though.
unique use of Raspberry Pi to solve a conundrum, “I then had the bright idea of mounting a
we decided we had to share it in the magazine. Raspberry Pi Camera on the end of a long pole to
“My wife and I had noticed that, whenever get a view of the plant itself,” Peter mentions.
it rained hard, we were getting a serious “The sticking-point here was how to connect the
overspill from one of our house gutters onto camera to Raspberry Pi whilst still being at the
Peter
MAKER

our conservatory,” Peter says in his email. far end of the pole. At first, I considered having
Anderton
“Unhelpfully, the overspill appeared to originate Raspberry Pi and camera both mounted at the far
A civil engineer with from an inner-corner joint of the gutter, over end, but this would have required much longer
a background in 15 feet up and directly over the conservatory, so power and display cables than I had available; the
computer science virtually impossible to reach without scaffolding obvious alternative was just to have the camera at
who eventually
became a software or a cherry-picker, either of which would be the far end of the pole but, at the time, I only had
developer before extremely expensive if it turned out there were to hand the short ribbon cable that came with the
semi-retiring, and no alternatives. We first thought the cause might camera, and had no idea whether longer cables
now does a lot of
just be a leaky joint, but one day we spotted were even available. However, after discovering
making and puzzle-
solving for fun. a suspicious growth poking out above the that cables up to 2 m in length existed - thank
gutter itself.” you, The Pi Hut! - I had at least solved the
With a bit of deductive reasoning, Peter figured connectivity issue.”
out that the plant was blocking the joint, so the
Printed solution
Peter turned to Fusion 360 to design and then
3D-print a mount that would allow the Camera
Module to slot inside a bike lamp bracket, which
was then mounted to a pole. After taking a peek,
Peter found the true culprit – a plant growing in a
big clump of soil.
“I now had a much clearer idea of what exactly
we were dealing with, but there was still the
matter of how to get the offending plant out,”
Peter continues. “It was unlikely any cherry-
picker would be able to fit through either of our
side gates to reach the rear of the house where
this gutter was, so it would have to operate from
the adjacent road, with all the safety and other
implications that would entail. However, to go
The original mount used to take a peek at the gutter down the scaffolding route would be equally

26 magpi.cc Gutter Probe


PROJECT SHOWCASE

A tw0-metre-long camera
cable was used to extend
the camera down the pole

The culprit causing the rainwater to spill over

T he success of this venture


has opened my eyes to 3D-printed parts allow
all the components to fit
the potential for remote- together nice and simply

viewing generally
Quick FACTS
problematic, not least because it would have to
bridge over the conservatory to get to the gutter in > The project was
the corner, with no obvious way to support it.” printed in PLA after
For one small plant, this was a bit overkill. initial tests in ABS
However, he did have a pole that could reach
> The WOLF-Garten
the plant, so he began Phase 2 of the operation:
tool was originally
attaching a trowel. He already had a WOLF-Garten
used to scrape a
system that he’d 3D-printed parts for, so he made
corrugated roof...
a further extension to fit the trowel on.
> …and Peter had to
Remote gardening print a different
After digging up a bit of the soil, the plant was scraper so it would
removed and the gutter stoppage fixed. It worked fit properly
so well, it’s inspired him to do more.
“I would be the first to admit that I produce > Apart from the
extra-long camera
more things using my 3D printer than I do using a
cable, everything
Raspberry Pi,” Peter says. “However, the success
used was stuff
of this venture has opened my eyes (no pun
From a previous project, this Peter had
intended!) to the potential for remote-viewing
trowel worked perfectly to
generally using Raspberry Pi / camera combination > The original
scoop out the offending plant
and, to this end, I have bought a second 2 m camera used was
camera cable and connector, as well as a new a Raspberry Pi
Raspberry Pi Camera Module 3.” Camera Module V1

Gutter Probe magpi.cc 27


PROJECT SHOWCASE

PicoSynth
One maker has turned PicoTouch capacitive board into a wave synthesiser.
Lucy Hattersley channels her inner Kraftwerk

T
od Kurt is a maker with a love of There is also a PicoTouch Slidercase that is “a
musical synths and his latest creation is simple 3D-printable protective enclosure for the
PicoSynth, a MIDI synthesizer based on the PicoTouch USB MIDI / HID controller board.”
PicoTouch board. “The result is still very thin and helps prevent
PicoTouch is a thin capacitive touch platform, false triggers or bad calibration if touching the
and Tod’s software turns Raspberry Pi Pico into a back on power up,” explains Tod. You print it in
MIDI synthesizer that he can use to play sounds two pieces, and no supports are required. Snap the
directly, or connect to another computer to control top piece around the PicoTouch board, then slide
Tod
MAKER

audio software (magpi.cc/picotouch). the combo into the bottom piece. A third ‘picocap’
Kurt
The PicoTouch CapSense MIDI keyboard is a piece can be printed and glued to the top piece to
Tod is a maker slim plastic board with 22 touch pads and 19 RGB protect the Pico.
from Pasadena CA. LEDs. “It’s one of the thinnest MIDI controllers The PicoTouch Synth software is installed
He runs ThingM, at about 6 millimetres when Raspberry Pi Pico is on Pico as a ready-made U2F file (magpi.cc/
is co-founder of
CrashSpaceLA installed,” says Tod. picosynthgit). The source code is also available.
hackerspace. The ten pads on the bottom are note triggers
mastodon. for the C major scale, while the two pads on the MIDI sound
social/@todbot right shift the octave up and down. The top row Once up and running, PicoSynth is powered by
of pads controls wave and filter functions. Finally, a USB-C socket on the right, and to the left sit
three ‘patch select’ buttons on the right move three 3.5 mm audio jack connections that provide
between different waveforms. You can pick the audio out, MIDI in, and MIDI out. The device can
board up from Tindie for $11, although it will need be connected directly via USB-C to a computer
a Raspberry Pi Pico soldering inside. running audio software, such as Ableton. You can
“It’s not too bad!” says Tod. “It’s a pretty also use Reaper if you want something that works
easy first-time, surface-mount device natively on Raspberry Pi
soldering project.” Tod has created a video
showing how to solder Pico to the board
(magpi.cc/picotouchsolder).

PicoTouch inside its


3D-printed ‘Slider’ case is a
thin and small (and cheap)
portable MIDI controller

28 magpi.cc PicoSynth
PROJECT SHOWCASE

The capacitive pads act as


buttons with the bottom row
used as a scale of notes, and
the top row adjusting the
waveform pattern

Pico needs to be soldered


onto the PicoTouch board
which makes it an easy
and fun soldering project

Quick FACTS
>  Tod needed a MIDI
The sound is generated by controller for his
Raspberry Pi Pico which also acts as computer
a MIDI connection when connected
to a MIDI device or computer >  It’s hackable,
cheap, and thin

>  The source code


is available

>  It’s designed for


It’s currently running (reaper.fm/). The USB-C connection to Raspberry
Pi Pico provides power and a MIDI connection in
MIDI but you could
code the pads for
CircuitPython and talking one step. This enables you to use the PicoTouch to
play instruments in audio software.
anything

MIDI to my computer “It’s currently running CircuitPython and >  The board costs
talking MIDI to my computer which is running just $11
Ableton Live so it can do monophonic and
polyphonic stuff; you can even play drums with it
if you want to,” says Tod.
“It’s a lot of fun!”

PicoTouch can
be used for other
The PicoTouch bare board is available on Tindie projects as well as
if you want to recreate this project at home creating PicoSynth

PicoSynth magpi.cc 29
SUBSCRIPTION

SUBSCRIBE TODAY
FOR JUST £10
Get 3 issues + FREE Pico W
Subscriber Benefits
FREE Delivery
Get it fast and for FREE

Exclusive Offers
Great gifts, offers, and discounts

Great Savings
Save up to 23% compared to stores

Subscribe for £10


Free Pico W
3 issues of The MagPi

GET Priority Boarding code


RASPBERRY £10 (UK only)
PI 5 FIRST!
Priority Boarding Subscribe for 6 Months
Free Pico W

+ 6 issues of The MagPi


Priority Boarding code
£30 (UK) $43 (USA)
€43 (EU) £45 (Rest of World)

Subscribe by phone: 01293 312193


Subscribe online: magpi.cc/subscribe
Email: [email protected]
Subscribe for £10 is a UK-only offer. The subscription will renew at £15 every three months unless
cancelled. A free Pico W is included with a 6-month subscription in USA, Europe and Rest of World.

30 magpi.cc
SUBSCRIPTION

SUBSCRIBE TODAY AND GET A


FREE Raspberry Pi Pico W
Subscribe in print
today and get a FREE
development board WORTH

A brand new RP2040-


based Raspberry Pi Pico
$6
W development board

Learn to code with


electronics and build
your own projects This is a limited
offer. Not included
with renewals. Offer
Make your own home subject to change or
withdrawal at any time.
automation projects,
handheld consoles,
tiny robots, and much,
much more

New subscribers to The MagPi


will get a Priority Boarding
code when they sign up.
So don’t delay. Take out a
subscription today! You’ll be
able to buy your Raspberry
Pi 5 first and get incredible
Raspberry Pi tutorials,
We’ve reserved Raspberry Pi 5 boards projects, and community
for The MagPi subscribers events every month.

GET YOUR RASPBERRY PI 5 FIRST! magpi.cc/priorityboarding


Terms & Conditions: A Priority Boarding code will be emailed to everybody who takes out a print subscription to The MagPi or HackSpace magazine. People who subscribe to both
magazines will get two codes. Print subs only! Priority Boarding does not apply to people with App Store, Google Play, Zinio, PDF contributions, or other paid-for subscriptions. Each
code will entitle you to purchase 1x Raspberry Pi 5 model (either 4 GB or 8 GB) for the standard retail price and delivery. Multiple codes need to be used individually. This is a limited
offer and is subject to change or withdrawal at any time.

magpi.cc 31
SUCCESS STORY

SUCCESS STORY magpi.cc/success

Arribada
technology for
conservation
Raspberry Pi is key to Arribada’s wildlife monitoring projects
By Rosie Hattersley

T ime-lapse photography and remotely


accessible monitoring tools are used
routinely in conservation these days, but
back in 2017, when Alasdair Davies founded his
non-profit organisation Arribada, they were
from a camera trap that would wake and detect an
animal walking by, to a device that would send back
an alert if a particular animal appeared.
Davies founded environmental organisation
Arribada (the name, meaning ‘arrival’, refers to
groundbreaking. Keen to draw attention to threats the migration and birth cycles of sea turtles), with
to wildlife in different habitats and locations, he the aim of using technology to make a positive
set about developing low-cost monitoring tools, environmental contribution.
reasoning that equipment costs should not be a
barrier to helping critically endangered animals. He THE CHALLENGE
produced and designed multiple observation tools, Arribada needed a robust, low-cost kit that could
be used in remote locations, often without human
intervention. Its first project was a tag to monitor
green sea turtles: this tool would show the impact
that fishing and human activity were having, and
open discussions about what protections might need
to be introduced for the endangered species.
To track the turtles, Arribada’s solution would
need to be waterproof at the depths at which
the creatures swim, as well as being able to
operate reliably without the possibility of human
intervention. It also needed to be both affordable
and accessible to local research teams.

THE SOLUTION
A Raspberry Pi Zero and a Raspberry Pi Camera
Module were enclosed in a lightweight, waterproof
enclosure. This could be attached, harmlessly, to
the shell of a sea turtle, to track its journey under
the waves. The device captures photos, video, and
location data.
“Once the video has been recorded, the tag is
released from the shell of the turtle and is then
recovered from the water’s surface two weeks

32 magpi.cc Arribada technology for conservation


SUCCESS STORY

later. This lets us capture behaviour footage of both longest-established conservation charities, was keen
female and male turtles,” Davies explains. to explore the use of LoRa radio communications to
A challenge for turtle monitoring is that GPS monitor fishing activity.
location tags are only effective when the creature The boat-based LoRaWAN gateway that
surfaces, which is often for less than two seconds. Arribada set up can provide a detailed overview
Waking up the monitoring devices to get a of local fishing activity, and report any potential
triangulation fix is not instantaneous, so Arribada encroachment on the five critical turtle breeding
developed its own Horizon Assisted-GPS tag as a sites around the country’s coast. Cypriot mobile
key part of its Raspberry Pi Zero-based kit.
The kit means that turtles’ behaviour, as well as
their locations, can be discerned. The first turtle The Penguin Watch camera units survived
tags were developed when AI and machine learning
were in their infancy, but, Davies says, we’re in three Antarctic winters before the Arribada
a very different space now. “You can imagine
the benefit of running AI models on Raspberry team made a maintenance visit
Pi devices for the sea turtle: we can wake up [the
device], capture a scene, process that scene, we phone regulations, requiring SIM cards to be
can even [get the device to] make some intelligent registered after four months, made using them
decisions to say, is this worth recording? Is it worth for cellular communications troublesome, hence
going back to sleep, or should I stay on?” the LoRaWAN setup using a Raspberry Pi 4 with a
In addition to making decisions about continuing Raspberry Pi Power-over-Ethernet HAT. This setup
to monitor a site, perhaps going into a sleep cycle also meant there was no cost to the boat owners
and awakening again an hour later to see what’s for having a tracking system on-board. An antenna
changed, using Raspberry Pi offers machine learning on an eight-metre pole offered a clear view of any
advantages. “We can pull the models off, sit there fishing vessels in a 15 km radius, providing a robust
and go through and train them a little bit more, and visible monitoring system.
tweak and review the video content. We can do
it all at very little cost, because [Raspberry Pi] is WHY RASPBERRY PI?
so affordable.” Raspberry Pi has become a keystone to almost all
It’s an approach that has begun to mark out of Arribada’s projects. Davies explains that it has
Arribada as a sophisticated research partner, with always been one of the tools he uses “because
conservation organisations showing “a real interest it is so accessible and affordable for anyone to
in what Edge ML is going to do. We still use it get involved. You are always partnering with a
on the Raspberry Pi. We don’t just use it with researcher or a local community member who works
sea turtles.” with an NGO and has a specific challenge. We get
Some initiatives need bespoke solutions. This called in to solve it with technology. They’ll always
was the case in Cyprus where the Society for the say it has to be affordable, it has to be repairable
Protection of Turtles (SPoT), one of the country’s and accessible.”

Arribada technology for conservation magpi.cc 33


SUCCESS STORY

out for replacement or upgrading – was a game-


changer. Instead of a camera costing £500, a sub-
£50 Raspberry Pi Camera Module with a Raspberry
Pi Zero or Zero W could be used. The ability to
deploy many of these much more affordable kits
meant it was possible to cover significantly larger
territories and provide more accurate population
estimates. In most cases, a 3D-printed waterproof
case became the most expensive element of
Davies has used Raspberry Pi with various HATs each kit. And, as new Raspberry Pi camera
to create whichever tool was needed, but after hardware became available, Arribada was able
Raspberry Pi Pico became available in 2021, he found to make huge improvements to image and video
the low-cost microcontroller board often provided capture capabilities.
a solution. Arribada also won over the Penguin Watch
project, a wide-ranging research project monitoring
THE RESULTS penguin populations in different parts of the world.
The footage gathered by Arribada’s Raspberry Arribada’s Python-controlled Raspberry Pi camera
Pi-based turtle tags helped quantify the number setup came in at least three times cheaper than
of sea turtles, as well as revealing their nesting the commercial cameras the penguinologists had
locations, bolstering arguments for specific previously been using. The cost reduction meant the
beaches and coastal areas to be off limits at specific team had far fewer qualms about where monitoring
times of the year – a crucial protection for this kits were sited, and were more relaxed about leaving
endangered species. equipment in situ for remote monitoring, where
The low cost of Raspberry Pi hardware had a big some units would inevitably be subject to damage.
impact too. Previously, many of the camera tools In fact, the hardware proved impressively resilient
conservationists needed had such high price tags to temperature: the Penguin Watch camera units
that research projects either became unviable or survived three Antarctic winters before the Arribada
ended up severely limited in scope and impact. team made a maintenance visit. They were able
Often, the quantity of kits a project really needed to retrieve three years’ worth of photos and found
could not be funded, or the high cost of repair that the Raspberry Pi units had reliably woken to
and replacement meant that monitoring could be capture a photograph once a day every day, saving
undertaken only once rather than repeated to track every single image. This photographic journal of
changes over time. the changing environment and its effect on penguin
Reducing the costs with off-the-shelf Raspberry populations contributed directly to conversations
Pi hardware – widely available and easily swapped about climate change and habitat loss.

34 magpi.cc Arribada technology for conservation


Your FREE guide to
making a smart TV

BUILD A RASPBERRY PI
MEDIA PLAYER
Power up your TV and music system

raspberrypi.com
FROM THE MAKERS OF THE OFFICIAL RASPBERRY PI MAGAZINE

magpi.cc/mediaplayer
LAUNCH
SPECIAL! It’s here! Here are some ideas for the
latest and greatest Raspberry Pi

y the time you read this, Raspberry Pi 5


will be out. We’ve been waiting four years
for this and we’re very excited to use it
ourselves, and see what other people come up
with. Which brings us to the age old question:
what do you want to do with your Raspberry Pi?
We have some answers for you, and with the
new capabilities of Raspberry Pi 5 in mind. So get
your brain into gear, and get ready to make.

36 magpi.cc Raspberry Pi 5 Launch Special


WHERE
TO BUY
The best way to get a Raspberry Pi 5 is via a
Raspberry Pi Approved Reseller. Check out
raspberrypi.com/5 for a full list of resellers
in your country. The MagPi subscribers get
theirs first! magpi.cc/priorityboarding

Raspberry Pi 5 Launch Special magpi.cc 37


For full instructions, head to:
magpi.cc/fileserver

Make a better NAS with the new features


of Raspberry Pi 5

n The MagPi 134 (magpi.cc/134) we talked to


Alasdair Allan, Head of Documentation, who
mentioned he was excited for the prospect
of low-power NAS boxes that made use of the
M.2 HAT coming to Raspberry Pi 5 in the future.
Here are the basics of setting one up.

An M.2 SSD card will


help bring down the
power requirements Example code for your Samba config file
Software setup
01
for a file server

Configuration
You need to install Samba onto Raspberry
Pi OS, usually done with:
03 The magic of the NAS box is in the Samba
configuration file – it’s like writing a spell to
sudo apt install samba samba-common-bin open up the shared storage to the network.
Here’s one example, and there’s another in the
We like to use NTFS for the shared drive so that screenshot above, but tweak it to your own needs:
other operating systems can use it easily, so we
install that with: [share]
Comment = Network share
sudo apt install ntfs-3g Path = /mnt/location
Browseable = yes
Writeable = yes
only guest = no
Storage setup
02 Usually we use an external hard drive,
create mask = 0777
directory mask = 0777
but using the SSD drive will be very similar – Public = yes
plug it in, make sure it’s formatted, and then Guest ok = yes
mount it to Raspberry Pi OS. It will do this
automagically when you plug it in once booted,
but to automount it on boot (there is a difference)
you’ll need to edit the fstab file with sudo nano
/etc/fstab and add a line like:
RAID NAS
PJ Evans shows you a way to create a
/dev/sdb1 /mnt/location ntfs nls-utf8,umask- home file server with redundancies over at
0222,uid-1000,gid-1000,rw 0 0 magpi.cc/raidnas.

38 magpi.cc Raspberry Pi 5 Launch Special


Add an extra dimension to your Create VR and
3D video with

photography and videography two cameras and


Raspberry Pi 5

Timing
ith the ability to add two cameras to
one Raspberry Pi 5, it’s never been
02 The trick to getting the perfect shot is
easier to create 3D video or take 3D timing the cameras. In a previous tutorial by
photos with Raspberry Pi. It can take some regular PJ Evans, he linked up to Raspberry Pi
tweaking to get it right, but here’s how you can Zero with cameras attached and had them shoot
get started. images at the same time. This was done with
some smart Python code, and you can look at how
he did it here: magpi.cc/make3dcam.
Editing video
together will be
VR or movie necessary
01 There are two distinct ways for doing
Stitching
3D filming – the kind you see in movies with
two slightly overlapping frames that 3D glasses
03 The images or
selectively view to make the flat image on the video, once created,
screen have depth, and the VR version which need to be stitched
either has two distorted images that a headset can together. For video,
render as a scene in front of you in high quality, we suggest giving each
or a slightly lower-quality 360° scene all around one a look on video
you. The latter uses two cameras with wide-angle editing software to
lenses opposite each other, while the former use make sure they line
two cameras facing forwards, and can be a bit up properly. PJ, in
easier. Also, with the lack of 3D TVs these days, his tutorial, created
we’ll be looking at using a VR headset. a way for images to
be put together for
3D (find the code at
magpi.cc/3dcameragit).
However, you can also do it in video editors like
Adobe Premiere.

3D video now
The POPCAM is a 360-degree 3D camera kit that
uses Raspberry Pi CM4 – it’s not out quite yet,
but we’ve been using a pre-release model and
it’s very good. If you’d like to skip the DIY, find out
more at magpi.cc/popcamera.
A previous version of 3D photography with Raspberry Pi

Raspberry Pi 5 Launch Special magpi.cc 39


Your media, but better
ibreELEC (in some form or another) and OS’ and, from the menu, choose LibreELEC. Setup is
Kodi have been mainstays for Raspberry Pi simple, and you can check our ultimate media player
media centres for a very long time. With the guide for more info on that: magpi.cc/mediaplayer.
new VideoCore VII GPU on Raspberry Pi 5, while
hardware decoding of H.264 is no longer present,
the power of the CPU is more than enough to play
them and it allows for 4K H.264 media now too.
What is exciting is the inclusion of H.265 and VC1
hardware decoding, which is used in a lot of newer
media for higher-quality files and audio.
Setting up LibreELEC, our preferred method of
using a media centre, is exceptionally easy: on
Raspberry Pi Imager (magpi.cc/imager), when
There are other media-based OSes you can use with Raspberry
selecting an operating system, select ‘Media player Pi too, including audio servers

Emulate more consoles than ever before


There are several options depending on your
emulation needs
ore power from Raspberry Pi means
more power to emulate the consoles of
yore. We’ve already seen reports of the
GameCube, and even the Wii, being successfully
emulated on Raspberry Pi 5. However, you may not Retro Gaming with
Raspberry Pi
be able to quite get it 100% working on day one of
Raspberry Pi 5. It likely won’t take long, though.
We like to use RetroPie for emulation, which is
This book has everything you
available as an installation option in Raspberry Pi need for creating retro game
Imager – find it under ‘Emulation and game OS’. boxes or even making your own
Set up is very simple, although you’ll have to source retro-style games. Grab it at
your own games. Check out magpi.cc/legalroms for magpi.cc/retrogaming.
how to do that.

40 magpi.cc Raspberry Pi 5 Launch Special


Other
PROJECTS
Still not inspired? Here are a few more projects you might like…

aspberry Pi 4 is a good desktop computer


– we’ve used a Raspberry Pi 400 on many
occasions for just that – but the extra grunt
of Raspberry Pi 5, along with the new Raspberry
Pi OS Bookworm, take it to a new level.
To get it set up, you just need a Raspberry Pi 5,
a mouse, a keyboard, and an available monitor or
TV to plug into. Using the Raspberry Pi OS ‘Full’
version with recommended software pre-installed
means you’ll have just about everything you need
to get working, making art, or just relaxing with
some YouTube.

ou don’t need to take 3D pictures with


Raspberry Pi 5; normal photography
works just great. Over the years, we’ve
covered many camera projects – from simple ith more
photographs to time-lapses, surreal IR power in
photos, motion-sensitive cameras, and even Raspberry
astrophotography. Pi 5 comes a greater
You can even make use of two cameras similarly ability to crunch
to the way smartphones do – two different lenses numbers. Whether
on two different cameras allowing for macro practical or not, you
shots or wide-angle shots can get a lot of Raspberry Pi into a small space,
alongside regular photos, and people have created art installations, as well
depending on the situation. as actual distributed computing setups.
With better processing There are kits you can get for previous Raspberry
speeds, along with the Pi models to help get them into a cluster, and
upcoming M.2 HAT, we’ve seen some people talking about upgrading
you’ll be able to take a lot these on social media – perhaps you could beat
more photos as well. them to the punch.

Raspberry Pi 5 Launch Special magpi.cc 41


PROJECT SHOWCASE

RRY PI
BE
RASP
A RTER
T
ETTY

S DE
I S P R
P B E R RY PI OLLOW
I N G U P RAS RD. JUST F SLEY
SETT HTFORWA IE HATTER

U I
STRAIG VICE OF ROS

G
THE AD

C What you need


ongratulations on becoming a Raspberry Pi explorer.
We’re sure you’ll enjoy discovering a whole new
world of computing and the chance to handcraft your All the bits and bobs you need
own games, control your own robots and machines, and to set up a Raspberry Pi computer
share your experiences with other Raspberry Pi fans.
Getting started won’t take long: just corral the extra
bits and bobs you need on our checklist. Useful additions
include some headphones or speakers if you’re keen on using A Raspberry Pi
Raspberry Pi as a media centre, or a gamepad for use as a Whether you choose the new Raspberry
retro games console. Pi 5 or a Raspberry Pi 4, 400, 3B+, 3B,
To get set up, simply use your pre-written microSD card Zero or Zero 2 W (or an older model of
(or use Raspberry Pi Imager to set up a card) and connect all Raspberry Pi), basic setup is the same.
the cables. This guide will lead you through each step. You’ll All Raspberry Pi computers run from a
find the Raspberry Pi OS, including coding programs and microSD card, use a USB power supply,
office software, all available to use. After that, the world of and feature the same operating systems,
digital making with Raspberry Pi awaits you. programs, and games.

42 magpi.cc Raspberry Pi Starter Guide


PROJECT SHOWCASE

USB mouse
A tethered mouse that physically attaches to
your Raspberry Pi via a USB port is simplest and,
unlike a Bluetooth version, is less likely to get
lost just when you need it. Like the keyboard,
we think it’s best to perform the setup with a
wired mouse. Raspberry Pi sells an Official Mouse
8GB microSD card (magpi.cc/mouse).
You’ll need a microSD card with a capacity of
8GB or greater. Your Raspberry Pi uses it to store
games, programs, and boot the operating system.
Many Raspberry Pi computer kits come with a card Power supply
pre-written with Raspberry Pi OS. If you want to Raspberry Pi 5, 4 and 400 need
reuse an old card, you'll need a card reader: either a USB Type-C power supply.
USB or a microSD to full-sized SD (pictured). Raspberry Pi sells power supplies
(magpi.cc/usbcpower), which
provide a reliable source of power.
Raspberry Pi 1, 2, 3, and Zero models
Windows/Linux PC or Mac computer need a micro USB power supply
You’ll need a computer to write Raspberry Pi OS (magpi.cc/universalpower).
to the microSD card. It doesn’t matter what
operating system this computer
runs, because it’s just
for installing the OS Display and HDMI cable
using the Raspberry Pi A standard PC monitor is ideal, as
Imager app. the screen will be large enough
to read comfortably. It needs
to have an HDMI connection,
as that’s what’s fitted on your
Raspberry Pi board. Raspberry
Pi 5, 4 and 400 can power two
HDMI displays, but require a
micro-HDMI to HDMI cable.
Raspberry Pi 3B+ and 3A+
USB keyboard both use regular HDMI cables;
Like any computer, you need a means to enter web Raspberry Pi Zero W needs a mini-HDMI
addresses, type commands, and otherwise control to HDMI cable (or adapter).
Raspberry Pi. The Raspberry Pi 400 comes with
its own keyboard. Raspberry Pi sells an official
Keyboard and Hub (magpi.cc/keyboard) for
other models. USB hub
Raspberry Pi Zero and Model A boards
have a single USB socket. To attach a
keyboard and mouse (and other items),
you should get a four-port USB hub
(or use the official USB Keyboard
and Hub which includes three ports).
Instead of standard-size USB ports,
Raspberry Pi Zero has a micro USB port
(and usually comes with a micro USB to
USB-A adapter).

Raspberry Pi Starter Guide magpi.cc 43


PROJECT SHOWCASE

RRY PI
ASPBE
UP R
SET 02 Connect a mouse
Connect a USB wired mouse to one of the
other larger USB-A sockets on Raspberry Pi. As
with the keyboard, it is possible to use a Bluetooth
Raspberry Pi 5 / 4 / 3B+ / 3 has
wireless mouse, but setup is much easier with a
plenty of connections, making it wired connection.
easy to set up

Hook up the keyboard HDMI cable


01 Connect a regular wired PC (or Mac)
03 Next, connect Raspberry Pi to your display
keyboard to one of the four larger USB-A sockets using an HDMI cable. This will connect to one of
on a Raspberry Pi 5 / 4 / 3/3B+. It doesn’t matter the micro-HDMI sockets on the side of a Raspberry
which USB-A socket you connect it to. It is Pi 5 / 4, or full-size HDMI socket on a Raspberry Pi
possible to connect a Bluetooth keyboard, but it’s 3 / 3B+. Connect the other end of the HDMI cable to
much better to use a wired keyboard to start with. an HDMI monitor or television.

An HDMI cable, such as ones used by most


modern televisions, is used to connect
Raspberry Pi to a TV or display. You'll need a
micro-HDMI to HDMI cable (or two) to set up
a Raspberry Pi 5 / 4. Or a regular HDMI cable
for Raspberry Pi 3B+ / 3 (or older) models

A regular wired mouse is connected


to any of the USB-A sockets. A wired
keyboard is connected to another
of the USB-A sockets. If you have a
Raspberry Pi 5 / 4, it's best to keep
the faster (blue) USB 3.0 sockets free
for flash drives or other components

44 magpi.cc Raspberry Pi Starter Guide


PROJECT SHOWCASE

The Ethernet socket can be used to connect


The USB-C socket is used to connect Raspberry Pi 400 directly to a network router (such
power to Raspberry Pi 400. You can use a as a modem/router at home) and get internet
compatible USB-C power adapter (found access. Alternatively, you can choose a wireless
on recent mobile phones) or use a bespoke LAN network during the welcome process
power adapter such as a Raspberry Pi 15.3 W
USB-C Power Supply

PI 400
BERRY
P RASP
SET U 02 Attach the micro-HDMI cable
Next, connect a micro-HDMI cable to one of
the micro-HDMI sockets on the rear of Raspberry
Pi 400. The one next to the microSD card slot is
the first one, but either connection should work.
Connect the other end of the HDMI cable to an
Raspberry Pi 400 has its own HDMI monitor or television.
keyboard – all you need to connect
is the mouse and power
The microSD
03 If you purchased a Raspberry Pi 400
Connect a mouse
01 Connect a wired USB mouse to the white
Personal Computer Kit, the microSD card will come
with Raspberry Pi OS pre-installed. All you need
USB connection on the rear of Raspberry Pi to do is connect the power and follow the welcome
400. The two blue USB 3.0 connectors are faster instructions. If you do not have a Raspberry Pi OS
and best reserved for external drives and other pre-installed microSD card, follow the instructions
equipment that need the speed. later in ‘Set up the software’.

Raspberry Pi Starter Guide magpi.cc 45


PROJECT SHOWCASE

Raspberry Pi Zero W features


You'll need this micro USB a mini-HDMI socket. You'll
to USB-A adapter to connect need a mini-HDMI to full-
wired USB devices such as a sized HDMI adapter like this
mouse and keyboard to your to connect your Raspberry Pi
Raspberry Pi Zero W Zero W to an HDMI display

I ZERO
ERRY P
RASPB
SET UP
Mouse and keyboard
02 You can either connect your mouse to a
USB socket on your keyboard (if one is available),
You'll need a couple of adapters to then connect the keyboard to the micro USB
set up Raspberry Pi Zero / Zero 2 W socket (via the micro USB to USB-A adapter).
Or, you can attach a USB hub to the micro USB
to USB-A adapter.
Get it connected
01 If you’re setting up a smaller Raspberry
Pi Zero, you’ll need to use a micro USB to USB-A
More connections
adapter cable to connect the keyboard to the
smaller connection on the board. Raspberry Pi
03 Now connect your full-sized HDMI cable
Zero models only have a single micro USB port for to the mini-HDMI to HDMI adapter, and plug the
connecting devices, which means you'll need to adapter into the mini-HDMI port in the middle of
either get a small USB hub or use an all-in-one your Raspberry Pi Zero. Connect the other end of
mouse and keyboard. the HDMI cable to an HDMI monitor or television.

46 magpi.cc Raspberry Pi Starter Guide


PROJECT SHOWCASE

First, insert your microSD With the microSD card fully


card into Raspberry Pi inserted, connect your power
supply cable to Raspberry Pi. A
red light will appear on the board
to indicate the presence of power

SE T UP
TWARE
HE S OF
T
Use Imager to install Raspberry Pi
OS on your microSD card and start
your Raspberry Pi
Top Tip
Choose OS Advanced
02 Click on ‘Choose OS’ in Raspberry Pi Imager options

N
ow you’ve got all the pieces together, it’s and select the recommended Raspberry Pi OS. Click
time to install an operating system on ‘Choose SD card’ and select the microSD card you Click the cog
your Raspberry Pi so you can start using just inserted (it should say 8GB or the size of the to customise
it. Raspberry Pi OS is the official software for card next to it). Click on ‘Write’. Your computer will Raspberry Pi OS
Raspberry Pi, and the easiest way to set it up on take a few minutes to download the Raspberry Pi with options
your Raspberry Pi is to use Raspberry Pi Imager. OS files, copy them to the microSD card, and verify such as Wi-Fi
See the ‘You’ll Need’ box and get your kit together. that the data has been copied correctly. passwords and
usernames.

You’ll Need
> A Windows/Linux
PC or Apple Mac
computer

Set up Raspberry Pi
03 When Raspberry Pi Imager has finished
> A microSD card
(8GB or larger)
Download Imager
01 Raspberry Pi Imager is available for
verifying the software, you will get a notification
window. Remove the microSD card and put it in your
> A microSD to
USB adapter (or
Windows, Mac, and Linux computers. You can also Raspberry Pi. Plug in your Raspberry Pi power supply a microSD to
SD adapter and
install it on Raspberry Pi computers, to make more and, after a few seconds, a blue screen will appear SD card slot on
microSD cards once you are up-and-running. with ‘Resizing Filesystem’. It will quickly vanish and your computer)
Open a web browser on your computer and visit be replaced by ‘Welcome to Raspberry Pi’. Click on
>  Raspberry Pi Imager
magpi.cc/imager. Once installed, open Imager and Next and follow the on-screen instructions to set up magpi.cc/imager
plug your microSD card into your computer. Raspberry Pi OS and start using your new computer.

Raspberry Pi Starter Guide magpi.cc 47


2024

200 PAGES OF RASPBERRY PI


Get started guide covering Have some serious fun with
every Raspberry Pi electronics

Everything you need to Learn robotics with our


know about the brand new super-simple robotics
Raspberry Pi 5 tutorial

Inspiring projects for your Play retro games with the


next build idea diminutive Raspberry Pi Pico

Buy online: magpi.cc/handbook


* Raspberry Pi hardware not included
TUTORIAL

Using Ubuntu
Part 01

on Raspberry Pi
Enjoy a new Raspberry Pi desktop experience by installing Ubuntu Linux

W
hile the official Raspberry Pi OS is
an excellent, easy-to-use operating
system tailored for Raspberry Pi
computers, there are numerous alternatives
you can use instead – see our feature in issue
111 (magpi.cc/111). The most popular among
these is Ubuntu, based on Debian Linux (just like
Raspberry Pi OS).
Phil King
MAKER

One of the most commonly used Linux distros


A long-time in general, Ubuntu offers a slick user interface,
contributor to The a wide range of up-to-date software, and the
MagPi, Phil is a benefit of familiarity for anyone who’s already
freelance writer and
editor with a focus used it on another computer. And Ubuntu 23.10 The Files browser is similar to the one in Raspberry Pi OS,
on technology. supports Raspberry Pi 5. except you only have access to your user folders

@philkingeditor We’ll walk you through how to install the


Desktop version on Raspberry Pi and make use of advanced options menu in Imager to preconfigure
some of its key features. aspects such as the Wi-Fi connection and SSH.
As usual, click on Choose Storage and select the
microSD card that you have connected to your
computer (typically via a USB card reader). You’ll
Ubuntu versions
01 The easiest way to install Ubuntu is
need at least a 16GB card for Ubuntu Desktop.
Finally, click on Write to flash the OS to the
to use the official Imager tool (magpi.cc/imager). microSD card – it’ll take a little while, including
Click on Choose OS, then ‘Other general-purpose verification. When ready, eject the card and insert
OS’ > Ubuntu. You’ll see a list of different Ubuntu it into your Raspberry Pi.
versions. The three main types are Desktop,
Server, and Core. The last two of these lack a
GUI by default, so we’ll stick to Desktop. For this
First boot
there are two options: the latest version (at the
top) and an earlier LTS (long-term support) one
03 Before powering it on, make sure Raspberry
which may prove more stable. Choose 23.10 if Pi is connected via HDMI to a monitor or TV.
available and you are using Raspberry Pi 5. Powering up, the usual colour gradients image will
appear briefly before the boot-up process begins.
After a few text lines on a black screen, the Ubuntu
You’ll Need
logo appears, followed by Ubuntu’s purple desktop
Install Ubuntu
> R
 aspberry Pi
02 Whichever Desktop version you choose
background and a System Configuration window.
This is much like the setup wizard in Raspberry
> 1 6GB microSD card
(or greater) in Raspberry Pi Imager, note that – unlike with Pi OS: choose the language, keyboard layout (or
Raspberry Pi OS – you won’t be able to access an detect it), connect to a wireless network (or skip

50 magpi.cc Using Ubuntu on Raspberry Pi


TUTORIAL

The Dash sidebar shows Click the taskbar icons for


favourite apps and tools; a red Wi-Fi, Bluetooth, audio, and
dot indicates an app is running power info and settings

Click the Show Apps icon


to see a grid of all the
apps currently installed

Navigate the desktop


for now), and select your location. Finally, enter
your details: name, computer name, username,
05 Ubuntu’s default desktop environment (you
and password. You can opt to log in automatically can install others) is GNOME, which is fairly easy
or require the password. to navigate once you get used to it. Here are the
A ‘Welcome to Ubuntu’ screen and progress bar key areas:
appears while it configures everything, followed by
an ‘Applying changes’ window. It then reboots. • Dash: The left sidebar has shortcut icons
for apps and tools – by default, Firefox,
Thunderbird Mail, Files, LibreOffice Writer,
T he easiest way to install Ubuntu Software, Help, and Trash.

Ubuntu is to use the official • Activities: This option (top left) brings up an
overview of current open windows.
Raspberry Pi Imager tool • Show Apps: Clicking this icon (bottom left)
shows all the installed apps. Top Tip
• Home: Double-clicking this icon (bottom
Final configuration Mount a
04 Following the reboot, you’ll see the Ubuntu
right) takes you to your home folder in the
Files browser. USB drive
user selection screen with the username you • Taskbar: At the top right you’ll find Wi-Fi,
selected. Click on it; if you opted to require the audio, and power icons; click to see their When you insert
a USB flash drive,
password to log in, you’ll need to enter it. settings. Or click the time to view a mini
it’s automatically
Finally, the full Ubuntu desktop appears. A calendar, along with any upcoming events on it. detected and
window offers you the option to connect to your its icon appears
online accounts – Google, Nextcloud, and/or in the Dash –
Microsoft – but you can skip this for now and do remember to
Launch an app right-click and
it later in the Settings. You’re also asked whether
to send system info to Canonical, and turn location
06 After clicking the Show Apps icon at the
Eject before
physically
services on. It then gives you a preview of some of bottom left, you’ll see a grid of icons for installed removing it.
the apps you can use in Ubuntu. apps and other tools. Clicking the right-hand

Using Ubuntu on Raspberry Pi magpi.cc 51


TUTORIAL

The Activities
Keyboard shortcuts
overview offers an
easy way to switch
arrow takes you to a second screen for more apps.
In addition, there’s a search option at the top; just
08 Here are just a few of the many handy
between windows
and workspaces start typing and relevant app icons will appear. keyboard shortcuts you can use in Ubuntu. Note
To launch an app, the Shotwell image organiser that SUPER is typically the Windows key, or
for instance, just click on its icon. It will open in Raspberry Pi logo key on Raspberry Pi 400.
a new window on the desktop, and its icon will
appear in the Dash sidebar. To keep it in the Dash • SUPER – Activities overview
as a favourite, right-click the icon and select Pin • SUPER+A – Show Apps
to Dash (to remove, right-click and Unpin). • SUPER+↑ – full-screen window
• SUPER+↓ – revert to standard window size
 y default, there are two
B • SUPER+← – move window to left side
• SUPER+→ – move window to right side
desktop workspaces which • SUPER+TAB – switch between apps
• ALT+ESC – switch between windows in
you can switch between current workspace
• SUPER+ALT+←/→ – switch between workspaces
Activities overview
Top Tip 07 Naturally, you can run several apps at
same time. The easiest way to see them all, and
Shut down Install more apps
switch between them, is to click Activities (top
left) to open an overview of all the open windows.
09 While there are several ways of installing
To shut down the
Just click on one to select it. You can also search new software in Ubuntu (which we’ll explore next
system safely,
click the top-right for open apps. time), the easiest is to use Software Centre – akin
taskbar icons, You’ll also notice that, by default, there are two to an app store. Click on the Ubuntu Software icon
then the power desktop workspaces which you can switch between (briefcase) in the Dash sidebar to launch it.
icon and select – very handy to avoid clutter when multitasking. In the Explore tab, you’ll see a range of app
Power Down. In Activities, you can drag and drop an app categories including Education, Games, and
There are also
window from one workspace to another; an extra Productivity; clicking one shows the relevant apps.
options to Restart
or Log Out. empty workspace will then be created, so you can (The other tabs show installed apps and available
have as many as you like! updates.) Alternatively, click the search icon (top

52 magpi.cc Using Ubuntu on Raspberry Pi


TUTORIAL

Open windows can


be resized or shifted
to the left or right
side of the desktop
for a neat split-
screen view

left) and start typing the name of the app you Software & Updates). It will then check for
would like to install. firmware and software updates. You then have the
Clicking an app icon brings up its details option of installing them now or later. If you get a
screen, including user reviews (at the bottom) and message about Software Updater not responding,
whether it’s by a known developer. Click on Install click Wait. Enter your password to authenticate
and enter your password to download and install and install updates. It may take a while (so go and
it. Once done, its icon will appear on the Show make a cup of tea). Finally, click Restart Now (or
Apps screen. To uninstall an app, open its details Later) to finish installing the updates.
in Ubuntu Software, click the Installed button, and
select Uninstall. Taking it further
Next time, we’ll cover more advanced Ubuntu
aspects such as using the command line,
enabling SSH and VNC, installing media codecs, Viewing an app’s
details in the
Change settings
10 There are several ways to reach the Settings
using the GPIO pins, installing software from
other sources, and switching to a different
Ubuntu Software
Centre; just click
Install to download
screen: by searching for it in Activities or Show desktop environment. and install it
Apps, or by clicking the icons at the top right of
the taskbar and then the gear icon.
There are numerous settings categories,
including Appearance, Desktop, Notifications,
Multitasking, Apps (individual app settings),
Power, Displays, and Printers.
In the Appearance section, for instance, you
can switch to dark mode and/or select a different
backdrop for the desktop – from the selection or
by importing your own appropriately sized image.

System update
11 From the Show Apps screen, launch
Software Updater (not to be confused with

Using Ubuntu on Raspberry Pi magpi.cc 53


TUTORIAL

An introduction
to MQTT
Communication between your devices.
By Tim Richardson

This code publishes


to the queue. The
message will appear
in the terminal window

The code running in the


Tim
MAKER

terminal subscribes to
Richardson the queue ‘MyHouse/
garage/temperature’
Tim has been
involved with
Raspberry Pi’s
community almost
from the start. He is
part of the Pi Wars
organising team
and their resident
course designer/
builder, as well as
writing the CamJam
EduKit worksheets,
former CamJam
organiser and

L
current maker. earn how to send messages between MQTT works on a publish/subscribe basis.
@Geeky_Tim Raspberry Pi computers, Raspberry Pi Pico, That means a device can either publish (or send)
and lots of other devices using a simple messages or can subscribe to (or listen for)
protocol called MQTT. messages. In between the devices is what is known
MQTT (Message Queuing Telemetry Transport) as an MQTT ‘message broker’. This is software that
was originally created back in 1999 to be a runs on a server that receives published messages
lightweight way of passing small messages and sends them out to subscribers. The broker is
between devices on unreliable or low-bandwidth also lightweight, so any Raspberry Pi computer can
networks. Its main use is for machine-to-machine run the MQTT broker software.
communication, or for the Internet of Things. To explain that with a real-life example,
Being lightweight means that it can be used by imagine you have a BME280 sensor connected to
small, resource-constrained microcontrollers, like a Raspberry Pi Pico measuring the temperature,
Raspberry Pi Pico. That does not mean its use is pressure and humidity within your garage or
limited, though. There are plenty of ways you can garden cabin. You are going to want to see what
use it within a home network, across the internet is being measured without going out to the garage
or even on a small cluster of devices that need or cabin or having to log into it remotely to get
to talk to each other. Its use is only limited by readings. You can program Pico as an MQTT client
your imagination. which will publish the measurements within

54 magpi.cc An introduction to MQTT


TUTORIAL

your network. You can then program a Raspberry


Pi computer, connected to a display of some
description, to subscribe to those MQTT messages,
interpret the contents, and display them on screen.
That Raspberry Pi can even be running the MQTT
broker as well as whatever software you use to
display the measurements. Figure 1 illustrates a
possible MQTT network structure.

On topic
MQTT clients publish to and subscribe to topics,
which are a hierarchy similar to the folder
structure on your computer. Think of the top level
as being the home folder on your Raspberry Pi,
/home. Underneath /home are the user folders,
like /home/pi. And under that are various folders
belonging to the user, like the Documents or
Downloads folders, /home/pi/Documents or
/home/pi/Downloads. The only difference with
MQTT is that there is no ‘/’ at the beginning of the don’t need to understand any complex structures Figure 1: An example
MQTT network
top-level topic. to be able to use MQTT. You just need to decide
Let’s call our top-level topic MyHouse. what text you want to send (publish) and be able to
Subtopics are added using a ‘/’ at the end of the interpret it on the other end (subscribe).
top-level topic followed by the subtopic name.
For example, MyHouse/garage. You might want Using MQTT
to go down one more topic level and have a topic MQTT is a well-defined and supported protocol. As
for the temperature only; e.g. MyHouse/garage/ such, there are plenty of broker implementations,
temperature. This helps you to organise your both commercial as well as open-source. MQTT
MQTT into, say, rooms of the house, types of device clients can be written in many languages, such as
(e.g. switch, light), what is being measured (e.g. C, Python, C# or Rust. Lots of tools and software
also support MQTT, like Node-RED and OctoPrint

If you need to send (3D printer control software).


In this article, you are going to use an open-
information around your source broker called Mosquitto running on a
Raspberry Pi. You will use some command-line
network then MQTT should tools to test your broker and learn to write simple
clients with Python using the paho-mqtt library.
be included within your
Installing Mosquitto
armoury of go-to tools Prepare your Raspberry Pi by writing the latest
Desktop Raspberry Pi OS image to a new microSD
temperature, humidity), action to be taken (e.g. card and boot up Raspberry Pi. Update the OS to
toggle, turn on, change channel), or anything else the latest version using:
you can think of. When publishing a message, it
must always be to a specific topic (like MyHouse/ sudo apt update && sudo apt upgrade -y
cabin/humidity), but when subscribing you are
able to use wildcards to say ‘I want to receive all Now install the Mosquitto MQTT server and all
messages from the garage’ by using MyHouse/ of its dependencies, plus some command-line
garage/#, or ‘I want to receive all temperatures client tools that can be used to test the server:
within the home’ using MyHouse/+/temperature.
Figure 2 shows an example MQTT Topic structure. sudo apt install mosquitto mosquitto-clients
There is nothing special about the messages -y
being sent around your network. They are plain
text enclosed within the MQTT protocol, so you After installation, the Mosquitto server will be

An introduction to MQTT magpi.cc 55


TUTORIAL

Figure 2: An
example topic
structure

started via systemd. To check that the server is • The -t option identifies the topic you want
running, use systemctl: to subscribe to. In this case, it is MyHouse/
garage/temperature.
sudo systemctl status mosquitto
The test client will sit there and wait for a
If it is not running for any reason, the service message to be sent on the topic. Leave it running
can be restarted using: and open a second terminal window and type in
the following command to send a message on the
sudo systemctl restart mosquitto chosen topic:

We will be using the default settings in this mosquitto_pub -h localhost -t "MyHouse/


article, but there are lots of options to secure and garage/temperature" -m "20.0"
otherwise set up your broker which we will be
covering here. • Again, the -h and -t options identify the
broker and topic respectively.
Sending messages
First, you need to set up a subscriber to listen for • The -m option is the plain text message itself.
the messages. Without one, anything published to
a topic will go nowhere. If everything has worked, you should see ‘20.0’
On your Raspberry Pi with Mosquitto installed, appear in the subscriber client terminal.
Top Tip open a terminal window and enter the following: Test again by publishing another message, this
time with a different number. It should once again
mosquitto_sub -h localhost -t "MyHouse/ appear in the subscriber test client terminal.
Topic Names
garage/temperature" Keep the subscriber terminal window open, as
Topics can be we are going to use it in the next section.
called pretty • Here, mosquitto_sub is one of the Mosquitto
much anything client tools you installed along with the Publishing messages
you like, but it Mosquitto server, providing a way to test the Before we can program in Python, we need to
helps to decide
receipt of MQTT messages. install a library to add MQTT functionality to our
on a structure
for when you
• The -h option identifies the hostname or IP code. We are going to use paho-mqtt. Run the
add more address of the MQTT broker. Since the client following command to install the library:
devices later. tool is running on the same Raspberry Pi as
the MQTT server, you can use localhost. sudo apt install python3-paho-mqtt

56 magpi.cc An introduction to MQTT


TUTORIAL

mqtt_publish.py DOWNLOAD
THE FULL CODE:
The program mqtt_publish.py is the minimal > Language: Python 3 magpi.cc/mqttgit
code you can write to send MQTT messages. Type
it in and run it. You should see the number ‘13.2’ 001. # An Introduction to MQTT, by Tim Richardson
appear in the subscriber terminal window you left 002.
running earlier. 003. # Import the paho-mqtt client library.
The first line of code imports the client section 004. import paho.mqtt.client as mqtt
of the paho-mqtt library. 005.
The second creates a client object. ‘Sender’ is the 006. # Create an MQTT Client – the client ID must be unique
client identification, and must be unique for your 007. client = mqtt.Client("Sender")
broker as it is used to identify that client amongst 008.
all the others that may connect. 009. # Connect the client
The third line connects the client to the broker. 010. client.connect("localhost")
As we are running this code on the same Raspberry 011.
Pi as the broker, we are using ‘localhost’. 012. # Publish a message to the MyHouse/garage/temperature topic
The last line of code publishes a message with 013. client.publish("MyHouse/garage/temperature", "13.2")
the topic MyHouse/garage/temperature. Any
client that has subscribed to that topic will receive
that message.

mqtt_subscribe.py DOWNLOAD
Subscribing THE FULL CODE:
The mqtt_subscribe.py program starts out the
same as mqtt_publish.py by creating a client > Language: Python 3 magpi.cc/mqttgit
(with a unique identifier) and connecting it to
the broker.
However, there is now a ‘callback’ function 001. # An Introduction to MQTT, by Tim Richardson
named message_received. The client.on_message 002.
line tells the client object which function to call 003. # Import the paho-mqtt client library.
when a message is received on any topics that the 004. import paho.mqtt.client as mqtt
client subscribes to. 005. from time import sleep
The client.subscribe line subscribes the client 006.
to a topic. You can subscribe to as many topics 007. # A function to handle any messages received
as you want to, handling the message within the 008. def message_received(client, userdata, message):
client.subscribe callback function 009. print("Message received on topic:", message.topic)
Finally, the subscription loop is started, telling 010. print("Message contents:", message.payload.decode("utf-8"))
the client object to start listening for messages. 011.
The program then goes into a forever loop (or until 012. # Create an MQTT Client – the client ID must be unique
you stop it). 013. client = mqtt.Client("Recipient")
Open a new terminal window and run the 014.
program. In the original window (or IDE) run the 015. # Connect the client
mqtt_publish.py program. You should now see 016. client.connect("localhost")
the subscriber report that it has received a message 017.
on the topic MyHouse/garage/temperature with 018. # Define the 'callback' function when a message is received.
its value. 019. client.on_message = message_received
020.
Conclusion 021. # Subscribe to a topic
In this tutorial we have only just scratched 022. client.subscribe("MyHouse/garage/temperature")
the surface of MQTT, but hopefully you now 023.
understand what it is and how simple it is to 024. # Start listening for a message on the subscribed topics
use. Areas not covered include securing MQTT, 025. client.loop_start()
formatting messages, ensuring that messages are 026.
received, using MQTT in Node-RED, and more. 027. print("Waiting for a message to be sent")
If you need to send information around your 028.
network, then MQTT should be included within 029. # Wait forever
your armoury of go-to tools. 030. while True:
031. sleep(1)

An introduction to MQTT magpi.cc 57


TUTORIAL

Raspberry Pi
Part 09

mecanum robot
Create a robot which can go forwards, backwards, sideways,
diagonally, and turn on the spot. The mecanum wheels allow
the robot to navigate the tightest of spaces

T
ake your Raspberry Pi on the move by This is achieved by having rollers angled around
Stewart
MAKER

designing and making a wheeled robot This the wheel. The rollers of diagonally opposite
Watkiss tutorial will explain how you can design and wheels need to be in the same direction. Turning
make your own robot. Start by designing your the wheels in a certain combination will determine
Also known as
Penguin Tutor. own chassis and mount mecanum wheels with the direction. This is easiest to understand
Maker and YouTuber full direction control. The robot will then need through watching the video on YouTube:
that loves all things
four separate motors individually controlled with magpi.cc/mecanumrobotyt.
Raspberry Pi and
Pico. Author of a H-bridge driver for each wheel. Take control
Learn Electronics by learning how to use AntiMicroX to control the
with Raspberry Pi. robot with a gamepad.
penguintutor.com Creating a chassis
twitter.com/
02 For any kind of vehicle, you will need a
stewartwatkiss chassis to mount the motors and electronics. You
Mecanum wheels
01 Mecanum wheels are a type of
can use any method you choose. The base should
be thin enough to accommodate the size of the
omnidirectional wheel which can be used to move wheels, but otherwise most materials can be used.
a robot vehicle in multiple directions. They are You could use plywood, acrylic sheet, or even
particularly good at getting into tight spaces as thick cardboard.

Figure 1: Robot the wheels can propel the robot forwards and If you have access to a 3D printer then you can
chassis design
created in FreeCAD. backwards as normal, but can then also move design your own 3D-printed chassis, or use the
Includes four motor
diagonally or sideways without any forward or one available at magpi.cc/robotmecanum. This is
brackets which are
printed separately backwards movement. shown in Figure 1.
You will need some way of fixing the motors.
Brackets are included in the 3D printer files, or you
can purchase suitable brackets which are included
in the component list.

Raspberry Pi Zero W
03 Whilst any model of Raspberry Pi can be
used, a Raspberry Pi Zero W or a Raspberry Pi Zero
2 W are well-suited for a robot vehicle. They are
small, making them easier to fit on a mobile robot,
and they also have lower power requirements
than some of the other models. The wireless
capability is useful when programming the robot

58 magpi.cc Raspberry Pi mecanum robot


TUTORIAL

The special mecanum


wheels allow the robot
to move in any direction

All four motors need


to be controlled
individually with two
motor driver ICs

and for getting the controller working. A micro- you can normally use a single power supply for
USB to USB adapter is needed for connecting the both your Raspberry Pi and the motors.
controller. A shim adapter is also recommended. The different options are a 6 V power supply You’ll Need
(4 × AA batteries) or a USB power bank. The
breadboard layout shows both options. Raspberry >2
 × TB6612FNG
Pi is powered through GPIO 2 using a diode which motor drivers
magpi.cc/
Powering the robot
04 The motors are designed for 6 V, whereas a
protects against reverse voltage and drops the
voltage slightly. If using the USB power bank and
TB6612FNG

Raspberry Pi needs a 5 V power supply. In practice, the voltage is too low, then the diode bypassed >M
 ecanum wheels
magpi.cc/
if required. In either case, power must NOT be
mecanumwheels
connected to your Raspberry Pi power input socket
when powered through the GPIO. >4
 × geared motors
magpi.cc/
gearmotor
>M
 otor brackets
magpi.cc/
H-bridge motor controller
05 To allow the motors to go both forwards
motorbracket

and backwards, they each need an H-bridge. A >U


 SB power bank
magpi.cc/nanowave
good choice is the TB6612FNG driver. This driver
can handle up to 1.2 A of current, and has two >M
 icro USB shim
H-bridge circuits on a single SMD integrated magpi.cc/
microusbshim
circuit. To be able to use these with a breadboard,
they are available on a SparkFun motor driver >W
 ireless gamepad
magpi.cc/
board. This is shown in Figure 2.
wirelessgamepad
Along with the inputs for forwards and
backwards, each H-bridge needs a PWM signal to >M
 icro USB breakout
board
set the speed of the motor. A single PWM output
magpi.cc/
can be used from your Raspberry Pi, which will usbbreakout
Figure 2: The motor driver is an SMD IC soldered onto a
breakout board, allowing it to be used with a breadboard ensure that all the motors run at the same speed.

Raspberry Pi Mecanum Robot magpi.cc 59


TUTORIAL

A schematic diagram is shown in Figure 4.


Note that the labels beginning with D indicate
connections to the motor driver input, and M is
used for the motor connections.

Setting up the Raspberry Pi


07 When setting up your Raspberry Pi, you
may find it easier to enable VNC, which you can do
through the Raspberry Pi Configuration tool. This

Figure 3: Breadboard
diagram showing will allow you to connect from another computer
the wiring between using a VNC client. Using VNC, you won’t need to
the different
components. There is connect a keyboard or mouse, allowing the only
both AA battery and
USB port to be used for the USB dongle for the
micro-USB power
connected, but only gamepad controller.
one should be used
If using a game controller, then the AntiMicroX
software is needed, which can be installed using:
Wiring up the circuit
06 The wiring diagram is shown in Figure 3. sudo apt install antimicro
This is just a case of wiring up the motor driver
inputs with appropriate pins from your Raspberry This will be configured later in the tutorial.
Pi. Note that the breadboard has two different
power rails. The top rail is connected to the 6 V or
5 V supply for the motors, whereas the bottom rail
Programming motor control
is connected to the 3.3 V pin on your Raspberry Pi
to run the motor driver at 3.3 V (so that it is at the
08 The motors are controlled using GPIO
same voltage as the GPIO pins). Zero. There is an instance of Motor for each of

Figure 4: Schematic
diagram which makes it
easier to see which pins
are connected. Labels
are used to avoid the
confusion where wires
cross each other

60 magpi.cc Raspberry Pi mecanum robot


TUTORIAL

Figure 5: A wireless
USB gamepad. This
is detected by Linux
as an Xbox 360
controller

the motor drivers with a pin for forwards and


reverse. There is then one more pin for the
PWMOutputDevice which is used to control the speed
of all the motors.
The dictionary direction holds the direction of
all four motors based on the selected direction.
These are 1 for the motor to go forward, -1 for
the motor to go in reverse, and 0 to stop. It does
not provide speed control, which is included in
the code available from the GitHub repository at
magpi.cc/mecanumrobotgit.

Adding keyboard support


09 One thing about Python is that it doesn’t
A wireless USB gamepad will be used, which
needs to be mapped to the appropriate keys. An
directly provide a way to read input characters example gamepad is shown in Figure 5.
except when the ENTER key is pressed. There are
various different ways around this, the one used
here is a getch() function which provides similar Figure 6: AntiMicroX
Using gamepad with AntiMicroX
functionality to the C/C++ getch() function. This
will pause the while loop until a key is pressed,
10 AntiMicroX is an application which converts
converts game
controller instructions
to key presses. It
and then return the key into the ch variable. gamepad instructions into keyboard or similar can be configured
using the GUI
The direction dictionary provides instructions. Start AntiMicroX from the accessories application, pressing
menu. This will add a game controller icon to the the controller
mapping between the numerical keys and the
will highlight the
selected direction. top right of the screen. Clicking on that will allow appropriate button

Raspberry Pi Mecanum Robot magpi.cc 61


TUTORIAL

you to map each of the buttons to the relevant reconnecting the USB dongle after AntiMicroX is
keys, and this is illustrated in Figure 6. running. Then, choosing Update Joysticks from
You can map each button on the gamepad, or the menu.
import the suggested layout which is included in
the GitHub repository.

Future upgrades
12 The robot can be controlled using a game
Troubleshooting
11 The gamepad must be recognised by
controller, or using a keyboard.
With some extra electronics and code, the
Linux to work with AntiMicroX. Some controllers robot can do more. There are holes included in
appear to work consistently, whereas others need the front of the chassis which can be used to add
reconnecting once or twice before they will work an ultrasonic distance sensor to detect and avoid
with AntiMicroX. nearby objects. Or, you could add a line sensor
If the gamepad doesn’t work after a reboot, to allow your robot to follow a line drawn along
then you may need to try disconnecting and the floor.

DOWNLOAD
mecanum1.py THE FULL CODE:
> Language: Python 3 magpi.cc/mecanumpy

001. import sys, tty, termios 028. '4' : (-1, 1, 1, -1), # Left
002. from gpiozero import PWMOutputDevice, Motor 029. '5' : (0, 0, 0, 0), # Stop
003. 030. '6' : (1, -1, -1, 1), # Right
004. motors = [ 031. '7' : (0, 1, 1, 0), # Diagonal left
005. Motor(2, 3, pwm=False), #Front left 032. '8' : (1, 1, 1, 1), # Forwards
006. Motor(22, 23, pwm=False), # Front right 033. '9' : (1, 0, 0, 1) # Diagonal right
007. Motor(14, 15, pwm=False), # Rear left 034. }
008. Motor(24, 25, pwm=False) # Rear right 035.
009. ] 036. current_direction = "stop"
010. pwm_out = PWMOutputDevice (18) 037. # speed is as a percentage (ie. 100 = top speed)
011. 038. speed = 50
012. # get a character from the command line 039. pwm_out.value = speed/100
013. def getch() : 040.
014. fd = sys.stdin.fileno() 041. print ("Robot control - use number keys to
015. old_settings = termios.tcgetattr(fd) control direction")
016. try: 042. while True:
017. tty.setraw(sys.stdin.fileno()) 043. # Get next key pressed
018. ch = sys.stdin.read(1) 044. ch = getch()
019. finally: 045. if (ch == 'q') : # Quit
020. termios.tcsetattr( 046. break
fd, termios.TCSADRAIN, old_settings) 047. elif (ch in direction.keys()) : # Change
021. return ch direction
022. 048. for i in range (0, 4):
023. # list to convert key into motor on/off values to 049. if direction[ch][i] == -1:
correspond with direction 050. motors[i].backward()
024. direction = { 051. elif direction[ch][i] == 1:
025. # number keys 052. motors[i].forward()
026. '1' : (-1, 1, -1, 1), # Turn left 053. else:
027. '2' : (-1, -1, -1, -1), # Backwards 054. motors[i].stop()
028. '3' : (1, -1, 1, -1), # Turn right 055. print ("Direction "+ch)

62 magpi.cc Raspberry Pi mecanum robot


SUBSCRIBE AND

SAVE UP
TO

35% on the cover price

ISSUE #72

hsmag.cc
TUTORIAL

Build a Bluetooth
remote for a flashlight
Make a remote Bluetooth remote control for the
Pico-powered flashlight using MicroPython

R
ecently, the author created a GitHub site for this project at this link:
remote-controlled light based on hsmag.cc/Bluetooth_Flashlight.
an old camera flash he found for
sale on a market stall. The light NO NEED TO PAIR
contains a Raspberry Pi Pico W The Wi-Fi-controlled flashlight is configured with
programmed in CircuitPython that network credentials, and the user must visit a
acts as a web server on a local network. The colour specific web address to connect to the flashlight
Rob Miles
of the light is controlled via the web page hosted controller page. The Bluetooth light and remote
@robmiles by the light. The Pico W also supports Bluetooth, control use a Bluetooth addressing scheme in
and so in this project, a new version of the light which there is no need to explicitly pair two devices
Rob Miles has been is created which is controlled by a second Pico that wish to communicate. There is no need to
playing with hardware
W-powered device sending Bluetooth commands. configure either the light or the control. However,
and software since
almost before there was Continuing the upcycling theme of the previous if you wanted to use multiple lights with a single
hardware and software. article, this one uses an upcycled milkshake box as controller in the same room, things get a little
You can find out more
about his so-called life at a case for the controller (Figure 1). You can find all trickier. You will need to use a different Bluetooth
robmiles.com. the software for the light and the controller on the addressing scheme if you want to enable multiple

64 magpi.cc Build a Bluetooth remote for a flashlight


TUTORIAL

Far Left
Figure 1. The
light output has
been reduced for
the purpose of
photography.

Figure 2
The remote control
works well with
only three alkaline
batteries, as the power
requirements of the
device are not high

sender.update()
time.sleep_ms(20)

connections. However, if you just want to send data The statements above create a BLE_sender instance
from one device to another over short distances, and feed it a ColourControls instance that reads the
the method described here works very well, and it control inputs. It then repeatedly calls the update
is easy to change the type and amount of method in the sender, which reads colour values
data sent. from the control. The ColourControls class reads the
control inputs. The code for the class is shown below.
CREATING A REMOTE CONTROL
Figure 2 shows the circuit diagram for the device. class ColourControls:
The three potentiometers are connected to the def __init__(self):
YOU’LL NEED
analogue-to-digital converter (ADC) inputs on the self.red_ADC = machine.ADC(0)
Pico. The input from the ADC is scaled to produce self.green_ADC = machine.ADC(1) A suitable box
(you can put
intensity values in the range 0–255. These values are self.blue_ADC = machine.ADC(2) the control into
sent via Bluetooth to the light. self.old_red=-1 anything you fancy)
self.old_green=-1 A Raspberry Pi
SENDING VALUES WITH CLASS self.old_blue=-1 Pico W (remember
The Pico W in the remote control runs a self.update() to get the 'W'
version as this has
MicroPython program called ble_sender.py, which Wi-Fi and Bluetooth
repeatedly reads the ADC devices connected to the def update(self): capability)
red, green, and blue potentiometers and sends a self.red = round(self.red_ADC.read_
3 × linear
block of data containing the colour intensity values. u16()/256) 10 K rotary
If the user adjusts one of the colour settings the self.green = round(self.green_ADC.read_ potentiometers
updated value is sent out over Bluetooth to the u16()/256) Other resistance
values will work as
light. The ble_sender program uses a class called self.blue = round(self.blue_ADC.read_ well. Make sure you
BLE_sender. This is supplied with an instance of u16()/256) get potentiometers,
not rotary encoders.
the ColourControls class which interacts with if self.red==self.old_red and self.
The potentiometers
the potentiometers: green==self.old_green\ will have only
and self.blue==self.old_blue: three connections,
whereas a rotary
def run(): return False encoder will
print("Light sender starting") self.old_red=self.red have four
controls = ColourControls() self.old_green=self.green
A single pole
sender = BLE_sender(controls) self.old_blue=self.blue single throw
while True: return True power switch

Build a Bluetooth remote for a flashlight magpi.cc 65


TUTORIAL

QUICK TIP DistanceControls) to read and pack the data from


Using the analogue def pack(self): the distance sensor and use this class with the BLE_
power and ground return struct.pack("<BBB", self.red,self. sender class instead. You don’t need to know how
connections on the green,self.blue) the BLE_sender class works to send different kinds of
Pico will make the information using it. As long as the class you create
analogue readings
The __init__ method is called when an instance contains update and pack methods (and the update
more stable.
of ColourControls is created. It sets up the ADC method returns True if the inputs have changed) it will
interfaces on the Pico and sets initial values used just work. The BLE_sender class itself is based on the
in the class. The update method is called to request temperature sensor example in the Pico examples
an update of the red, green, and blue values held you can find here: hsmag.cc/MicroPython_


inside ColourControls Examples.
class. The class stores
previous values of red, You don’t need to know how RECEIVING LOUD
green, and blue readings AND CLEAR
the BLE_sender class works
and update returns True Figure 3 shows the
to send different kinds of


if it detects the inputs Pico from the flashlight
have changed. The pack information using it being reprogrammed.
method returns the byte The Pico was loaded
values to be sent to with MicroPython, as
the light. It packs the red, green, and blue intensity the original Wi-Fi-controlled light uses CircuitPython.
values into three bytes. The BLE_sender class calls Below, you can see the MicroPython code that
update and then calls pack if update returns True. runs when the light starts running. The Pico W in
the controller acts as a server, serving out red,
TWO CLASSES ARE BETTER THAN ONE green, and blue intensity values which can be
You may be wondering why two classes are used, used to set the intensity of a light. The program
when it would be perfectly possible for a single ble_reciever.py runs in the light to receive these
class to do everything. This is to provide flexibility. values. It uses a class called BLE_receiver to receive
If you want to send values from a different device data from the controller and use the data to set the
Below
The control is set (for example you might want to send values colour of the light.
to around halfway. from a distance sensor) you can create your own
You can tell this
because the little version of the ColourControls class (perhaps called def run():
plastic finger over the print("Light Receiver Starting")
wiper is connected
pixieLight = PixieLight(0.2)
to the centre of
the circular track POTENTIOMETERS receiver = BLE_receiver(pixieLight)
connecting the outer
two contacts AND ROTARY ENCODERS while(True):
receiver.update()
There are two types of twiddly knobs you can
use with microcontrollers: potentiometers time.sleep_ms(50)
and rotary encoders. The former, which
we've used here, create a changing The run function above implements the receiver
voltage as they’re turned. This voltage behaviour. It creates a BLE_receiver instance called
can be read by an analogue input. receiver. The receiver is given the device to control,
They're easy to use and hold a
in this case, an instance of the PixieLight class.
physical memory of their position (i.e.
if you power off the project, they will Once the receiver has been created the run function
read the same value when you power repeatedly calls the update function of receiver. The
it back on). However, they can only be update function creates a connection to a transmitter
turned a fixed amount. Rotary encoders and then fetches blocks of data from Bluetooth
emit a series of pulses as they’re turned, which are then passed onto the pixieLight.
often with a soft click as they do. You can
keep on turning them forever in either
direction and they’ll keep on pulsing. from machine import Pin,UART
They’re great for user interfaces (scroll from Pixie import Pixie
wheels are one type of rotary encoder). import time
import struct

66 magpi.cc Build a Bluetooth remote for a flashlight


TUTORIAL

class PixieLight:

def __init__(self, brightness, txPinNo=4,


rxPinNo=5):
uart =
UART(1,tx=Pin(txPinNo),rx=Pin(rxPinNo),
baudrate=115200)
self.pixies = Pixie(uart, 1,
brightness=brightness)
self.old_red=-1
self.old_green=-1
self.old_blue=-1
self.pixies[0] = (0, 255, 0)

def render(self):
self.pixies.fill((self.red,self.green,self.
blue))

def set_colours(self,red,green,blue):
if red==self.old_red and green==self.old_
green\
and blue==self.old_blue:
return False
self.red = red
self.green = green
self.blue = blue
self.old_red=self.red
self.old_green=self.green
self.old_blue=self.blue
self.render()
return True

def unpack(self, data):


value = struct.unpack("<BBB", data)
if self.set_
colours(value[0],value[1],value[2]):
self.dump()

def dump(self):
print("Red:%3d Green:%3d Blue:%3d"%(self. aware of the content of the data they are transferring.
red,self.green,self.blue)) They just move blocks of binary data from one place Figure 3
If the light output
to another over Bluetooth. The form and meaning is not set very
bright, the light
The PixieLight class is shown above. The receiver of the data is determined by a ’contract’ between software can be
will get blocks of data from Bluetooth and pass the ColourControls and the PixieLight classes. The tested using just
a USB connection
them to pixieLight by calling the unpack method. pack method in ColourControls assembles a block of for the power
The unpack method is supplied with a block of data three bytes which contains the red, green, and blue
which must be unpacked and then used to set a new intensity values selected by the user. The unpack
light colour. It sets the colours of the light and, if the method in PixieLight then takes these three values
colours have changed, it prints the new values to from an incoming block and uses them to control the
the terminal. colour intensities in the lights it is driving.
Both the classes need to agree on the encoding
TAKING OUT A CONTRACT (8-bit values) and the order (red, green, blue) of the
The BLE_reciever and BLE_sender classes are not values. Any misunderstandings will result in wrong,

Build a Bluetooth remote for a flashlight magpi.cc 67


TUTORIAL

class of your own which contains an unpack method


that acts on the data that is received from the BLE_
receiver, but you would need to make sure that the
send and receive objects agree on the form of the
data being transferred.

TIME FOR AN UPDATE


Most light devices, for example NeoPixels, are easy
to use. You just tell them the colour you want, and
they light up with that colour until they are given a
new colour value. However, the Pixie light used in the
flashlight needs to be repeatedly told the colour to
be displayed, otherwise it will shut down. To achieve
this, we add an update function to the PixieLight
class. This is called regularly by BLE_receiver and will
refresh the colour settings on the light when required.

or no colours being displayed. We are sending ’raw’ def update(self):


Figure 4 data values like this because Bluetooth limits the size millis = time.ticks_ms()
The potentiometer of data packets. If we were sending the data over a interval = time.ticks_diff(millis, self.last_
connections were
wrapped around the network connection with more capacity, we could update_ticks)
Pico pins and then use JSON (JavaScript Object Notation) to encode the if interval>self.update_tick_interval:
soldered to
the potentiometers data. JSON data includes a description of the data. self.render()
self.last_update_ticks = millis
{
"red_byte":0, The PixieLight class contains two member values:
"green_byte":255, last_update_ticks and update_tick_interval.
"blue_byte":0 The last_update_ticks value contains the time in
} milliseconds since the light was refreshed. The
update_tick_interval value contains the interval
The JSON encoded data above could be used between refreshes, in our case 200 milliseconds.
to send the colour bright green to a JavaScript
application. The name of each value is part of the
data, making it easy to understand what is being
sent. However, this message contains many more
bytes than the three that are used by the light. With
low-capacity connections such as Bluetooth, we
must make sure that both sides of the conversation
agree on the data format.
If you want to use the incoming data to control
a different device, you can swap PixieLight for a

CIRCUITPYTHON VS MICROPYTHON
The code to control the original light was written using CircuitPython. However, at the
time of writing, there are no Pico W Bluetooth libraries available for CircuitPython.
Bluetooth connections are presently only supported by MicroPython. CircuitPython
and MicroPython are very similar; they differ mainly in the availability of different
libraries for specific devices. If you are serious about becoming an experienced Figure 5
embedded developer, you should aim to be familiar with both implementations. The When drilling the holes for the controls, start
with a small hole and then drill it out to fit.
author originally chose CircuitPython because of the availability of a library for the This makes it much easier to correct any
Pixie lamp he was using. However, he was able to convert this library to MicroPython mistakes with the initial hole position. It also
and then use MicroPython for this project. produces a nicer finish to the hole

68 magpi.cc Build a Bluetooth remote for a flashlight


TUTORIAL

Each time update is called, it gets the current time and purchased for this project. The author really likes
then works out how many milliseconds have elapsed strawberry milkshake.
since update was last called. If the interval is greater Figure 5 shows the controls fitted to the top of
than update_tick_interval, the render function is the milkshake box. The switch was pushed through
called to display the lights and keep the Pixie shining. the top of the box and then connected to the Pico
and the battery. The Pico and battery holder were
FINAL ASSEMBLY then secured to the inside of the box using adhesive
Figure 4 shows the wiring for the light controller. It Velcro. The resulting box looks quite pleasing (at least
Below
was first built on the desk and tested before being to the author), and the device inside works well. Only a good idea
transferred to the case. The power is controlled by It would be possible (and indeed quite easy) to if your device
doesn’t use radio
a push-button which is connected in series with the use the same technique to create other Bluetooth- communications
battery box. Once the circuit had been tested, it was connected devices.
then ready to be put inside the case, which was a
box of milkshake which was in no way specially

BOXING CLEVER
The author likes the idea of upcycling, where a project
reimagines an existing product. The controller for the light
is fitted inside a box that previously contained milkshake
powder. Here are some tips for upcycling.

• Don’t use metal boxes for devices that contain


radios. The author’s first choice of box was a tin
that had previously contained mints. After a bit of
thought, this was abandoned as a bad idea, but
the mints were delicious.

• Use longish connecting wires. The author used • Use heat-shrink tubing to cover connections
to take great pride in how all his wires between and make sure that connections have physical
components were exactly the right length. This, integrity. If you are soldering a wire to a terminal,
while aesthetically pleasing, did tend to make make sure to hook the wire through a hole to give
fitting the components into the box much harder the connection physical strength, and then use
and more likely to cause damage. Longer wires solder to hold the wire in place and provide the
give a lot more leeway in case construction and electrical connection. Then cover the whole
can be safely tucked inside the case. thing with heat-shrink tubing. This makes
everything look a lot tidier and means that loose
• Don’t always twist all the connecting wires wires won’t cause problems. This is particularly
together to make a wiring harness. This sounds important if you are using a metal case, as it
counter-intuitive, but it does make sense (at least prevents signals shorting.
to the author). If you have ten wires going to a
component, you could twist them all together to • Use connectors with components that fit into
make a single cable. However, because all the the case from the outside. Some components,
wires will be different lengths, this means that the for example, some switches and lights, are fitted
weight of all the wires may end up being borne from the outside of the case and then secured
by the shortest cable connection, which will internally. In the light control, the push-button
then break. If all the wires are separated, each power switch is fitted into the case from the This tutorial is from
connection will only have to support the weight outside, and so it is connected using push-fit HackSpace magazine.
of one wire. If you really do want to group cables connectors rather than being connected directly. Each issue includes a
together, make sure they are supported inside huge variety of maker
the case. • Don’t stick components into your case using projects inside and
a permanent adhesive. The author is a big fan outside of the sphere
• Construct and test your circuit outside the case. of self-adhesive Velcro, which can be used to of Raspberry Pi, and
It is very hard to check connections once you hold processors and batteries in place. The also has amazing
have put them in a box. Create the entire circuit components are held firmly, but they can be tutorials. Find out
and test it first. Then put it in the box. removed if required. more at hsmag.cc.

Build a Bluetooth remote for a flashlight magpi.cc 69


50 Phenomenal
Raspberry Pi
Projects T he uses for Raspberry Pi are endless –
and, now Raspberry Pi 5 is here, you’re
all doubtless looking forward to your
next build.
Here is a selection of amazing projects using
all Raspberry Pi computers. We’ve categorised
this selection, drawn mainly from the past
year’s issues, by theme from space and scientific
sensing and investigation to photography, music
Get clued in about Raspberry and art, AI, robots, and retro.
Pi projects worth pursuing with Whether you’ve just taken delivery of a
shiny new Raspberry Pi 5 or are using a Pico
your guide Rosie Hattersley or Raspberry Pi 400, there’s plenty of project
inspiration to be found in the following pages,
almost all of it created by makers, tinkerers and
readers of The MagPi magazine!
Check out these examples, and don’t forget
to show us your own creative versions on
Threads, Facebook, Instagram, or Mastodon,
tagging #MagPiMonday.

70 magpi.cc 50 Phenomenal Raspberry Pi projects


Retro gaming 4 Retro Gaming
with Raspberry Pi

& computing magpi.cc/retrogaming

Our very own guide


to old-school gaming,

1 Pico Pocket Gamer


complete with project
ideas and amazing
builds to emulate.
magpi.cc/pocketgamer

A straightforward strategy is at the heart of this great Pico-


based game, for which maker Grgo Mariani created a custom 5 Lunchbox Arcade
circuit board (but stresses that this bit is optional) and added
a 320×240-pixel display and five simple switches. We love this magpi.cc/lunchboxarcade
project’s achievable simplicity.
Tin lunchboxes are nostalgic in their
own right. They’re also ideal for
adding speakers and decals for your
own mini arcade.

2
NB100 Cyberdeck
magpi.cc/nb100
3
Upcycling old tech using
Raspberry Pi is marvellous fun, as
RetroPie gaming 6 Fancy Octopus Arcades
this repurposing of an Amstrad
magpi.cc/octopusarcades
A4 notepad with a split keyboard retropie.org.uk
and 8.8-inch widescreen display New Yorker Shonee Strother’s
RetroPie provides a simple,
shows. Retaining nothing but amazing custom-built RetroPie
software-based way of getting to
the 1980s case, it’s now a fully arcades are co-designed by his
enjoy old favourites on any version
functioning Cyberdeck computer six-year-old son and packed with
of Raspberry Pi you choose, with
with 2020s processing chops. incredible detail.
or without a classic console case.
Half the fun is repurposing an old
console or customising a biscuit
tin to house your brand-new
gaming device.

50 Phenomenal Raspberry Pi projects magpi.cc 71


7 8 Clamshell BlackBerry Cyberdeck
magpi.cc/diycyberdeck

Raspberry Radio Combining an iconic early smartphone keyboard


with the gorgeous HyperPixel 4.0 display via the
magpi.cc/121 incredibly useful GPIO pins of a Raspberry Pi 4,
the BlackBerry Cyberdeck provides powerful
A detailed tutorial in The MagPi
computing power in a pocket-sized form. The
magazine issue 121 explains how
icing on the cake is maker Michael’s beautifully
to put together a Raspberry Pi Pico
designed and laser-cut plywood case.
Radio with stations and podcasts
tailored to your own interests and

9
musical tastes. The Display-O-Tron
LED screen will even show news Team Pinball
headlines – or you can have them
magpi.cc/teampinball
read aloud.
Pinball wizardry has also been fascinating,
for the intricate table designs as much as
the flipper-based play. Wales is home to the
UK’s only pinball factory, where it’s a labour of
Raspberry Pi CM3-based love for its designer-
maker team. Their retro game, The Mafia, “brings
the player back to Chicago and the 1930s
Prohibition Era with gangsters, casinos, and of
course, a bank to rob!”

10 Retro gaming
Mini PC
magpi.cc/minipc

This miniature PC started out as


& computing “ Upcycling old tech
using Raspberry Pi

11 is marvellous fun

a Bluetooth speaker. Seeing its
resemblance to a small desktop Unity 3D
computer, owner Carter made magpi.cc/unityintro
the vision a reality with the aid
of Raspberry Pi 3B, a BlackBerry With guidance on how to
keyboard, and some 3D printing. It create characters and your
runs Raspberry Pi OS and could be own 3D adventure game,
replicated using Raspberry Pi Zero. Unity 3D offers lots of
Raspberry Pi-based coding
fun and an alternative to
the better-known Python,
C, and Scratch. Kids will
respond to the bright
visuals and the chance to
create their own worlds,
collecting experience
badges along the way.

72 magpi.cc 50 Phenomenal Raspberry Pi projects


Space Projects
12 Heavy Pan Tilt System
magpi.cc/heavypan

Astrophotographers often find it hard to create a setup robust enough


to take a hefty digital SLR camera and have it pan smoothly across the
night sky without it juddering, or losing either focus or the object in the
viewfinder. Maker Vito put together his own mechanical designs and
software to automate object tracking, with Raspberry Pi 4 providing the
critical stepper motor controls and OpenCV libraries for computer vision.
See the incredible results at magpi.cc/vigasanyt.

13 15
EPIC Satellite
14 Astro Pi Challenge
magpi.cc/epicsatellite astropi.org

NASA shares daily photos from its Mini Mars Rover While on the International Space Station,
Deep Space Climate Observatory astronauts undertake experiments on Raspberry
magpi.cc/minimarsrover
including its EPIC (Earth Pi computers devised by dozens of groups as
Polychromatic Imaging Camera) Lightweight but durable materials part of the annual Astro Pi challenge. Read about
which is trained on the sunlit and a simple design that others teenagers’ attempts to measure variations in the
side of the Earth. This gorgeous can easily replicate were the strength of magnetic north, climate change in
project by Matt Gray shows off principles behind this wonderful inaccessible locations, and much more.
these visual treats wonderfully on Pico W-based Mars rover, inspired
Young people aged 19 and under can enter
a HyperPixel Round Touch Display, by a workshop at Belgium’s
Astro Pi and Mars Mission between now and
having pulled them into view CubeSat Summer School. Maker
the end of the year. Entry packs will be sent out
using NASA’s Blue Marble API and Nikodem designed everything in
to schools, code clubs and groups of friends,
Raspberry Pi Zero W. CAD himself, then 3D-printed it
regardless of where in the world you live.
and set up the MicroPython code
to control his mini marvel.
Credit: ESA/NASA

50 Phenomenal Raspberry Pi projects magpi.cc 73


Robotic Projects
16 Chip Bipedal Robot Companion
magpi.cc/chipbiped

Having a chip on your shoulder is not


usually indicative of Zen-like happiness, but
accomplished robot builder Kevin McAleer
(kevsrobots.com) is more than content with his
“cute interactive humanoid pal.” The shoulder-
percher has a Raspberry Pi RP2040 board inside
in the form of a Pimoroni Servo 2040, chosen
for its 18 servo sockets, and senses the world
through an ultrasonic range finder.

17 RockyBorg
magpi.cc/rockyborg

18
PiBorg’s RockyBorg is an enduring
favourite at Raspberry Pi Towers. K-9
The three-wheeler corners
magpi.cc/k9
like a dream and is capable of
magnificent speeds. Two 180 rpm True Whovians will approve of the fact that maker/tinkerer
motors on the rear provide forward Fitz used whatever he had to hand when creating The Doctor’s
momentum, while a servo tilts famous companion and adapting the schematic shared by
the robot’s body of the robot to other fans: magpi.cc/k9pdf. K-9 features various mechanisms
change direction. This £99 kit to defend himself, but also uses AI to sense friends nearby – at
just needs a Raspberry Pi and HQ which point, the camera in his head takes a quick snap that K-9
Camera to complete. prints out through his mouth and presents to his new buddy.

74 magpi.cc 50 Phenomenal Raspberry Pi projects


AI Projects
19 ClippyGPT
magpi.cc/clippygpt

Microsoft’s annoying
Windows assistant
gets a seemingly
20 Love Machine & Olga
magpi.cc/lovemachine
sentient makeover
with this Raspberry Pi 3B+ character that uses Among the most endearing Raspberry Pi
Adafruit’s Cricket HAT to connect up various servos, projects we’ve covered recently are two by Will
motors and solenoids to create a chirpy Clippy who Lahrs and his creative team at Kakapo Labs.
chats back. First, they designed the smooth-talking Love
Machine which uses AI and ChatGPT to connect
with passers-by and engage them in flattering
WhatsApp banter. They then went on to create
Olga The Fortune Teller who shares much of the

Photography
original project’s Pico W-enabled interaction and
prints out fortunes on a Zebra thermal printer.

Projects 21 Photon DIY Incident Meter


magpi.cc/photonlight

22
Good photographs need good lighting as well
as an interesting subject and framing. This Pico-
based light meter, coded by our friends at Veeb.ch,
using MicroPython helps you get the balance right.

Digital Toy
Camera 23 Instant 24 POP 360-Degree
magpi.cc/digitaltoycam
Photo Printer Camera
magpi.cc/cameraprojects magpi.cc/popcamera
Despite declaring digital sensors
“a pain,” maker Volzo designed You can easily print out your best A virtual reality
a camera that uses the 5 MP snaps using a thermal printer housed camera in a Flip video
Raspberry Pi Camera Module in a cardboard box. Use any Raspberry camera-sized form, this CM4-
V1 lens and Raspberry Pi Zero Pi and add based VR videocam is impressively
to capture Lomographic photos large push- straightforward to use. Although the
that are far more interesting, and buttons to visuals are blockier than we’d like,
quirky, than those you get with a initiate the it’s another example of Raspberry Pi
boringly efficient smartphone. print process. pushing technological barriers.

50 Phenomenal Raspberry Pi projects magpi.cc 75


Science Projects 26 Wire loop game
magpi.cc/wireloop

Making use of the Scratch visual


coding interface, this fun buzzer game

25 Raspberry Pi Pico Advanced Kit takes you through creating circuits


with lights, jumpers, and sounds. It
magpi.cc/picoadvkit will even display a scoreboard to
encourage healthy competition.
Pico owners will get hours of
enjoyment from the excellent £29 box
of electronics, all aimed at extending
the way you use your low-cost
Raspberry Pi using sensors, lights, and
buzzers. There are 32 projects detailed
and the kit even includes elements to
get you started making robots!

27 CamJam EduKit 28 Open-source Gamma


magpi.cc/edukit3 Spectrometer
magpi.cc/gammaspec

This enduringly This Pico-based radiation detector


popular £6 kit is smaller and cheaper than a
contains everything standard Geiger counter. Sensitive
you need to get stuck into electronics enough to detect even low levels
and devising your own science of gamma radiation, it uses spectrometry to determine the
projects with Raspberry Pi. It literally composition of a radioactive material and its approximate age.
contains bells and whistles (well,
buzzers and lights) along with jumper
leads, breadboards, and clips. 30 Ohsillyscope
magpi.cc/ohsillyscope

29 Rudolph The Red Musician Thomas created a Raspberry Pi


Nose Reindeer oscilloscope with an LED matrix to show
the waveforms created by his electric
magpi.cc/rudolph guitar. Marvellous and suitably OTT!

Rob was charmed


by this workshop
aimed at getting
newbies into programming, while
31 LEGO Submarine 4.0
magpi.cc/legosub4
assembling a plywood Rudolph
complete with flashing red nose, a Propellers provide buoyancy and motion in
leg that moves, and enough festive this stunning submersible. An air compressor
lights and a star to keep even our adjusts the water displacement and a piston
resident Christmas obsessive happy. ballast governs the sub’s gravitational heft.

76 magpi.cc 50 Phenomenal Raspberry Pi projects


Sensing & Monitoring
32 Raspberry Shake
raspberryshake.org

Raspberry Shake provides


an ideal kit for monitoring
earth tremors both natural
and man-made. You can
see real-time seismic
activity from volcanoes,
thunderstorms, and
tsunamis, but also log
vibrations from lorries
rumbling down your street
or the crowd excitedly
enjoying a jam-packed gig.
34 AuraLock Automatic
Door Opener
33 Flight Tracker magpi.cc/auralockdoor
With Weather
Face recognition provides
magpi.cc/flightweather hands-free home access
(good news if you’re laden
Inspired by a simpler aircraft tracker
with groceries) with the
on Reddit, maker Adam Paulson
help of Raspberry Pi 4 and
came up with one that also provides
camera, lock mechanism,
localised weather forecasts. The
and an Android phone.
three-day forecast is shown on
The mechanised wooden latch manoeuvres the deadbolt –
a rather lovely 64×32 RGB matrix
no annoying PIN or fiddly keys are needed.
display, thanks to an Adafruit
Bonnet, while data comes from the
FlightTracker API and everything is
managed by Raspberry Pi 3B+.
35 Home automation
magpi.cc/129

We covered all manner of home


automation options back in issue 129,
highlighting how easily Raspberry
Pi integrates with the likes of
Apple’s HomeKit to control lights,
robot vacuums, heating, and more.
Download the issue to get started with
voice assistants and smart sensors.

50 Phenomenal Raspberry Pi projects magpi.cc 77


36 Bugg.xyz
magpi.cc/ecosystemmonitoring

We’ve covered lots of Raspberry Pi-


based wildlife camera setups in The
MagPi. Bugg.xyz is used in forests
from Norway to Borneo to listen
in and establish ecosystem health


according to the soundscape. You
can conduct your own experiments You can conduct
using Raspberry Pi, an HQ Camera,
and some simple garden tools your own
by following Bugg founder
experiments

Sarab’s instructions (linked above).

37 Pico Plant Waterer 38 Night Clock


magpi.cc/plantwaterer magpi.cc/sensehatnightclock

Give your houseplants some loving The Sense HAT is capable of all kinds of computing capers, but
care without having to bother your lends itself especially well to projects where you want to be able
neighbours or kids to keep an eye to get the gist of something without really trying. Lorna Jane’s
on them. Simple moisture sensors Night Clock Sense HAT coloured grid shows you whether it’s
either sprinkle your plants – or not – night or day, so you can immediately decide whether to get up.
Sensing & Monitoring

depending on whether the soil has


dried out. Neat!

39 NeoPixel Stairlights
magpi.cc/neopixelstairs

The rainbow staircase in Lorraine Underwood’s


project sets off the lights particularly well, but it’s
actually temperature sensing that triggers them. A
perennial The MagPi favourite project, it works with
any Raspberry Pi alongside Adafruit’s NeoPixels to
create a giant visual thermometer.

78 magpi.cc 50 Phenomenal Raspberry Pi projects


Fashionable Projects
40 Disco Diva Dog Jacket
magpi.cc/cyberdogsaddle

Robot maker Kevin McAleer kitted out his beloved dogs with
light-up jackets using NeoPixels, then headed to Blackpool for a
celebratory promenade. This innovative dog coat is not just about
style; it’s about ensuring the safety of his pets during night-time
walks. Kevin’s creation uses a Raspberry Pi to control the LED
patterns, making the coat functional and fashionable.

41 Wearable Tech 44
magpi.cc/wearabletech

Queen of wearable tech Sophie Wong


put together this book for us featuring Raspberry Pi Beret
fantastic makes such as helmets, magpi.cc/raspberrypiberet
hoodies, and apparel – all featuring
electronic elements. NeoPixels, A Raspberry Beret was an early example
individual LEDs, and a discreet power of Pi-based wearable tech. The princely
pack, along with a microcontroller project has had a new Pi (power
such as Raspberry Pi Pico to add any generation) update and gained a new
clever time triggers are all you need. audience of admirers on TikTok. A Pico W,
addressable LED lights, and the effortless

42 Mona Lisa
chic that wearing a beret conveys create

43
an instant classic.
Fluid Painting
magpi.cc/monalisafluid

Showcasing the potential of


fluorescent fluid in medical
CNC Plotter
applications, this mesmerising magpi.cc/cncplotter
liquid painting on a tiny chip was
Fascinated by how plotters
captured in all its miniature glory by a
work, maker Stratos Botsaris
Raspberry Pi HQ Camera.
set about using an old scanner
and printer and some G-code
text files extracted via Python to
create detailed A4 drawings. The
Raspberry Pi-controlled device
reads the text-based instructions
and tells the stepper motors how
to execute them.

50 Phenomenal Raspberry Pi projects magpi.cc 79


Music & Media Projects
45 Lo-Fi Orchestra
magpi.cc/makesound

The ‘Make sound with Pico’ article is well worth a look if you need
some ideas of what you might make. Included alongside the DIY Trill
guitar (magpi.cc/trillguitar) is the Lo-Fi Orchestra, in which multiple
instruments controlled by Arduino and Raspberry Pi boards feature.

46 PaperPi V3
magpi.cc/paperv3

The restful Waveshare e-ink display of this understated media


player makes it a classy addition to your home décor. “Ideally, the
screen would be easy to read from across the room, look great,
but also fade into the room,” says maker Aaron, who uses it to
show off phases of the moon, as well as photos, and occasionally
plugs in a HiFiBerry DAC.

47 PicoStepSeq
magpi.cc/picostepseq

Taking advantage of the RP2040’s


GPIO pins, pulse-width modulation,
and movable UARTs, Tod Kurt
used step switches (lever switches
with LEDs) to create a sequencer
reminiscent of an 1980s classic synth.
A super, geeky Pi project.

80 magpi.cc 50 Phenomenal Raspberry Pi projects


“ Extending the
possibilities of
49 Magic Mirror
magpi.cc/mirrorguide

Braille literacy for Voted the number one greatest use


of Raspberry Pi way back in issue
blind and partially- 50 of The MagPi, a magic mirror is
still one of the most popular, not
sighted users is no least because you can choose or
create different frame options and


mean feat it can easily be customised with
info feeds, as well as blending in
wonderfully with your décor. Follow

48
PJ Evans’s tutorial to create your own
The Lost magic mirror your own way. This LCD

Sounds Project Chalkboard version is a really great


example (magpi.cc/lcdchalkboard).
magpi.cc/thelostsounds

50
We really like the low-tech approach
to this project in which bird silhouettes Bristol Braille Canute 360
emit their corresponding bird sound
magpi.cc/bristolbraille
when the electrical circuit is complete.
The Raspberry Pi-based project only Extending the possibilities of Braille
costs a few pounds to replicate, and is literacy for blind and partially sighted
perfect for getting citizen scientists to users is no mean feat: community
notice their surroundings and show off interest organisation Bristol Braille took
their findings. eight years and a dozen iterations to
bring the world’s first multi-line Braille
reader into being. This Raspberry Pi
Zero-based device and its Raspberry Pi
400-based sibling, the Canute Console,
hugely extend reading options and
digital library access.

50 Phenomenal Raspberry Pi projects magpi.cc 81


REVIEW

ClipZin
EDAC magpi.cc/clipzin £4 (pack of two)

An easier way to connect Raspberry Pi Pico to PCBs.


By Phil King

A
imed mainly at breakout/carrier board a design or want to later replace a standard Pico
SPECS manufacturers, along with advanced board with a Pico W.
electronics hobbyists, ClipZin is a new way
FEATURES: to connect a Raspberry Pi Pico to a PCB. Clip in, clip out
Gold flash-
Ever wondered why Pico has those castellated In practice, we found it extremely easy to clip a
plated
contacts, (bumpy) edges alongside the two strips of 20 GPIO Pico onto a sample PCB fitted with a pair of surface
surface-mount pin holes? You can use these castellations – actually mounted, 20-way ClipZin connectors. Just push
connectors, gold-plated half-holes – instead of the usual pins Pico down and it clicks securely into place, held
board retention to connect Pico to other electronics. This kind by individual springy pins that maintain a good
clips
of card-edge technology has long been used in
DIMENSIONS: computer design.
57 × 26 × 6 mm While you could always just solder Pico’s J ust push Pico down and it
castellations directly onto metal contact pads
on the surface of another PCB, ClipZin has the
clicks securely into place
advantage of being able to clip the board in and out
at any point – ideal for when you’re prototyping connection with each castellation. Small plastic
retention clips on either end also help to keep it
in place.
Removing Pico from the ClipZin connectors is as
simple as gently pulling one of the retention clips
and lifting the board out.
While a little more expensive than the alternative
Pico clicks neatly and of using FlexyPins (magpi.cc/flexypins), ClipZin
securely into place
connectors benefit from being all-in-one (coming
between two 20-way
ClipZin connectors in 6-, 8-, 17-, and 20-way versions), making them
far less fiddly to solder onto a PCB.

The connectors’ springy pins maintain a reliable connection

Verdict
with Pico’s castellations

Should prove
handy for Pico-
based PCB
prototyping and
could also be
used in
final products.

8 /10
82 magpi.cc ClipZin
REVIEW

CM4 XGO-Lite
Robot Dog Kit
Elecfreaks magpi.cc/cm4xgo £469 / $599

SPECS
A Compute Module 4-powered robot dog with five limbs and
a huge amount of potential. Rob Zwetsloot takes it for a walk
SIZE:

W
250 mm × 145 mm
× 170 mm while e’ve seen a small explosion of dog- It’s definitely a very well put together product,
standing, 620g like robot kits over the past few years, although it’s not the most stable looking
LIMBS: although we cannot put a finger on robot we’ve ever seen. The price is also a little
Four walking what might have started it. Perhaps the cuteness eyewatering, but we think the tech inside justifies
limbs and one of a four-legged pet is hard to resist when you can it, especially if you’re looking for a more advanced
gripper allowing program it yourself, which brings us to the very bit of kit.
for 15 degrees of
movement, and
powerful XGO line of robot kits.
three on the arm Unlike a lot of a robot kits, this one has metal
construction throughout, making it chunky and
T here are several bits
PROGRAMMING
LANGUAGES:
weighty in the satisfying way quality technology of example code that
can be. It also comes all pre-assembled so you
Blockly, Python,
ROS won’t be bending any metal plates or doing any illustrate the impressive
complicated wiring to get it working, like with
BATTERY: other legged robots. features of the robot, such
2500 mAh lithium
ion battery with
120 minute life Smart dog as facial recognition
At its core is a powerful
Compute Module 4,
controlling the robot The box comes with
some coloured balls
and allowing for
that you can program
reprogramming with XGO to pick up
custom code over a web
Verdict browser – although you
can also plug it into a monitor (or go a
A very impressive VNC route) if you want and program it
robot kit that the old-fashioned way. There are several
while fine for
bits of example code that illustrate the
beginners may be
impressive features of the robot, such as
better suited to
those already into facial recognition with the inbuilt camera,
robotics due to remote control, and more. There’s a full
the price breakdown of the Python commands on

9
the quite detailed documentation over at
magpi.cc/xgodocs, and it even has a block

/10
code editor for people not quite up to speed
on Python.

CM4 XGO-Lite Robot Dog Kit magpi.cc 83


RESOURCES

Learn circuits
with Raspberry Pi
Start building electronic circuits with the help
of these resources. By Phil King

CamJam EduKit
CamJam Raspberry Pi’s 40-pin GPIO started: a 400-point breadboard,
AUTHOR

header is its ‘superpower’, three LEDs (red, yellow, green),


Price: enabling you to connect not only push-button, buzzer, resistors,
From £6 HATs and other breakout boards, and a selection of jumper wires
magpi.cc/camjamkits but also your own custom to connect components to each
electronic circuits. other on the breadboard and to
If you’re looking for a low- Raspberry Pi’s pins.
cost way to learn how to begin Best of all, online worksheets
building circuits, you can’t guide you through a series of well want to explore adding
go wrong with the CamJam electronics projects, coding sensors (including temperature,
EduKit series. The first of these, them with Python on Raspberry light, and IR) with EduKit #2,
EduKit #1, has everything (bar Pi. Once you’ve mastered the and/or build a simple two-
a Raspberry Pi) you need to get basics of circuits, you might wheeled robot with EduKit #3.

Get kitted out Start building circuits with these electronics kits

RASPBERRY PI ULTIMATE KIT everything you need to get started


CanaKit’s electronics kit lives up with the projects detailed in a 46-
to its name and also includes a page downloadable PDF guide.
Raspberry Pi 4, 3+ or 3 and quick- magpi.cc/projectbox1
start guide. A full-size breadboard
is complemented by an interface to WAVESHARE SENSORS KIT
extend Raspberry Pi’s GPIO pins. Enable your Raspberry Pi to sense
magpi.cc/canakitultimate the world around it with this
selection of 13 sensors – as used
MONK MAKES PROJECT BOX 1 in our Sensory World tutorial series
This kit includes LEDs, a thermistor, (issues 111 to 114) – including gas,
phototransistor, switches, and moisture, and tilt.
handy GPIO pin identifier overlay – magpi.cc/wavesensors

84 magpi.cc Learn circuits with Raspberry Pi


RESOURCES

Learn Electronics Recommended


reading
with Raspberry Pi
Stewart You may recognise author Books to help you
AUTHOR

Watkiss Stewart Watkiss from the series learn more about


of electronics tutorials he’s circuits
Price: written for The MagPi, starting Python, and reading light and
£40
in issue 127 and covering PIR sensors. BEGINNER’S
magpi.cc/
everything from the basics Of particular interest is the GUIDE TO
learnelectronicsbook
to creating a Pong game and chapter on making your circuits READING
controlling a model railway. more permanent by soldering SCHEMATICS
His book, Learn Electronics with components to stripboard or A proper
Raspberry Pi, guides you step- protoboard. The final chapter schematic
by-step through the creation looks at designing your own diagram
of a variety of electronics and custom circuits – using the offers a much clearer,
hardware projects using a Fritzing tool (fritzing.org) to high-precision view of circuit
Raspberry Pi. These include create schematics which you designs, once you understand
mastering input and output from could even turn into a PCB the symbols used. Stan
the GPIO pins, programming in (printed circuit board). Gibilisco’s book explains how
to read schematics and design
your own for projects.
magpi.cc/readschematics

Wokwi RASPBERRY PI COOKBOOK


4TH EDITION
Simon Monk’s 650-page tome
CodeMagic Sometimes you may want to test free and simple to use. It covers is an all-round Raspberry Pi
AUTHOR

out a circuit design before you Raspberry Pi Pico among other user and programming guide
Price: go ahead and build it, which is microcontrollers and there’s a that includes several chapters
Free where a circuit simulator comes variety of examples and shared dedicated to connecting
wokwi.com in handy. There are several user projects to try out, along electronics such as LEDs, push-
available online, but Wokwi is with starter templates for Pico. buttons, and sensors.
In the Simulation window on magpi.cc/rpicookbook4
the right, you can add all sorts
of electronic components –
including sensors and motors/ GET STARTED WITH
servos – and wire them up MICROPYTHON ON
(with or without a breadboard) RASPBERRY PI PICO
to Pico’s pins. The left-hand This official Raspberry Pi Pico
window is used to code your guide book features step-by-
project, in MicroPython or step guides on building a range
C/C++; just run it to see if it of circuits and programming
works correctly. If so, you can them in MicroPython on the
download the project code to use powerful microcontroller board.
on Pico for real. magpi.cc/picobook

Learn circuits with Raspberry Pi magpi.cc 85


INTERVIEW

Nai-Wen Hsu
Taiwanese Raspberry Pi reseller and Raspberry Pi community
organiser, you can’t miss Nai-Wen in the Taiwanese maker space

> Name Nai-Wen Hsu > Occupation Raspberry Pi reseller


> Community role Advocate > URL piepie.com.tw

W
hile the Raspberry Pi Raspberry Pi educational Since coming into contact with
community spreads courses,” Nai-Wen tells us. Arduino in 2009, I have been
across the globe, each using MCU and SBC combined
country has its own unique What is your history with mechanical structures to
community with its own with making? solve problems in small projects.
events and ideas. Taiwan is I studied manufacturing
no different, with the founder technology and computer When and where did you learn
of the Taiwan Raspberry Pi engineering in college and about Raspberry Pi?
Community also an Approved graduate school respectively, In July 2012, I was looking for
Reseller of Raspberry Pi. so I am familiar with program a small computer for a power-
Excellent projects are “My job is to promote and sell development and processing of saving project and bought a
shown off at the meetups
Raspberry Pi, provide Raspberry various materials such as metal, Raspberry Pi 1 Model B. The
– we wonder if this one
can beat captcha Pi-based solutions, and design wood, and acrylic. first one was 256MB. The goal
of the project, at that time, was
to monitor the flow of people
and adjust the air-conditioning
settings according to the people
present to achieve energy saving.

What is it like to be a maker


in Taiwan?
Because the land in Taiwan is
relatively small, most makers
also solve small problems.
If makers in Taiwan want to
be influential, they can first
establish a small community for
promotion. If the government
finds it suitable and adopts it,
it will have more influence. For
example, the PiM25 air pollution
detection box I cooperated with
Academia SINICA has more than
4000 monitoring points, and can
be drawn into an air pollution
map to assist government
decision-making.

86 magpi.cc Nai-Wen Hsu


INTERVIEW

This energy-saving project


was one of Nai-Wen’s first
Raspberry Pi projects

ThermalPi is used
around Taiwan to check
temperatures of people
so COVID can be detected

I started a meetup and established


a community in 2013 to promote
Raspberry Pi
In addition to promoting It features the use of an RGB
PiM25 AirBox in Taiwan, I also camera and a Thermal Camera,
go to other countries to share and can accurately detect various
related experiences [such as objects after dual-camera
Hong Kong]. calibration. It is widely used
in schools and government
How did the meetups start? agencies, and some companies
I started a meetup and have adopted it and mass-
established a community in 2013 produced it into products.
to promote Raspberry Pi [and it I also shared the technical
exists to this day]. details of the ThermalPi project
At that time, people were very at PyCon Taiwan 2020, including
interested in what the Raspberry the principles of thermal imaging
Pi could do, so I hosted a meetup cameras, how to use Raspberry Pi
every one-to-two months, each to read, dual camera calibration
with a different topic, such as and temperature measurement
GPIO, cameras, robots, IoT, mass applications, etc.
production manufacturing, etc. I
invited friends who use Raspberry
Pi for projects to share their
experiences. My own code name
in the community is ‘sosorry’,
and I share different technologies
at almost every meetup.

What is your favourite thing


you’ve made with Raspberry Pi?
ThermalPi is my favourite
project. ThermalPi is a solution
I designed to detect human
body temperature for COVID-19. A big turn out for the Taiwanese Raspberry Pi community

Nai-Wen Hsu magpi.cc 87


THIS MONTH IN RASPBERRY PI

MagPi
Monday
01

Amazing projects direct from social media!

E
very Monday we ask the question: have you
made something with a Raspberry Pi over
the weekend. Every Monday, our followers
send us amazing photos and videos of the things
they’ve made.
Here’s a selection of some of the awesome
things we got sent this month. Remember to follow
along at the hashtag #MagPiMonday!

01. 
Raspberry Pi 5 robotics has begun and it’s
not even out yet
02. 
A robot-heavy month, we love to see all
these automatons
03. 
A very cool robot, it reminds us of the one
in Jedi Survivor
04. Raspberry Pi Pico is still a great controller
for robots
05. If you’re getting interrupted during video
calls, a little notifier can be a lifesaver
06. A camera that specifically reads QR
codes is a great idea – perhaps an NFC 02
alternative?
07. We’re calling this a rave in the box. Who
has a Ministry of Sound CD?
08. Do, Re, Egon, let’s light ‘em up

88 magpi.cc MagPi Monday


THIS MONTH IN RASPBERRY PI

03

04

05

06

07

08

MagPi Monday magpi.cc 89


THIS MONTH IN RASPBERRY PI

Events in pictures:
Experiencing Raspberry Pi 5
at the Melbourne Raspberry Pi
Makers Meetup
Community and official events in the wild

W
e showed some images from the
Melbourne Meetup last month but, 01
this time, the meetup was a bit
more special, allowing people to experience
Raspberry Pi 5 before it was even out! You can
find out other events with a Raspberry Pi 5 on
our events calendar over on page 94.

01. 
There were still room for other projects,
like this Raspberry Pi Zero robot
02. 
Free swag of excellent magazines
always goes down well
03. 
It’s a Raspberry Pi 5 in the wild!
04. 
This robot is not powered by Raspberry
Pi 5 in the traditional sense

02 03

04

90 magpi.cc Mondays
Coolest
This Month
Projects
are
infor
Raspberry
Pico
online! Pi
THIS MONTH IN RASPBERRY PI

Best of the rest!


Other cool things we saw using Raspberry Pi this month

Lockdown Mini nineties PC


handheld project
Peter Anderton, who
made the Gutter
Probe project you can
find on page 26, also
sent us this handheld
Raspberry Pi project
he’d made. It was Is nineties nostalgia here? Has it been and gone? We’re not sure,
apparently a challenge but this fun project styled after a classic late-1990s package
he set for himself PC is very small and employs Raspberry Pi. Although it does run
during Lockdown Windows XP, which is a bit advanced for your Gateway.
in 2020, and it looks
pretty good. magpi.cc/mini90spc

magpi.cc 91
YOUR LETTERS

Your
Letters
Raspberry Pi 5 projects
I’m very excited by the news of Raspberry Pi 5 coming
out, and really looking forward to getting mine. My
mind is abuzz with ideas but I was wondering if you’d
be able to propose any projects that make use of the
new features?

Chuck via email

We’re as excited as you are, and we also have a load


of project ideas in mind – check out this month’s
features for some excellent ideas on where to get
started! Features Ed Rob is really looking forward to
checking out VR
movie filming with
Raspberry Pi, a
project Ben Everard,
 he latest Raspberry Pi OS brings with it some interesting
T
Editor of HackSpace updates behind the scenes, such as the switch to Wayland
Magazine, is
currently working
on too. Booking Bookworm
If anyone has any
project ideas, or I read about the upgrade to Debian 12 (“bookworm”) for Raspberry
complete projects Pi OS in your latest issue. I went over to the Raspberry Pi website
they want to share to download it but could not see it. Is it not out yet?
with us, don’t
hesitate to drop us Cole via Mastodon
a line.
The date for Raspberry Pi OS Bookworm slipped a little to the week
after The MagPi 134 came out but, as you read this, it is out now! It’s
By the time you read
also the version that you should be using for Raspberry Pi 5 when
this, Raspberry Pi 5
will already be out you get one, and 64-bit is included on Imager as well.

92 magpi.cc Your Letters


USA SPECIAL!
6 ISSUES
Priority boarding now
How does Priority Boarding work? What kind of
subscription do you need, and will I get the code
FOR $43
now or with my first issue?

Nicole via Threads

You can get a Priority Boarding code – a code to


pre-order Raspberry Pi 5 and be one of the first
to get one – by subscribing to the print edition of
the magazine. Within a few days, you’ll get a code
which can be used on Approved Reseller sites. Get
more info at magpi.cc/priorityboarding.

We’ve reserved Raspberry Pi 5 boards

FREE
for The MagPi subscribers

GET YOUR RASPBERRY PI 5 FIRST!


RASPBERRY PI
magpi.cc/priorityboarding
PICO W
We’re very excited to offer these codes to print subscribers!

Contact us!
> Mastodon magpi.cc/mastodon
>
>
Threads
Facebook
@themagpimag
magpi.cc/facebook
Subscribe online:
>
>
Email
Online
[email protected]
forums.raspberrypi.com
magpi.cc/subscribe
Email: [email protected]

Continuous credit card orders will auto-renew at the same price unless cancelled. A free Pico W is
included with all subscriptions. This is a limited offer. Not included with renewals. Offer subject to
change or withdrawal at any time.
EVENTS

Community
Events Calendar
Find out what community-organised Raspberry
Pi-themed events are happening near you…

01. Raspberry Pi Club @ Makespace 03. Melbourne Raspberry Pi Meetup


Cambridge - Experience Raspberry Pi 5! Sunday 5 November
Tuesday 31 October Docklands Makerspace and Library, Melbourne,
Makespace Cambridge, Cambridge, UK Australia
magpi.cc/rpc135 magpi.cc/mrpm135
Tuesday nights in the Makespace Classroom are This meetup is open to everyone with an interest in
Raspberry Pi, Microcontroller, and CAD Clubs meet-ups. electronics, robotics, home automation, 3D printing, laser
Come and join fellow coding and computer aided design cutting, amateur radio, high altitude balloons, space tech,
enthusiasts for an informal evening of tinkering with tech. etc. Makers are invited to bring along their projects and
Help is on hand to assist you with any problems. project ideas, and come connect with other makers. Get
your questions answered, show off the work you are doing,
and get support to resolve nagging issues.

FULL CALENDAR
Get a full list of upcoming
community events here:
magpi.cc/events

02. Pi Fawkes at HackWimbledon


Experience Raspberry Pi 5!
Sunday 5 November
Wimbletech, London, UK
magpi.cc/fawkes135 04. Cape Town Raspberry Pi Jam
It’s a very special HackWimbledon. We meet and make Experience Raspberry Pi 5!
every fortnight, but Pi Fawkes Night (well, afternoon really) Saturday 2 December
will be a festival of Raspberry Pi 5s on November 5th. If you CTV Training Centre, Cape Town, South Africa
want to get a look at a Raspberry Pi 5 in the flesh, or if you magpi.cc/ctrpj135
want to hear how it’s going, come along. If you’re getting a Cape Town’s first Jam since lockdown! Learn about the
Raspberry Pi 5, come and tell how you’re finding yours. new Raspberry Pi 5 and more.

94 magpi.cc Community Events Calendar


EVENTS

01
02

04

03

RASPBERRY PI
AT MAKER FAIRE
Where can you find
Raspberry Pi next?
> Next location Maker Faire Shenzhen
> Where Vanke Design Commune, Shenzhen, China
> When Saturday 11 November to Sunday 12 November

R
aspberry Pi is proud to partner
with Raspberry Pi Approved
Reseller Seeed Studio, to be at
Maker Faire Shenzhen for the first
time ever. Come and meet members of
the Raspberry Pi team, learn about their
latest products, and share what you’ve
made with Raspberry Pi technology.

magpi.cc/smf23

Community Events Calendar magpi.cc 95


COMPETITION

WIN ONE OF TEN


RASPBERRY PI 5
CASES
With a new Raspberry Pi
comes a new and improved
case - the official Raspberry Pi
5 case has improved airflow
and a fan to help keep the
insides nice and cool. We
have ten to give away.

Head here to enter: magpi.cc/win Learn more: magpi.cc/rpi5case

Terms & Conditions


Competition opens on 25 October 2023 and closes on 23 November 2023. Prize is offered to participants worldwide aged 13 or over, except employees of Raspberry Pi Ltd, the
prize supplier, their families, or friends. Winners will be notified by email no more than 30 days after the competition closes. By entering the competition, the winner consents to any
publicity generated from the competition, in print and online. Participants agree to receive occasional newsletters from The MagPi magazine. We don’t like spam: participants’ details
will remain strictly confidential and won’t be shared with third parties. Prizes are non-negotiable and no cash alternative will be offered. Winners will be contacted by email to arrange
delivery. Any winners who have not responded 60 days after the initial email is sent will have their prize revoked. This promotion is in no way sponsored, endorsed or administered by,
or associated with, Instagram, Facebook, Twitter or any other companies used to promote the service.

96 magpi.cc Win one of ten Raspberry Pi 5 cases


NEXT MONTH

EDITORIAL
Editor
Lucy Hattersley
[email protected]
Features Editor
Rob Zwetsloot
[email protected]
Sub Editor
Nicola King

BENCHMARKS & ADVERTISING


Charlotte Milligan
[email protected]

THERMAL TESTING
+44 (0)7725 368887

DESIGN
criticalmedia.co.uk

Head of Design
Take Raspberry Pi to its full potential with Lee Allen

our benchmarks, testing and thermal control


Designer
Sam Ribbits
Illustrator
Sam Alder

CONTRIBUTORS
David Crookes, Rosie Hattersley,
Nicola King, Phil King,
Rob Miles, Tim Richardson,
Stewart Watkiss

PUBLISHING
Publishing Director
Brian Jepson
[email protected]
Director of Communications
Liz Upton
CEO
Eben Upton

DISTRIBUTION
Seymour Distribution Ltd
2 East Poultry Ave,
London EC1A 9PT
+44 (0)207 429 4000

SUBSCRIPTIONS
Unit 6 The Enterprise Centre
Kelvin Lane, Manor Royal,
Crawley, West Sussex, RH10 9PE

THE MAGPI #136 +44 (0)1293 312193


magpi.cc/subscribe

ON SALE 23 NOVEMBER [email protected]

This magazine is printed on paper sourced

DON’T MISS OUT! magpi.cc/subscribe from sustainable forests and the printer
operates an environmental management
system which has been assessed as
conforming to ISO 14001.
Holiday buyer’s MASTODON magpi.cc/mastodon The MagPi magazine is published by
Raspberry Pi Ltd, Maurice Wilkes Building,
guide St. John’s Innovation Park, Cowley Road,
Cambridge, CB4 0DS. The publisher,
THREADS @themagpimag editor, and contributors accept no

Raspberry Pi OS
responsibility in respect of any omissions
or errors relating to goods, products, or
FACEBOOK magpi.cc/facebook services referred to or advertised in the

Bookworm magazine. Except where otherwise noted,


content in this magazine is licensed under
EMAIL [email protected] a Creative Commons Attribution-
Remote control NonCommercial-ShareAlike
3.0 Unported
ONLINE forums.raspberrypi.com
with TigerVNC
(CC BY-NC-SA 3.0).
ISSN: 2051-9982.
THE FINAL WORD

Number 5 is alive!
Now what will we all make with it?
By Lucy Hattersley

W
atching Raspberry Pi along the lines of the PlayStation and Over to you!
5 come to life was an GameCube era. Cloud Gaming from That’s just the start! What we’re
incredible process. From Games Pass is also an incredible really looking forward to is what you
hearing about the initial designs, experience (and a whole lot cheaper all make with Raspberry Pi 5. Our
to seeing the problem-solving, and than buying an Xbox Series X). readers always surprise us with the
hearing clever solutions proposed We’re also busy looking at the dual incredible things they make with
by the incredible design team. camera support and stereographic Raspberry Pi products. Whether it’s
On our part, there was the stress photography for 3D images. And, live-action RGB lighting in a pole
of making sure everything was ready dancing club, automatic weeding
for launch. And the fear of being the  achine learning is
M machines for Japanese gardens, retro
one to accidentally leak it and ruin equipment repairs, or monitoring
the surprise for everyone. It’s been a another area where animals in the wild: the uses for
real eye-opener. Raspberry Pi are wildly varied.
It’s not really real until this point we’re very keen to I was reminded of this while
though. When it launches and gets
into the hands of our readers, and
see what advantages reading through our Handbook 2024
(available now: magpi.cc/handbook).
they start to build stuff with it:
that’s when Raspberry Pi 5 becomes
the new, much faster This collects all the best community
projects, tutorials, and kits from
a real product. CPU offers the last year. It’s a tour-de-force
So, what are we all to do with of the best The MagPi readership
this super-fast, packed-with- we’ve mooted the idea of using two has to offer - which is an incredible
new-features, and ringing and small screens for creating a virtual amount of variety and cleverness.
singing full of bells-and-whistles reality option (although this is very I really can’t wait to see what you
new computer? much in the ideas stage). all make with Raspberry Pi 5. Here’s
Machine learning is another area to 2024, and another year of
Where to start? where we’re very keen to see what Raspberry Pi-goodness.
Like many new Raspberry Pi 5 advantages the new, much faster
owners, my first port of call was CPU offers. We’re waiting on an
Raspberry Pi OS Bookworm (magpi. update to TensorFlow Lite to get
cc/downloads). This is now available things working, and are going to be Lucy Hattersley
AUTHOR

for download and offers a vast all over image recognition projects.
Lucy is editor of The MagPi and is
increase in speed. I’ve also been We’re also waiting on the M.2
currently putting this issue to press with
testing out the advances in retro drive, at which point we will be an 8BitDo controller in her inbox, which
gaming (expect a big feature on this turning Raspberry Pi 5 into a server. is ready and waiting for a Raspberry Pi 5
soon). Early reports suggest a big So, there’s lots to talk about in the retro gaming weekend.

leap forward for console support coming months! magpi.raspberrypi.com

98 magpi.cc Number 5 is alive!


HIGHPI PRO
The new case from the HiPi.io team

Rapid tool-free assembly and disassembly Secure microSD card cover


Large internal volume for HATs VESA mount support
Compatible with Pi 2/3/4 Molding-configurable output ports
Multiple lid options customizable for volume orders
Passive & Active Cooling options Printed logo for your branding

Available at these great Pi stores:

Contact your favorite Pi store if it’s not listed here


PiKVM Manage your servers or
workstations remotely

A cost-effective solution for data-centers,


IT departments or remote machines!

PiKVM HAT
for DIY and custom projects Pre-Assembled version

Real-time clock with rechargeable super capacitor OLED Display Bootable virtual CD-ROM
& flash drive Serial console Open-source API & integration Open-source software

Available at the main Raspberry Pi resellers

Reseller suggestions and inquiries:


[email protected]

You might also like