Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
60 views132 pages

Mag Pi 148

The MagPi issue 148 highlights the latest Raspberry Pi products, including the AI HAT+, SSD kit, and a new version of Raspberry Pi OS. It features a Gear Guide for 2025, project showcases, and tutorials aimed at enhancing engineering skills for makers. Additionally, the new Raspberry Pi Touch Display 2 is introduced, offering improved resolution and touch capabilities, while the OS update shifts to the labwc Wayland compositor for better performance and security.

Uploaded by

sanjayjohny.mec
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
60 views132 pages

Mag Pi 148

The MagPi issue 148 highlights the latest Raspberry Pi products, including the AI HAT+, SSD kit, and a new version of Raspberry Pi OS. It features a Gear Guide for 2025, project showcases, and tutorials aimed at enhancing engineering skills for makers. Additionally, the new Raspberry Pi Touch Display 2 is introduced, offering improved resolution and touch capabilities, while the OS update shifts to the labwc Wayland compositor for better performance and security.

Uploaded by

sanjayjohny.mec
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 132

WELCOME

WELCOME
to The MagPi 148

N
ow is the best time to be an engineer, maker, or
hobbyist interested in Raspberry Pi. There’s an
absolute cornucopia of Raspberry Pi riches to discover.
Last month, we got the new AI Camera and the small (but
surprisingly crowd-pleasing) Bumper. This month we’ve Lucy

EDITOR
got an AI HAT+, an official SSD kit, USB 3.0 Hub, and a new Hattersley
version of Raspberry Pi OS. All of this alongside the Raspberry Lucy is editor of
The MagPi and this
Pi 5 and Pico 2 boards that make it all work. month her smart
scale is telling her
We’re big on making your own entertainment, but having to drink more water
(a potential hack if
so many maker options to choose from can be daunting: our ever she’s seen one).

Gear Guide 2025 feature shines a light on new Raspberry Pi magpi.cc


products and equipment to use in your creative projects. With
this exceptional range of kit you’ll boost your engineering
skills, complete new coding challenges, and create incredible
things. There’s never been a better time to get into Raspberry
Pi. Here’s to 2025!
GET A
RASPBERRY PI
Lucy Hattersley Editor PICO W
PAGE 36

magpi.cc 03
CONTENTS

Contents
> Issue 148 > December 2024

Cover Feature

38 Gear Guide 2025 38

Regulars
10 World of Raspberry Pi
64 Into HackSpace
122 Your letters
124 Community events calendar
129 Next month
130 The Final Word
Project Showcases
20 Fably
24 CatBot
26 Bumpin’ Sticker 24
30 T-Rex Game Auto Jumper
32 Wax

26

Bumpin’ Sticker CatBot

The MagPi is published monthly by Raspberry Pi Ltd, 194 Cambridge Science Park, Milton Road, Cambridge, England, CB4 0AB. Publishers
Service Associates, 2406 Reach Road, Williamsport, PA, 17701, is the mailing agent for copies distributed in the US and Canada. Periodicals
Postage paid 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
48 Use Python virtual environments
52 Make a Jellyfin media server
58 Private cloud server - part 4

Top Projects
66 Bluetooth bakelite headset
68 
Gimbal clock
70 
Pelican cyberdeck
72 
Ouija robot
Private cloud server: Collaborate
74 
Rotating art gallery

Forge 70
80 Build Pico software-defined radio
84 Write a software language
88 Create string art
Objet 3d’art
74

Pelican cyberdeck

88
Robot hand

Best of Breed
94

RP2350 Boards Create string art

06 magpi.cc
CONTENTS

The Big Feature

100 112

Argon Poly+ 5

Gift a project
118
Reviews
106 PiDog
108 PCIe USB HAT
110 Rpi All-in-One
112 Argon Poly+ 5
114 10 amazing festive light builds

Community
118 This Month in Raspberry Pi This Month in Raspberry Pi

WIN THUMBY COLOR 126

1 OF 3
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.

08 magpi.cc
All the best combined in one connector
The new SPC 4 series PCB
connectors
The everyday challenges our customers face are what drive us to continuously
improve our products. The new SPC 4 series PCB connectors are the best proof that
passionate engineering is indeed an art

.� For additional information, visit https://phoe.co/uk-spc4


THE WORLD OF RASPBERRY PI

Introducing
Touch Display 2
Raspberry Pi Touch Display 2 on sale now at $60
By Eben Upton

W
ay back in 2015,
we launched the
Raspberry Pi Touch
Display, a seven-inch 800×480-pixel
LCD panel supporting multi-point Raspberry Pi
capacitive touch. It remains one of Touch Display 2

our most popular accessories, finding


a home in countless maker projects and
embedded products.
We’re excited to announce Raspberry Pi Touch Simple setup
Display 2 (magpi.cc/touchdisplay2), at the same Touch Display 2 is powered from your Raspberry
low price of $60 (£56), offering both a higher Pi, and is compatible with all Raspberry Pi
720×1280-pixel resolution and a slimmer form computers from Raspberry Pi 1B+ onwards, except
factor. for the Raspberry Pi Zero series which lack the
Key features of Raspberry Pi Touch Display necessary DSI port. It attaches securely to your
2 include: Raspberry Pi with four screws, and ships with
• Seven-inch diagonal display power and data cables compatible with both
• 88mm × 155mm active area standard and mini FPC connector formats. Unlike
• 720 (RGB) × 1280 pixels its predecessor, Touch Display 2 integrates the
• True multi-touch capacitive panel, display driver PCB into the display enclosure itself,
supporting five-finger touch delivering a much slimmer form factor.
• Fully supported by Raspberry Pi OS Like its predecessor, Touch Display 2 is fully
• Powered from the host Raspberry Pi supported by Raspberry Pi OS, which provides

10 magpi.cc Introducing Touch Display 2


THE WORLD OF RASPBERRY PI

Touch Display 2 is
powered-by, and
controlled-from a
Raspberry Pi board

drivers to support five-finger touch and an


on-screen keyboard. This gives you full
T ouch Display 2 is fully supported
functionality without the need for a keyboard
or mouse. While it is a native portrait-format
by Raspberry Pi OS, which provides
720×1280-pixel panel, Raspberry Pi OS supports drivers to support five-finger touch
screen rotation for users who would prefer to
use it in landscape orientation. and an on-screen keyboard
Consistent with our commitment to long product
availability lifetimes, the original Touch Display
will remain in production for the foreseeable We’ve never gone nine years between refreshes
future, though it is no longer recommended for of a significant accessory before. But we took the
new designs. Touch Display 2 will remain in time to get this one just right, and are looking
production until 2030 at the earliest, allowing our forward to seeing how you use Touch Display 2
embedded and industrial customers to build it into in your projects and products over the next nine
their products and installations with confidence. years and beyond.

Introducing Touch Display 2 magpi.cc 11


THE WORLD OF RASPBERRY PI

A new release of
Raspberry Pi OS
Introducing labwc – a new Wayland compositor. By Simon Long

12 magpi.cc A new release of Raspberry Pi OS


THE WORLD OF RASPBERRY PI

R
aspberry Pi is releasing a new version of
Raspberry Pi OS. This version includes a
significant change, albeit one that we hope
most people won’t even notice. So we thought
we’d better tell you about it to make sure you do.
First, a brief history lesson. Linux desktops
– like their Unix predecessors – have for many
years used the X Window system. This is the
underlying technology that displays the desktop,
handles windows, moves the mouse, and all
that other stuff that you don’t really think about
because it (usually) just works. X is prehistoric in
computing terms, serving us well since the early for Raspberry Pi hardware, but it still didn’t run Raspberry Pi OS
has significantly
’80s. But after 40 years, cracks are beginning to well enough on older Raspberry Pi computers, so we improved support
couldn’t switch to it everywhere. for touchscreens
show in the design of X.
As a result, many Linux distributions are moving All of this was a learning experience – we learned
to a new windowing technology called Wayland. more about Wayland, how it interacted with our
Wayland has many advantages over X, particularly hardware, and what we needed to do to get the best
performance. Under X, two separate applications out of it. As we continued to work with wayfire, we
help draw a window: realised it was developing in a direction that would
• The display server creates windows on the make it less compatible with our hardware. At this
screen and gives applications a place to draw point, we knew it wasn’t the best choice to provide
their content. a good Wayland experience for Raspberry Pi. So we
• The window manager positions windows started looking at alternatives.
relative to each other and decorates windows
with title bars and frames.
 e learned more about Wayland, how it
W
Wayland combines these two functions into a
single application called the compositor. Applications
interacted with our hardware, and what we
running on a Wayland system only need to talk to needed to do to get the best out of it
one thing, instead of two, to display a window. As
you might imagine, this is a much more efficient This search eventually led us to a compositor
way to draw application windows. called labwc. Our initial experiments were
Wayland also provides a security advantage. encouraging: we were able to use it in Raspberry
Under X, all applications communicated back and Pi OS after only a few hours of work. Closer
forth with the display server; consequently, any investigation revealed labwc to be a much better fit
application could observe any other application. for the Raspberry Pi graphics hardware than wayfire.
Wayland isolates applications at the compositor We contacted the developers and found that their
level, so applications cannot observe each other. future direction very much aligned with our own.
We first started thinking about Wayland at The labwc compositor is built on top of a system
Raspberry Pi around ten years ago; at that time, called wlroots, a set of libraries which provide
it was nowhere near ready to use. Over the last the basic functionality of a Wayland system. The
few years, we have taken cautious steps towards wlroots system has been developed closely alongside
Wayland. When we released Bullseye back in 2021, the Wayland protocol. Using wlroots, anyone who
we switched to a new X window manager, mutter, wants to write a Wayland compositor doesn’t need
which could also be used as a Wayland compositor. to reinvent the wheel; we can take advantage of the
We included the option to switch it to Wayland mode experience of those who designed Wayland, since
to see how it worked. they know it best.
With the release of Bookworm in 2023, we So we made the decision to switch. For most of
replaced mutter with a new dedicated Wayland this year, we have been working on porting labwc
compositor called wayfire and made Wayland the to the Raspberry Pi desktop. This has very much
default mode of operation for Raspberry Pi 4 and been a collaborative process with the developers
5, while continuing to run X on lower-powered of both labwc and wlroots: both have helped us
models. We spent a lot of time optimising wayfire immensely with their support as we contribute

A new release of Raspberry Pi OS magpi.cc 13


THE WORLD OF RASPBERRY PI

The new raindrop


screen configuration
is written as native C
and is faster and more
maintainable than the
old one

features and optimisations needed for our desktop. This launches the command-line Raspberry Pi
After much optimisation for our hardware, we have Configuration application. Use the arrow keys to
reached the point where labwc desktops run just select “6 Advanced Options” and hit Enter to open
as fast as X on older Raspberry Pi models. Today, the menu. Select “A6 Wayland” and choose “W1 X11
we make the switch with our latest desktop image: Openbox window manager with X11 backend”. Hit
Raspberry Pi Desktop now runs Wayland by default ESCAPE to exit the application; when you restart
across all models. your device, your desktop should restart with X.
When you update an existing installation of We don’t expect this to be necessary for many
Bookworm, you will see a prompt asking to switch to people, but the option is there, just in case! Of
labwc the next time you reboot. We recommend that course, if you prefer to stick with wayfire, or X,
most people switch to labwc. for any reason, the upgrade prompt offers you the
Existing Raspberry Pi 4 or 5 Bookworm option to do so – this is not a compulsory upgrade,
installations running wayfire shouldn’t change in just one that we recommend.
any noticeable way, besides the loss of a couple of
animations which we haven’t yet implemented in Improved touchscreen support
labwc. Because we will no longer support wayfire While labwc is the biggest change to the OS in
with updates on Raspberry Pi OS, it’s best to adopt this release, it’s not the only one. We have also
labwc as soon as possible. significantly improved support for using the
Older Raspberry Pi computers that currently use Desktop with a touchscreen. Specifically, Raspberry
X should also switch to labwc. To ensure backwards Pi Desktop now includes a virtual keyboard and
compatibility with older applications, labwc supports right-click and double-click equivalents for
includes a library called Xwayland, which provides touch displays.
a virtual X implementation running on top of This change comes as a result of integrating the
Wayland. The labwc compositor provides this virtual Squeekboard virtual keyboard. When the system
implementation automatically for any application detects a touch display, the virtual keyboard
that isn’t compatible with Wayland. With Xwayland, automatically displays at the bottom of the
you can continue to use older applications that you screen whenever it is possible to enter text. The
rely on while benefiting from the latest security and keyboard also automatically hides when no text
performance updates. entry is possible.
As with any software update, we cannot possibly This auto show-and-hide should work with most
test all possible configurations and applications. If applications, but it isn’t supported by everything. For
you switch to labwc and experience an issue, you can applications which do not support it, you can instead
always switch back to X. To do this, open a terminal use the keyboard icon at the right end of the taskbar
window and type: to manually toggle the keyboard on and off.
If you don’t want to use the virtual keyboard
sudo raspi-config with a touchscreen, or you want to use it without a
touchscreen and click on it with the mouse, you can

14 magpi.cc A new release of Raspberry Pi OS


THE WORLD OF RASPBERRY PI

turn it on or off in the Display tab of Raspberry Pi and third parties.


Configuration. The new virtual keyboard only works • We also introduced a new Screen Configuration
with labwc; it’s not compatible with wayfire or X. tool, raindrop. This works exactly the same
In addition to the virtual keyboard, we added as the old version, arandr, and even looks
long-press detection on touchscreens to generate the similar. Under the hood, we rewrote the old
equivalent of a right-click with a mouse. You can use application in C to improve support for labwc
this to launch context-sensitive menus anywhere in and touchscreens. Because the new tool is native,
the taskbar and the file manager. performance should be snappier! Going forward,
We also added double-tap detection on we’ll only maintain the new native version.
touchscreens to generate a double-click. While
this previously worked on X, it didn’t work in How to get it
wayfire. Double-tap to double-click is now The new release is available right now in apt,
supported in labwc. Raspberry Pi Imager, or as a download from the
software page on raspberrypi.com.
Better Raspberry Pi Connect integration To update an existing Raspberry Pi OS
We’ve had a lot of very positive feedback about Bookworm installation to this release, run the
Raspberry Pi Connect, our remote access software following commands:
that allows you to control your Raspberry Pi from
any computer anywhere in the world. This release sudo apt update
integrates Connect into the desktop. sudo apt full-upgrade
By default, you will now see the Connect icon in
the taskbar at all times. Previously, this indicated When you next reboot, you will see the prompt
that Connect was running. Now, the icon indicates described above which offers the switch to labwc.
that Connect is installed and ready to use, but is not To switch to the new Screen Configuration tool,
necessarily running. Hovering the mouse over the run the following commands:
icon brings up a tooltip displaying the current status.
You can now enable or disable Connect directly sudo apt purge arandr
from the menu which pops up when the icon is sudo apt install raindrop
clicked. Previously, this was an option in Raspberry
Pi Configuration, but that option has been removed. The new on-screen keyboard can either be
Now, all the options to control Connect live in the installed from Recommended Software – it’s called
icon menu. Squeekboard – or from the command line with:
If you don’t plan to use Connect, you can uninstall
it from Recommended Software, or you can remove sudo apt install squeekboard wfplug-squeek
the icon from the taskbar by right-clicking the
taskbar and choosing “Add / Remove Plugins…”. We hope you like the new desktop experience. Or
perhaps more accurately, we hope you won’t notice
Switching from wayfire
Other things much difference! to labwc
This release includes some other small changes
worth mentioning:
• We rewrote the panel application for the
taskbar at the top of the screen. In the
previous version, even if you removed a plugin
from the panel, it remained in memory. Now,
when you remove a plugin, the panel never
loads it into memory at all. Rather than all
the individual plugins being part of a single
application, each plugin is now a separate
library. The panel only loads the libraries for
the plugins that you choose to display on your
screen. This won’t make much difference to
many people, but can save you a bit of RAM
if you remove several plugins. This also makes
it easier to develop new plugins, both for us

A new release of Raspberry Pi OS magpi.cc 15


THE WORLD OF RASPBERRY PI

Raspberry Pi
SSDs and SSD Kits
Raspberry Pi NVMe SSDs on sale now!
By Eben Upton

T
o help you get the best out of your and the PCI Express port – that had captured
Raspberry Pi 5, we’re launching a range people’s imagination.
of Raspberry Pi-branded NVMe SSDs We’ve seen everything from Ethernet adapters,
(non-volatile memory express, solid-state to AI accelerators, to regular PC graphics cards
drives, magpi.cc/ssd). They are available both (magpi.cc/gpu4k) attached to the PCI Express
on their own and bundled with our M.2 HAT+ port. We offer our own low-cost M.2 HAT+
as ready-to-use SSD Kits (magpi.cc/ssdkit). (magpi.cc/m2hat), which converts from our FPC
When we launched Raspberry Pi 5, almost standard to the standard M.2 M-key format, and
exactly a year ago, I thought the thing people there are a wide variety of third-party adapters
would get most excited about was the three-fold which do basically the same thing. We’ve also
increase in performance over 2019’s Raspberry released an AI Kit (magpi.cc/aikit), which bundles
Pi 4. But very quickly it became clear that it the M.2 HAT+ with an AI inference accelerator
was the other new features – the power button from our friends at Hailo (hailo.ai).

16 magpi.cc Raspberry Pi SSDs and SSD Kits


THE WORLD OF RASPBERRY PI

The SSD
connects to
Raspberry
Pi M.2 HAT+

 cost-effective way
A
to squeeze even more
performance out of Raspberry Pi

your Raspberry Pi 5
SSD is a M.2
2230-format
NVMe drive

PCI Express
But the most popular use case for the PCI Express
port on Raspberry Pi 5 is to attach an NVMe
solid-state disk (SSD). SSDs are fast; faster even
Features
than our branded A2-class SD cards (magpi.cc/ M.2 2230-format NVMe SSD for Raspberry Pi
sdcards). If no-compromises performance is your
goal, you’ll want to run Raspberry Pi OS from an Official Raspberry Pi SSD
SSD, and Raspberry Pi SSDs are the perfect choice.
Compatible with Raspberry Pi 5 (when used with a compatible SSD HAT)
The entry-level 256GB drive is priced at $30
(£28) on its own, or $40 (£40) as a kit; its 512GB Complies with PCIe Gen 3 standard
big brother is priced at $45 (£42) on its own, or
NVMe 1.4 register interface and command set
$55 (£51) as a kit. Both densities offer minimum
4KB random read and write performance of 40k ● Individually packaged in anti-static bags
IOPS and 70k IOPS respectively. The 256GB SSD
● Choice of 256GB or 512GB
and SSD Kit are available to buy today, while the
512GB variants are available to pre-order now for ● Reliable and fast storage or boot drive for your Raspberry Pi 5
shipping by the end of November.
● Operating temperature: 0℃ to 70℃ (ambient)
So, there you have it: a cost-effective way
to squeeze even more performance out of your ● Dimensions: 30mm x 22mm x 1.35mm (2230 format)
Raspberry Pi 5. Enjoy!

Raspberry Pi SSDs and SSD Kits magpi.cc 17


THE WORLD OF RASPBERRY PI

Introducing the
Raspberry Pi AI HAT+
Integrated HAT+ with Hailo AI accelerator
provides up to 26 TOPS. By Naush Patuck

F
ollowing the successful launch of the featuring the same Hailo-8L accelerator as the AI
Raspberry Pi AI Kit (magpi.cc/aikit) and Kit, and the more powerful 26 TOPS model at $110
AI Camera (magpi.cc/aicamera), we are (£102), equipped with the Hailo-8 accelerator.
excited to introduce the newest addition to Designed to conform to our HAT+ specification
our AI product line: the Raspberry Pi AI HAT+ (magpi.cc/hatplusspec), the AI HAT+ switches
(magpi.cc/aihat). automatically to PCIe Gen 3.0 (magpi.cc/pciegen3)
The AI HAT+ features the same best-in-class mode to maximise the full 26 TOPS of compute
Hailo AI accelerator technology as our AI Kit, but power available in the Hailo-8 accelerator.
now with a choice of two performance options:
the 13 TOPS (tera-operations per second) Direct connection
model, priced at $70 (£65) and Unlike the AI Kit, which utilises an M.2
connector, the Hailo AI accelerator chip is
directly integrated onto the main PCB.
Raspberry Pi AI HAT+
This change not only simplifies setup
has an integrated but also offers improved thermal
Hailo AI accelerator
providing up to 26 dissipation, allowing the AI
tera-operations HAT+ to handle demanding AI
per second
workloads more efficiently.
What can you do with
the 26 TOPS model
over the 13 TOPS
model? The same,
but more! You
can run more
sophisticated neural
networks in real
time, achieving
better inference
performance. The 26
TOPS model also allows
you to run multiple networks
simultaneously at high frame rates. For
instance, you can perform object detection,
pose estimation, and subject segmentation
simultaneously on a live camera feed using the
26 TOPS AI HAT+.
You can see this in action via this Raspberry Pi
YouTube demonstration: magpi.cc/aihatyt.

18 magpi.cc Introducing the Raspberry Pi AI HAT+


THE WORLD OF RASPBERRY PI

T he 26 TOPS model also AI HAT+ provides fast

allows you to run multiple inference for powerful


image recognition
apps and projects

networks simultaneously
at high frame rates

Backwards compatible
Both versions of the AI HAT+ are fully backwards
compatible with the AI Kit. Our existing Hailo
accelerator integration in the camera software
stack works in exactly the same way with the AI
HAT+. Any neural network model compiled for
the Hailo-8L will run smoothly on the Hailo-8;
while models specifically built for the Hailo-8 may
not work on the Hailo-8L, alternative versions
with lower performance are generally available,
ensuring flexibility across different use cases.
After an exciting few months of AI product
releases, we now offer an extensive range of
options for running inferencing workloads on
Raspberry Pi. Many such workloads – particularly
those that are sparse, quantised, or intermittent
– run natively on Raspberry Pi platforms; for
more demanding workloads, we aim to be the best
possible embedded host for accelerator hardware
such as our AI Camera and today’s new Raspberry
Pi AI HAT+. We are eager to discover what you
make with it. Hailo’s Model Zoo website provides a range of neural network models for your project

Introducing the Raspberry Pi AI HAT+ magpi.cc 19


PROJECT SHOWCASE

Fably
Bedtime stories made up on the spot.
Rosie Hattersley spins an electronic yarn

O
nce upon a time, there was a father called using AI and Raspberry Pi. The project took many,
Stefano whose daughter hung on every many hours, and was done in secret in case it
word of his inventive night-time tales. didn’t work out. Eventually, the new storyteller
She loved the characters he conjured up and was complete and, one evening, Stefano shyly
remembered each one with fondness. After a few introduced Fably to his daughter.
years, Stefano found himself running out of new
storylines with which to entertain his beloved Childhood wonder
child. He decided to look around for someone Stefano’s first computer, a Commodore Vic20,
Stefano
MAKER

– or something – to rescue them both from was something he could program himself
Mazzocchi having to go back over the same old stories. and opened up a world of possibilities. Most
Having exhausted the big book of fabulous fables, importantly, this first computer awakened
Electronics
engineer Stefano Stefano invented a new way of creating tales, Stefano to the idea of tinkering and eventually
says his “heart
is in hardware”.
Raspberry Pi deeply
resonates with
him, thanks to its
focus on hardware,
openness and the
tinkering spirit

magpi.cc/fablygit

 penAI text to
O
speech synthesis
offers a choice of
narrator voices

20 magpi.cc Fably
PROJECT SHOWCASE

A few seconds later, an OpenAI-


generated story is narrated in a
naturalistic voice. Fably can optionally
cache stories to enjoy again later too

The child presses the


Raspberry Pi Zero 2 W’s
button and, in response
to Fably’s greeting,
requests a story topic

Fably is a smart storyteller that Quick FACTS


uses AI to generate bedtime
stories. It is straightforward enough > Stefano was at
for youngsters to use themselves pains to ensure
Fably’s narrator
sounded human...

> ... rather than an


off-putting robot-
like experience
T he LLM “felt like talking to a person that spoke
> The Python-based
like a college professor but had the understanding of project took a
month to complete
the world of a five-year-old”
> Fably cost around
$150 to build...
led to him pursuing a degree in electronic wondered whether he could use one to create a
engineering. Over the past 20 years he has worked storytelling machine. Stefano found the command > ... and will run on
with many tech startups and software companies, of language impressive but the LLM “felt like any Raspberry Pi
often with Apache Frontier Foundation, where talking to a person that spoke like a college
he became a fellow and met many passionate professor but had the understanding of the world
inventors. Fably, however, was very much of a five-year-old. It was a jarring experience
inspired by Stefano’s own family, particularly his especially when they confidently made stuff
nine-year-old daughter who kept asking him to up.” The phenomenon is often referred to as
invent new stories. ‘hallucination’ but Stefano says some colleagues
Stefano had encountered LLMs (large language at Google call it ‘fabulism’. He prefers this term
models) while working at Google Research and and it is the origin of his Raspberry Pi project’s

Fably magpi.cc 21
PROJECT SHOWCASE

 tefano’s YouTube
S
demo has Fably
create and tell an AI
story in moments  ably is simple enough for a child to use
F

22 magpi.cc Fably
PROJECT SHOWCASE

name. Importantly, ‘fably’ is also a word the text


to speech synthesis API can pronounce. Tell tremendous tales
As well as making more sense than an
overconfident LLM, the smart storyteller needed
to come up with compelling stories that engaged
the listener and be sufficiently autonomous
that it could be used without continuous adult
supervision. Being an ambitious, entrepreneurial
type, Stefano also wondered about the commercial
possibilities and whether Fably could be made at a
sufficiently low cost to build a community around
it. He notes that children are demanding users

T he smart storyteller needed to come


Fably can run on any Raspberry Pi from Zero 2
up with compelling stories and be used 01 upwards, as well as PC, Mac or Linux. It needs
a sound input and a speaker. Full instructions, sample
without continuous adult supervision stories and code are at magpi.cc/fablygit.

being both “impatient and used to interactivity


as a foundational aspect of learning”. It would be
critical that the “time to first speech” (the time
from the last word the child said and the first
word coming out of the machine) could not be
more than a few seconds.

Every cloud
Since LLMs are very resource-intensive (as
he knew from working on machine learning
at Google), Stefano chose a cloud API-based
approach to address the need for speed, and
Raspberry Pi to keep costs down so other
You will need an OpenAI key
technically minded makers could create their 02 (platform.openai.com) if you want to get
own. Raspberry Pi felt like the best choice because Fably to create original stories, a microphone,
of its price, availability, fantastic and very active and a speaker or audio HAT for Raspberry Pi.
community, and because it runs Linux directly
– a development environment Stefano felt
right at home in. Additional hardware such as a
microphone could also be added easily. Stefano
praised Raspberry Pi’s “relatively stable” I/O
pinout across versions in ensuring “a healthy
and diverse ecosystem of extension boards”,
which could prove important should Fably
become a commercial product.
Fably makes full use of OpenAI cloud APIs,
alongside a text-to-speech synthesiser with a
warm and cosy voice. Stefano’s daughter enjoys
the fact that she hears a slightly different story
Follow Stefano’s GitHub instructions to SSH
even if she makes the same request. Using a cloud 03 into Raspberry Pi remotely and set up Fably
setup means each story costs a few cents, but to run when you power it on, and call on APIs in the
Fably can be set up to cache stories as well as to cloud or locally hosted to generate your stories.
cap cloud costs.

Fably magpi.cc 23
PROJECT SHOWCASE

CatBot
Feed the cats without poisoning the birds, thanks
to an open-source AI stack. By Andrew Gregory

I
f you like cats, and you want to be alerted
whenever a cat wanders into your garden,
then we have the project for you. CatBot is a
notification system for stray cat sightings. It’s a
brilliant example of a project that takes a minimal
amount of hardware, adds open-source services,
and just works.
CatBot is built using two Raspberry Pi boards:
Michael the first, a Raspberry Pi Zero, hosts a Raspberry
MAKER

Suguitan Pi Camera Module 2 and a Flask server, which


sends images to a Raspberry Pi 5 for processing.
An engineer
and researcher The Raspberry Pi 5 is a much more powerful
 he AI model correctly identifies cats,
T
interested in machine, and so that’s where the clever stuff and sends pictures to Michael’s phone
human-robot happens: it runs a computer vision model, which
and -computer
determines whether the cat-shaped collection of But there’s a catch: the food that Michael was
interaction,
machine learning, pixels is a cat. If it’s a cat, the Raspberry Pi 5 can leaving out for the cats was also attracting birds,
and creative send photos to Michael’s phone via a Twillo client for which cat food is potentially unhealthy, so
programming.
(as an MMS message, sent to Michael’s phone he needed to find a way of identifying birds and
michaelsuguitan. number, not an email). scaring them away. He eventually settled on a
com/catbot
“I used Raspberry Pi because I was recently minimal solution that just – only just – qualifies
working with Raspberry Pi and cameras for for the label of ‘robot’: an actuator (a Tower Pro
another project, a digital sensor for a film micro servo) connected to a chopstick that taps on
Because the camera,” says Michael. “Although there are the window to scare the birds away. If Raspberry
Raspberry Pi Zero is
too underpowered to definitely simpler solutions with cheaper
deploy a computer microcontrollers, I find it valuable to start
vision model, a
separate Raspberry with techniques I know rather than going down I find it valuable to
Pi 5 requests images rabbit holes of learning new tools. I used two
from the Zero and
performs object separate boards because Raspberry Pi 5 is my home start with techniques I
detection with a
server and NAS, which I did not want to mount
small Faster R-CNN
MobileNet model on the kitchen window.” know rather than going
down rabbit holes of
learning new tools
Pi 5 detects a bird, it sends a request to Raspberry
Pi Zero to activate the servo.
“Defining ‘robot’ is hard to pin down and
frequently leads to disagreement among
roboticists,” says Michael. “I believe that a robot
is any physical thing with sensors and actuators.
While some definitions require autonomy, that
excludes arguably robotic things like human-
piloted mecha or heavy industrial equipment.
Relaxing the requirement of autonomy frames

24 magpi.cc CatBot
PROJECT SHOWCASE

The absolute
minimum viable robot
arm: a chopstick, to
scare away birds

A Tower Pro micro


servo leaps into action
Raspberry Pi Zero links when a bird is detected
to a Raspberry Pi 5,
which does the heavy
computation

Quick FACTS
> Before settling on
the servo-and-
chopstick solution
Raspberry Pi for scaring away
Camera Module is birds, Michael tried
an easily-integrated a simple shirt-on-a-
camera solution stick scarecrow…

> …but it scared


away both the birds
and the cats.

>  Michael had to


reduce the false
positive rate by
robots as tools that complement rather than “My favorite projects include Blossom, an open- raising the detection
supplant our abilities, which I find valuable in source robot platform that I developed during my threshold for the bird
the current hype wave of AI and ML. PhD, and the Leica MPi, a swappable digital sensor class.
“There are commercial products that do similar for a Leica film camera. I’m currently taking a
things, like the Bird Buddy or pet-oriented indoor sabbatical at the Recurse Center, a programming >  You can buy similar
security cameras. By the time that I could hack retreat in New York, where I am exploring devices off the shelf,
those to get the functionality I wanted, I might as alternative HCI hardware and brushing up on but they’re not as
cool as this is.
well have started with open-source tools.” AIML for robotics.”

>  Cats, birds and


raccoons all like free
food.

The work of
building this
project was mostly
integrating the
various subsystems

CatBot magpi.cc 25
PROJECT SHOWCASE

Bumpin’
Sticker
When Guy Dupont spotted a bumper sticker
expressing love for experimental jazz, he decided
to ‘sax’ it up by creating a changeable digital
version, as David Crookes discovers

B
umper stickers have been around since
1946 when an American silkscreen The 11.3-inch LCD display was
printer called Forest P Gill spotted purchased from AliExpress for just
the popularity of attaching advertising over $63 and is the perfect size and
messages to the rear of vehicles and combined shape for a digital bumper sticker
adhesive-backed paper with fluorescent paint
– significantly upgrading the old practice of
printing messages on a piece of cardboard or
Guy
MAKER

metal and attaching them with wire.


Dupont They weren’t great – they’d often become
soggy in wet weather – but they became widely
Guy is a software
developer, audio used, particularly in the US. Still popular today,
engineer, and they enable drivers to promote goods and
hardware hacker
services, express humour, highlight political
from Cambridge,
MA. He likes to and religious affiliations, and share their love On track
build things that of sports teams. But what if someone wanted to Figuring a changeable bumper sticker would be
make people say: change their message depending on their mood both practical and fun, he initially decided to
“That’s ridiculous,
but I would buy
or the time of year? Is it really practical to keep experiment by connecting a Raspberry Pi Zero 2 W
one anyways!” peeling and replacing? computer to a 5-volt HDMI display before working
magpi.cc/ During a long morning walk, Guy Dupont began out a way to gather and share information about
bumpinstick thinking along those lines. He’d spotted a car in the song he was currently listening to in near
his neighbourhood with a sticker that read, “Keep real-time. He figured the best method would be
Honking! I’m listening to Alice Coltrane’s meteoric to connect the Raspberry Pi device to the internet
sensation ‘Universal Consciousness’!” (a sticker and make use of the online music service Last.fm.
which appeared on countless vehicles) and he “It’s a ‘scrobbling’ tool that you can use to keep
believed the concept could be vastly improved. track of everything you listen to, regardless of
“I love the idea of using bumper stickers as where you’re listening from,” Guy explains.
a form of self-expression, but I got to thinking By connecting Spotify to his Last.fm account,
about how ‘permanent’ they are, and how my own Guy had a way of grabbing details about his most
style, mood and taste tends to change relatively recently played tune. Raspberry Pi could then pull
quickly,” he says. “I wanted to see how I could that information and send it to the display for
resolve those things – could I make a bumper others to view. Since he wanted his project to look
sticker that was always up to date? Would it like a bumper sticker, this entailed creating an
still be interesting if it wasn’t permanent?” easily updated graphic – one with black text on a

26 magpi.cc Bumpin’ Sticker


PROJECT SHOWCASE

A Raspberry Pi Zero 2 W computer


is mounted on the back of the
display. It was chosen for its
small size, BLE/WiFi capabilities
Electrical tape is used on the and ability to drive a high-definition
back of the display because HDMI display
the electrical connections on
the back of Raspberry Pi can
short out when they come
into contact with metal Quick FACTS
>  It’s a realistic-
looking digital
bumper sticker

>  It’ll display the last


song you listened to

>  Data is
automatically
scraped from
last.fm

>  A PNG image


is created using
Val Town

>  Power is obtained


from the car battery

 rom a distance,
F
you wouldn’t be
able to tell that
the bumper sticker
is a digital display

Bumpin’ Sticker magpi.cc 27


PROJECT SHOWCASE

to improve the design. I find that momentum, as


well as the ability to see and feel a project early
on, really helps me stay on track, even if I know
I’m going to have to revise things.
Given the idea was to create a device that
looked as much like a real bumper sticker
as possible, Dupont swapped out the display
for an 11.3-inch strip LCD. “Size, shape, and
readability came before anything else,” he
explained. Figuring he’d be drawing power from
a 12-volt car battery, he also grabbed a couple of
breakout connectors and a buck converter to knock
the power down to five volts.
Initial plans to connect the Raspberry Pi
computer to the internet using a hotspot on his

I always start with


components I already
have or already know
how to use

phone were revised as well. Dupont realised that


he’d need to manually connect Raspberry Pi to
the hotspot every time he got into his car and
 he project is open
T yellow background – that could be easily updated he knew, in his heart of hearts, that he would
source with the code
available at magpi.cc/
with new details – and Guy came up with the idea eventually tire of doing this, causing him to
bumpinstickgh of using an image file that could be produced and eventually consign the project to a drawer. To
rendered just before it was shown. avoid this situation, he utilised a Particle Baron
To enable this, Guy turned to a social website IoT development board which he also happened
called Val Town which allows developers to code to have lying around.
in the cloud. He wrote a small chunk of code “The main advantage of the board versus using
– referred to as a val – that would access and the phone as a hotspot is that I never have to
fetch his Last.fm profile to gather details of the
last song he was listening to. He then, with the
assistance of Val Town’s AI, wrote another val
to use a Javascript HTML5 canvas library to lay
out the bumper sticker using the information
gathered. This involved a lot of trial and error
to make the text fit correctly, but he was able
to successfully create, export and display a PNG
image without any manual intervention.

Driving forward
 he heat-shrunk,
T With the nuts and bolts of the project in place, it
weatherproofed
device also comes was time to start refining. “I always start with
with a warning to components I already have or already know how
potential thieves
on the back, telling to use,” Guy says. “I then quickly get as close as
them they won’t be I can to a finished version, and then I see if there
able to get it to work
if they steal it. are any deal-breakers or cheap and obvious ways

28 magpi.cc Bumpin’ Sticker


PROJECT SHOWCASE

Road to success

A function written in Typescript and deployed


01 on val.town periodically fetches Guy’s profile
from last.fm and scrapes his most recently played
item from the web page. When the car is turned on,
touch it or remember to turn it on,” he says. The  he bumper sticker is
T
wired to the car’s battery Raspberry Pi receives power from the battery and
board connects to Raspberry Pi and uses cellular and, for a neat finish, connects to the internet.
data, the bonus being there are no monthly fees. you would need to gain
access to various parts
The data is limited in quantity, but there’s more of the vehicle’s innards
than enough for Guy’s intended use which makes
for a perfect fit. With everything working, it was
then a case of installing it, which required a spot
of in-car wiring – and some dismantling of the
vehicle’s interior panels.

The right path


The Raspberry Pi and other components were
affixed to the back of the display panel which was
also fitted with magnets to allow the device to be
easily secured to the back of the car. For a neat
From inside the car, the Particle Boron IoT
finish, the device was placed in a heat-shrink 02 board uses its cellular connection to fetch
sleeve that happened to be the perfect size. A bit the scraped data from val.town via Particle’s
of cutting was then required to allow the screen to webhook system. It then rebroadcasts that data
show through, and Guy used some glue around the as a JSON string using a Bluetooth Low Energy
cuts for weatherproofing. GATT Characteristic.

It works well. Powered by the car battery as


soon as the vehicle is turned on, it immediately
connects to the internet, grabs the required
information and displays it. “Honestly,
everything went pretty smoothly with this
build,” Guy said. “It’s funny, but the thing that
held me up the most was trying to figure out
which HDMI settings would make this oddball
display show what I wanted it to!”
Guy particularly likes the fact that it’s entirely
The Raspberry Pi has a loop that reads the
automated so he always knows that it’ll be
03 latest data from the Boron’s BLE Characteristic.
displaying his songs when he tootling down the
It generates a bumper sticker image and displays
road. “It lives with the car, which also means
it via HDMI. The image generation script was also
the sticker continues to work even if my wife is written in Typescript and can be run either locally
driving,” he laughs. “I’m afraid to ask whether on Raspberry Pi or in the cloud, on val.town.
she thinks that’s a bug or feature!”

Bumpin’ Sticker magpi.cc 29


PROJECT SHOWCASE

T-Rex Game
Auto Jumper
Is it really cheating at a game if you take the time to program
a robot that plays it? Rob Zwetsloot sits back and finds out

F
or those who have used Google Chrome detects differences in analogue measurements
(which is apparently most people: whenever it senses cacti, which are always dark-
gs.statcounter.com), you may have seen coloured and appear on the same plane. The
the screen that pops up when your internet analogue-digital converter [ADC] port of the
connection fails. It’s of a pixelated T-Rex, and if Pico measures each passing cactus ten times per
you press the space bar, you can kill time before second. After a 0.2-second delay, the Human
your internet connection is restored by playing a Interface Device [HID] library simulates pressing
little cactus-jumping game. If your internet goes the ‘up’ button on the keyboard, making the
Bas op
MAKER

down for a really long time, then maybe you can T-Rex jump at the right time.”
ten Berg automate playing it. For Bas it was a fun way to show people he
A trainer, maker, Maker Bas op ten Berg presented us his project, teaches and trains how the HID libraries work
university lecturer, the full name of which is ‘Automatic Jumping in code: “I’ve found that simulating single or
and consultant in in the T-Rex Game: Detecting Cacti with a multiple key presses with embedded processors
electro-mechanical
Raspberry Pi Pico CircuitPython HID Controller’, stimulates the creativity and inventiveness of
prototyping, located
in the Netherlands. that does just that. training participants,” he tells us.
He’s the owner “Using a Raspberry Pi Pico, a light dependent
of BotBerg
resistor (LDR), a breadboard, some DuPont See the light
magpi.cc/ cables, and tape, I automated the famous Raspberry Pi Pico was the obvious choice for
autotrex Google T-Rex game,” Bas explains. “The LDR Bas. “[It’s] easy to obtain, very cost-effective,
and supports MicroPython, CircuitPython, and
Arduino C++,” Bas says. “It has a small form
factor, can be easily soldered onto a prototyping
board using castellated connections, or placed
into a breadboard using headers. Personally, I like
the Pimoroni Pico Explorer Base for prototyping,
as it includes a breadboard, LCD screen, buttons,
and breakout connectors. I especially appreciate
the MicroPython and CircuitPython capabilities
– they’re easy to explain to students, powerful,
[and have a] wide range of libraries.”
The build itself is fairly simple – an LDR is
placed in front of the screen, with tape acting
as ‘blinders’ to stop other light interference.
A pull-up resistor was used to stabilise the
measurements too.
“The program displayed the measured [light]
values in real time, making it easy to define and
adjust the threshold values to trigger the T-Rex’s
The set up is quite simple – Pico Explorer for
jump,” Bas further explains. “I stored the delay
Pimoroni helps quickly set up the circuit needed time for simulating the ‘up’ button press in a

30 magpi.cc T-Rex Game Auto Jumper


PROJECT SHOWCASE

The light dependant


resistor detects the
difference in incoming
light sources

The cacti are always dark


on a light background,
making it easier to sense
when they’re approaching

Quick FACTS
> Other wild ideas
from students
included: game
assistance tools…
When a cactus is detected
by the resistance changing,
> …accessibility tools
Pico sets a small delay
for people with
before the ‘up’ key is sent
disabilities…

> …and security


penetration testing
tools. That one is
less wild

> It was inspired


T he build itself is fairly simple – an by a project that
used a servo to
LDR is placed in front of the screen, press the ‘up’ key

with tape acting as ‘blinders’ to stop > A lot of Bas’ other
projects are
other light interference educational for his
role as a trainer

Python variable, allowing for easy adjustments


through Thonny.”

The LDR is right up


Jumping ahead against the screen,
with a small bit of
What’s next for the T-Rex Jumper? “I have
tape to block out
various future plans for these types of educational the rest of the world
setups,” Bas says. “I’m always excited when
participants in my trainings come up with with disabilities, as they can greatly improve
creative ideas for using HID functions in quality of life and make a meaningful difference.
combination with sensors and actuators, as it Speaking of the creative ideas they came
means I’ve succeeded in educating them about up, here’s just a few: automatic typing poem
computer science and improving their digital generators, pedal-based keyboards, automated
literacy. Personally, I find it very rewarding to testing tools for user interfaces, automatic
develop and create accessibility tools for people swiping of dating apps… the list goes on.

T-Rex Game Auto Jumper magpi.cc 31


PROJECT SHOWCASE

Wax
Organising and playing your classical music collection is simple
with this easy-to-use Python program. Rob Zwetsloot has a listen

T
here are many ways to organise – and think about tags, file names and layout, style
play - your music with Raspberry Pi, and guidelines, compilations, parents, and more.
we’ve told you how to use a few in the Wax hides the gears and levers, providing
pages of this very magazine over the last decade operation that is more natural and intuitive.
or so. Maker Jeffrey Barish has created a way to It makes it possible to enjoy your collection
simplify the process using only a Python script, as a collection of music rather than a collection
with classical music in mind. of data.”
“[It’s] designed for music lovers, not Wax differs from most existing music
Jeffrey
MAKER

programming wizards,” Jeffrey explains. “By managers in three ways. Instead of individual
Barish
taking a novel approach to the challenge of tracks, music is catalogued as ‘works’ – such as
Jeffrey is a retired cataloguing a music collection, Wax avoids an album, a symphony, an opera, etc. Secondly,
music lover and frustrations associated with other music works are categorised by genre, but it also allows
fan of Python, with management systems, especially when handling you to tag works in a way that is relevant to
high standards for
audio systems classical music. Other programs force users to the genre too; symphonic works can include

magpi.cc/
waxmusic

 ou can search
Y
by kind of music
you want, or by
specific works

32 magpi.cc Wax
PROJECT SHOWCASE

Find your favourite Late


Romantic symphony, and
your preferred conductor
of that symphony easily

Quick FACTS
> Jeffrey has
a modest
collection of 3600
recordings...

> … they’re mostly in


FLAC so they take
up about 750 GB

> Wax is smart


enough to suggest
familiar names
when editing works

> Redundant scraped


data, such as
repeated classical
While music is grouped by music track titles,
works, you can dive deeper You can queue up works can be easily
and queue up single tracks just like with traditional edited
or groups of tracks – such music players
as requiems in an opera > You can go through
to Wikipedia pages
on works you’re
composer and conductor, while pop music comes listening to
with the group and title.
The final feature is that it will start playing
music as soon as you’ve given it enough
requirements (in the form of metadata), which
you can then change on the fly.

Multi-core wonder
Wax is specifically designed for Raspberry Pi
4 because of its quad-core processor. “Wax
uses one core to run the user interface, one
for playing, one for ripping, and the fourth for
time-consuming tasks like fetching metadata
from the cloud, like MusicBrainz and Cover Art
Archive,” Jeffrey says. “Many audiophiles worry  s music plays you get the usual data you’d expect but you can also access
A
needlessly that burdening a processor involved the Wikipedia page on a work to learn more

Wax magpi.cc 33
PROJECT SHOWCASE

 ou can use scraped


Y
or custom data to
create and edit
works in your library

in playing a sound file can impair the quality one that you forgot you had. Wax also provides
of the sound it produces. The multi-processing incremental search if you already have a specific
architecture of Wax obviates this concern as the work in mind.”
core responsible for playing the music is not Individual tracks or even the entire work can
simultaneously performing any other tasks.” be added to the queue. You can also group tracks
From the app you can select music starting by within a work – perhaps to represent the acts of
genre. “Works by the same composer are listed an opera. “The other interesting feature is that
together,” Jeffrey tells us. “Likewise, multiple the values in any column can alternatively be
versions of each work are listed together. This represented as a filter button,” Jeffrey continues.
hierarchical sorting makes it easy to survey the “[I can convert] the ‘subgenre’ field to a filter
collection for the desired recording – possibly

 ax is specifically designed
W
for Raspberry Pi 4 because
of its quad-core processor
button by dragging the column header to the
filter button area. Selecting a value with the filter
button removes works from the list that do not
match that value.”

Dive deeper
While the ‘gears and levers’ are usually hidden,
you can enter a robust edit mode that lets you
customise metadata, as well as creating new
metadata for works. You can use the metadata
downloaded from the online sources when
If you need to dive
deeper to edit the creating and editing too.
tags for genres, you’re
Specific data is used to filter inside genres – the
able to do that with
Wax-Config categories of data can be edited too. “WaxConfig

34 magpi.cc Wax
PROJECT SHOWCASE

Build a Wax machine

is a separate program used for configuring Wax,”  dd works, tracks, or


A
even smartly grouped
Jeffrey says. “Most importantly, this is where tracks to your queue
You don’t need many components to copy
you specify genres, including their name and 01 what Jeffrey made – as well as a Raspberry Pi
the primary and secondary keys. The Info page
4 with at least 2GB RAM, it uses an Argon ONE M.2
provides information about your collection, case, NanoSound One Hi-Fi DAC, and a 2TB SSD.
including the number of works in each genre.”
You can see an example of this in the image to
the left. Jeffrey has put together a very in-depth
guide on how to install and setup Wax, as well as
going into more depth on how to use it:
magpi.cc/waxdocs. Performance on Raspberry
Pi 4 is good too, especially on Jeffrey’s setup.
“I run Wax on a Raspberry Pi 4 with 4 GB of
RAM,” Jeffrey tells us. “I use the NanoSound
One DAC with the Argon One M.2 case. The
NanoSound One DAC uses the TI PCM5122 DAC
for high-quality audio output - 112 dB SNR. The
Argon case makes it possible to integrate a 2TB
SSD which I use for storing my sound archive.”
Even with the high-power audio hardware
The NanoSound One Ho-Fi DAC is
and no active cooling, the CPU temperature 02 specially made to be installed into Argon
only reached 45C, with a CPU load of 2.4 (of a ONE cases, and connects to the GPIO pins of
theoretical maximum of 4.0 due to the quad-core Raspberry Pi to output high-quality audio from
architecture). He even reckons a 2GB Raspberry Pi more traditional RCA connectors.
would do the job just fine.
“Wax makes it easy to find and appreciate the
music I want to hear,” Jeffrey says. “Finding a
recording of a specific work was often hard and
always inconvenient when I had to sort through
thousands of LPs and CDs. With Wax, I can make
a selection from the comfort of my listening
position. I sacrifice nothing for this convenience
because Wax presents all the information I need
to appreciate the recording -- artist names, for
example -- and I am able to explore further, as
I used to do by reading record jackets or CD liner
notes, by accessing Wikipedia and liner notes in As a 2TB SSD is being used for storage,
03 you only need normal sized SD card for
Wax from the comfort of my listening position.
Raspberry Pi. Jeffrey has used 2GB here. The
Instead of a wall full of recordings, my entire
SSD goes into the underside of the Argon ONE
collection now fits in a tiny box powered by a
case, and connects via a USB 3.0 adapter.
Raspberry Pi.”

Wax magpi.cc 35
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
£10 (UK only)

Subscribe for 6 Months


Free Pico W
6 issues of The MagPi

+ £30 (UK)
€43 (EU)
$43 (USA)
£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 six-month subscription in USA, Europe and Rest of World.

36 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 W
$6
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

Buy now: magpi.cc/subscribe

SUBSCRIBE
on app stores

magpi.cc 37
FEATURE

Gear
Guide
2025!
Discover a treasure trove of Raspberry Pi devices and
great accessories taking us into a glittering 2025
Rosie Hattersley

W
hether, like our very own Features
Ed Rob, you regard Christmas as the
most wonderful time of the year,
or it’s simply a period when you get a well-
earned break and can finally focus on favourite
hobbies, there’s lots to love about the tail end of
the year. Festivities over, you can clear the decks
and spend some quality time with shiny new tech
treats, perhaps including some new Raspberry Pi
gems that will make your life run that much more
smoothly and your leisure hours much more fun.
There is a lot going on with Raspberry Pi in 2025.
Here’s our official guide to what you should put
into your shopping basket for next year.

38 magpi.cc Gear Guide 2025!


FEATURE

Buy a
Raspberry Pi
Raspberry Pi is really spoiling you with a choice
of computing options to suit your pockets as
well as your projects

Raspberry Pi 400 Raspberry Pi


→ magpi.cc/raspberrypi400
Zero 2 W
→ From £67 / $70
→ magpi.cc/zero2w
An all-in-one computer that showcases just how well Raspberry Pi 4 → £17 / $15
works as an alternative to a clunky desktop PC, the Pi 400’s striking
keyboard conceals its computing hardware. A matching mouse is part Make your home smarter with the Pi Zero 2 W: it
of the kit, so you simply need to add an HDMI screen for a neat, space- is ideal for IoT projects such as motion detectors
saving computing setup with 4K video playback. The 4GB Raspberry Pi and security cameras. The tiny Raspberry Pi is
4 inside has an exposed 40-pin GPIO header, so plenty of accessories both wireless and Bluetooth enabled, so can be
can be attached to the back of the keyboard too. used around your home and in small, power
efficient projects. With 512MV onboard memory
and a 64bit Arm processor, it’s a brilliant choice
for gaming, drones and tiny robot builds too, see
these projects: magpi.cc/zeroblogs.

Raspberry Pi 5
→ magpi.cc/raspberrypi5
→ £47/$50 (2GB); £57/$60 (4GB); £77/$80 (8GB)

The flagship Raspberry Pi model sports a 2.4MHz


quad-core processor, PCI Express and up to 8GB
Raspberry Pi Pico 2
of RAM for the smoothest, fastest computing
→ magpi.cc/raspberrypi400
experience to date. As well as being a great
→ From £67 / $70
platform for the AI applications, Raspberry Pi 5 is
more than twice as powerful as Raspberry Pi 4. It This souped-up version of our powerful microcontroller, Pico 2 features PIO
sports USB 3, includes nippy PCI Express with the (programmable input/output– see magpi.cc/whatispio), optionally comes
bandwidth to make proper use of SSD, a real-time with wireless connectivity and is ideal for Internet of Things projects to
clock, gigabit Ethernet, and dual 4K digital display make your home super-smart. The RP2350 chip is faster, has a dual Cortex
connections. It even has a power button. Arm or RISC-V cores and twice as much onboard RAM as the original Pico.

Gear Guide 2025! magpi.cc 39


FEATURE

Accessory
guide A2 SD Card
We’ve been rolling out lots of lovely → magpi.cc/sdcards
Raspberry Pi add-ons over the past → From £10 / $13

few months. What’s not to like? Our very own branded Class A2 SD cards have been
specifically with support for DDR50 and SDR104
bus speeds and command queueing (CQ). You’ll
need to update to the latest version of Raspberry Pi
OS to take full advantage of the extra performance
a Class A2 SD card offers. For the technical details
see magpi.cc/sdnbumper.

Raspberry Pi SSD Kit Raspberry Pi Bumper


→ magpi.cc/ssdkit → magpi.cc/bumper
→ From £37 / $40 → £3 / $3

While SD cards have traditionally been used Protect your precious Raspberry Pi with a cute
for Raspberry Pi OS, there has long been a clamour silicon-rubber surround that ensures knocks don’t
for faster, more capacious solid state drives. The push it off course. Available in translucent white
new Raspberry Pi SSD Kit comes in 256GB or or solid black, the Raspberry Pi Bumper is a great
512GB versions and is packaged with an M.2 HAT+ alternative to a case, ensuring plenty of natural
for lightning-fast disk access and Raspberry Pi airflow to keep things cool while showing off the
boot-up times. computer at the heart of your DIY projects.

40 magpi.cc Gear Guide 2025!


FEATURE

PicoZX ePiPod
Handheld → magpi.cc/epipod

Del Hatch’s iPod-style music


→ magpi.cc/picozxhandheld
player encases a Raspberry
A tiny gaming Pi Zero 2 W in a homebrew
device inspired case (find the STL files here:
by Sinclair’s ZX magpi.cc/epipodstl) with a
Spectrum could Waveshare ePaper touchscreen

M2+ HAT
be the perfect project for those for the display and controls.
of a certain age who grew up Once assembled, you will have
learning computing on the home a portable player that serves up
computing visionary’s original. albums from an SD card, doesn’t
→ magpi.cc/m2hatplus
The PicoZX Handheld consists need to be connected to the
→ £12 / $12
of several custom circuit boards internet to play them,
For the fastest data transfers, an M2 SSD that soldered on to a Pico, plus a and offers more
uses the NVMe protocol is just the ticket. retro faceplate that conceals the than five hours of
Raspberry Pi’s official M2+ HAT sits atop
charger, battery and connectors, entertainment before
Raspberry Pi 5, adding M2’s speedy 500MBps

Projects
USB ports and SD card slot. needing a recharge.
transfers to and from NMVe drives as well to the
board’s existing PCIe 2.0 interface. If AI projects
are your thing, you’ll really notice the performance
difference when using accelerators.

Touch Display 2
→ magpi.cc/touchdisplay2
→ £58 / $75 Air Hockey table/ Pretty Tide Clock
This seven-inch capacitive touchscreen boasts an games emulator → magpi.cc/prettytideclock
800×480-pixel IPS display with support for five-
This project was inspired by maker
finger touch and an onscreen keyboard. The screen → magpi.cc/minihockey
Levi wanting to know when to
connects to your Raspberry Pi via an adapter
Maker Chris Downing descend his cliff-top home and
and can be powered by a ribbon cable with DSI
connector and a GPIO with no need for an external and his @BitBuilt expect to swim. Even if you have
power pack, so it can be used as a standalone gaming site co- no pressing need to know when
display for entertainment or IoT duties. owner CreshBash and where it will be high or low
spent more than tide, this gorgeous Raspberry Pi
two years designing, 3B+ project pulls tidal data from
3D-printing and the US National Oceanic and
perfecting this 1:5 scale air hockey Atmospheric Administration API.
table. It offers either regular air The 3B+ converts them into PWM
hockey (first to seven points) values, used for the analogue
or Doom mode for a fiery table gauges. The tide clock indicates
lightshow complete with scream a rising and receding tides via
effects. Since it uses Retropie red and green
there’s also a games emulator LEDs either
mode. The whole crazy caboodle side of its lovely
is controlled by Raspberry Pi 4. wooden frame.

Gear Guide 2025! magpi.cc 41


FEATURE

Argon Neo 5 case


→ magpi.cc/neo5
→ £18 / $23

Protect your Raspberry Pi from knocks and accidental spills with this hardy
case – the latest in Argon’s well-regarded range of cooling accessories for
Raspberry Pi is well geared-up for school or industrial use. The aluminium
enclosure offers effective CPU and circuitry cooling helped by an onboard,
Pi-controlled 30mm PWM fan which is largely silent. Raspberry Pi’s SD card
slot can be left accessible when the enclosure is in place, or optionally covered
with a screw-on plate to stop anyone messing with your setup.

“The aluminium
case offers CrowView Note
excellent cooling → magpi.cc/crowview

qualities” → £128 / $169

Slide your Raspberry Pi into the side


of the CrowView and you’ve got your
very own sliver of portable computing
convenience. This laptop dock has a
socket that is designed especially
for Raspberry Pi 5, but can also
be used with earlier versions of
our favourite computer. Once
connected, Raspberry Pi OS runs
on the CrowView without further
prompting. The dock has a 5000mAh
battery pack which powers both dock and
Raspberry Pi for up to two hours

Pironman 5 case Tiny Circuits Thumby


→ magpi.cc/pironman5
Color gaming device
→ £70 / $91
→ magpi.cc/thumbycolor
With its transparent sides and internal spot lights,
→ £38 / $45
plus detailed LED status info, the Pironman
5 reminds us of PC computing kit beloved by While the initial appeal of Thumby Color probably lies in being able to play
modders and overclockers. The aluminium case all sorts of arcade-derived and board games on its teeny 128×128-pixel 16-bit
offers excellent cooling qualities for optimal colour screen, the RP2350 microprocessor-powered Thumby soon lures you
performance. There are USB 2.0 and USB 3.0 ports, in to the world of coding your own games. Reviewing it, MagPi editor Lucy
gigabit Ethernet and two HDMI ports and support remarked that “The real deal is the ability to investigate the API and create
for both M2 SSD hard drives and has a Raspberry games yourself by following the tutorials [to which end] Thumby has an
Pi 5 NVMe PCIe peripheral board. Geek out! online Code Editor and a starter guide. Thumbs up all round!

42 magpi.cc Gear Guide 2025!


FEATURE

Cool kits &


electronics
Tinkering with lights, sensors and diodes
is a great way of exploring electronics

Raspberry Pi Pico
Advanced Kit
→ magpi.cc/advpicokit
→ £29 / $38

Electronics kits are something


of a classic festive gift, and
we can certainly see ourselves getting stuck
in to this absolute trove of jumpers, diodes, Raspberry Pi
LEDs, breadboards, sensors, inputs, outputs,
robot components and bleepy things. An ideal AI Camera
companion set for Pico owners of any
age, it also comes with instructions → magpi.cc/aicamera
for several MicroPython Pico projects. → £63 / $70

Perhaps the most prevalent phrase of 2024 (closely


followed by ‘brat’), AI promises to radically alter
how we interact, glean information, process data

Raspberry Shake and create and consume images. We couldn’t resist


designing our own AI camera based around Sony’s
IMX500 Intelligent Vision Sensor. With its on
→ raspberryshake.org module AI processor, the Raspberry Pi AI helps you
→ From £267 / $349 create impressive vision AI applications and neural
network models. There’s a useful Getting Started
Citizen scientists will love this incredible device that can measure ground guide at magpi.cc/aicamdocs.
tremors near and far. From volcanoes and earthquakes another continent The 12.3Mp IMX500 Raspberry Pi AI Camera
away to heavy traffic and even the footfall of large crowds, all sorts of seismic includes everything you need for Raspberry Pi
events are recorded on Raspberry Shake, and can duly be seen by fellow photography and works with the AITRIOS platform
shake-watchers around the globe. Depending on the version you choose, (magpi.cc/aitrios) to create your own classifier
Raspberry Shake records tremors across one, two or four axes, (vertically detectors, train and label models, and produce
and laterally) including underground, under the sea and even overhead. brilliant machine-learning projects.

Gear Guide 2025! magpi.cc 43


FEATURE

Amazing
maker tools
A fully loaded box of tricks will see you
through many making adventures

Hozo NeoRuler GO
Solder Scroll → magpi.cc/neorulergo
→ £46

→ magpi.cc/solderscroll This digital rolling ruler is accurate to less than


1mm and provides measurements in inches,
→ Free to 3D print
centimetres, feet, yards and miles. However, it
Hackspace’s Andrew Gregory immediately saw the use of Solder Scroll, will probably be of most use to The MagPi and
describing it in his review as a “brilliant device [that] makes soldering more Hackspace readers for tackling curves and awkward
ergonomic by allowing you to dispense any diameter of solder out of an shapes when planning 3D and electronics projects,
object you hold like a pen”. It effectively provides an extra hand to accurately schematics and drafting plans. It has 93 built-in
hold in place that tiny object you’re attempting to solder. You just need to scales. Measurements are automatically saved to
3D-print the handy tool using designer Victor’s STL files: magpi.cc/scrollstl. the linked Meazor app.

“Measurements are
automatically saved to
the linked Meazor app”
Pimoroni Explorer xTool S1
→ magpi.cc/pimexplorer
→ From £34 / $44
Laser Cutter
Pimoroni’s ‘electronic adventure playground for → magpi.cc/xtools1
physical computing’ is available both as a kit with
→ £1799 / $2334
or without a RP2350 (Pico 2) included, the Explorer
goody bag includes sensors to measure moisture, Laser cutting is a very compelling alternative to 3D printing, involving far less
temperature, light and movement, two 60mm plastic, (although it works on this as well as wood) but also requiring proper
wheels, rotation servos and a potentiometer. precautions. The fully enclosed xTool S1 keeps its potentially dangerous 2W
There’s also a breadboard, 2.8in LCD display, infrared and 20W and 40W blue lasers away from the user, while offering
speaker, STEMMA connectors and a generous admirable engraving and cutting features. Powerful enough to use with 10mm
number of analogue and digital connectors. wood or plywood, this is a great hobbyist machine.

44 magpi.cc Gear Guide 2025!


FEATURE

CrowPi
Educational Kit
→ magpi.cc/crowpi
→ £165 / $208

Raspberry Pi and electronics kits are a great pairing. The advantage

Plasma 2350 LED of CrowPi’s offering is that they’ve sourced pretty much all the
components you’re likely to need: USB-C power input, GPIO ribbon cable,

Light Controller LEDs, sensors, jumpers, cables, and gamepad gubbins – for a fulfilling
electronics extravaganza (lesson plans are thrown in too). The whole thing
is presented in a sturdy self-contained case along with a breadboard and a
9 inch touchscreen inside the lid.
→ magpi.cc/plasma2350
→ £12 / $13

Bullfrog Synthesizer
Some Raspberry Pi projects offer real
coding challenges, but many smart lights
and sensor-based ones can be done with a
straightforward electronics setup and a suitable
→ magpi.cc/bullfrog
microcontroller. The Plasma 2350 is based around
→ £450 / $541
the same chip as Raspberry Pi Pico 2 and can
illuminate strings of NeoPixel lights or separate Home computers and electronic
RGB LEDs, making for a great fun project that’s music have plenty of shared
ideal for those new to coding. history, which Bullfrog’s
subtractive and analogue
synth continues. An RP2040
microcontroller takes care of
MIDI implementation and is
used in a sampler/Loloper voice
card. Both digital instrument and educational
tool with a 70-page instruction manual, it’s a
wonderful machine on which to experiment
with pitch, timbre and amplitude. Co-
designer and DJ/music producer Richie
Hawtin proclaims the goal “to both
nurture a passion for electronically
produced sounds and promote fun”.

PiDP-11 replica kit


ArmPi FPV AI Vision
→ magpi.cc/pidp11
→ $297 → magpi.cc/armpifpv
→£200 / $300
Fans of early computers and electronic music may
well be familiar with DEC’s PDP machines. We If you want to give AI a try, you could do far worse than experiment with
covered a Raspberry Pi-enabled rebuild project last this programmable robotic arm which you can variously challenge to
issue (magpi.cc/147). This gorgeous replica kit is pick up specific coloured blocks, manoeuvre the arm and transport them
the next best thing, miniaturising the 1975 model from place to place via an app. The arm’s six degrees of lateral movement
to 6:10 with Raspberry Pi 2, 3, 4 or 5 (optionally) include joints and a robotic ‘wrist’, while smarts include reporting on
running the Blinkenbone SimH emulator. temperature, voltage and position.

Gear Guide 2025! magpi.cc 45


FEATURE

“It supports TensorFlow


and Pytorch”

Pimoroni Inventor
2040 HAT Mini
→ magpi.cc/inventorhatmini
→ £24 /$25

Two motor ports and four three-pin servo headers


make this HAT ideal for robot projects, for which
Pimoroni provides plenty of relevant guidance in
this package. However, the inputs for sensors,
ADC-compatible GPIO connections, audio and
UART ports make this a fairly flexible package
for all wannabe inventors.

Raspberry Pi AI HAT+ CM4 XGO Lite


→ magpi.cc/aihat Robot Dog Kit
→ From £65 / $70
→ magpi.cc/cm4xgo
Machine learning and Raspberry Pi work flawlessly
→ £429
together in this integrated AI accelerator. The
Raspberry Pi AI HAT+ features a built-in neural Robot dogs have become pretty popular, but few have Compute Module
network accelerator, turning your Raspberry Pi 5 (the industrial version of Raspberry Pi) at their heart. The XGO is a
into a high-performance, accessible, and power- pre-constructed metal machine you can control wirelessly via a web browser.
efficient AI machine. Available with 13 or 26 TOPS It’s great for mastering movement using either Python or the simpler Blockly.
performance, it’s suited to everything from entry- Your canine companion can walk on all fours, sit up, flex its gripper paw by 15
level applications to complex neural processing. degrees and use its onboard camera to recognise faces.

Mini Desktop PC
→ magpi.cc/minipc
→ 3D-printed file

A tiny version of an MS-DOS 286 PC, this charming computer can be


assembled by 3D-printing a replica case (magpi.cc/retropccase) and adding
a Raspberry Pi plus printed circuit board, 3.5in LDC, power supply and cables.
A lovely touch with this nostalgia-inducing build is that its DOSbox emulator
software runs from an SD card you pop in what, on the original computer,
would have been its floppy disk drive.

46 magpi.cc Gear Guide 2025!


Reach a
global community!

Advertise in The MagPi –


The Official Raspberry Pi Magazine

Our readers are passionate about


technology and the Raspberry Pi
ecosystem. From DIY enthusiasts to
professional engineers.
Your advertisement can sit alongside
our cutting-edge tutorials, features
and reviews. And we have flexible
advertising options for
a range of different businesses.

Take the next step –


advertise with us today!

Email Charlie Milligan at: [email protected]


TUTORIAL

Using Python
with virtual
environments
Raspberry Pi comes with Python and you need
to use virtual environments to install packages

R
aspberry Pi OS comes with Python 3 pre- Install Python libraries using pip
installed. Interfering with the system In older versions of Raspberry Pi OS, you could
Python installation can cause problems for install libraries directly into the system version
your operating system. When you install third- of Python using pip. Since Raspberry Pi OS
party Python libraries, always use the correct Bookworm, users cannot install libraries directly
package-management tools. into the system version of Python.
On Linux, you can install python dependencies Instead, install libraries into a virtual
in two ways: environment (venv). To install a library at the
Nate
MAKER

• use apt to install pre-configured system system level for all users, install it with apt.
Contino packages Attempting to install a Python package system-
Nate is a retrofuturist
• use pip to install libraries using Python’s wide outputs an error similar to the following:
and writes dependency manager in a virtual environment
documentation for pip install buildhat
Raspberry Pi.
Install Python packages using apt
lambdalatitudinar Packages installed via apt are packaged specifically error: externally-managed-environment
ians.org
for Raspberry Pi OS. These packages usually come
pre-compiled, so they install faster. Because × This environment is externally managed
apt manages dependencies for all packages, To install Python packages system-wide, try
installing with this method includes all of the sub- apt install
dependencies needed to run the package. And apt python3-xyz, where xyz is the package you
ensures that you don’t break other packages if you are trying to
uninstall. install.
For instance, to install the Python 3 library
that supports the Raspberry Pi Build HAT, run the If you wish to install a non-Debian-
following command: packaged Python package,
create a virtual environment using python3
sudo apt install python3-build-hat -m venv path/to/venv.
Then use path/to/venv/bin/python and path/
You’ll Need To find Python packages distributed with apt, to/venv/bin/pip. Make
use apt search. In most cases, Python packages sure you have python3-full installed.
> R
 aspberry Pi use the prefix python- or python3-: for instance,
>  Raspberry Pi OS you can find the numpy package under the name For more information visit http://rptl.
python3-numpy.

48 magpi.cc Using Python with virtual environments


TUTORIAL

Click the interpreter in


Thonny to activate the virtual
environment in your IDE

It is possible to create virtual


environments inside Thonny as
well as from the command line

io/venv environment in the root folder of each project,


typically with a shared name like env. Run the
note: If you believe this is a mistake, following command from the root folder of
please contact your Python installation or each project to create a virtual environment
OS distribution provider. You can override configuration folder:
this, at the risk of breaking your Python
installation or OS, by passing --break- python -m venv env
system-packages.
hint: See PEP 668 for the detailed Before you work on a project, run the following
specification. command from the root of the project to start
using the virtual environment:
Python users have long dealt with conflicts
between OS package managers like apt and source env/bin/activate
Python-specific package management tools like
Attempting to install
pip. These conflicts include both Python-level API You should then see a prompt similar to the packages with pip
causes an error in
incompatibilities and conflicts over file ownership. following:
Raspberry Pi OS
Starting in Raspberry Pi OS Bookworm, packages Bookworm
installed via pip must be installed into a Python
virtual environment (venv). A virtual environment
is a container where you can safely install third-
party modules so they won’t interfere with your
system Python.

Use pip with virtual environments


To use a virtual environment, create a container to
store the environment. There are several ways you
can do this depending on how you want to work
with Python:

per-project environments
Many users create separate virtual environments
for each Python project. Locate the virtual

Using Python with virtual environments magpi.cc 49


TUTORIAL

Create a virtual
environment in a (.env) $ your configuration in a folder whose name
project folder to begins with a period to hide the folder by default,
install packages
local to that project When you finish working on a project, run the preventing it from cluttering your home folder.
following command from any directory to leave Use the following command to create a virtual
the virtual environment: environment in a hidden folder in the current
user’s home directory:
deactivate
python -m venv ~/.env

per-user environments Run the following command from any directory


Instead of creating a virtual environment for each to start using the virtual environment:
of your Python projects, you can create a single
virtual environment for your user account. Activate source ~/.env/bin/activate

You should then see a prompt similar to the


following:
 e recommend Thonny for editing
W
(.env) $
Python code on the Raspberry Pi
To leave the virtual environment, run the
following command from any directory:
that virtual environment before running any of
your Python code. This approach can be more deactivate
convenient for workflows that share many libraries
across projects.
When creating a virtual environment for Create a virtual environment
multiple projects across an entire user account, Run the following command to create a virtual
consider locating the virtual environment environment configuration folder, replacing <env-
configuration files in your home directory. Store name> with the name you would like to use for the

50 magpi.cc Using Python with virtual environments


TUTORIAL

virtual environment (e.g. env): setuptools 66.1.1


Top Tip
python -m venv <env-name> The list should be much shorter than the list of
packages installed in your system Python. You can Tip
now safely install packages with pip. Any packages
Pass the
Enter a virtual environment you install with pip while in a virtual environment
--system-site-
Then, execute the bin/activate script in the only install to that virtual environment. In a packages flag
virtual environment configuration folder to enter virtual environment, the python or python3 before the
the virtual environment: commands automatically use the virtual folder name to
environment’s version of Python and installed preload all of the
source <env-name>/bin/activate packages instead of the system Python. currently installed
packages in your
system Python
You should then see a prompt similar to the Exit a virtual environment installation
following: To leave a virtual environment, run the following into the virtual
command: environment.
(<env-name>) $
(<env-name>) $ deactivate
The (<env-name>) command prompt prefix
indicates that the current terminal session is in a
virtual environment named <env-name>. Use the Thonny editor
To check that you’re in a virtual environment, We recommend Thonny for editing Python code on
use pip list to view the list of installed packages: the Raspberry Pi.
By default, Thonny uses the system Python.
(<env-name>) $ pip list However, you can switch to using a Python virtual
Package Version environment by clicking on the interpreter menu
---------- ------- in the bottom right of the Thonny window. Select a
pip 23.0.1 configured environment or configure a new virtual
environment with Configure interpreter.

Add a virtual
environment to your
home directory to
use it in multiple
projects and share
the packages

Using Python with virtual environments magpi.cc 51


TUTORIAL

Build your
own streaming
media server
Access your music, digital-download movies, ebooks
and more using Jellyfin, a free, open-source
media server with a slick web interface

I
K.G.
MAKER

f you have a large media library, having it an M.2 HAT (magpi.cc/m2hat) on Raspberry Pi 5
Orphanides trapped on a single computer is increasingly to add a large amount of local storage and create
frustrating if your family uses multiple a fully self-contained media server. You can also
KG has been
hoarding media devices, and this is part of why online streaming create a Samba/SMB/CIFS share on any server or
since the late is convenient. The Jellyfin media server brings appliance that is permanently on and connected to
1990s and sees
this convenience to your home media collection. your local network.
no reason to stop
now, just because It’s not legal to rip CDs and DVDs in the UK, but
everything’s you can buy digital music online from places like
gone digital. Bandcamp, HDTracks, Steam, Mirlo, Apple Music
twoot.space/ Organising your movies
@owlbear
and even Amazon.
Video is a bit harder, but many independent
02 Jellyfin works best if you structure
filmmakers and comedians allow you to buy their your media in the right way, allowing it to
videos. Go Faster Stripe (gofasterstripe.com) has correctly apply metadata. The documentation
an excellent range of UK stand-up comedy and (magpi.cc/jellydocs) provides extensive details on
Vimeo On Demand section (magpi.cc/vimeood) how this is best carried out for each media type.
lets you buy films to download, while enthusiasts It can read media identifiers, notably online
for French cinema can buy films from Cinemutins media database codes, from both file and folder
(cinemutins.com). names, so, per its example you could name a
Warning! file ‘Film Name (2010) [imdbid-tt0106145].mp4’
Copyright or have it in a folder called ‘Film Name (2018)
[tmdbid-65567]’. Multiple versions of the same
UK law does not allow Media hosting
you to copy CDs, DVDs,
or other media discs.
01 Before you set up your streaming media
file, at different resolutions or even in different
cuts, can be placed in a single folder for that
This feature includes
recommendations for
server, you’ll need to set up somewhere to store film, and you’ll be able to select from them when
numerous services your media. There are so many different options playing back. The documentation also details
that will sell you
downloadable music for this, that it’s somewhat beyond the scope of Jellyfin’s preferred conventions for naming extras.
and movies. this tutorial. We’ve hosted ours on a Synology NAS Series episodes should be labelled into a folder
magpi.cc/copyright device on our local network, but you can also use names for the series, along with its year and,

52 magpi.cc Build your own streaming media server


TUTORIAL

You can name your libraries


whatever you please. All the films
we’ve added here come from DRM-
free video-on-demand services

You’ll Need
> M.2 HAT for
Raspberry Pi 5
(optional)

> Network attached


storage (optional)

If you name your directories


correctly, Jellyfin will
automatically add movie
posters, cast lists and other
metadata for them

It’s worth taking


the time to at
least add films to
directories named
for their title and year
– this is sufficient to
provide all the data
you see here

if you wish to use it, online media database


identifier, and then folders below that for each
season, with files in those labelled as something
like ‘Series Name S00E01.mkv’.

Organising your music


03 You’ll want to do something for your
music, with a structure that looks like ‘Artist
Name > Album Name > XX Track Name.format’,
where XX is the track number. You can do this
manually, and Jellyfin is pretty forgiving as
long as you have the folder structure the way it
likes. If you don’t want to manually rearrange
everything, consider using Beets (beets.io)
to rename and structure files based on their
MusicBrainz entries. Fortunately, even if you
don’t get the ordering right initially, you can
have Jellyfin rescan your media folders at
any point.

Build your own streaming media server magpi.cc 53


TUTORIAL

You’re prompted
to add your media
libraries at setup
time. You can
add as many
directories as you
like to each library

Have Beets relabel your music


04 You can run Beets with any source and
also told it to move, rather than copy files, as we
have had limited space. Setting move to ‘no’ is the
target directory location, whether you’re storing better option if you also wish to retain your audio
music in a local folder or on a network share. files in their original structure. Note that tabs are
not supported in the yaml file, only spaces.
$ sudo apt install beets
$ beet config -p directory: ~/Music/Ordered
library: ~/Music/Ordered/musiclibrary.db
This will spit out the address of a Beets config move: yes

 ith your media


W If your target directory doesn’t already exist,
you’ll need to create it:
organised, actually
$ mkdir ~/Music/Ordered
installing Jellyfin could And now import your music:

hardly be any simpler $ beet import /path/to/your/music

file: /home/pi/.config/beets/config.yaml in our


Install Jellyfin
case. The next command will allow us to edit it
so that we can tell it where to put our reorganised
05 With your media organised, actually
music and whether to move or copy our files. installing Jellyfin could hardly be any simpler.
Once you’ve installed and updated Raspberry Pi
$ beet config -e OS, run the following command to add Jellyfin’s
official Debian repository and fully install its
This will open your default text editor, allowing server and web interface components:
you to define the directory you’ll be exporting
sorted music to and keeping its database in. We’ve $ sudo apt update && sudo apt upgrade

54 magpi.cc Build your own streaming media server


TUTORIAL

$ curl -s https://repo.jellyfin.org/install- This account will be able to add media sources,


debuntu.sh | sudo bash create other user accounts and access the server’s
administration interface, potentially from outside
With that done, you’ll need to mount some your network if you set up remote access, so make
media. We don’t recommend using directories sure it gets a strong password.
on your OS SD card’s root, as Jellyfin can be
temperamental about mounting these, although
you could manually create a second partition on a
Connect your media
large SD card.
08 With that step done, it’s time to set up your
media libraries. Click Add Media Library, choose
the content - metadata application works best for
Connect a media share
06 single-type content, so split up your movies and
your shows into separate libraries and storage
$ sudo mkdir /mnt/Share directories if possible. Name each library as you
$ sudo mount -t cifs -o please, and add folders to it. Once you’ve added
username=RemoteUserName //x.x.x.x/ /mnt/share/ everything you want - you can always add more
later, click Next.
Assuming your target share directory shows up Select your primary metadata language. You
as planned, we’ll now add this to Raspberry Pi’s can set individual languages per library as needed,
fstab so that it’s automatically mounted when which is handy for multilingual users.
your Jellyfin server boots.

$ sudo nano /etc/fstab


Optional networking features
///x.x.x.x/media /mnt/share/ cifs guest,
uid=YourUserName, file_mode=0777,dir_
09 You’ll next be prompted to consider a
mode=0777,noperm 0 0 x-systemd.mount- couple of networking questions. The Configure An admin dashboard
timeout=45 Remote access options by default allow remote allows you to see
recent activity on
connections to the server - untick this if you don’t the server, manage
your libraries, your
reboot plan on ever enabling access from the broader
users and a range of
internet. You can optionally enable automatic advanced settings
With all that done, your media server is ready
to set up and you should now be able to access
it from any device on your local network that’s
capable of running a web browser. By default,
Jellyfin serves HTTP traffic on port 8096.
Get the IP address of your Raspberry Pi and note
it down for the next step, because you’ll need that
to access your new media server.

$ ip a

Set up admin access


07 In a browser on another device, visit:
http://[IP address]:8096/. If everything’s installed
correctly, you should be presented with a page that
reads “Welcome to Jellyfin!”
Select your language from the pulldown menu
- English (United Kingdom) is an available option.
You’ll then be asked to set up your Jellyfin admin
account on a page that’s slightly ambiguously
titled “Tell us about yourself”.

Build your own streaming media server magpi.cc 55


TUTORIAL

download media to a local device, or limiting


their access to only certain media libraries. This
is one way to approach kids’ accounts. If you’ve
got everything set up with accurate metadata,
you can use the parental controls alongside age
ratings to ensure that younger users see only
appropriate material, as well as blocking content
that doesn’t have a rating. You can also use tags
to allow or block content, and create an access
schedule so that the user can’t play media outside
specified hours. Every user gets their own viewing
history and favourites,

Remote control
11 You can even access Jellyfin while you’re
travelling or simply when using a different
network at home, such as your mobile broadband
connection. By default it makes itself available

 se the parental controls


U
A range of UPnP (Universal Plug and Play) port mapping,
transcoding options
are available if you although this media streaming feature set isn’t alongside age ratings to
want to have Jellyfin supported by all routers these days, so it’s off
attempt to reduce
media file sizes for by default.
ensure younger users see
smoother streaming With that, you’re done. Jellyfin has already
begun indexing your media collection in the
only appropriate material
background.
via HTTP port 8096, so you’ll want to forward
that port from the external static IP address
provided by your ISP to the IP address of your
Adding users, parental controls
10 You can create profiles for every member
Jellyfin server. Make sure that you give your users
strong passwords if you’re going to make Jellyfin
of your household via the admin dashboard, available externally.
and configure what their access privileges
are, giving them admin rights, the ability to

Watch together
12 You can also invite other members of your
household to have a digital watch party using the
Groups feature, which will keep multiple streams
of a movie in sync with the person who’s running
the group-watch, making it easy for you to drop
into family movie nights while you’re travelling.
You can also cast Jellyfin to compatible media
receivers. Although the symbol is the same that
Jellyfin’s interface for
serving music is just you’ll see on services that support Google’s
as slick as its video ChromeCast standard, the two are not compatible.
counterpart, making
it ideal if you have We’ll talk about setting up a Jellyfin receiver for
a large collection
your TV, phones, computers and other devices in a
you wish to access
from any device future tutorial.

56 magpi.cc Build your own streaming media server


TUTORIAL

Build a private
Part 04

cloud server:
Collaborate!
Take control of the cloud with your own collaboration
and office suite hosted on Raspberry Pi

Even the base installation


comes with an impressive
PJ
MAKER

array of applications - and


Evans you can install many more!

PJ is a writer,
software engineer
and homelab
enthusiast. He likes
to stop, collaborate,
and listen (you
might have to ask
your parents).

mastodon.
social/@ The heart of NextCloud is the
mrpjevans
file manager where you can
create documents and share
them with your colleagues

You’ll Need

O
ne of the great things about cloud cloud server up and running, it’s time to unleash
>  Private cloud server services is the ability to collaborate with its true potential.
magpi.cc/144 people all over the world. You can share
magpi.cc/145 documents and work on them together. You can
magpi.cc/146 have shared calendars, contact lists, and more.
Introducing NextCloud
>  Domain name

> S
 tatic IP (or
It was once true that this kind of power meant
sharing your data with large companies. Now,
01 If we need all the common tools for group
DuckDNS setup) open source tools mean you can have your very collaboration then we’re talking calendars,
own groupware running on your device that can contacts, notes, email and maybe chat. And
be accessed from anywhere. Now we have our that’s for starters. What about being able to

58 magpi.cc Build a Private Cloud Server: Collaborate!


TUTORIAL

 his friendly
T
dashboard is the
first thing you see
upon logging in and
provides a useful
summary of activity

 e’re talking calendars,


W to install. It’s that simple. Give it a couple of
minutes, maybe a bit more if you’re on a slower
contacts, notes, email connection, and you should be returned to the
CasaOS dashboard with a shiny new NextCloud
and maybe chat icon. Best thing to do now is click it!

view and edit documents or spreadsheets? You


Set up the admin account
would think doing this would require installing
many, many packages and trying to get them all
03 Upon clicking on NextCloud you will be
talking together. Thankfully, the good people of taken to a new browser tab on port 10081. This
NextCloud have created a fully integrated suite is NextCloud’s entry point locally, although
of products that make running a collaboration
system easier than ever before. We’re going to
we’ll make that easier later. For now, the
most important thing to do is set up the first
Top Tip
install a simple version of the NextCloud suite account, which will double as the administration
and make sure it can be accessed from anywhere. account for the whole system. If this is for Mail matters
an organisation, you may want to consider a
Running your own
dedicated admin account, although you can email server is
promote and demote accounts later on. Also, not for the faint-
Installation
02 In the previous part of this series we
remember to choose a decent password, the
longer the better. Now you’ll be taken through a
hearted. If you
really want to,
installed CasaOS, a control system and dashboard brief introduction and then to your dashboard. we recommend
reading ‘Run Your
for installing server-side apps. Again, CasaOS
Own Email Server’
will take the pain out of installing NextCloud.
by Michael W
Create the domain
Log into CasaOS on your server (if you followed
the instructions it’s on port 82) and select
04 NextCloud is very particular about the
Lucas: magpi.cc/
emailserver
the App Store. Search for NextCloud and click domain name and security. Therefore we

Build a Private Cloud Server: Collaborate! magpi.cc 59


TUTORIAL

Add trusted host


06 Well, you can access NextCloud but you’ll
probably see an error about now being a trusted
host. Again, NextCloud is trying to keep things
as secure as possible and you’ve arrived on a
domain name it doesn’t know about. To fix this
we need to add your new domain as a trusted
domain. Unfortunately, this requires a bit of
command-line work. SSH into your server and
run these commands:

cd /DATA/AppData/nextcloud/var/www/html/
config
sudo nano config.php

Carefully amend the trusted_domains array


so you add the line starting ‘1’:

‘trusted_domains’ =>
array (
0 => ‘nas.local:10081’,
1 => ‘nc.themagpi.com’
 haring a file or
S recommend using a real external domain name. ),
folder with another
user takes just a
If you followed the previous tutorial (magpi.
couple of clicks. You cc/146) you will already have one for file CTRL+X, followed by Y, to save and leave
can also set various
permissions and sharing. In this case, you need an additional one Nano. The changes take effect immediately.
expiry dates that is either pointing to your static IP address
or dynamic DNS service provider. We’ll use ‘nc.
themagpi.com’ as an example. If you haven’t
Take the tour
already, configure your router to forward ports
80 and 443 to your server. See The MagPi issue
07 That’s all the hard work over with. If all
#146 (magpi.cc/146) for the full guide. Any is well, the error message will have disappeared
requests coming to your new domain name will and you can log in to NextCloud. If you find the
now be sent to your private cloud server. server is no longer working, return the file you
edited in the previous step and check everything
is exactly right. One character out of place may
break everything. Hopefully, you’re now in
Configure Nginx
05 Last time we installed Nginx to act
and can have a look around. You’ll see a useful
dashboard that will summarise what’s been
as a proxy between the outside world and going on (probably not a lot to begin with) and
your server. This also allows the traffic to be a range of apps across the top that perform all
encrypted using SSL. We’re now going to use manner of useful functions. To the top-right
another trick up Nginx’s sleeve which is domain you are able to access both your account and
proxying. From CasaOS, click on Nginx Proxy the server settings.
Manager, log in and click on ‘Proxy Hosts’.
Now enter your new domain name, leave ‘http’
unchanged and add the IP of your private cloud
Meet the apps
server under ‘Forward Hostname’. Enter 10081
for the port. Now click on the ‘SSL’ tab and
08 Out of the box, NextCloud has a range of
select ‘Get a new certificate from Let’s Encrypt’. useful features so do spend some time exploring
Click ok to configure everything. You should them. It has its own dedicated file storage and
now be able to access NextCloud from your new sharing app which kind of acts as a central
domain name using HTTPS. hub. You have a personal folder and can share

60 magpi.cc Build a Private Cloud Server: Collaborate!


TUTORIAL

folders with others by creating new users in are all just a click away with no fuss installation.
Administration and granting them permissions. Have a browse around and see how you could
You also have access to calendars, contacts, enhance your server! To access, just click Apps
chat, notes and email. You can create multiple under your account menu on the top-right.
instances of these and share them. Try creating
a second user and setting up shared file space,
calendars and contact lists. NextCloud doesn’t
Enabling office features
come with an email server but can act as a client
and use it to integrate with the other features.
10 We’ve got all the collaboration and
communication good stuff ready to go, but what
about creating documents? Out-of-the-box
NextCloud can edit simple text files but what if
Add new apps
09 Did we mention the app store? By
you need more? NextCloud uses Collabora CODE
as a back-end for office apps. A simple version is
no means have you reached the limits of available built-in but needs a couple of steps to
NextCloud’s potential. NextCloud provides a enable. Under Apps, click on ‘Office & text’ then
community app store with literally hundreds of look for Collabora Online (ARM64) and install
enhancements for your cloud server. Some are it. Then go to ‘Administration’ then ‘Built-in
simple integrations to make it easier to work CODE Server’. You can now enable it. Go back to
with other products and others are business- the files app and click ‘New’. You’ll be able to
class apps in themselves such as charting, mind create documents, spreadsheets, presentations
mapping and technical drawing. Best of all, these and more.

 ithout even having


W
to leave NextCloud,
you can install
hundreds of apps
in just a single click

Build a Private Cloud Server: Collaborate! magpi.cc 61


TUTORIAL

Connecting
Top Tip 11 NextCloud doesn’t just restrict you to the
are a few things we should warn you about
before carrying on. NextCloud is a well-
web interface. It also has a range of services developed product, but all software of this size
Memory available so you can use your favourite client has bugs and there are occasionally security
matters apps if you wish. Files can be accessed directly
using the common WebDAV protocol (which
NextCloud needs
a lot of memory
is built-in to many operating systems). A
free background sync app is also available for
F or mobile access, you can
to run, even more
with Collabora. download. Calendars and contact lists can be use the dedicated NextCloud
A Raspberry Pi accessed over the CalDAV and CardDAV protocols
with 8 GB of which many apps support. For mobile access, app for the full experience
RAM is a must. you can use the dedicated NextCloud app for the
full experience. With your setup you’ll be able to
access everything from anywhere in the world risks. Make sure NextCloud is kept up-to-date
from a phone, laptop, or computer. (via CasaOS) and consider using VPN (magpi.
cc/vpn) for access if you’re unsure. Also, if
you’re considering a lot of usage, read up on
implementing a more capable database and
Going to the next level
12 Congratulations, you have an amazing
a dedicated Collabora instance. More than
anything, make sure you back everything up!
system for collaboration that you own, and Now the serious business is done, next time
therefore your data is private. However, there we’ll be getting a bit more social.

 fter a little
A
configuration
NextCloud becomes
a suite of office
apps including
word processing,
spreadsheets
and presentations

62 magpi.cc Build a Private Cloud Server: Collaborate!


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
HACK MAKE BUILD CREATE

TOP PROJECTS OBJET 3D’ART


PG PG

66 76
BLUETOOTH ROBOT
RETRO PHONE HAND
Video chat with friends and 3D print an extra
colleagues like it’s 1955 set of fingers
PG

68
GIMBAL CLOCK
3D printed numbers turn FORGE
and twist to tell the time

PG PG

70 80
PELICAN SOFTWARE
CYBERDECK DEFINED RADIO
Merge form and function Pick up radio waves on a Raspberry Pi Pico
with some clever 3D printing
PG

72
PG
84
OUIJA ROBOT PYTHON-ISH
Write your own programming language
A creepy way to get messages from social media

PG PG

74 88
ROTATING MUSEUM STRING ART
Bring the world’s treasures to your 3D printer A fine way to make pictures

64 helloworld.cc
PG
94
RP2350
B0ARDS
The best products rocking
the new RP2350 chip

Best of Breed

65 helloworld.cc
TOP PROJECTS

Bluetooth bakelite
phone headset
By Jouke Waleson hsmag.cc/BakeliteBluetooth

T
his Bluetooth headset is built into the body of a
Dutch phone from 1950, simply called a ‘type 1950’.
It’s powered by an ESP32 development board, and it
works well enough that its creator, Jouke Waleson,
can use it in a professional setting.
Lifting the horn picks up a call; putting it down
disconnects the call. If there’s no incoming call when you pick
it up the phone connect to Siri. There’s a 1500mAh battery that
lasts for about a day; that’s not huge for something like this, but
there is a USB-C charging port, and the nature of this device
means that it stays on your desk.
What else? The rotary dial works for calling phone numbers,
and there are buttons to connect/disconnect to Bluetooth on
the creator’s phone, and his laptop, for when you need to inject
some 1950s flavour into your video chats.

Right
Jouke bought this
handset for about
€10 in a second hand
shop a few years
back. There’s so
much retro hardware
out there begging to
be upgraded!

66 magpi.cc Top Projects


TOP PROJECTS

Top Projects magpi.cc 67


TOP PROJECTS

Gimbal clock
By Mosivers hsmag.cc/GimbalClock

W
e’ve seen the brilliant creations of physicist,
electronics enthusiast and maker Mosivers
before, but never anything as intriguing
as this clock, which plays with motion
and perspective to display the time on a
constantly moving set of 3D-printed rotating
characters. These characters use the dual letter illusion, which is
an effect created by extruding different numbers from a solid block
after rotation. It’s simple, and it’s clever, which makes it a perfect
basis for an unusual clock.
The project uses an ESP8266 development board, 13 MG90
servos and a PCA9685 PWM driver board; everything else in this
build is 3D-printed.
Of the four digits the clock displays, the simplest is the first one,
which needs to be either a 0, a 1 or a 2 to display every time from
00:00 to 23:59. When looked at from one angle it shows a 0; rotate
it and it shows a 1; rotate it again and it shows a 2. The other digits
are more complicated, so Mosivers has got round this by adding
more than one rotating number to each column; it’s an imperfect
solution, but it works (as long as you’re looking at the clock from
just the right angle).

Right
You’ll need a reliable
3D printer if you want
to try this at home

68 magpi.cc Top Projects


TOP PROJECTS

Top Projects magpi.cc 69


TOP PROJECTS

Pelican cyberdeck
By Jake Simek hsmag.cc/PelicanCyberdeck

T
his 1150 case contains a Raspberry Pi 4 with 4GB
RAM, and separate USB battery packs for the
screen and the Raspberry Pi. There’s inbuilt cooling in
the shape of a 30mm fan and two 18mm fans, water-
resistant ports for HDMI, USB-C, and Ethernet, as well
as an SD card reader. All together, it’s a nice build,
and one that really fits the aesthetic of a cybersecurity professional
working away on Kali Linux.
Of course, you can’t just chuck a load of components together
and hope that everything will fit. Jake has had to design and build
some 3D-printed elements to hold everything in place, namely a
screen holder and a base for the keyboard.

Right
Jake used ChatGPT
to help with the
electrical parts
– just don’t ask it
how many Rs there
are in strawberry

70 magpi.cc Top Projects


TOP PROJECTS

Top Projects magpi.cc 71


TOP PROJECTS

Ouija Robot
By Ronald McCollam hsmag.cc/OuijaRobot

T
his spooky build reached our attention too late
for Halloween, but there are always opportunities
to contact the spirit realm. Or maybe just hook it
up to ChatGPT and ask it for recipes. Either way, this
Ouija Robot by Ronald McCollam is an unusual build,
in that it uses both a Raspberry Pi and an Adafruit
Crickit board. The reason for this is pretty standard: he had a Crickit
to hand, wanted to do something with it, then later realised that
it would be good to add the Raspberry Pi to provide a screen to
display the messages displayed by the ouija board.
The Ouija Robot takes input from the social media platform
formerly known as Twitter, and reads out messages via a robotic
hand that moves a piece of plywood with a hole in it over a board
(we now know that this smaller board is called a planchette,
which sounds very much like French for ‘little plank’) with a laser-
engraved alphabet.
Other hardware includes a servo for the arm and one for the
planchette; two NeoPixels; and a 3.5-inch TFT screen to display
the text of the messages received.

Right
A pair of NeoPixels
give a spooky
flashing effect when
a letter is chosen

72 magpi.cc Top Projects


TOP PROJECTS

Top Projects magpi.cc 73


TOP PROJECTS

Rotating art museum


By Sanforlu hsmag.cc/RotatingMuseum

A
s wonderful as our local art gallery is, it doesn’t
compare to the Museum of Fine Arts in Boston,
MA, the Prado in Madrid, or any of the other
major collections in Europe. But while we have a
3D printer, a laser cutter, and access to some free
online resources, we can make our own version
– at least, you can if you follow the example set by sanforlu in
this superb rotating art museum. They’ve made 3D prints of four
classical artworks and mounted them in a small rotating gallery,
complete with a self-recorded audio description that plays at a touch
of a button. “It’s like having a museum curator right in front of you,”
according to its creator.
Rather than fly round the world with a scanner, the maker has
used files from the Scan The World project, which is attempting
to document the great artworks of humanity in .stl format
(hsmag.cc/ScanTheWorld).
And rather than reinvent the wheel, they also used the free
MakerCase tool – enter the dimensions of the enclosure you need,
and MakerCase will produce a set of files that you can put into a
laser cutter, or edit to add the cutouts you might need. For example,
sanforlu made holes for the speaker, potentiometer (which controls
the speed that the artworks rotate), on/off switch and the wires
leading to the turntable (hsmag.cc/MakerCase).
This build is a brilliant synthesis of loads of freely available
techniques and common maker tools. There’s a Raspberry Pi Pico,
an Adafruit potentiometer board and Adafruit microSD card reader,
breakout board, speaker, breadboard and switch, while for the
rotating part of the build there’s a stepper motor, driver board and
a bearing to make sure it rotates freely. What elevates this is the
vision that put it all together.

Right
For these small,
detailed prints, the
maker used a .10mm
layer size at 15%
infill on a Prusa-XL

74 magpi.cc Top Projects


TOP PROJECTS

Top Projects magpi.cc 75


OBJET 3D’ART

Objet 3d’art
3D-printed artwork to bring more beauty into your life

M
any’s the time we wished we
had an extra hand. Whether
it’s carrying a round of drinks
back from the bar, juggling keys,
phone and baby all at the same
time, or holding soldering iron, solder, a PCB
and a through-hole component at once, a third
hand would be useful. It’s something that
evolution really should have got round to by
now, but somehow most of us are stuck with
just the two.
You can buy little clamps to help with
soldering tasks, but if you can 3D-print your
own hand, complete with individually moving
joints, why wouldn’t you do that instead?
This poseable robot right hand by Make-A-Print
can move freely when assembled, and holds
its position thanks to a locking mechanism in
the joints.
Look closely, and you’ll see how parts of
each finger are clearly labelled on the print. The
four parts of the index finger are A1, A2, A3;
the next finger is comprised of B1, B2, B3 and
so on. No, we haven’t miscounted; the first of
those parts is the knuckle joint, which is what
enables the hand to flare out the fingers. The
maker advises that anyone printing this makes
sure that the supports are removed cleanly
from each part, as not doing so will interfere
with the fit and movement of the parts.

hsmag.cc/RobotHand

76 magpi.cc Objet 3d’art


OBJET 3D’ART

Objet 3d’art magpi.cc 77


STEP INTO THE WORLD
OF MAKING!

ƒ CONTROL THE WORLD AROUND YOU WITH A RASPBERRY PI PICO

ƒ BUILD YOUR OWN CREATIONS USING OUR STEP-BY-STEP GUIDES

ƒ DESIGN FOR 2D AND 3D FABRICATION METHODS AND MAKE THEM


A REALITY

ƒ FULL OF PROJECTS PERFECT FOR AN HOUR, AFTERNOON, OR


WEEKEND OF MAKING

hsmag.cc/BookOfMaking2025
TUTORIAL

01
Build a Pico
software-defined radio
Based around a Raspberry Pi Pico, this standalone SDR
enables you to listen to a wide range of radio signals

T
ake a look around you… no, you can’t run for hours on battery power. Intrigued by the
see them, but there are radio waves possibilities, your author decided to have a go at
moving at the speed of light building one.
wherever you go. They’re even being In this first part of the guide, we’ll build the main
beamed well beyond our world, into circuit and explain the basics of how it works. In the
outer space – maybe an alien civilisation second part, we’ll add an antenna and speakers/
Phil King will pick them up one day? headphones and experiment to see what the Pico
Of course, you can use standard radio receiver SDR can do.
A long-time Raspberry hardware – analogue or digital – to turn some of those
Pi user and tinkerer,
Phil is a freelance writer invisible broadcast signals into sound. A software- SIGNALS TO SOUND
and editor with a focus defined radio (or SDR for short) takes a different Details of how this SDR works can be found on Jon’s
on technology.
approach, using software to replace some of the radio blog page for the project. Signals from the antenna
hardware. Typically, you’d be running this on a PC, are boosted by the low noise amplifier (LNA) and sent
or at least sending audio to its sound card. Using a to the analogue multiplexer. Together with the dual op
standard Raspberry Pi Pico microcontroller and some amp and an arrangement of capacitors and resistors,
DIY electronic circuitry, this forms what is known


however, Jon Dawson‘s as a Tayloe quadrature
Pi-Pico SDR project sampling detector (aka
(hsmag.cc/PicoSDR) With just a Raspberry Pi receiver or mixer), which
is a standalone device Pico, an analogue switch converts high-frequency
with its own audio output radio signals into lower-
and an op-amp, you can


– although you can still frequency IQ (in-phase
hook it up to a PC if build an SDR receiver and quadrature) signals
QUICK TIP you want. that can be sampled
While Jon’s original Pi using the analogue to
For the connecting
Pico RX receiver project was based around a custom- digital converter in Raspberry Pi Pico.
wires, cut them to
about the correct designed PCB, this version can be built using (mostly) The Tayloe detector also helps to deal with the
length, stripping the standard through-hole electronic components on a limited 250kHz bandwidth of Pico’s ADC. For this,
ends with a wire piece of protoboard or a solderless breadboard. Yes, a local oscillator close to the desired listening
stripper. If using equipped with just a Raspberry Pi Pico, an analogue frequency is generated by Pico’s PIOs and sent to the
stranded (rather than switch (aka multiplexer/demultiplexer) and an op-amp, multiplexer; with each oscillator cycle, this switches
solid-core) wire,
you can build an SDR receiver capable of listening in the incoming radio signals between four paths in
you may want to tin
the ends with some to signals with a frequency of up to 30MHz – in the quick succession. These samples are combined by
solder for a more long wave, medium wave, short wave, and amateur the dual op amp to generate I and Q signals. These
reliable connection. HT bands – from halfway around the globe. It’ll also contain all the info needed for demodulation, including

80 magpi.cc Software-defined radio


TUTORIAL

C1 7
+ 3 V3
U1C
Source Impedance (~50 ohm) combined with 220 p
+ 3 V3
switch resistance (~5 ohm) combined with
Figure 1
+ 3 V3 + 3 V3

R1
C10, 11, 12, 13 determine QSD cuttoff
1 0K Capacitors charge 1/4 duty cycle. R9
The schematic for
8

1/(2 * pi * 4 * (50+5) * 56e-9) ~= 12kHz 56k


V+

MCP602 2
C1
100 n
C3
100 n
C1 5 the Pico SDR. Note
R5
10u
that, unlike the wiring
4 V

C5 R2
-

8 2
100 n 1 0K 6
-
7
RX_ I
diagram, this includes
GN D GN D

GN D
5
+
User Interface a placeholder for
R6
8 2 MCP602 2
U1B
+ 3 . 3 VP an optional band
GN D + 3 V3
pass filter between

C10

C12
56n

56n
R3 C1 8
1k
U3
74CBTLV325 3
220 p
1
2
J4
the antenna and
16

Antenn a SC L 3
multiplexer
10n
C7

SSD1306 I2C Display


VCC

7 6
1 Band Filter 9
1A
2A
1 B1
1 B2
5
GN D R1 0
SD A 4

4 56k
1 B3
3
2

1 B4 GN D
1 4 C1 4
LO_ I S0 R7
2 1 0 10u
LO_ Q S1 2 B1 8 2
GN D 1 1 2
2 B2 - SW 1
1 1 2 1
1~{OE} 2 B3 RX_ Q RotaryEncoder_Switc h
1 5 1 3 3
GND

2~{OE} 2 B4 +
R8 U 1A ENCODER_ A A S1 PUS H
GN D
8

8 2 MCP602 2 C
C13
C 1

ENCODER_ B
56n

56n
B S2

GN D

R9, R10, C17, C18 op-amp cutoff GN D

1/(2 * pi * 220e-12 * 56e3) ~= 12kHz Quadrature Sampling Detector


GN D
YOU’LL NEED
J3
Headphon e
Raspberry Pico /
Pico W / Pico 2
1st order low pass filter
+ 3 . 3 VP + 3 V3
C9 S

SW2
R4
100 u SN
U2 100 BUTTON_FW D
Pico T
SPEAKE R

LO_ Q
1
GPIO 0 VBU S
4 0
C1 6
J2
Speake r
TN
PCB protoboard

SW3
2 3 9

or solderless
1
G
LO_ I GPIO 1 Raspberry Pi VSY S Ferrite_Bea d 470 n
3 3 8 2 BUTTON_BAC K
GN D GN D
4 3 7 FB1
BAND_ 0 GPIO 2 3V3_E N
BAND_ 1
BAND_ 2
5
6
GPIO 3
GPIO 4
3V3
ADC_VRE F
3
3
6
5 GN D GN D GN D breadboard
PUS H 7 3 4
GPIO 5 GPIO28_ADC 2
8 3 3 C8 GN D

100μH inductor /
GN D AGN D
9 3 2 10u
GPIO 6 GPIO27_ADC 1 RX_ I
1 0 3 1
GPIO 7 GPIO26_ADC 0
ferrite bead
RX_ Q
1 1 3 0
GPIO 8 RU N
1 2 2 9 BUTTON_FW D
GPIO 9 GPIO2 2 GN D
1 3 2 8
GN D GN D
1 4 2 7 ENCODER_ A
MCP6022 dual
GPIO1 0 GPIO2 1
1 5
1 6
GPIO1 1 GPIO2 0
2
2
6
5
ENCODER_ B
SC L Using PWM, it then outputs the final samples to
op amp
GPIO1 2 GPIO1 9
1 7 2 4 SD A
GPIO1 3 GPIO1 8
1 8
GN D GN D
2 3
BUTTON_BAC K
a 3.5mm audio output, to which you can attach
SWCLK

1 9 2 2
SWDIO

GPIO1 4 GPIO1 7
GND

2 0 2 1
GPIO1 5 GPIO1 6 SPEAKE R
headphones or powered speakers to listen in. A 74CBTLV3253
41
42
43

rotary encoder and buttons are used to select the 4:2 analogue
multiplexer
desired radio frequency, with the interface info
amplitude phase and frequency. Having both I and Q displayed on an OLED screen. Wire stripper/
enables us to tell whether the signal frequency was cutter tool
and wires
higher or lower than the local oscillator and by how SOURCING THE PARTS
much. The dual op amp also subtracts one signal from The main electronic components required for the Capacitors: 2×
another and amplifies the result by around 800. The build are standard through-hole fare (with one 200pF, 1× 10nF,
4× 56nF, 3×
capacitor in the feedback loop works as a low pass exception that we’ll come to) and most are fairly easy 100nF, 1× 470nF,
filter, removing signals above 12kHz. to find from the usual online retailers at little cost. 3× 10μF, 1× 100μF
Running Jon’s custom firmware, Raspberry Pi After delving around in the bits box and discovering
Resistors: 4× 82Ω,
Pico does some clever stuff such as oversampling that his existing capacitor and resistor selections 1× 100Ω, 1× 1kΩ,
the signals to remove unwanted alias signals. didn’t contain all the values needed – including the 2× 10kΩ, 2× 56kΩ
smaller capacitors – your
128×64 0.96-inch
author bought a couple OLED
more component kits on
2× push-buttons
Amazon. Even then, the
(momentary)
56nF (563) capacitors
needed for the Tayloe Rotary encoder
detector were not 3.5mm stereo
present, so these had to headphone jack
be sourced separately Radio antenna,
such as a
YouLoop
or similar
Left
The wiring diagram Wideband LNA
for the SDR. Pico’s 3V3
pin powers the main BNC (or SMA)
circuit via a 100μH
inductor to help handle female antenna
any current fluctuations connector

Software-defined radio magpi.cc 81


TUTORIAL

QUICK TIP
Below
Confused by Here, the main circuit is shown without the ICs present, enabling
ceramic capacitor us to see more clearly the wiring and components around them
codes? You can
discover the values
they represent
with this handy
calculator at Circuit
Digest: hsmag.cc/
CapCalculator.

Right
The wiring diagram for
the SDR. Pico’s 3V3
pin powers the main
circuit via a 100μH
inductor to help
handle any current
fluctuations

Below
A hands-free
magnifier is very
useful for getting a
close-up view for
the surface-mount
soldering of the
multiplexer IC to a
through-hole adapter


on eBay – they’re of the polyester film variety, but
The soldering process for assembling the circuit that shouldn’t matter. Similarly, any of the ceramic


capacitors in Jon’s build can be substituted with other
on a protoboard is fairly simple types, including electrolytic ones for the higher values
(but check the polarity is right for those).
Most of the other electronic components we
ordered from DigiKey, but should be stocked by other
specialist electronics suppliers. These included the
two IC (integrated circuit) chips: the 74CBTLV3253
4:2 analogue multiplexer and MCP6022 dual op amp.
Unfortunately, the multiplexer is only available in a
surface-mount package (with 0.65mm pin pitch), so
needs to be soldered to a suitable 16-pin SMD to DIP
adapter (e.g hsmag.cc/SMDtoDIP) for breadboard
use. This requires some fiddly surface-mount
soldering, which we’ll come to later.
For the display, any standard I2C OLED screen will
work. We opted for a mini 0.96-inch one, as specified
in Jon’s design. The push-buttons and rotary encoder
(not a potentiometer) for the controls can be sourced
easily, along with the 3.5mm audio jack.

MAKING THE CIRCUIT


Helpfully, Jon has provided a wiring diagram and
schematic on the project page, along with photos
of the main circuit, reproduced here with his kind

82 magpi.cc Software-defined radio


TUTORIAL

permission. The combination of photos and schematic


should enable you to recreate it on a prototyping
breadboard. You could use a solderless breadboard
to lay out the circuit and test it before going on to
solder it on protoboard. You’ll need to really check the
connections are solid in each hole. You will still need
to do some soldering to connect the surface-mount
analogue multiplexer chip to a through-hole adapter
– see the ‘Surface-mount soldering’ box below. We’d
advise using protoboard for the final build.
If using a solderless breadboard, you can simply
plug Raspberry Pi Pico and the two ICs (one with
an adapter) into it. For protoboard, it’s advisable to
solder DIP sockets or female headers, into which
you can plug the Pico and ICs, so you can swap them
out later if needed.
Compared to the surface-mount soldering for the
multiplexer, the soldering process for assembling
the circuit on a protoboard is fairly simple. Just take
your time and make sure the components are placed
and connected correctly, referring to the photos and ARE YOU RECEIVING?
Above
schematic (Figure 1). Note that the latter contains With the main circuit built, you will be ready to flash The schematic for
an optional band pass filter. Check you’re using the the custom firmware (from Jon’s GitHub repo) to Pico the Pico SDR. Note
that, unlike the wiring
correct value capacitors and resistors in each position. and connect a suitable antenna, such as a YouLoop- diagram, this includes
a placeholder for
You can cut the leads to the required length after style one, via a wideband LNA – powered by a 9V an optional band
poking them through the holes and soldering. battery – to boost the signal. For more details on how pass filter between
the antenna and
The op amp and multiplexer through-hole adapter to connect and position the antenna, use the interface multiplexer
may have pin labels. If not, a small dimple on the for tuning, and what you can do with this low-cost
top signifies pin 1, and the remaining pins are then SDR, stay tuned for next issue’s second instalment!
numbered anticlockwise. You can also refer to the
ICs’ datasheets to double-check pin functions referred
to in the schematic.
SURFACE-MOUNT SOLDERING
Jon’s circuit layout includes a couple of female Since the 74CBTLV3253 4:2 analogue multiplexer is only available as a surface-mount
headers for an optional band pass filter, such package, you’ll need to solder this to a through-hole adapter. Make sure the latter has
as those available from QRP Labs at shop.qrp- a 0.65mm pitch for the pads on the top, to match that of the multiplexer pins. Naturally,
labs.com/BPF. You can bypass this and the SDR the adapter’s pins on the bottom should have a 2.54mm (0.1in) pitch to fit a standard
will still work fine without it, although you may breadboard.
experience some interfering stations appearing Your author had never attempted surface-mount soldering before, so this was new
where they shouldn't be. territory. A hands-free magnifying glass with a light proved very helpful for getting
a closer look at the tiny components. Branchus Creations’ YouTube tutorial
(hsmag.cc/SMDsolderYT) was also a great help.
Below To start, cover the adapter’s pads generously with a tacky liquid solder flux. Following
Built on a prototyping breadboard, Jon’s circuit includes female this, use anti-static tweezers to position the IC on top of them, making sure all the pins
headers to add an optional band pass filter are aligned correctly with the pads.
With the soldering iron on a high heat (around 420°C), melt a blob of solder onto
the tip Then, holding the chip in position with the tweezers, solder one of the
corner pins. Check again that the pins are well aligned, then solder the corner pin
diagonally opposite.
With the chip secure and the pins aligned, you’re ready for some drag soldering to
connect the remaining pins. Holding the solder wire (preferably 0.5mm or thinner) in
one hand and the iron in the other, move quickly along the pins to solder each one to
its pad. If you get a solder bridge between two or more pins, you can usually remove it
with the iron, or use a desoldering pump if needed.

Software-defined radio magpi.cc 83


TUTORIAL

01
Make your own
programming language:
Running programs
Create your own programming language

W
e use programming languages acts on them. The input to the Python-Ish interpreter
to tell computers what to do. program is a string of Python-Ish statements. Let’s
There are lots of different ones look at one:
and most programmers know
move 100
a few. But how does a
programming language work? The Python-Ish statement above can be loaded
And how do you make one? Let’s find out by looking at into a robot and will run. It would make a robot move
Rob Miles
Python-Ish, a language created by the author that runs forwards 100mm. This language looks simple enough,
@robmiles on any computer that supports C++. It works on but adding more move statements would very
Arduino devices and on ESP-8266, ESP-32 and quickly fill up the 1,000-character storage available on
Rob Miles has been Raspberry Pi Pico. the Arduino Uno used in the first Pixelbots. So, the
playing with hardware
and software since
In this part we're going to focus on how programs interpreter converts this statement into ‘low-level’ code.
almost before there was run on a robot. In the next part we’ll work with higher It does this by searching through a list of high-level
hardware and software. level Python-ish statements. You can find all the source command names and finding the low-level command
You can find out more
about his so-called life at code for Python-Ish and how to build a Pico-powered sequence that matches it. We will discover more about
robmiles.com. robot here: hsmag.cc/pixelbot how this works in the next article in this series. For
now, we are more interested in just how we get the
IT STARTED WITH A ROBOT low-level to run.
CREATE Figure 1 shows a Hull Pixelbot. You can find out
FOR FUN more about these in HackSpace magazine issue 74: LOW-LEVEL CODE
hsmag.cc/74 The first versions were programmed in Below you can see the ’low-level‘ code that represents
Creating C. To make a Pixelbot do something new you had to the above move.
something plug it into a PC and install an updated C program. The
“because it mf100
author wanted to be able change robot behaviour by
seemed to be a
good idea at the just sending new instructions, so he thought it might be This ’low-level‘ code is smaller than the original
time” happens a good idea create a language for this. The processor program. It is also much easier and quicker to decode.
surprisingly inside the first Pixelbots had limited space for memory Rather than having to recognise the word ’move‘
often in the and programs, so the language had to be very simple. a program can use the first character to work out
computer world. the type of command (in this case ’move‘) and the
Both Python and
WHAT IS PYTHON-ISH? second character to work out which command is to be
Unix, along with
Figure 2 shows what Python-Ish was built for. You can performed. We can start by using a C language switch
a huge number
of other things use it to create a program that takes input from the construction to choose a particular action based on the
we use today, distance sensor on the front of the robot and controls first character of the statement:
originated in the Motors, Pixel and Sound elements on the robot.
this way. switch (commandCh)
The Python-Ish program is an interpreter. It is a large C
{
program that accepts Python-Ish instructions and then

84 magpi.cc Make your own programming language: Running programs


TUTORIAL

case 'M':
case 'm':
remoteMoveControl();
break;
case 'P':
case 'p':
remotePixelControl();
break;
case 's':
case 'S':
remoteSoundPlay();
break;
...
}

The code above shows how the first character of a


command is decoded using the C switch construction.
The variable commandCh contains the first character
of the statement being decoded. The switch works on each statement in a program runs. Now we need
this value. Each case in the switch specifies a selection to discover how the program itself is stored inside Figure 1
It’s called the Hull
value. If the value in commandCh matches that value, Python-Ish. Pixelbot because it
the code in that case is performed. In other words, was created in the city
of Hull in the UK
if commandCh contains ’m‘ the remoteMoveControl STORED CODE
function is called. When the remoteMoveControl Figure 3 shows how a Python-Ish program is loaded
is called it moves on to the next character in the into computer memory. Each memory location holds
command and repeats the process: one character of the program, and memory locations
are numbered. Memory location 1200 contains M,
switch (commandCh)
location 1201 contains F and so on. The variable
{
decodePos is declared as a C pointer that can point
case 'F':
at a particular location in memory. A pointer holds the
case 'f':
number of a particular memory location. You can see
remoteMoveForwards();
that decodePos in Figure 3 holds the value 1200.
break;
case 'R': char *decodePos;
case 'r':
Putting a ‘*’ in front of a C variable name causes it
remoteRotateRobot();
to be declared as a pointer. We can ‘de-reference’ a
break;
pointer in a program by using ‘*’:
case 'S':
case 's': char commandCh = *decodePos;
remoteStopRobot();
The statement above sets the character variable
break;
commandCh to the contents of the location that
...
decodePos presently points at. If the values are set as
}
in Figure 3, this would set commandCh to ‘M’.
In the code above the value of commandCh has been We can move down to the next location in memory
updated to hold the second character in the statement, by adding 1 to the value in decodePos:
so that the remoteMoveForwards function is called
decodePos = decodePos + 1;
when the statement ‘MF’ is performed. The remainder
of the MF statement specifies the distance that the This makes it very easy to create C programs that
robot should move. Code in the remoteMoveForwards move rapidly through the memory of a computer.
QUICK TIP
function decodes this value and then starts the motors We now know how Python-Ish low level instructions From these code
samples you can
turning. There is a family of move commands, a family are structured and how they are decoded in memory.
deduce that program
of pixel commands and a family of sound commands. Now we need to know how the Python-Ish keeps commands can be
We can add new language behaviours by adding new track of which statement is being performed when the in capital letters or
case elements to the switches. We now know how program runs. lower case.

Make your own programming language: Running programs magpi.cc 85


TUTORIAL

Figure 2
The first robots only
have distance sensor
inputs, but other
inputs can be added

QUICK TIP JUMPING FOR JOY


Python-Ish programs are stored in non-volatile
You need to be very
careful when using C memory (EEPROM) on the host device so that the
pointers. If you forget code is retained when the power is switched off.
to de-reference a When a Python-Ish program is running each program
pointer (miss the statement in turn is fetched from this memory and
* off) or try to de- decoded as we have seen above. A program counter The code above would make a robot repeatedly move
reference a pointer
variable keeps track of the current statement being forward and rotate 90 degrees. It uses three control
that has not been set
to a sensible value executed from EEPROM. instructions. The first one is CL which creates a ‘label’.
your program will Sometimes a program needs to change its behaviour This is a point in the program code that can serve as the
probably crash. in response to a data value (an ‘if’ construction) or some destination of a jump instruction. The second control
statements need to be repeated (a loop). This means instruction is CA. This instruction causes a program to
that Python-Ish must support labels and jumps. To do pause while a move completes. It is possible for the
this we need to have some instructions that control robot to move while the program is running, so if the CA
program execution. The low-level commands that statements were omitted the robot would go directly
control what a program does start with the letter C, for from the move to the rotate. The third control instruction
control. Below is a program which uses these to make is CJ which performs a jump. When a jump is performed
a robot repeatedly move in a square. Comments have the Python-Ish interpreter searches through the program
been added to explain each statement. text for the destination label and then continues running
the program from the statement following the label.
CLl1 create a label called l1
There are also control instructions which can be used to
MF100 move forward 100 mm
make a decision based on the value in a variable
CA wait for the move to complete
MR90 rotate the robot 90 degrees CCcount<10,l2
CA wait for the rotate to complete
The statement above is testing to see if the value
CJl1 jump to label l1
in the variable count is less than 10. The CC (Control
Compare) instruction is followed by something which
can be true or false. If the expression is true the
KEY SKILLS program will jump to the given label. In other words,
You might think that to create a programming language execution will move to l2 if the value in count is less
such as Python-Ish you’d need to have lots of than 10. There is also a CF (Control False) instruction
complicated programming skills. However, this is not which will jump if an expression is false. Now that
the case. There are two fundamental programming we know how to compare variables, the next thing to
QUICK TIP activities that are used inside Python-Ish. These are:
understand is how variables work.
The program • Choosing an action based on a particular value.
probably won’t be • Searching for something in a list.
stored at memory
MAKING MEMORIES
location 1200, this If you know how to do these things you can create your The V family of commands manages variables in
value is just for own programming language like Python-Ish. Python-Ish. The VS command sets a variable to a
the example. particular value.

86 magpi.cc Make your own programming language: Running programs


TUTORIAL

VScount=0
Figure 3
The statement above would set a variable called The terminator
character is a
count to the value 0. If count does not exist it special value which
identifies the end
is automatically created. Variables are held in a of a statement
variable structure.

#define MAX_VARIABLE_NAME_LENGTH 10

struct variable VARIABLE VARIATIONS


{
You might not think you could have much fun with
bool empty;
variable names, but the author thinks that you can.
bool unassigned;
When Python-Ish is looking for a variable in the
// add one to the end for the terminating zero variable list it searches for a variable with a matching
char name[MAX_VARIABLE_NAME_LENGTH + 1]; name. Shorter variable names are quicker to work
int value; through, so you could speed up a Python-Ish program
}; by shortening the names of your variables. The author
once wrote a program that scanned through code
A C struct (structure) is a way of bringing several replacing variable names with shorter ones to maximise
items together to make a named lump of storage. The speed and minimise size. The BBC Microcomputer from
variable structure contains two flags called empty and the 1980s (created when memory and computer power
unassigned. It also contains an array of characters to were in very short supply) contained an interpreter for
the BASIC programming language that used 26 lists of
hold the name of the variable. Finally, it contains the
variables, one for each letter. Programmers wanting
value in the variable, as an integer. to get the most out of the machine would spread their
variable names around the alphabet.
#define NUMBER_OF_VARIABLES 20
variable variables[NUMBER_OF_VARIABLES];

The code above creates an array of variables. variables. Python-Ish also has special system variables.
Python-Ish programs can have up to different 20 These are built-in to the language. Their names start
variables. When the interpreter sees an assignment with the @ character. They can be used to get values
statement it searches the variables list for a variable from sensors into a running program. The variable
with that name. If the variable is not found the @distance returns the current distance reading from
interpreter creates one. The interpreter can use the the distance sensor. QUICK TIP
empty flag in a variable to find empty locations in The #define
VSd=@distance
the variable array. When a variable is created, its statement creates
unassigned flag is set to True. The flag is set to False The statement above would set a variable called ‘d’ a ‘macro’ telling C
when a value is assigned to the variable. This means to the current distance reading. to substitute the
that Python-Ish can detect when a programmer tries string on the left
(MAX_VARIABLE_
to use a variable before they have put a value into it. If PYTHON-ISH POWER
NAME_LENGTH)
we want to perform calculations the item following a The author thinks that there is nothing quite like
for the value on the
variable name can be a simple expression: making your own programming language. You get that right (10) when the
Frankenstein moment when you make something program is built. This
VScount=count+1
that is kind of alive and can follow instructions that makes programs
The statement above would add 1 to the value in you give it. He also likes the idea that once you clearer and makes
count. The expression in this statement (the part after have built a language of your own there is less it easier to change
values, for example if
the ‘=’) takes two values (in this case count and 1) and magic about other programming languages. You can
we needed to build a
performs the operator (in this case ‘+’). The result is start to understand how they work too. In the next version of Python-Ish
then set in the count variable. There are also variable instalment we’ll discover how to use our low-level that supported longer
commands which can be used to remove all the from Python-Ish code. variable names.

Make your own programming language: Running programs magpi.cc 87


TUTORIAL

String art
Create a piece of retro-chic art for
your walls and step back to the 1970s

A
n abiding memory from this
author’s childhood is of a Above
For a first attempt, we were happy with this. There really is no
picture that hung on her wrong way to thread and weave around the nails; just don’t let
grandmother’s wall. It was a the string slacken, as poor tension will ruin the picture. You can
even try threading two strings around the image, one on top of
piece of string art that her uncle the other, to give more depth
had made, and took the form of
Nicola King a geometric shape constructed of white thread geometric patterns. Given the recent trend in this
tightly strung around a number of tiny nails on a author’s articles to cover crafts that have a distinct
@holtonhandmade
black background. If you were to ask this particular crossover with mathematics (we’ve looked at
writer what encompasses the 1970s to her, that tessellations and mathematical shapes made from
Nicola King is a freelance
picture, along with the general unfathomable yarn, to name but two), a dalliance with string art
writer and sub-editor.
She’d like to qualify penchant towards brown/earthy-toned décor, seems highly appropriate. In fact, if you take a look
this piece by reiterating would be her answer. at the ‘Ahead of the Curve’ box, you’ll see that
that she was very (very!)
young in the 1970s, and
In this tutorial, we are going to take a look the invention of this art form has been credited
barely remembers the at string art, a pastime which essentially uses to a female mathematician way, way before its
decade… really! coloured string, yarn, or thread of some kind, along better-known 1970s revival. As Mary Everest Boole
with some nails and a board, to create various was aware many decades ago, you can obviously

88 magpi.cc String art


TUTORIAL

Left
These are the basics
that will be required
to get started.
Remember that the
size of your board
will dictate the size
of the pattern that
you can use. You
can also paint or
stain the wooden
board your preferred
colour before you
get stringing, but
do leave a decent
make shapes such as squares, triangles and so on
with string art using straight lines, but you can also
STRING ART’S ZENITH length of time for
it to dry before you
set to with your
make things like beautiful parabolic curves with lots We’ve alluded to the fact that the high point of string
hammer and nails!
of straight lines positioned in a certain way. This art’s popularity occurred some decades ago. A
was, and still is, a great way for children to explore company that was central to the rise of stringing up a
geometric shapes and enhance their fine motor piece of art for the wall was Open Door Enterprises, YOU’LL NEED
skills, but you might want to undertake any required an American business that really saw the potential
for a string art craze in the 1970s, and was a leading Nails
hammering of nails.
distributor of hobby craft-type kits to the masses. A hammer (for
John Eichinger, a US artist, created some geometric use with nails
NAIL IT string designs in the late 1960s, labelling them ‘string and wood base)
In terms of the wood that you need to use for a mandalas’, and some of these were marketed by Open
A suitable board/
project like this, plywood works really well, and our Door Enterprises. A huge number of such kits were
base (e.g. plywood)
Pictures With Pins ‘manual’ suggested it should sold around the world during that decade, although
have a depth of at least 13mm. Our wood piece is many are now probably in people’s garages or lofts, or ‘String’ (string,
languishing in a charity shop. thin yarn,
20cm by 20cm square, and we decided to leave it embroidery
A lot of those vintage 1970s kits had black or brown
blank before we started working on it. If you want thread, raffia etc.)
backgrounds to them, often a black felt or velvet or
to decorate the base in any way, such as covering sometimes burlap, which certainly tallies with this Printed template
it with fabric, felt, or even a 1970s-vibed hessian, author’s memory of the piece on her grandmother’s (the design for
wall. If you scout sites like Etsy and eBay, you can your picture)
then ensure that you do that before undertaking the
steps below. With your base and pattern template probably find an original retro kit if you are craving true Adhesive tape
1970s authenticity. Owls and other birds, dragonflies,
to hand, you’re ready to get underway. Pliers (optional)
and ships and sailing boats seemed particularly popular
It’s always a good idea to have two copies of options, and one of things that stands out about these Squared graph
your pattern to hand, as one will be taped to the 1970s creations is that they were very geometric, in paper/pencil
board and then removed, but the other can be used as much as straight lines were often used to form (optional)
for reference while you string your piece. If you elaborate shapes, whether that was a starburst design
or a very angular-looking vase. Fabric (for
search online, you can soon find a multitude of free covering board
template patterns to work from or, alternatively, – optional)

String art magpi.cc 89


TUTORIAL

QUICK TIP draw up your own idea on a sheet of squared paper


As a first project, to make something really personalised. If you do
try to use an make your own pattern, it’s worth knowing that the
image or pattern generally accepted spacing distance between each
that has simple, nail appears to be around 1cm – so mark these
uncomplicated
points on your pattern with a pencil. We used a
outlines. It will
be quicker to design that came with a very inexpensive kit, and
complete and you’ll 1cm was the spacing that it followed.
avoid ‘first project Stick your design to the right side of your board
failure’ syndrome. with some tape, and then begin to hammer the
nails into each dot, through the paper, along the
perimeter of the shape. Don’t hammer the nails
in too deeply – just make sure they are all at the
same depth and are fully stable within the board.
We used one-inch nails and found they worked
perfectly. Some makers like to match the colour of
their thread to their nails but, for your first piece
Right we’d suggest that’s really not necessary.
If I had a hammer! Try
and hammer the nails We used a fairly lightweight hammer to first
in as straight and gently tap them in, and then to properly embed
true as possible. This
pattern used just over them in the base. You really don’t want to be using
a hundred one-inch a hammer that is too heavy for this task. You could,
nails. Pictures With
Pins even suggests if you wished, also use a depth gauge to make
making an image
purely from nails,
sure that the nails are all the same height once
filling in the middle hammered in – a small block of wood would be a
of an image with
nails too. Frankly, great hack for this.
that’s a lot of precise
hammering and
potential finger STRING IT OUT
bashing, and their Now that the nails are in place, the next step is
examples weren’t
that attractive! to remove the paper that you taped to the board,

AHEAD OF THE CURVE


Mary Everest Boole (1832 – 1916) was the wife of English mathematician George Boole,
himself a pioneer in the application of mathematical ideas to logic, and the man who had
Boolean algebra named after him. Mary was an accomplished mathematician in her own
right and one who particularly enjoyed algebra. She actually laid the foundations of modern which is much easier to do now before you start
string art with her ‘curve stitching’ or ‘string geometry’ technique, and is regarded by many stringing rather than later when your piece of art
as the inventor of string art. is complete. If any small pieces of paper are stuck
Mary was somewhat ahead of her time when it came to teaching children mathematics, around the nails, use your pliers, or even some
and favoured a progressive, direct, hands-on learning approach. In order to convey
tweezers, to pull them gently away.
mathematical ideas and patterns to young people so that they could grasp them better,
specifically algebraic curves and the geometry of angles and spaces, she used curved If possible, get a long length of string ready, or
stitching, or the practice of stitching coloured threads through a pattern of holes pricked whatever thread you are using, as this will mean
in cardboard. This made learning for her students a much more interactive process. that you won’t have to make as many joins later in
In 1909, Mary Everest Boole published a book called Philosophy and Fun of Algebra your work. Joining one piece of string to another
which was something of a groundbreaking work at the time as it presented algebra as needs to be done very carefully once you are
a mathematical subject, but also as a tool for developing problem-solving skills. Given
underway, as joins should really be made at a nail. If
that it was published some time ago, it’s generally agreed that her writing style was very
engaging and accessible, and this book is still used and referenced today. you make too many joins throughout the piece and
Overall, it can be argued that devoted mathematician Mary Everest Boole was don’t try to hide them, your picture will be marred
something of an innovator in both the fields of women’s education and the development by some unsightly knots.
of mathematics, with her creative teaching techniques that aimed to stimulate geometric The 1970s book that we procured – Pictures
imagination and her belief that logical thinking was empowering. With Pins – contains very precise and detailed
information on how to thread each picture. They

90 magpi.cc String art


TUTORIAL


map out the design with a kind of numbering
system and direct the maker from C3 to C4, A5 to The generally accepted Above
A8, etc. If you want to create a complicated design, The ‘string’ that
spacing distance between you use will have a
then precise directions are probably needed, but lot to do with how
contemporary string art kits or the DIY approach each nail appears to be the picture turns


out. Something in a
can be much more haphazard and random, so don’t
around 1cm nylon, for example,
might have more of
worry that the threading element is going to be a shine to it than a
overly complicated. hemp or parcel string,
so it might reflect
Tie your thread or string to the first nail, securing light better
with a knot, and leave a decent length tail for tying nails inwards, and they could even come out of the
off when you are finished. We now want to outline base. Just pull the thread so it fits snugly around
the perimeter of the image with our thread. We each nail but is not too tight – practice will help
decided to use an embroidery thread, and used with finding your rhythm.
all six threads, as removing any would mean our
thread was weaker and could possibly break when FILL ME IN
pulled taut. With the outside of the shape now defined, you
Your choice of thread or string will depend very can then start to fill in the middle area of the
much on what you want your finished project to pattern, criss-crossing and wrapping from one
look like, and whether you want a thin, delicate nail to another, and it’s completely up to you how
look, or something more rustic. You only need to you fill in your design. You can be very methodical
make one wind around each nail as you go, and about filling the inside and follow a pattern or, as
it’s important to remember not to pull the string or seems to be generally a more popular approach
thread too tightly as you go or you risk forcing your and the one that we used, you can simply adopt a

String art magpi.cc 91


TUTORIAL

ADD A STRING TO YOUR BOW Above


Dating from string art’s 1970s upswing period, this second-
hand book purchased for £1 (!) contains designs for ‘thread
This might be the cheapest, easiest, and most accessible new hobby idea that we’ve sculptures’ of goldfish, snowflakes, goblets, the signs of
ever written about – you only need a board, some nails, and something to wind around the zodiac, and a ballerina, to name just an eclectic few. If
them. It could also prove to be an interesting side hustle, as a quick search of Etsy found you are looking to add a 1970s vibe to your décor, this is the
book for you
plenty of examples of people making string art and selling it… just saying! So, if you are
now keen to give string art a go, here are some ideas for useful resources that might help
you tie up your new hobby:
completely random, unsystematic approach and run
• Buy a kit – if you don’t own all of the items required, an inexpensive craft store kit will the thread wherever you please, making the inner
suffice, although you will probably need to find your own hammer. We had no idea that part as sparse or dense as you wish. Keep going
so many kits actually existed until we searched online, so the craft clearly appears to until you’re happy, then tie off the end with a knot
be having a resurgence. Prices are very reasonable, so they can make a great holiday when you’re finished. Snip off any stray thread
gift idea – hsmag.cc/StringArtKit.
tails, or try to tuck them inside your work, and you
• Borrow a book on the subject – once again, your local library might be a good source are done!
of knowledge, and you can always order a book from another library if your nearest So, if you’re tempted to create a piece of art
does not have it. Or, scour those charity/thrift stores to see what crafty volumes they from string, give it a go. Some contemporary
have hidden on their shelves. As well as Pictures With Pins (1974) which might now be string art kits do reflect that geometrical obsession
a little tricky to get hold of, another appropriate tome might be String Art Symmography of the 1970s, but they also give makers a chance
(1971) by Lois Kreischer – 3D creative string art designs that positively scream 1970s!
to show their creative freedom. The work of
A more contemporary read would be DIY String Art (2016) by Jesse Dresbach, or The
String Art Dot-to-Dot Book (2019) by Patricia Moffett.
some of the exciting current string art artists and
creatives includes many ultra-modern patterns,
• Take some inspiration from contemporary artists who are pulling the strings of this and often exhibits their own mathematical
art form into the modern day. Gabriel Dawe, for example, is a Mexican artist based in perceptions, so seek some modern inspiration
Dallas who is renowned for his ‘Plexus’ installations – take a look at these and you’ll from their stringing skills.
never see thread in the same way again (hsmag.cc/Plexus). Or, how about self-taught The basics of string art are not difficult to grasp,
string artist Ben Koracevic, whose string art images encompass the fields of icons,
no special skills are required, and a complicated
culture, nature, and even cities (stringometry.com and hsmag.cc/TheStringArtGuy)?
picture does not require any more expertise than
• Find some free templates to use to get you underway quickly. Alternatively, you a simple one, just more time and, of course,
can pay a small amount for slightly more complicated patterns… the choice is yours more nails and string. Latch on to the basics of
– hsmag.cc/StringArtPatterns. the craft, and then let your senses for colour and
texture take over.

92 magpi.cc String art


REVIEWS

ONLYTHE
BEST
RP2350 Boards
Unleash the power of the RP2350 microcontroller with these boards

By Phil King

T
he chip that powers Raspberry Pi Pico
2, the RP2350 microcontroller, has
also been used in an array of third-
party boards, while even more are in
the works. The RP2350 itself offers a
considerable upgrade over the original
Pico’s RP2040, featuring dual Arm Cortex-M33
processor cores running at 150MHz (vs 133MHz),
520KB of on-chip SRAM (vs 264KB), and 12 PIO
state machines (vs eight). So it offers a performance
boost and is better at handling more complex
computational tasks.
Not only that, but there’s the bonus feature of
two open-hardware Hazard3 RISC-V cores which
can be substituted at boot time for the Cortex-M33s,
so you can switch between them depending on
your needs.
All of this means that RP2350 offers a whole lot
of power and flexibility, resulting in a wide variety
of boards and other products making use of it.
We take a look at just a few of them here, but
you can check out the full product catalogue
at hsmag.cc/rp2350catalogue.

94 magpi.cc Best of Breed


REVIEWS

Pico Plus 2 vs Pro Micro – RP2350


PIMORONI £13 / $14 pimoroni.com SPARKFUN £14 / $15 sparkfun.com

P
acking extra features over a standard
Raspberry Pi Pico 2, this is one of
the few third-party products to be
based on the RP2350B variant of
the microcontroller chip, which
offers an extra 18 GPIOs and four
additional analogue inputs.
Some of those extra GPIOs are broken out here via
an eight-pin SP/CE edge connector for hooking up SPI/
serial devices – located on the rear, it means the board
won’t quite sit flat. There are also QW/ST and Debug
mini headers on the top. Other than that, it maintains
the standard Pico form factor and 2×20-pin layout, so
is compatible with existing Pico add-ons.
Other notable upgraded features on the Pico Plus 2
include a handy reset button, 16MB of QSPI flash
supporting XIP (execute in place), and 8MB of PSRAM. Left
The Pico Plus 2
The boot button also doubles as a user button. maintains the
If you need wireless connectivity, there’s a Pico standard Pico layout
while adding extra
Plus 2 W variant with 2.4GHz Wi-Fi and Bluetooth. pins and features

VERDICT

A
Pico Plus 2
s the name suggests, SparkFun’s Pico Plus 2. Other features include a handy reset
Plenty of RAM,
general-purpose RP2350 board button, WS2812 RGB LED, and red power LED.
flash storage,
has a more compact form So, unless you need a whole lot of pins, this board and extra
factor than Pico (and thus is a good compact option, though not the smallest features to
Pico Plus 2) – 33×17.8mm on the market. play with

9 / 10
(1.3×0.7in), matching other
products in the firm’s line-up.
A downside of this is a reduced 24-pin layout (the
same as on the earlier RP2040 version of the Pro
Micro), so only 18 GPIOs are broken out on the Arduino Make
edges, plus a couple more via a Qwiic connector. This Your UNO
also means that the RP2350’s HSTX (High-Speed A compact
Serial Transmit) mode is not supported. board with
Still, there are four analogue inputs extra features,
on offer, along with two UART but a reduced
interfaces and SPI, plus I2C via pin layout.

8/ 10
that Qwiic connector. Above
The board also packs 16MB of flash A smaller board
with fewer
storage and 8GB of PSRAM, matching pins broken out

Best of Breed magpi.cc 95


REVIEWS

Thumby Color
TINYCIRCUITS £38 / $49 color.thumby.us
Above
Is this the tiniest
games console
in the world?

A
major upgrade over the original larger buttons. Both feature a LiPo rechargeable battery
Thumby itty-bitty games console, for around two hours of portable power. VERDICT
this mini marvel features a vibrant The power of the RP2350 chip enables the Thumby Thumby Color
0.85-inch colour TFT LCD screen Color to run fairly complex games with full-colour A tiny, fully
with 128×128 resolution. While its graphics and sound – via a tiny speaker. Its 16MB of functional
predecessor had a Game Boy-style flash is preloaded with six games, including Bust A games console
design, the Thumby Color resembles a miniature Thumb, 4 Connect, Solitaire, and Thungeon II. They’re that you
Game Boy Advance. fun to play, although you may need to hold the screen can program

9 / 10
It comes in two versions: the standard KickStarter up close to see the detail!
model with a plastic case (featuring a hole to attach a Best of all, you can program your own MicroPython
keychain), and the developer version with no case but games for it in an online code editor or a standard IDE.

96 magpi.cc Best of Breed


REVIEWS

XIAO RP2350
SEEED STUDIO £4 / $5 seeedstudio.com

S
ometimes you need something a
little smaller to fit into a tight space
for your compact project, such as a
wearable. For this, there are a few
RP2350 boards that may suit, including
the Pimoroni Tiny 2350, Phyx Rick TNY,
and Seeed Studio RP2350. Above
Seeed’s board packs an incredible number of This tiny board VERDICT
breaks out more
features into the firm’s XIAO form factor, with the GPIOs on the rear Proof that
board measuring a mere 21×17.8mm. While this good things
only leaves room for 14 pins, including 11 GPIOs, a the board has a battery management system with can come in
further eight GPIOs are broken out via tiny connector direct battery voltage measurement. small packages

8/ 10
pads on the rear. Other notable features include (annoyingly) tiny
There are also rear pads to connect a battery. With boot and reset buttons, three LEDs (including an
ultra-low power consumption (27μA in sleep mode), RGB one), and 2MB of PSRAM.

PGA2350
PIMORONI £9 / $10 pimoroni.com

W
e mentioned the RP2350B
variant of the microcontroller
chip earlier. On the PGA2350,
Left
every single pin is broken out One for the more
in a PGA (pin grid array) form advanced user,
it breaks out
factor – all in a 25.4mm square every single pin
footprint. It also packs 8MB
PSRAM and 16MB of flash.
There are 64 unpopulated pins in total. Of these, 48
VERDICT
can be used as GPIOs – 18 more than a standard Pico PGA2350
2 – and eight double as analogue inputs. Ideal for delving
Standard 2.54mm (0.1in) Pico pin headers can be deeper into the
used to populate the holes. Note that there’s no USB GND pins with a piece of wire/metal to put it into RP2350B chip

8 / 10
connector, though, so you’ll need to wire up a USB boot select mode to flash the firmware. Mind you,
breakout to start programming it. There’s no boot it is aimed at advanced users wanting to start
button either – you have to connect the BS and building their own boards.

Best of Breed magpi.cc 97


REVIEWS

Perpetuo LoRa
MELOPERO £21 / $27 melopero.com

R
P2350 boards – including Pico 2 W
– are now emerging with embedded
Wi-Fi and Bluetooth connectivity.
But if you need something with a
longer range, the Perpetuo LoRa is a
good option to communicate with a
LoraWAN network gateway – for instance, using a
LoRa HAT on a Raspberry Pi computer.
Equipped with a LoRA radio module, the Perpetuo PICO JUMBO
operates on the UK/European standard 868MHz
carrier frequency, offering robust long-range Below
communication once you add an external RF antenna. Long-range connectivity PIMORONI £16 / $17 pimoroni.com
on the 868MHz band
With a low-power mode, it’s also energy efficient. for IoT projects
Power is provided by a LiPo battery (not supplied) How’s this for a bit of fun? A jumbo-size Pico 2 board!
Measuring 180×73.5mm, it breaks out all the pins from a
rechargeable via the USB-C port, and it
standard Raspberry Pi Pico 2 soldered to the rear. You
can be used with an optional solar can use crocodile clips to connect electronic circuits to
panel, to keep the board running them. There’s also a handy reset button. It’s not very
indefinitely when it’s off-grid. A practical, but could be useful in an educational setting.
Qwiic connector makes it
easier to add a sensor,
too. There are also
32 standard
pins, including
20 GPIOs.

VERDICT
Perpetuo LoRa
Power-efficient
long-range
communication
for European
users’ projects

8 / 10
98 magpi.cc Best of Breed
BUY ONLINE: magpi.cc/picobook
FEATURE

Gift
a project
Give makers the present they
really want – something to build

S
ometimes the perfect gift doesn’t exist.
Sometimes that means you have to make it.
Sometimes the person better suited to the
job of making this perfect gift is the person who
will receive it.
For makers, constructing their own gift can be very
exciting. Normally it’s just pre-packaged kit but giving

By g if t elf
them a big project to put together is even better. We
thought we’d highlight a range of great projects for

Rob Zwetsloot
different interests that are also fun to build.
On a budget? We’re breaking down the prices so
that you can make a more informed decision too.
Let’s get gifting.

Buyer’s guide
Want a one-box gift? Check out
our Gear Guide on page 38 for
cool gifts for any skill level or age!

100 magpi.cc Gift a project


FEATURE

Gift a DIY
games console Making a handheld console can
be as much fun as playing one

Apple Pocket Pi Shopping List


Raspberry Pi Zero 2 W £14/$15

link: magpi.cc/applepocketpi MicroSD card £10 / $13


tools required: 3D printer, soldering iron Waveshare 2.4” screen £13 / $17

Custom motherboard £18 / $23

T
USB-C breakout board £3 / $4
his cool little handheld project features
some great manual making and Warning! Oval speaker £2 / $3
construction, with a custom PCB and 3D Legal ROMs
PAM8302 amplifier £4 / $5
printed parts to play with. If your or the giftee
Please be cautious
don’t have a 3D printer, you can always get it when finding ROMs for Powerboost 500C £15 / $19
printed elsewhere however that may increase the your retro setup that you
are not downloading Tactile buttons x12 £3 / $4
budget a bit. from a site hosting
software illegally. B103 10k potentiometer wheel £7 / $9
Software wise it’s very simply, using RetroPie
(retropie.org) for emulation which easily magpi.cc/legalroms
SPDT slide switch £6 / $8
recognises the buttons via GPIO. The real meat
comes in the manual construction, and user Breakaway pin headers £4 / $5
Chris Haynes has created a very comprehensive 3000mAh 104060 LiPo battery £9 / $12
build guide for folks to follow on Instructables
– which you can also print out as a PDF.
If you need to find game ROMs for the Total: £108 / $137
system, then you can get homebrew games
from itch.io, and many classic game ROMs are The special Apple Pocket
Pi board created by Chris
sold legally online. Haynes for this project

Kit alternative
name: RetroFlag GPi Case
url: magpi.cc/gpicase

RetroFlag cases are


easy to set up, with a
lot less soldering and
3D-printing involved.
You can get gaming in
about 30 minutes.

Gift a project magpi.cc 101


FEATURE

Gift
a DIY file server
A practical gift for the practical maker

How to build a
Raspberry Pi NAS
link: magpi.cc/buildanas
Shopping List
tools required: None Raspberry Pi 4 or 5 £43 / $45

Powered USB hub £20 / $26


Some hard drives are
sold as NAS drives but

A
they don’t make a huge Hard drive enclosure caddy £20 / $26
ny serious maker or techie desires a amount of difference for
centralised spot on their internal network home use 4TB hard drive £80 / $104
where they can host all
their files. Then you can access
them from any device – PC, Total: £163 / $201
tablet, smart phone, smart
speaker, maybe even a smart
watch if it’s set up correctly.
It also doesn’t need a huge
number of components – Kit alternative
in fact the biggest part of name: Argon EON
the project is the software url: magpi.cc/argoneon
setup, with a tutorial on
the Raspberry Pi website
detailing the various aspects of You’ll need to supply
making sure the hard drive is a few extra bits like a
connected, and how to make Raspberry Pi and hard
it visible on the network (link drives, however this
above). Linux doesn’t make it
special case/enclosure
as easy as Windows to set up a
is custom-made for all
network share, but it does give
your NAS needs while
you greater control over how
the storage is shared, and it also pushing the price
works better. of the overall project up.

102 magpi.cc Gift a project


FEATURE

Gift a DIY
smart mirror
Mirror, mirror, on the wall, why are you not level

Magic Mirror Shopping List


Raspberry Pi 4 or 5 £43 / $45

link: magpi.cc/90 Ikea Ribba 18×24 picture frame £8 / $10


tools required: Drill, for hanging (optional) Official Raspberry Pi 7″ Touchscreen £56 / $60

A5 observation mirror £9 / $12

S
mart mirrors are one of the quintessential Velcro or foam sticky pads £4 / $5
Raspberry Pi projects, and they look very
cool too. Working like a futuristic smart The Ribba series is
gone, but Rödalm
home, they hook into your calendar and weather is almost the same Total: £120 / $132
data to let you find out about the day ahead as
you get dressed. And as Features Ed Rob’s
mother always says: make
sure to have a look in the The depth of the Ikea frames allows you to
mirror before you go out. put electronics behind them quite easily

This particular version


is a little smaller but
also a little less involved
than the traditional magic
mirror, making use of
an off-the-shelf picture
frame to construct it.
Unfortunately, the Ribba
frame series from Ikea has
been discontinued, although
you can still find some on
Amazon and eBay if you look.
The Rödalm series (magpi.cc/
rodalm) that replaced Ribba is a
good alternative though.
For those who might want
to build a full-size mirror, at a
higher cost, you can check out the
original magic mirror build in issue
54 of The MagPi (magpi.cc/54)

Gift a project magpi.cc 103


FEATURE

Gift
a DIY camera
Point and shoot with a preview screen

Touch Cam
link: magpi.cc/touchcam
Shopping List
Raspberry Pi 4 or 5 £43 / $45
tools required: 3D printer, soldering iron
DFRobot Raspberry Pi Touch Display £35 / $45

Raspberry Pi HQ Camera Module £48 / $50

T
here are fewer full-body Raspberry Pi
16mm Lens or 6mm Lens £39 / $50
camera projects out there than you’d
think, especially when it comes to a Touch Sensor £5 / $6
traditional camera using the excellent Raspberry
5V 4020 Fan £10 / $13
Pi HQ Camera Module. This very elegant design
allows you to build a portable point-and-shoot Raspberry Pi heatsink kit £4 / $5
camera with a preview screen, rechargeable
battery, and even a tripod adapter.
Maker Mukesh Sankhla goes into detail on A modest selection
of parts to get
Total: £184 / $214
how he designed the case on the Instructables the job done
page, giving an insight into the 3D-print design
process that may be useful for future projects.
The use of the HQ Camera allows for multiple
lenses, and the touchscreen allows you to edit
camera settings such as ISO, exposure and more,
thanks to a graphical interface.

We appreciate the explanation of how everything


was designed – it’s a great peek into CAD

104 magpi.cc Gift a project


FEATURE

Gift
a DIY robot
A low-cost automaton for the robot lover

Burgerbot V2
link: magpi.cc/burgbotv2
Shopping List
Raspberry Pi Pico £6 / $6
tools required: 3D printer
Ultrasonic Range Finder £7 / £9

Motor SHIM for Pico £10 / $13

K
ev’s low-cost Pico-powered robot is
LiPo SHIM for Pico £8 / $10
very compact and extremely functional.
Version two lets it work like a turtle Micro Metal Motors £5 / $6
of old with a marker pen inserted inside, and
Moon Buggy Tyres £5 / £6
you can even access it remotely thanks to its
wireless capabilities. Galleon Battery £8 / $10
It uses a lot of off-the-shelf robot parts that
SG90 Servo £2 / $3
are not only fairly cheap, but universal. They can
always be used in future robot projects, and the
Burgerbot itself is easily upgradeable.
Many of the parts are 3D-printed, and they’re
Total: £51 / $63
designed in such a way that everything slots or
screws in, so there are no cutting, sticking, or
soldering tools required to build it. Especially The original Burgerbot

Kit alternative
had a Pico resting on top,
useful if the maker in mind to receive this gift
which had the effect of
is a bit younger than most. making it easily accessible

name: CamJam Edut Kit 3


url: magpi.cc/camjamedu3

This classic and very


cheap kit is a great
way to get someone
into robotics. You can
3D-print a casing or just
use the box as a chassis
for it to run around.

Gift a project magpi.cc 105


REVIEW

PiDog
SunFounder magpi.cc/pidog £157 / $180

A smart robotic dog packed with features


and possibilities. By Phil King

P
owered by a Raspberry Pi (not included) – including numerous sizes of screws and plastic
SPECS and featuring 12 servos, PiDog is a metal rivets – come in labelled bags. The kit includes a
marvel that can do (almost) anything a couple of screwdrivers too.
FEATURES: real dog can do. Walk, sit, lie down, doze, bark, The main chassis is built from aluminium alloy
12 × metal-gear howl, pant, scratch, shake a paw… panels, giving this dog a shiny and robust ‘coat’.
servos, Robot
HAT, camera
Equipped with a bunch of sensors, it can self- There are also several acrylic pieces, including
module, RGB balance, discern the direction of sounds, detect some to build a stand to place PiDog on when
LED strip obstacles, and see where it’s going. You can even calibrating its leg servos. A nice touch.
get a dog’s-eye view from its nose-mounted Raspberry Pi sits on a sound direction sensor
SENSORS:
Sound direction, camera via a web page or companion app. module and is then mounted with a Robot HAT
6-DOF IMU, dual The first thing to decide is which Raspberry Pi which handles all the servos (via PWM pins),
touch, ultrasonic model to use before assembling the kit. PiDog sensor inputs, and battery management. Portable
distance will work with Raspberry Pi 4, 3B+, 3B, and Zero
WORKS WITH: 2 W. Using a Raspberry Pi 5 is not recommended
Raspberry Pi 4, since its extra power requirements put too much
3B+, 3B, of a strain on the battery power – PiDog uses a
Zero 2 W lot of current when standing or moving – so it’s
POWER: likely to suffer from under-voltage. We opted for
USC-C, a Raspberry Pi 4, although even then we did have
rechargeable a few issues with crashes when the battery level
2×18650 was low.
battery pack PiDog takes a
while to build
Canine construction from the kit, but is
a lot of fun to play
With a kit comprising a huge array
with and program
of parts, building a PiDog is no in Python
mean feat. We reckon it took
us around five to six hours,
although we were taking
our time to get it right.
The printed diagram-
based instructions are
easy to follow, however,
and there are online
videos if you get stuck.
Apart from a few fiddly bits,
including manipulating
some tiny screws and
nuts, it’s an enjoyable
process. Helpfully, the
fixtures and fittings

106 magpi.cc PiDog


REVIEW

An example Python program sees PiDog using


OpenCV computer vision to track a moving red ball

power is supplied by a custom battery pack sensor on its neck. There’s also a balance demo to You’ll end up with
spaghetti wiring into
comprising two 18650 batteries with a capacity showcase its 6DOF IMU module that enables PiDog the Robot HAT, but
of 2000mAh, which takes a couple of hours to to self-balance when walking on a tilting tabletop. can use the supplied
spiral binding to tidy
charge fully. There are a few examples using the camera it up a bit
module with OpenCV computer vision. A face-
Doggy-do code tracking demo generates a web server, enabling
Once you’ve assembled the kit, it’s time to fine-
tune the calibration of the servos with a script.
You’ll have used a zeroing script during assembly Y ou can even communicate
to get the rough positions right, so will have
already installed the PiDog libraries and software with your PiDog via GPT-4o AI,
in Raspberry Pi OS.
Detailed online documentation guides you
using text or spoken commands
through everything, including running a script to
enable I2S sound from the robot’s speaker. It also you to see the camera view on a web page. There’s
covers a good range of Python example programs also the option to control PiDog with an iOS or
that showcase what PiDog can do. Android app, complete with live camera feed.
In patrol mode, for instance, PiDog walks You can even communicate with your PiDog via
forward and stops to bark when it detects GPT-4o AI, using text or spoken commands – with
something ahead. The react demo sees it rear up a USB mic (not supplied) equipped. It takes a bit of
and bark when approached from the front, but roll setting up, using an API key, but the online guide
its head and wag its tail when you pet the touch takes you through the process.

Verdict
Great fun to play
with, this smart
canine companion
has an impressive
feature set and
lots of possibilities
for further training.

Control PiDog remotely from an app, with a customisable widget layout, and view its camera feed 9 /10
PiDog magpi.cc 107
REVIEW

Waveshare PCIe USB


3.2 Gen 1 HAT+
The Pi Hut magpi.cc/pcieusbhat £19 / $21

For when you need more USB ports on Raspberry Pi 5.


By Phil King

W
aveshare’s PCIe USB 3.2 Gen 1
SPECS HAT+ adds four extra
USB 3.2 Gen 1 ports
FEATURES: to Raspberry Pi 5 via the
4 × USB 3.2
latter’s high-speed PCIe port.
ports, USB-C
power port, So, as well as not tying up an
GPIO extender, existing USB port, as a standard
PCIe cable, USB hub would, it’s not limited to
standoffs the bandwidth of that single port.
and screws
Assembly is as simple as connecting
USB PORTS: the supplied 40mm flexible ribbon
Up to 4Gbps cable between the HAT+ and Raspberry With four extra USB 3.2
shared, 2.6A Pi 5’s PCIe port, making sure it’s oriented ports, it’s ideal for projects
total (without such as a multi-drive NAS
extra PSU)
correctly. You can then secure the board on
top with the supplied screws and standoffs.
A square cutout in the PCB aids ventilation,
and can be used with the Active Cooler. Another  n on-board INA219 chip
A
cutout offers easy access to the Camera/Display
ports. The GPIO header is extended so you can
enables each port’s power
stack another HAT on top. to be turned on and off
Speed and power
To enable the HAT+, you just need to enable
PCIe (if not already done) in the config.txt file in
Raspberry Pi OS. While you can also enable PCIe

Verdict Gen 3 there, the HAT+ is limited to Gen 2 speeds.


Even so, the latter offers up to 4Gbps to share
between the ports – exact speeds will vary greatly
A neat way to add
depending upon the device connected.
extra, fast USB
ports, although While the ports are limited to 2A of current
it does tie up each (from a total of 2.6A), this can be boosted
the PCIe port. via the board’s USB-C power port. An on-board

8
INA219 chip enables each port’s power to be
turned on and off, too – for advanced users, The slimline PCB
sits neatly on top of

/10
GPIO control is possible by soldering four SMT
Raspberry Pi 5, with a
resistors on the PCB. cutout for ventilation

108 magpi.cc Waveshare PCIe USB 3.2 Gen1 HAT+


Get game design tips and
tricks from the masters
Download and play game
examples inspired by classics
Learn how to code your own
games with Pygame Zero
Explore the code listings and
find out how they work

Code the Classics Volume II not only tells the


stories of some of the seminal videogames of the
1980s, but shows you how to create your own games
inspired by them using Python and Pygame Zero,
following examples co-programmed by Andrew Gillet
and Raspberry Pi founder Eben Upton.

Available now: magpi.cc/store


REVIEW

UPi B7 -
Raspberry Pi Case
With Touchscreen
UPERFECT hsmag.cc/UPiB7 $169.99 (approx £130)

An affordable touchscreen device for your grubby little fingers.


By Andrew Gregory

T
he UPi B7 from Uperfect is a case, a to the three test points (TP 18, 19 and 20) on the
SPECS touchscreen and a power supply all in back of the Raspberry Pi. These aren’t through-hole
one. It’s compatible with Raspberry Pi 3B+ soldering locations, so you’ll have to be confident
DISPLAY: and Raspberry Pi 4, and because of this there are that you can attach the wires with a small amount
Capacitive
slightly different ways of connecting it all up that of solder so as not to short the connections, and
touch, 10.1-inch,
1920×1200, mean there are components in the box that you do so without damaging the rest of the board. The
IPS, 60Hz won’t use, depending on whether you’re using it second option is to use one of the enclosed cables
refresh rate with a 3B+ or a 4. from one of the Raspberry Pi’s USB ports back
In the box there’s the device itself, which though a small hole in the case, and clip it into the
CONNECTIONS:
Power, full-size features a crisp 10.1-inch screen, the electronics circuit board on the device. For testing purposes
HDMI, USB-C to enable you to plug your Raspberry Pi in, we went for this option, and it worked, but it does
including a power supply, a built-in fan, and
a pair of 8-ohm, 1W speakers. There
are also a few tiny PCBs that join
the HDMI and Micro USB ports of
the Raspberry Pi to pins on the
device, and two plastic panels
that correspond to the USB
port layout of either a model
3B+ or a Raspberry Pi 4. We
tested the UPs B7 using a
Raspberry Pi 4.
There are two ways of
connecting a Raspberry
Pi to the touchscreen:
the first and most
complicated is
to solder three
points of a wire

The IPS screen has a


nice sharp resolution

110 magpi.cc UPi B7 - Raspberry Pi Case With Touchscreen


REVIEW

Raspberry Pi model 3B+ or 4 are supported, with all the parts you
need for both Raspberry Pi boards included in the box

mean that if you’re going to use the touchscreen imprecise. But when you use the touchscreen as You can either
solder the cable that
functionality then you’ll have to give up one of the an input device for a larger monitor, it feels so provides touchscreen
USB ports on your Raspberry Pi. much more natural. We found ourselves working functionality, or take
the easy way out
The Uperfect UPi B7 had us baffled at first. on our large monitor and not even looking at the at the expense of a
USB port, like we did
It’s a touchscreen, with a boxy rectangle on touchscreen as we were using it – it really does
the back into which you slot your Raspberry Pi. feel natural. With the touchscreen flat on our desk
The first comparison we make when presented it worked as a useful replacement for a mouse –
with a portable touchscreen is a tablet, such as more creative types than us could use it instead
an iPad. It’s very much not one of these, as it’s You get all the cables
you need to connect
bulkier, and it needs to be plugged in to a mains
power source, which limits how well you can use
 bargain alternative
A the device to an
additional monitor
it when you’re lounging on the sofa looking up
actors on imdb.com.
to the mouse-screen-
Where this device really shines is when it’s keyboard combination
hooked up to a larger monitor. Raspberry Pi OS
is made to be used with a mouse and keyboard,
and so using it on a 10-inch touchscreen can feel of a graphics tablet. And while we wouldn’t want
to use it to type for long periods it’s good enough
Raspberry Pi’s inputs for quick data input, which opens up a range of
remain accessible
possibilities in industry – say, keeping track of
orders in a restaurant, or connected over a network
to an inventory system where a full-size keyboard
would attract dirt.
We’re seen this model on sale for just over
£100, which makes it a bargain if you’re looking
for an alternative to the mouse-screen-keyboard
combination that has been keeping posture
experts in work since it was unleashed on to
the world in 1968. You may want to make
some adjustments to the icon sizes in
Verdict
the default Raspberry Pi OS display to
Unlocks extra
make them more touch-friendly, and input options
we wouldn’t recommend this to for Raspberry
anyone who wants a tablet. But as a Pi 3B+ and 4

8
device that, with a little tweaking, can
unlock extra input options, and breathe

/10
new life into a Raspberry Pi 4 or even a 3B+,
we’ll give it a thumbs up.

UPi B7 - Raspberry Pi Case With Touchscreen magpi.cc 111


REVIEW

Argon Poly+ 5
Argon 40 argon40.com £6

Argon’s latest offering bucks the high-end trend


and goes back to basics. PJ Evans gets on the case

S
ince the first appearance of the original come to expect. The slightly transparent slidable
SPECS Raspberry Pi, there have been Raspberry top cover is available in red or black with a black
Pi cases in all shapes, sizes and colours. base in both cases. The standard model comes with
FORM The first were often improvised affairs, including a 30mm PWM fan and an array of heatsinks. For
FACTOR: carefully cut acetate sheets and a model treasure a few more pounds you can opt for the mightier
Raspberry Pi 5
plus fan or HAT chest from a hobbyist shop. Soon, we were deluged THRML-30 unit if you’re going to be running
with options and the standard has only risen. things hot. This is a similar unit to the official
ASSEMBLY: Today there is a multitude of choices, but cooler with a fan and a large heatsink in one. If you
Snap-together
it is Argon40 that has cornered the high end of forgo the fan you can fit a standard HAT in the case
MATERIAL: the market. Argon’s recent ONE, NEO and EON too (albeit one without any protrusions).
ABS Plastic range represent great design, rock-solid build and Assembling the case is straightforward. Attach
quality finish. Something you will always be happy the fan to the cover, pop on the heatsinks and clip
to have on display. That might be about to change everything together. It took no more than a few
with the Argon Poly+ 5. minutes. This is a clip-together screwless case
Argon has decided that owning the top end of (with the exception of the fan). The fan connects to
the market is not enough and, has launched its the new fan header, so you get active, responsive
first budget case, the Poly+ 5. Will Argon’s high cooling, just like the official equivalent.
standards translate to a lower-end product? We
were keen to see. In that case
The Poly+ 5 is a Raspberry Pi 5 case in two In terms of usage: well, it’s a case and it does that
flavours and colours. The case itself is moulded job well. At no point did the Raspberry Pi leap
plastic with none of the aluminium work we’ve out and do a runner, so we’ll call that a win. The

The Argon Poly+ 5


comes in two colour
options for the
sliding ‘hood’

112 magpi.cc Argon Poly+ 5


REVIEW

Having the power button highlighted


in orange is a nice touch for the case

 t no point did the


A
Raspberry Pi leap out
and do a runner

Need more
aggressive cooling?
This powerful unit is
available as an option

Verdict
It’s a case. No
fancy features,
no extravagant
Need more aggressive cooling? This powerful unit is available design, no
as an option fancy lights. It
is something
fan was whisper-quiet throughout. There are no that will protect
and cool your
impediments to port access with the exception
Raspberry Pi well
of the GPIO, which is fully covered. A thoughtful Argon is trying to bring its design ethos to
and at a fantastic
touch is the addition of a power button in a striking the budget market, and does it succeed? It’s price. If that’s
orange on the exterior, and next to that, unusually certainly pleasing to look at, although lacking what you need,
for a budget case, is a cover for the SD card the sleek lines of the ONE or the elegant look no further.

8
(although this cannot be secured as with the NEO curvature of the official cases. What it does have in
case). The base features ventilation slats to ensure spades is value for money. At just £6 this is a great

/10
good air movement from the fan. It stands on four choice if you just need a protective, cooling case
rubber feet (also supplied). and nothing more.

Argon Poly+ 5 magpi.cc 113


RESOURCES

10 Amazing:
Raspberry Pi
festive light
projects
N
 eoPixel Menorah
No oil needed
Celebrate the nights of Hannukah without needing candles permanently lit
in your home. Just press the button to light the next candle each night.
Light up your home this holiday season
magpi.cc/neomenorah
with a little help from Raspberry Pi

W
hether you celebrate Christmas, Yule, Hannukah, C
 hristmas Tree
Festivus, or anything else during December,
there’s plenty of ways to decorate your home
Lights 1
this festive season. We’ve got a selection of ten amazing
light projects to help inspire you along the way.
Simple NeoPixel tree
The simplest way to create Christmas
tree lights with Raspberry Pi – and
it even makes use of Node-RED for
the code block enjoyers.

magpi.cc/treelights1

Johnson Family Christmas


Light Show
Garden display
This very custom lightshow changed many times over the years but
always lit up in sync with the music, and you could listen in on your radio.

magpi.cc/johnsonlights
Raspberry Pi
Fireplace Emulator
No chestnut roasting
Unable to build a real fireplace, maker Peinador decided to
make their own out of a Raspberry Pi and an LED matrix. It’s
not as warm but it’s just as festive.

magpi.cc/fireplace

114 magpi.cc Raspberry Pi festive light projects


RESOURCES

Holiday Light Show LED snowflake


House display
Non-denominational decoration
A slightly simpler but no-less spectacular way of creating a music-synced
light show for your home – it uses very few components too. This simple project from Codeacademy is mostly code and a lot
of LEDs, but it’s a cool decoration to put behind a window.
magpi.cc/holidaylightshow
magpi.cc/ledsnowflake

C
 hristmas Tree
Lights 2
Festive Energenie
automation
Automating your Raspberry
Pi-powered Christmas tree
lights couldn’t be easier with
an Energenie and Pi-mote, as
Stewart Watkiss shows us.

magpi.cc/treelights2
Audio Reactive
Holiday Lights
Cheap LED display matrix
Fa-lah-lah-LED
Lights on a budget Having your lights react to your Christmas songs is a great way
From a distance you don’t need a dense concentration of LEDs – with to make the festive atmosphere much more immersive.
just 96 you can create excellent festive matrix that can display colourful
low-res animations. magpi.cc/audiolights

magpi.cc/cheapled
C
 hristmas Tree
Lights 3
Tree light show
This tree light show goes the extra step
and has lights that flash to the music.
Be extra careful if you attempt this
build though – it uses relays and mains
power. We suggest integrating the
code into a similar project.

magpi.cc/treelights3

Raspberry Pi festive light projects magpi.cc 115


2025

200 PAGES OF RASPBERRY PI


A guide to getting started Inspiring projects to give
with every Raspberry Pi board you your next big idea

All the essential info on the Upgrade your emulation


brand new Raspberry Pi Pico 2 with next-gen retro gaming

Buy online: magpi.cc/store


THIS MONTH IN RASPBERRY PI

MagPi
01

Monday
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 – and remember to
follow along at the hashtag #MagPiMonday!

01. 
We’re fans of Blackberry projects here,
and this one looks great
02. 
A really cool technical project, discovering
how video signals work
03. 
Ah, a classic way to mount your camera:
in a fictional robot’s head
04. 
Honestly, we don’t think we want to
know anything more
05. Pepper’s ghost is an old-school hologram-
style effect and we love this interpretation
06. Hmm, why is this eyeball tracking your
every move? 02
07. LEGO cases for Raspberry Pi are still
very popular even in 2024
08. Aki making a cool custom monitor for
Raspberry Pi 03
09. This is very cool, we wonder if you could
have an entire library looking setup that is
secretly a Raspberry Pi desktop computer
10. We hadn’t quite appreciated how perfectly
sized Raspberry Pi Zero is for model trains
11.  esla coil music is something we always
T
forgets exists but is an exceptionally
cool concept
12. This is a really cool and colourful project,
reminds us of Epcot
13. These photos are incredible! We love some
good Raspberry Pi astrophotography
14. PPU stands for ‘Picture Processing Unit’
– this is cool and opens up a whole new 04
world for NES homebrew

118 magpi.cc MagPi Monday


THIS MONTH IN RASPBERRY PI

05 06

07

08

10

09

11 12

14

13

MagPi Monday magpi.cc 119


THIS MONTH IN RASPBERRY PI

USB volume
controller
Fixing a day-to-day problem with a simple, custom, volume knob

T
emirlan Yergazy got in touch with us over The rotary encoder is
affixed to the Tiny2040
email about a little project he’d made to
improve his TV-watching experience.
“I have a laptop that I watch YouTube and TV-
series on, and sometimes, I need to adjust volume
multiple times because of the volume fluctuations
in the videos,” Temirlan tells us. “But the problem
with manually adjusting the volume is that I need
to minimize the screen and adjust the volume from
the taskbar. This is very annoying. So, I thought of
making a USB volume controller that I can use to
adjust the volume without minimizing the screen.
Similar feature I had on my previous keyboard,
that I don’t have now.”
He fixed this using a Pimoroni Tiny2040 and a
rotary encoder attached to it.
“The board is programmed to act as a USB HID
device (same as keyboard or mouse) that sends
volume commands to the host computer. The
rotary encoder is used to control the volume.
Software used in this project is CircuitPython and
HID library from Adafruit.”
It’s a neat little solution using just two The whole set up is quite small and connects to a computer via a USB cable
components and a bit of code, which you can find
here: magpi.cc/usbvol.

A visual confirmation comes up on screen of volume changing


thanks to the UI on most modern PCs

120 magpi.cc Mondays


Coolest
This Month
Projects
are
infor
Raspberry
Pico
online! Pi
THIS MONTH IN RASPBERRY PI

Best of the rest!


Other cool Raspberry Pi things we saw this month

TRACKING CREEPY EYE RASPBERRY PI IN A TURBOEXPRESS

We didn’t see a huge amount of Halloween projects this year but Also known as the PC Engine GT, this relatively obscure handheld
the few we did see were pretty great – like this creepy eye that is is yet another old console that’s been converted to work with a
displayed on a matrix of seven-segment displays Raspberry Pi, and we think that’s cool.
magpi.cc/creepyeye magpi.cc/turbogt

Together we can
make a difference
Give young people the opportunity
to learn about technology

The Raspberry Pi Foundation enables young


people to realise their full potential through
the power of digital technologies, but we can’t
do this work without your help. Your support
helps us give young people the opportunities
they need in today’s world. Together we can
offer thousands more young people across
the globe the chance to learn to create with
digital technologies.
Generous donations from organisations and DONATE NOW
individuals who share our mission make our
work possible.

Donate today to make a difference: rpf.io/magpidonate


YOUR LETTERS

Your
Letters
Gadget types
I’m after copies of your magazine, numbers 139 and
140, which are sold out! Are these both available as
paid-for downloads, or even reprints?

Chris via email


 s we write, this
A
Touch Display
While the PDFs for the magazines are currently only 2 is the newest
product that was
available to print subscribers and contributors, that is announced, but there
only for the first three weeks! MagPi issues 139 and 140 may be more by the
time you read this
are therefore available for free from our website, as
well as all our other back issues.
You can find them all at magpi.cc/issues, and you Raspberry Pi overload
can print them for yourself as well if you’d prefer
them to be physical. You seem to be releasing a lot of new products at the moment!
My wallet can’t quite keep up, although at least it means I have
plenty of things to put on my Christmas list.
Is there a reason so much is coming out at once? Not that I’m
complaining...

Aya via email

There is quite a lot of new stuff at the moment, and there’s been
more announced since you sent this email, including the new release
of Raspberry Pi OS. Much like the way an updated OS is largely
dependant on Debian releases, the rest of the products are things
that have been in development for varying lengths of time and just
happened to be ready at the same time.
It does mean we have lots of cool stuff to play with whenever
we’re in the office though. Hopefully your wallet and Christmas list
All our back issues are available as free PDFs direct from our website can hold out!

122 magpi.cc Your Letters


USA SPECIAL!
6 ISSUES
FOR $43
Holiday showcase
I have a festive project for December that I’m
planning – will I be able to submit it to you once
it’s done? Or will you not be doing any Christmas
content in the issues after? I enjoy seeing what
other people make in your magazine, and would
like to be one of those people.

Sam via Facebook

A cool project is a cool project, and we’re happy


to showcase any seasonal project all year round.
If there’s a load of Christmas-themed projects we
might also collect them all into one big article like
#MagPiMonday in the community section.
Whether you’ve got Christmas, Halloween,
Bastille Day, White Day, or any other holiday
project, we’d love to see it and are happy to
publish it at any time of year.

FREE
RASPBERRY PI
If you need any
festive inspiration,
PICO W
check out page
114 for some
illuminating ideas

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

03

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

01. PLUG in the Pub 03. Riverside Raspberry


Thursday 28 November Microprocessor Showdown
Hygge Bar, Perth, Australia Monday 2 December
magpi.cc/plug148 Ann Arbor District Library, Ann Arbor, MI, USA
Come eat, drink, chat, hack and socialise. We are easy magpi.cc/showdown24
going and it’s a very casual event. If you don’t drink alcohol, Riverside Raspberry is a California-based enthusiast group that’s
we would still love to have you there. You don’t have to be a been meeting up for almost a decade. This group will appeal
member to come along. to thinkers and tinkerers, the scientifically curious, software
developers looking to get into embedded development, or
02. Melbourne Raspberry Pi Meetup anyone young or old that has a knack for tech in general.
Sunday 1 December In this annual showcase of tech projects, you can try
Docklands Makerspace and Library, Melbourne, Australia
 out basic coding and physical computing on several FULL CALENDAR
magpi.cc/mrpm148 different platforms, including the Raspberry Pi 5. Try your Get a full list of upcoming
This meetup is open to everyone with an interest in electronics, hand at making wearable tech, solar-powered Morse community events here:

robotics, home automation, 3D printing, laser cutting, amateur Code transceivers, blackout poetry, computerised magpi.cc/events
radio, high altitude balloons, space tech, etc. Makers are object detection, animation with Scratch, live dance
invited to bring along their projects and project ideas, and music, and much more
come and connect with other makers. Get your questions
answered, show off the work you are doing, and get support 04. Cornwall Tech jam
to resolve nagging issues. Saturday 14 December
Fraddon Village Hall, Fraddon, UK

magpi.cc/ctj148
The Cornwall Tech Jam returns to Fraddon Village Hall in
December for four hours of fun for children to learn to code.
It’s likely there will be some Christmas-themed coding too.
The Cornwall Tech Jams are an ideal place for children to
learn to code, develop important problem-solving skills,
meet like-minded friends and generally have a great time.

124 magpi.cc Community Events Calendar


EVENTS

01

CORNWALL TECH JAM 02

Christmas
> Where Your rooftop
> When Wednesday 25 December

O
ur sources tell us that Raspberry Pi gifts should be making
their way to your home this Christmas Day, delivered
(supposedly) by a bearded man dressed in red. When asked
for comment, Raspberry Pi CEO Eben Upton ignored us and went
back to work.
04
magpi.cc/xmas

Community Events Calendar magpi.cc 125


COMPETITION

WIN ONE OF THREE


THUMBY
COLOR
The tiny Thumby Color
is powered by RP2350
and allows you to
develop fun games and
play cool exclusives that
other folks have made
too! It comes preloaded
with games that run out
of the box, and even
includes rumble. We
have three to give away.

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

Terms & Conditions


Competition opens on 20 November 2024 and closes on 19 December 2024. 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.

126 magpi.cc Win one of three Thumby Color gaming consoles


Learn coding
Discover how computers work
Build amazing things!

magpi.cc/beginnersguide
KiCad is an amazing
piece of free and open
source software that
allows anyone, with some
time and effort, to make
high-quality PCB designs.

Create a schematic for a


microcontroller board using
Raspberry Pi’s RP2040

Select the right components

Customise the hardware for


your needs

Lay out and route the PCB design

Prepare your board for


manufacture and assembly

Write software to get your design


working

Buy online: magpi.cc/kicad2040


NEXT MONTH
EDITORIAL
Editor
Lucy Hattersley
[email protected]
Features Editor

RASPBERRY PI
Andrew Gregory
[email protected]
Features Editor
Rob Zwetsloot

DESKTOP
[email protected]
Sub Editor
Ian Evenden
ADVERTISING
Charlotte Milligan
Thin computing, home Linux, and [email protected]
+44 (0)7725 368887
personal computing with Raspberry Pi DESIGN
Designer
Lee Allen
Illustrator
Sam Alder
Photographer
Brian O Halloran
CONTRIBUTORS
David Crookes, PJ Evans, Rosemary
Hattersley, Phil King, Nicola King,
Andrew Lewis, Simon Long,
Rob Miles, KG Orphanides,
Naush Patuck, Eben Upton

PUBLISHING
Publishing Director
Brian Jepson
[email protected]
Director of Communications
Helen Lynn
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

The Magpi #149 Kelvin Lane, Manor Royal,


Crawley, West Sussex, RH10 9PE

On sale 19 December
+44 (0)1293 312193
magpi.cc/subscribe
[email protected]

DON’T MISS OUT! magpi.cc/subscribe This magazine is printed on paper sourced


from sustainable forests and the printer

Starter guide for MASTODON magpi.cc/mastodon


operates an environmental management
system which has been assessed as

newcomers
conforming to ISO 14001.
The MagPi magazine is published by
THREADS @themagpimag Raspberry Pi Ltd, 194 Cambridge Science

Mapping caves Park, Milton Road, Cambridge, England, CB4


0AB. The publisher, editor, and contributors

with Shake
accept no responsibility in respect of any
FACEBOOK magpi.cc/facebook omissions or errors relating to goods,
products, or services referred to or advertised
in the magazine. Except where otherwise
Implementing EMAIL [email protected] noted, content in this magazine is licensed
under a Creative Commons

Compute Module Attribution-NonCommercial-


ShareAlike 3.0 Unported (CC
ONLINE forums.raspberrypi.com BY-NC-SA 3.0).
ISSN: 2051-9982.
THE FINAL WORD

Putting AI to use
Lucy Hattersley has all the AI kit and an urge to build something real

B
race yourself, because I’m A lot is going on with this I recently updated my iPhone to
about to talk again about this equipment, and things are use Apple Intelligence (there are not
year’s thrilling but worn-out starting to get serious: Sony has enough rolling eyes in the world)
topic: artificial intelligence. been using the AI Camera on its and it’s producing some handy
First of all: I’m not a fan of the production line. Look at Sony’s overviews of email conversations.
term. It’s misleading, because AITRIOS developer site (magpi.cc/ While this is all well and good, it is
people focus too much on the imx500dev) for more information Raspberry Pi that’s putting AI in an
‘intelligence’ part and not enough on how AI Camera is genuinely industrial setting. You can hook an
on the ‘artificial’ aspect. More useful from an industrial point of AI Camera to a Raspberry Pi and get
than that: it’s vague. AI is used to view. We’re hoping to get some it to do real-world things.
describe everything from fictional great tutorials with them lined up My personal involvement with
sci-fi megabrains to barely testing and writing about AI started
functional chatbots and ‘ducking’ out with Google AIY (which went on
predictive text, leading people to  lot is going
A to become the Coral toolkit). This
dismiss the whole thing as bunk.
It’s far better to discuss the
on with this add-on to Raspberry Pi gave it a
TensorFlow Lite machine learning
underlying technologies that make equipment, and accelerator and the USB Accelerator
it all work: machine learning, with a Google Edge TPU coprocessor
deep learning, natural language things are starting provides 4 TOPs (tera-operations
processing, knowledge graphs, and per second). We’ve built teachable
especially computer vision. to get serious machines, I’m now delighted to
That last one means a lot to have an AI Camera and AI HAT and
us, because Raspberry Pi has While the usefulness of AI is like am very open to ideas. Let’s build
released its AI Camera and I for Schrodinger’s cat, both existing something wild.
one can’t wait to start putting it and not existing at the same time,
to serious use (the fantastic AI I think it’s important to remember
Kit is now an all-in-one AI HAT that the underlying technologies
Lucy Hattersley
AUTHOR

with a Hailo accelerator running have real and serious purposes in


Lucy Hattersley is editor of The MagPi
at up to 26 TOPS, enabling a wider industry, education, and healthcare. and is currently working with the
range of non-vision ML projects, It’s not all trying to get ChatGPT SenseHAT so maybe, just maybe, will
which is also looking very handsome to figure out how many times the make something smart and sense-y.

at this point). letter ‘r’ appears in ‘strawberry’. magpi.raspberrypi.com

130 magpi.cc Putting AI to use

You might also like